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

rjw rjw at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 07:42:40 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit f0c65bbeffd1ecfbf54e1a5f69c4f043eff9a1c4
Author: rjw <rjw at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Wed May 21 00:19:22 2003 +0000

    	Fixed 3262825.
    	Fixed 3245625.
    	Fixed 3262547.
    
    	Recursively check items when going back/forward to ensure all
    	frame URLs are correct.
    
    	Added some logging to help diagnose back/forward problems.
    
            Reviewed by John.
    
            * History.subproj/WebHistory.m:
            (-[WebHistory addItem:]):
            * Misc.subproj/WebKitLogging.h:
            * Misc.subproj/WebKitLogging.m:
            * WebView.subproj/WebDataSource.m:
            (-[WebDataSource initWithRequest:]):
            * WebView.subproj/WebFramePrivate.m:
            (-[WebFrame _createItem:]):
            (-[WebFrame _createItemTreeWithTargetFrame:clippedAtTarget:]):
            (-[WebFrame _transitionToCommitted:]):
            (-[WebFrame _URLsMatchItem:]):
            (-[WebFrame _loadItem:withLoadType:]):
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@4402 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog
index 6ef7ee4..c462fe9 100644
--- a/WebKit/ChangeLog
+++ b/WebKit/ChangeLog
@@ -1,3 +1,29 @@
+2003-05-20  Richard Williamson   <rjw at apple.com>
+
+	Fixed 3262825.
+	Fixed 3245625.
+	Fixed 3262547.
+
+	Recursively check items when going back/forward to ensure all
+	frame URLs are correct.
+
+	Added some logging to help diagnose back/forward problems.
+
+        Reviewed by John.
+
+        * History.subproj/WebHistory.m:
+        (-[WebHistory addItem:]):
+        * Misc.subproj/WebKitLogging.h:
+        * Misc.subproj/WebKitLogging.m:
+        * WebView.subproj/WebDataSource.m:
+        (-[WebDataSource initWithRequest:]):
+        * WebView.subproj/WebFramePrivate.m:
+        (-[WebFrame _createItem:]):
+        (-[WebFrame _createItemTreeWithTargetFrame:clippedAtTarget:]):
+        (-[WebFrame _transitionToCommitted:]):
+        (-[WebFrame _URLsMatchItem:]):
+        (-[WebFrame _loadItem:withLoadType:]):
+
 === Safari-80 ===
 
 2003-05-20  Ken Kocienda  <kocienda at apple.com>
diff --git a/WebKit/History.subproj/WebHistory.m b/WebKit/History.subproj/WebHistory.m
index d3370df..660062c 100644
--- a/WebKit/History.subproj/WebHistory.m
+++ b/WebKit/History.subproj/WebHistory.m
@@ -9,6 +9,7 @@
 #import <WebKit/WebHistoryPrivate.h>
 #import <WebKit/WebHistoryItem.h>
 #import <WebKit/WebHistoryItemPrivate.h>
+#import <WebKit/WebKitLogging.h>
 
 #import <Foundation/NSError.h>
 #import <WebKit/WebAssertions.h>
@@ -109,6 +110,7 @@ static WebHistory *_sharedHistory = nil;
 
 - (void)addItem: (WebHistoryItem *)entry
 {
+    LOG (History, "adding %@", entry);
     [_historyPrivate addItem: entry];
     [self _sendNotification: WebHistoryItemsAddedNotification
                     entries: [NSArray arrayWithObject:entry]];
diff --git a/WebKit/Misc.subproj/WebKitLogging.h b/WebKit/Misc.subproj/WebKitLogging.h
index e434611..8b10aea 100644
--- a/WebKit/Misc.subproj/WebKitLogging.h
+++ b/WebKit/Misc.subproj/WebKitLogging.h
@@ -31,3 +31,5 @@ extern WebLogChannel WebKitLogCacheSizes;
 extern WebLogChannel WebKitLogFormDelegate;
 
 extern WebLogChannel WebKitLogFileDatabaseActivity;
+
+extern WebLogChannel WebKitLogHistory;
diff --git a/WebKit/Misc.subproj/WebKitLogging.m b/WebKit/Misc.subproj/WebKitLogging.m
index 06cacb6..e08b2b6 100644
--- a/WebKit/Misc.subproj/WebKitLogging.m
+++ b/WebKit/Misc.subproj/WebKitLogging.m
@@ -27,3 +27,5 @@ WebLogChannel WebKitLogCacheSizes =             { 0x00100000, "WebKitLogLevel",
 WebLogChannel WebKitLogFormDelegate = 	        { 0x00200000, "WebKitLogLevel", WebLogChannelUninitialized };
 
 WebLogChannel WebKitLogFileDatabaseActivity =   { 0x00400000, "WebKitLogLevel", WebLogChannelUninitialized };
+
+WebLogChannel WebKitLogHistory =                { 0x00800000, "WebKitLogLevel", WebLogChannelUninitialized };
diff --git a/WebKit/WebView.subproj/WebDataSource.m b/WebKit/WebView.subproj/WebDataSource.m
index 54bc1e9..693b36f 100644
--- a/WebKit/WebView.subproj/WebDataSource.m
+++ b/WebKit/WebView.subproj/WebDataSource.m
@@ -10,6 +10,7 @@
 #import <WebKit/WebException.h>
 #import <WebKit/WebFramePrivate.h>
 #import <WebKit/WebHTMLRepresentation.h>
+#import <WebKit/WebKitLogging.h>
 #import <WebKit/WebKitStatisticsPrivate.h>
 #import <WebKit/WebMainResourceClient.h>
 #import <WebKit/WebView.h>
@@ -33,6 +34,8 @@
     _private = [[WebDataSourcePrivate alloc] init];
     _private->originalRequest = [request retain];
     _private->originalRequestCopy = [request copy];
+    
+    LOG(Loading, "creating datasource for %@", [request URL]);
     _private->request = [_private->originalRequest mutableCopy];
 
     ++WebDataSourceCount;
diff --git a/WebKit/WebView.subproj/WebFramePrivate.m b/WebKit/WebView.subproj/WebFramePrivate.m
index 09ad0b6..dfb5b37 100644
--- a/WebKit/WebView.subproj/WebFramePrivate.m
+++ b/WebKit/WebView.subproj/WebFramePrivate.m
@@ -133,6 +133,7 @@ Repeat load of the same URL (by any other means of navigation other than the rel
 - (void)_restoreScrollPosition;
 - (void)_scrollToTop;
 
+- (WebHistoryItem *)_createItem: (BOOL)useOriginal;
 - (WebHistoryItem *)_createItemTreeWithTargetFrame:(WebFrame *)targetFrame clippedAtTarget:(BOOL)doClip;
 
 - (void)_resetBackForwardListToCurrent;
@@ -268,13 +269,23 @@ Repeat load of the same URL (by any other means of navigation other than the rel
     }
 }
 
-- (WebHistoryItem *)_createItem
+- (WebHistoryItem *)_createItem: (BOOL)useOriginal
 {
     WebDataSource *dataSrc = [self dataSource];
-    NSURLRequest *request = [dataSrc request];
-    NSURL *URL = [request URL];
+    NSURLRequest *request;
+    NSURL *URL;
     WebHistoryItem *bfItem;
 
+    if (useOriginal && 1) {
+        request = [dataSrc _originalRequest];
+    }
+    else {
+        request = [dataSrc request];
+    }
+    URL = [request URL];
+
+    LOG (History, "creating item for %@", request);
+    
     bfItem = [[[WebHistoryItem alloc] initWithURL:URL target:[self name] parent:[[self parentFrame] name] title:[dataSrc pageTitle]] autorelease];
     [dataSrc _addBackForwardItem:bfItem];
     [bfItem setOriginalURLString:[[[dataSrc _originalRequest] URL] absoluteString]];
@@ -298,7 +309,7 @@ Repeat load of the same URL (by any other means of navigation other than the rel
 */
 - (WebHistoryItem *)_createItemTreeWithTargetFrame:(WebFrame *)targetFrame clippedAtTarget:(BOOL)doClip
 {
-    WebHistoryItem *bfItem = [self _createItem];
+    WebHistoryItem *bfItem = [self _createItem: [self parentFrame]?YES:NO];
 
     [self _saveScrollPositionToItem:[_private previousItem]];
     if (!(doClip && self == targetFrame)) {
@@ -687,7 +698,7 @@ Repeat load of the same URL (by any other means of navigation other than the rel
                 // The only case where parentItem==nil should be when a parent frame loaded an
                 // empty URL, which doesn't set up a current item in that parent.
                 if (parentItem) {
-                    [parentItem addChildItem:[self _createItem]];
+                    [parentItem addChildItem:[self _createItem: YES]];
                 }
                 [self _makeDocumentView];
                 break;
@@ -1080,6 +1091,28 @@ static CFAbsoluteTime _timeOfLastCompletedLoad;
     [[currentURL _web_URLByRemovingFragment] isEqual: [destinationURL _web_URLByRemovingFragment]]);
 }
 
+// Walk the frame tree and ensure that the URLs match the URLs in the item.
+- (BOOL)_URLsMatchItem:(WebHistoryItem *)item
+{
+    NSURL *currentURL = [[[self dataSource] request] URL];
+
+    if (![[item URL] isEqual: currentURL])
+        return NO;
+    
+    NSArray *childItems = [item children];
+    WebHistoryItem *childItem;
+    WebFrame *childFrame;
+    int i, count = [childItems count];
+    for (i = 0; i < count; i++){
+        childItem = [childItems objectAtIndex:i];
+        childFrame = [self _immediateChildFrameNamed:[childItem target]];
+        if (![childFrame _URLsMatchItem: childItem])
+            return NO;
+    }
+    
+    return YES;
+}
+
 // loads content into this frame, as specified by item
 - (void)_loadItem:(WebHistoryItem *)item withLoadType:(WebFrameLoadType)loadType
 {
@@ -1096,8 +1129,7 @@ static CFAbsoluteTime _timeOfLastCompletedLoad;
     
     // FIXME: These checks don't match the ones in _loadURL:referrer:loadType:target:triggeringEvent:isFormSubmission:
     // Perhaps they should.
-    
-    if (!formData && ![self _shouldReloadForCurrent:itemURL andDestination:currentURL] )
+    if (!formData && ![self _shouldReloadForCurrent:itemURL andDestination:currentURL] && [self _URLsMatchItem:item] )
     {
 #if 0
         // FIXME:  We need to normalize the code paths for anchor navigation.  Something
@@ -1138,10 +1170,7 @@ static CFAbsoluteTime _timeOfLastCompletedLoad;
             [self _loadDataSource:newDataSource withLoadType:loadType formState:nil];            
         }
         else {
-	    // Use the original URL to ensure we get all the side-effects, such as
-	    // onLoad handlers, of any redirects that happened. An example of where
-	    // this is needed is Radar 3213556.
-            NSMutableURLRequest *request = [[NSMutableURLRequest alloc] initWithURL:itemOriginalURL];
+            NSMutableURLRequest *request = [[NSMutableURLRequest alloc] initWithURL:itemURL];
             [self _addExtraFieldsToRequest:request alwaysFromRequest: (formData != nil)?YES:NO];
 
             // If this was a repost that failed the page cache, we might try to repost the form.

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list