[SCM] WebKit Debian packaging branch, debian/unstable, updated. debian/1.1.15-1-40151-g37bb677

darin darin at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 08:42:15 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit 3964ef71eb868f41e9062b028ed6436b7b8471fd
Author: darin <darin at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Thu May 27 08:14:25 2004 +0000

            Reviewed by Maciej.
    
            - fixed <rdar://problem/3667948>: (REGRESSION: Page Down key goes down two pages when smooth scrolling is on)
    
            * WebView.subproj/WebFrameView.m:
            (-[WebFrameView _scrollVerticallyBy:]): Added return value to indicate if any scrolling was done.
            This requires using secret AppKit methods; the public methods don't have a return value.
            (-[WebFrameView _pageVertically:]): Added return value to indicate if any scrolling was done.
            (-[WebFrameView scrollPageUp:]): Base call through to next responder on whether any scrolling was done,
            using return value, rather than looking at new scroll position. This was the cause of the bug,
            since with smooth scrolling no scrolling has happened yet when the function returns.
            (-[WebFrameView scrollPageDown:]): Ditto.
    
            - removed temporary DOMDocument method from WebView
    
            * WebView.subproj/WebView.m:
            (-[WebView computedStyleForElement:pseudoElement:]): Call getComputedStyle on the document that owns the
            element rather than on the document that currently contains the selection.
            (-[WebView _updateFontPanel]): Get the document from the DOM range rather than using the DOMDocument method.
            (-[WebView styleDeclarationWithText:]): Change this method to not use the DOMDocument method, but do the same
            job with inline code.
    
            * WebView.subproj/WebViewPrivate.h: Moved a recently-added category that is not SPI out of here.
            * WebView.subproj/WebViewInternal.h: Moved the category in here. And removed the DOMDocument method from it.
    
            - other changes
    
            * English.lproj/StringsNotToBeLocalized.txt: Updated for recent changes.
    
            * copy-webcore-files-to-webkit: Change tabs to spaces. Quiet the script down by
            making it no longer echo each command or print messages about what it's doing by default.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@6704 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog
index 5c3fb42..f513d0f 100644
--- a/WebKit/ChangeLog
+++ b/WebKit/ChangeLog
@@ -2,6 +2,40 @@
 
         Reviewed by Maciej.
 
+        - fixed <rdar://problem/3667948>: (REGRESSION: Page Down key goes down two pages when smooth scrolling is on)
+
+        * WebView.subproj/WebFrameView.m:
+        (-[WebFrameView _scrollVerticallyBy:]): Added return value to indicate if any scrolling was done.
+        This requires using secret AppKit methods; the public methods don't have a return value.
+        (-[WebFrameView _pageVertically:]): Added return value to indicate if any scrolling was done.
+        (-[WebFrameView scrollPageUp:]): Base call through to next responder on whether any scrolling was done,
+        using return value, rather than looking at new scroll position. This was the cause of the bug,
+        since with smooth scrolling no scrolling has happened yet when the function returns.
+        (-[WebFrameView scrollPageDown:]): Ditto.
+
+        - removed temporary DOMDocument method from WebView
+
+        * WebView.subproj/WebView.m:
+        (-[WebView computedStyleForElement:pseudoElement:]): Call getComputedStyle on the document that owns the
+        element rather than on the document that currently contains the selection.
+        (-[WebView _updateFontPanel]): Get the document from the DOM range rather than using the DOMDocument method.
+        (-[WebView styleDeclarationWithText:]): Change this method to not use the DOMDocument method, but do the same
+        job with inline code.
+
+        * WebView.subproj/WebViewPrivate.h: Moved a recently-added category that is not SPI out of here.
+        * WebView.subproj/WebViewInternal.h: Moved the category in here. And removed the DOMDocument method from it.
+
+        - other changes
+
+        * English.lproj/StringsNotToBeLocalized.txt: Updated for recent changes.
+
+        * copy-webcore-files-to-webkit: Change tabs to spaces. Quiet the script down by
+        making it no longer echo each command or print messages about what it's doing by default.
+
+2004-05-27  Darin Adler  <darin at apple.com>
+
+        Reviewed by Maciej.
+
         - moved to new symlink technique for embedding frameworks
 
         * WebKit.pbproj/project.pbxproj: Get rid of embed-frameworks build step
@@ -56,9 +90,9 @@
         - moved HTML editing operations from WebView to WebHTMLView, leaving only forwarding machinery
           at the WebView level
 
-        - fixed <rdar://problem/3655412>: (Editing:Ê-startSpeaking:ÊmethodÊunimplementedÊ(WebKitÊeditingÊAPI))
-        - fixed <rdar://problem/3655414>: (Editing:Ê-stopSpeaking:ÊmethodÊunimplementedÊ(WebKitÊeditingÊAPI))
-        - fixed <rdar://problem/3655375>: (Editing:Ê-pasteAsRichText:ÊmethodÊunimplementedÊ(WebKitÊeditingÊAPI))
+        - fixed <rdar://problem/3655412>: (Editing: -startSpeaking: method unimplemented (WebKit editing API))
+        - fixed <rdar://problem/3655414>: (Editing: -stopSpeaking: method unimplemented (WebKit editing API))
+        - fixed <rdar://problem/3655375>: (Editing: -pasteAsRichText: method unimplemented (WebKit editing API))
 
         * WebView.subproj/WebView.h: Added missing declaration of selectionAffinity. I think this
         omission was an editorial mistake.
diff --git a/WebKit/English.lproj/StringsNotToBeLocalized.txt b/WebKit/English.lproj/StringsNotToBeLocalized.txt
index 164855f..5eb868d 100644
--- a/WebKit/English.lproj/StringsNotToBeLocalized.txt
+++ b/WebKit/English.lproj/StringsNotToBeLocalized.txt
@@ -5,14 +5,17 @@
 " *POST*"
 " *target*"
 " >>>"
+"#"
 "%"
 "%.1lf"
 "%.2lu/%.2lu/%.10lu-%.10lu.cache"
 "%2d) "
 "%@ %@"
+"%@ unable to initialize with font %@ at %@"
 "%@"
 "%@/%s"
 "%@/Library/Preferences/%@"
+"%@: Don't know how to pack glyphs for font %@ %f"
 "%@:%u"
 "%@://%@"
 "%d"
@@ -29,13 +32,11 @@
 "0x0"
 "1"
 "1.0.0"
-"1.00"
 "1000"
 "13"
 "16"
 "1800"
 "4"
-"4096"
 "4194304"
 "7"
 "9"
@@ -43,8 +44,6 @@
 ":/?#"
 ";"
 "<!--framePath "
-"<A HREF=\"%@\">%@</A>"
-"<IMG SRC=\"%@\">"
 "="
 "=================\nARGUMENT BAD: %s, %s (%s:%d %s)\n=================\n"
 "=================\nASSERTION FAILED: "
@@ -122,6 +121,7 @@
 "Set-Cookie"
 "Times"
 "UTF-8"
+"Unable to cache glyph widths for %@ %f"
 "UseBackForwardList"
 "WebActionButtonKey"
 "WebActionElementKey"
@@ -181,9 +181,6 @@
 "WebKitFixedFont"
 "WebKitHistoryAgeInDaysLimit"
 "WebKitHistoryItemLimit"
-"WebKitInitialTimedLayoutDelay"
-"WebKitInitialTimedLayoutEnabled"
-"WebKitInitialTimedLayoutSize"
 "WebKitJavaEnabled"
 "WebKitJavaScriptCanOpenWindowsAutomatically"
 "WebKitJavaScriptEnabled"
@@ -194,8 +191,6 @@
 "WebKitPageCacheSizePreferenceKey"
 "WebKitPluginsEnabled"
 "WebKitPrivateBrowsingEnabled"
-"WebKitResourceTimedLayoutDelay"
-"WebKitResourceTimedLayoutEnabled"
 "WebKitSansSerifFont"
 "WebKitSerifFont"
 "WebKitShouldPrintBackgroundsPreferenceKey"
@@ -209,10 +204,12 @@
 "WebPageCacheDataSourceKey"
 "WebPageCacheDocumentViewKey"
 "WebPageCacheEntryDateKey"
+"WebPlugInAttributesKey"
+"WebPlugInBaseURLKey"
+"WebPlugInContainerKey"
 "WebPluginAttributes"
 "WebPluginBaseURL"
 "WebPluginContainer"
-"WebPluginDefaultView"
 "WebPluginDescription"
 "WebPluginExtensions"
 "WebPluginLocalizationName"
@@ -227,13 +224,20 @@
 "WebProgressFinishedNotification"
 "WebProgressStartedNotification"
 "WebResourceData"
+"WebResourceFrameName"
 "WebResourceMIMEType"
 "WebResourceTextEncodingName"
 "WebResourceURL"
 "WebRuntimeError"
 "WebSiteURLToIconURLKey"
+"WebSubframeArchives"
 "WebSubresources"
 "WebURLsWithTitlesPboardType"
+"WebViewDidBeginEditingNotification"
+"WebViewDidChangeNotification"
+"WebViewDidChangeSelectionNotification"
+"WebViewDidChangeTypingStyleNotification"
+"WebViewDidEndEditingNotification"
 "\""
 "\"@?"
 "\"\\"
@@ -249,14 +253,17 @@
 "\nList root path: %s\n"
 "\r"
 "\r\n"
+"\t"
 "__KHTML__"
 "_blank"
 "_current"
 "_parent"
 "_self"
 "_top"
+"a"
 "about:"
 "about:blank"
+"applewebdata"
 "application/octet-stream"
 "application/pdf"
 "application/postscript"
@@ -266,6 +273,8 @@
 "application/xhtml+xml"
 "application/xml"
 "c"
+"canGoBack"
+"canGoForward"
 "com.RealNetworks.RealOne Player"
 "com.apple.HIWebView"
 "com.apple.JavaAppletPlugin"
@@ -276,21 +285,29 @@
 "com.apple.hiview"
 "com.apple.universalaccess"
 "displayTitle"
+"estimatedProgress"
 "ftp:"
+"href"
 "htm"
 "html"
 "http"
 "https"
 "image/pict"
 "image/tiff"
+"img"
+"isLoading"
 "javascript:"
 "lastVisitedDate"
 "localhost"
 "localized string not found"
 "lproj"
 "mailto:"
+"mainFrameIcon"
+"mainFrameTitle"
+"mainFrameURL"
 "nullplugin"
 "pluginspage"
+"src"
 "text/"
 "text/calendar"
 "text/directory"
@@ -304,13 +321,20 @@
 "text/x-vcard"
 "text/xml"
 "tiff"
+"unable to get glyphsfor %@ %f error = (%d)"
 "unexpected result from ATSUGetGlyphBounds():  actualNumBounds(%d) != 1"
 "url_icon"
+"utf-16"
 "visitCount"
 "webarchive"
 "x"
 "x-apple-web-kit/"
 "~/Library/Icons"
+DOM.subproj/WebDOMOperations.m:"background"
+DOM.subproj/WebDOMOperations.m:"data"
+DOM.subproj/WebDOMOperations.m:"icon"
+DOM.subproj/WebDOMOperations.m:"movie"
+DOM.subproj/WebDOMOperations.m:"stylesheet"
 History.subproj/WebHistoryItem.m:" in \"%@\""
 History.subproj/WebHistoryItem.m:"children"
 History.subproj/WebHistoryItem.m:"title"
@@ -326,29 +350,16 @@ Plugins.subproj/WebPluginDatabase.m:"Java Applet Plugin Enabler"
 WebCoreSupport.subproj/WebBridge.m:"height"
 WebCoreSupport.subproj/WebBridge.m:"width"
 WebCoreSupport.subproj/WebCookieAdapter.m:"Cookie"
-WebCoreSupport.subproj/WebTextRenderer.m:"%@ unable to initialize with font %@ at %@"
-WebCoreSupport.subproj/WebTextRenderer.m:"%@: Don't know how to pack glyphs for font %@ %f"
 WebCoreSupport.subproj/WebTextRenderer.m:"Times New Roman"
-WebCoreSupport.subproj/WebTextRenderer.m:"Unable to cache glyph widths for %@ %f"
 WebCoreSupport.subproj/WebTextRenderer.m:"YES"
 WebCoreSupport.subproj/WebTextRenderer.m:"not known"
-WebCoreSupport.subproj/WebTextRenderer.m:"unable to get glyphsfor %@ %f error = (%d)"
 WebCoreSupport.subproj/WebTextRendererFactory.m:"Arabic"
 WebCoreSupport.subproj/WebTextRendererFactory.m:"Geeza Pro"
 WebCoreSupport.subproj/WebTextRendererFactory.m:"Pashto"
 WebCoreSupport.subproj/WebTextRendererFactory.m:"Urdu"
-WebView.subproj/WebDataProtocol.m:"applewebdata"
 WebView.subproj/WebDataSource.m:"Refresh"
-WebView.subproj/WebFrame.m:"utf-16"
 WebView.subproj/WebPreferences.m:"Identifier"
 WebView.subproj/WebPreferences.m:"Values"
 WebView.subproj/WebPreferences.m:"WebPreferences%d"
 WebView.subproj/WebRenderNode.m
 WebView.subproj/WebView.m:"Preferences"
-WebView.subproj/WebView.m:"canGoBack"
-WebView.subproj/WebView.m:"canGoForward"
-WebView.subproj/WebView.m:"estimatedProgress"
-WebView.subproj/WebView.m:"isLoading"
-WebView.subproj/WebView.m:"mainFrameIcon"
-WebView.subproj/WebView.m:"mainFrameTitle"
-WebView.subproj/WebView.m:"mainFrameURL"
diff --git a/WebKit/WebView.subproj/WebFrameView.m b/WebKit/WebView.subproj/WebFrameView.m
index 2c4c1de..dbf583b 100644
--- a/WebKit/WebView.subproj/WebFrameView.m
+++ b/WebKit/WebView.subproj/WebFrameView.m
@@ -25,12 +25,17 @@
 #import <WebKit/WebTextRendererFactory.h>
 #import <WebKit/WebTextView.h>
 #import <WebKit/WebViewFactory.h>
+#import <WebKit/WebViewInternal.h>
 #import <WebKit/WebViewPrivate.h>
 #import <WebKit/WebAssertions.h>
 
 #import <Foundation/NSDictionary_NSURLExtras.h>
 #import <Foundation/NSURLRequest.h>
 
+ at interface NSClipView (AppKitSecretsIKnow)
+- (BOOL)_scrollTo:(const NSPoint *)newOrigin; // need the boolean result from this method
+ at end
+
 enum {
     SpaceKey = 0x0020
 };
@@ -132,11 +137,11 @@ enum {
     return [[self _scrollView] contentView];
 }
 
-- (void)_scrollVerticallyBy: (float)delta
+- (BOOL)_scrollVerticallyBy: (float)delta
 {
     NSPoint point = [[self _contentView] bounds].origin;
     point.y += delta;
-    [[self _contentView] scrollPoint: point];
+    return [[self _contentView] _scrollTo:&point];
 }
 
 - (void)_scrollHorizontallyBy: (float)delta
@@ -162,7 +167,7 @@ enum {
     return [[self _scrollView] horizontalLineScroll] * 4;
 }
 
-- (void)_pageVertically:(BOOL)up
+- (BOOL)_pageVertically:(BOOL)up
 {
     float pageOverlap = [self _verticalKeyboardScrollAmount];
     float delta = [[self _contentView] bounds].size.height;
@@ -173,7 +178,7 @@ enum {
         delta = -delta;
     }
 
-    [self _scrollVerticallyBy: delta];
+    return [self _scrollVerticallyBy: delta];
 }
 
 - (void)_pageHorizontally: (BOOL)left
@@ -214,21 +219,17 @@ enum {
 
 - (void)scrollPageUp:(id)sender
 {
-    // After hitting the top, tell our parent to scroll
-    float oldY = [[self _contentView] bounds].origin.y;
-    [self _pageVertically:YES];
-    if (oldY == [[self _contentView] bounds].origin.y) {
-        [[self nextResponder] tryToPerform:@selector(scrollPageUp:) with:nil];
+    if (![self _pageVertically:YES]) {
+        // If we were already at the top, tell the next responder to scroll if it can.
+        [[self nextResponder] tryToPerform:@selector(scrollPageUp:) with:sender];
     }
 }
 
 - (void)scrollPageDown:(id)sender
 {
-    // After hitting the bottom, tell our parent to scroll
-    float oldY = [[self _contentView] bounds].origin.y;
-    [self _pageVertically:NO];
-    if (oldY == [[self _contentView] bounds].origin.y) {
-        [[self nextResponder] tryToPerform:@selector(scrollPageDown:) with:nil];
+    if (![self _pageVertically:NO]) {
+        // If we were already at the bottom, tell the next responder to scroll if it can.
+        [[self nextResponder] tryToPerform:@selector(scrollPageDown:) with:sender];
     }
 }
 
diff --git a/WebKit/WebView.subproj/WebView.m b/WebKit/WebView.subproj/WebView.m
index 98908a4..e21ecc8 100644
--- a/WebKit/WebView.subproj/WebView.m
+++ b/WebKit/WebView.subproj/WebView.m
@@ -2236,7 +2236,7 @@ static WebFrame *incrementFrame(WebFrame *curr, BOOL forward, BOOL wrapFlag)
     if (pseudoElement == nil) {
         pseudoElement = @"";
     }
-    return [[self DOMDocument] getComputedStyle:element :pseudoElement];
+    return [[element ownerDocument] getComputedStyle:element :pseudoElement];
 }
 
 @end
@@ -2331,10 +2331,8 @@ static NSFont *_fontFromStyle(DOMCSSStyleDeclaration *style)
             // FIXME: The "&& NO" prevents createNodeIterator from being called, which is nice because
             // it's not actually defined yet.
             if (lastSelectedElement != firstSelectedElement && NO) {
-                DOMNodeIterator *iterator = [[self DOMDocument] createNodeIterator:firstSelectedElement
-                                                                                  :DOM_SHOW_ELEMENT
-                                                                                  :nil
-                                                                                  :NO];
+                DOMNodeIterator *iterator = [[[selection startContainer] ownerDocument]
+                    createNodeIterator:firstSelectedElement :DOM_SHOW_ELEMENT :nil :NO];
                 DOMNode *element = [iterator nextNode];
                 ASSERT(element == firstSelectedElement);
                 
@@ -2519,14 +2517,10 @@ static NSFont *_fontFromStyle(DOMCSSStyleDeclaration *style)
     return _private->editingDelegate;
 }
 
-- (DOMDocument *)DOMDocument
-{
-    return [[self _bridgeForCurrentSelection] DOMDocument];
-}
-
 - (DOMCSSStyleDeclaration *)styleDeclarationWithText:(NSString *)text
 {
-    DOMCSSStyleDeclaration *decl = [[self DOMDocument] createCSSStyleDeclaration];
+    // FIXME: Should this really be attached to the document with the current selection?
+    DOMCSSStyleDeclaration *decl = [[[self _bridgeForCurrentSelection] DOMDocument] createCSSStyleDeclaration];
     [decl setCssText:text];
     return decl;
 }
diff --git a/WebKit/WebView.subproj/WebViewInternal.h b/WebKit/WebView.subproj/WebViewInternal.h
index b117f5f..9a5a15e 100644
--- a/WebKit/WebView.subproj/WebViewInternal.h
+++ b/WebKit/WebView.subproj/WebViewInternal.h
@@ -8,3 +8,9 @@
 - (BOOL)_isLoading;
 - (void)_updateFontPanel;
 @end;
+
+ at interface WebView (WebViewEditingExtras)
+- (BOOL)_interceptEditingKeyEvent:(NSEvent *)event;
+- (BOOL)_shouldBeginEditingInDOMRange:(DOMRange *)range;
+- (BOOL)_shouldEndEditingInDOMRange:(DOMRange *)range;
+ at end
diff --git a/WebKit/WebView.subproj/WebViewPrivate.h b/WebKit/WebView.subproj/WebViewPrivate.h
index 98ab979..95816a0 100644
--- a/WebKit/WebView.subproj/WebViewPrivate.h
+++ b/WebKit/WebView.subproj/WebViewPrivate.h
@@ -313,12 +313,3 @@ Could be worth adding to the API.
 - (id)initWithTarget:(id)t defaultTarget:(id)dt templateClass:(Class)aClass;
 + (id)safeForwarderWithTarget:(id)t defaultTarget:(id)dt templateClass:(Class)aClass;
 @end
-
-
- at interface WebView (WebViewEditingExtras)
-- (BOOL)_interceptEditingKeyEvent:(NSEvent *)event;
-- (DOMDocument *)DOMDocument;
-- (BOOL)_shouldBeginEditingInDOMRange:(DOMRange *)range;
-- (BOOL)_shouldEndEditingInDOMRange:(DOMRange *)range;
- at end
-
diff --git a/WebKit/copy-webcore-files-to-webkit b/WebKit/copy-webcore-files-to-webkit
index 25b6cff..73dbc26 100755
--- a/WebKit/copy-webcore-files-to-webkit
+++ b/WebKit/copy-webcore-files-to-webkit
@@ -50,99 +50,88 @@ sub Say {
 }
 
 sub CheckInWebKit {
-	if (cwd() =~ /WebKit$/) {
-		# ok...we're in WebCore
-		$WebKitPath = cwd();
-	}
-	else {
-		Say("*** $ProgramName: not being run from WebKit directory. Cannot copy, exiting...");
+    if (cwd() =~ /WebKit$/) {
+        # ok...we're in WebCore
+        $WebKitPath = cwd();
+    }
+    else {
+        Say("*** $ProgramName: not being run from WebKit directory. Cannot copy, exiting...");
         exit(0);
-	}
+    }
 }
 
 sub CheckWebCoreFound {
-	my $path = cwd();
-	$path = dirname($path) . '/WebCore';
-	if (-d $path) {
-		# ok...WebCore is where we expect it
-		$WebCorePath = $path;
-	}
-	else {
-		Say("*** $ProgramName: WebCore is not a sibling directory to WebKit. Cannot copy, exiting...");
+    my $path = cwd();
+    $path = dirname($path) . '/WebCore';
+    if (-d $path) {
+        # ok...WebCore is where we expect it
+        $WebCorePath = $path;
+    }
+    else {
+        Say("*** $ProgramName: WebCore is not a sibling directory to WebKit. Cannot copy, exiting...");
         exit(0);
-	}
+    }
 }
 
 sub CheckJavaScriptCoreFound {
-	my $path = cwd();
-	$path = dirname($path) . '/JavaScriptCore';
-	if (-d $path) {
-		# ok...WebCore is where we expect it
-		$JavaScriptCorePath = $path;
-	}
-	else {
-		Say("*** $ProgramName: JavaScriptCore is not a sibling directory to WebKit. Cannot copy, exiting...");
+    my $path = cwd();
+    $path = dirname($path) . '/JavaScriptCore';
+    if (-d $path) {
+        # ok...WebCore is where we expect it
+        $JavaScriptCorePath = $path;
+    }
+    else {
+        Say("*** $ProgramName: JavaScriptCore is not a sibling directory to WebKit. Cannot copy, exiting...");
         exit(0);
-	}
+    }
 }
 
 sub CopyFilesIfNeeded {
-	# Only copy files if the dest file does not exist
-	# or the source file is different than the dest file
-	my $blab = 0;
-	
-	for my $file (keys(%WebCoreFiles)) {
-		my $source = "$WebCorePath/$file";
-		my $dest = "$WebKitPath/$WebCoreFiles{$file}";
-		if (! -f $source) {
-			Fail("$source is not a plain file");	
-		}
-		if (-e $dest && ! -f $dest) {
-			Fail("$dest is not a plain file");	
-		}
-
-        Say("$ProgramName: comparing files...") if $blab == 0;
-        ExecuteCommand("sed -e 's%#import .*<WebCore/\\(.*\\)>%#import <WebKit/\\1>%' $source > $dest-X");
-        ExecuteCommand("sed -e 's%#import .*<JavaScriptCore/\\(.*\\)>%#import <WebKit/\\1>%' $dest-X > $dest-Y");
-        ExecuteCommand("rm $dest-X");
-        if (! -e $dest || system("cmp $dest $dest-Y > /dev/null 2>&1")){
-            Say("$ProgramName: copying files...") if $blab == 0;
-            $blab = 1;
-            ExecuteCommand("cp -f $dest-Y $dest");
+    # Only copy files if the dest file does not exist
+    # or the source file is different than the dest file
+    my $blab = 0;
+    
+    for my $file (keys(%WebCoreFiles)) {
+        my $source = "$WebCorePath/$file";
+        my $dest = "$WebKitPath/$WebCoreFiles{$file}";
+        if (! -f $source) {
+            Fail("$source is not a plain file");    
+        }
+        if (-e $dest && ! -f $dest) {
+            Fail("$dest is not a plain file");    
+        }
+
+        ExecuteCommand("sed -e 's%#import .*<WebCore/\\(.*\\)>%#import <WebKit/\\1>%' -e 's%#import .*<JavaScriptCore/\\(.*\\)>%#import <WebKit/\\1>%' $source > $dest-X");
+        if (! -e $dest || system("cmp $dest $dest-X > /dev/null 2>&1")){
+            ExecuteCommand("cp -f $dest-X $dest");
        }
-       ExecuteCommand("rm $dest-Y");
-
-	}
-
-	for my $file (keys(%JavaScriptCoreFiles)) {
-		my $source = "$JavaScriptCorePath/$file";
-		my $dest = "$WebKitPath/$JavaScriptCoreFiles{$file}";
-		if (! -f $source) {
-			Fail("$source is not a plain file");	
-		}
-		if (-e $dest && ! -f $dest) {
-			Fail("$dest is not a plain file");	
-		}
-		
-        Say("$ProgramName: comparing files...") if $blab == 0;
-        ExecuteCommand("sed -e 's%#import .*<WebCore/\\(.*\\)>%#import <WebKit/\\1>%' $source > $dest-X");
-        ExecuteCommand("sed -e 's%#import .*<JavaScriptCore/\\(.*\\)>%#import <WebKit/\\1>%' $dest-X > $dest-Y");
-        ExecuteCommand("rm $dest-X");
-        if (! -e $dest || system("cmp $dest $dest-Y > /dev/null 2>&1")){
-            Say("$ProgramName: copying files...") if $blab == 0;
-            $blab = 1;
-            ExecuteCommand("cp -f $dest-Y $dest");
+       ExecuteCommand("rm $dest-X");
+
+    }
+
+    for my $file (keys(%JavaScriptCoreFiles)) {
+        my $source = "$JavaScriptCorePath/$file";
+        my $dest = "$WebKitPath/$JavaScriptCoreFiles{$file}";
+        if (! -f $source) {
+            Fail("$source is not a plain file");    
+        }
+        if (-e $dest && ! -f $dest) {
+            Fail("$dest is not a plain file");    
+        }
+        
+        ExecuteCommand("sed -e 's%#import .*<WebCore/\\(.*\\)>%#import <WebKit/\\1>%'  -e 's%#import .*<JavaScriptCore/\\(.*\\)>%#import <WebKit/\\1>%' $source > $dest-X");
+        if (! -e $dest || system("cmp $dest $dest-X > /dev/null 2>&1")){
+            ExecuteCommand("cp -f $dest-X $dest");
        }
-       ExecuteCommand("rm $dest-Y");
-       
-	}
+       ExecuteCommand("rm $dest-X");
+    }
 }
 
 sub ExecuteCommand {
     my ($cmd) = @_;
-    Say($cmd);
     my $result = system($cmd);
     if ($result != 0) {
+        Say($cmd);
         Fail("error: $result");
         exit($result);
     }

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list