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

trey trey at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 06:56:22 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit 08b74ab7f9ee318548c952d5b33392e7609ddcae
Author: trey <trey at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Thu Oct 31 22:59:43 2002 +0000

    	Added API to support 3072505 - SnapBack for user-entered page address
    	Refixed 3041616 - Extra page added in back button history
    	Previous fix was stepped on by a later checkin.  Re-established that fix, then
    	went on to make sure we have the final URL and title in the BF item in the
    	case of a client redirect.  Also handles redirects that happen within frames.
    	Fixed 3078560 - div added to "back" list
    
            * History.subproj/WebBackForwardList.h:
            * History.subproj/WebBackForwardList.m:
            (-[WebBackForwardList containsEntry:]):
    	Added new API for 3072505.
            * WebCoreSupport.subproj/WebBridge.h:
            * WebCoreSupport.subproj/WebBridge.m:
            (-[WebBridge reportClientRedirectTo:delay:fireDate:]):
            (-[WebBridge reportClientRedirectCancelled]):
            (-[WebBridge loadURL:reload:]):
    	Added logging.  Renamed flag.  Establish the right loadtype and set BF items
    	from the old dataSource onto the new dataSource in the case of a client redirect.
            * WebView.subproj/WebDataSourcePrivate.h:
            * WebView.subproj/WebDataSourcePrivate.m:
            (-[WebDataSource _setRequest:]):
    	Add logging.
            (-[WebDataSource _addBackForwardItem:]):
            (-[WebDataSource _addBackForwardItems:]):
            (-[WebDataSource _backForwardItems]):
    	New setters/getters to support setting up the new dataSource of a client redirect.
            * WebView.subproj/WebFramePrivate.h:
    	New loadType WebFrameLoadTypeClientRedirect.
            * WebView.subproj/WebFramePrivate.m:
            (-[WebFrame _transitionToCommitted]):
    	Update the URL in the BF list in the client redirect case.
            (-[WebFrame _isLoadComplete]):
    	NOP case for WebFrameLoadTypeClientRedirect
            (-[WebFrame _goToItem:withFrameLoadType:]):
    	ASSERT_NOT_REACHED case for WebFrameLoadTypeClientRedirect
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@2525 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog
index 1a0a03d..ef4d843 100644
--- a/WebKit/ChangeLog
+++ b/WebKit/ChangeLog
@@ -1,3 +1,41 @@
+2002-10-31  Trey Matteson  <trey at apple.com>
+
+	Added API to support 3072505 - SnapBack for user-entered page address
+	Refixed 3041616 - Extra page added in back button history
+	Previous fix was stepped on by a later checkin.  Re-established that fix, then
+	went on to make sure we have the final URL and title in the BF item in the
+	case of a client redirect.  Also handles redirects that happen within frames.
+	Fixed 3078560 - div added to "back" list
+
+        * History.subproj/WebBackForwardList.h:
+        * History.subproj/WebBackForwardList.m:
+        (-[WebBackForwardList containsEntry:]):
+	Added new API for 3072505.
+        * WebCoreSupport.subproj/WebBridge.h:
+        * WebCoreSupport.subproj/WebBridge.m:
+        (-[WebBridge reportClientRedirectTo:delay:fireDate:]):
+        (-[WebBridge reportClientRedirectCancelled]):
+        (-[WebBridge loadURL:reload:]):
+	Added logging.  Renamed flag.  Establish the right loadtype and set BF items
+	from the old dataSource onto the new dataSource in the case of a client redirect.
+        * WebView.subproj/WebDataSourcePrivate.h:
+        * WebView.subproj/WebDataSourcePrivate.m:
+        (-[WebDataSource _setRequest:]):
+	Add logging.
+        (-[WebDataSource _addBackForwardItem:]):
+        (-[WebDataSource _addBackForwardItems:]):
+        (-[WebDataSource _backForwardItems]):
+	New setters/getters to support setting up the new dataSource of a client redirect.
+        * WebView.subproj/WebFramePrivate.h:
+	New loadType WebFrameLoadTypeClientRedirect.
+        * WebView.subproj/WebFramePrivate.m:
+        (-[WebFrame _transitionToCommitted]):
+	Update the URL in the BF list in the client redirect case.
+        (-[WebFrame _isLoadComplete]):
+	NOP case for WebFrameLoadTypeClientRedirect
+        (-[WebFrame _goToItem:withFrameLoadType:]):
+	ASSERT_NOT_REACHED case for WebFrameLoadTypeClientRedirect
+
 2002-10-31  Richard Williamson  <rjw at apple.com>
 
         Corrected extern definitions of lookup tables.
@@ -144,7 +182,6 @@
         * Misc.subproj/WebDownloadHandler.m: Removed.
         * WebKit.pbproj/project.pbxproj:
 
->>>>>>> 1.1051
 2002-10-28  Darin Adler  <darin at apple.com>
 
 	- fixed crash I just introduced
diff --git a/WebKit/ChangeLog-2002-12-03 b/WebKit/ChangeLog-2002-12-03
index 1a0a03d..ef4d843 100644
--- a/WebKit/ChangeLog-2002-12-03
+++ b/WebKit/ChangeLog-2002-12-03
@@ -1,3 +1,41 @@
+2002-10-31  Trey Matteson  <trey at apple.com>
+
+	Added API to support 3072505 - SnapBack for user-entered page address
+	Refixed 3041616 - Extra page added in back button history
+	Previous fix was stepped on by a later checkin.  Re-established that fix, then
+	went on to make sure we have the final URL and title in the BF item in the
+	case of a client redirect.  Also handles redirects that happen within frames.
+	Fixed 3078560 - div added to "back" list
+
+        * History.subproj/WebBackForwardList.h:
+        * History.subproj/WebBackForwardList.m:
+        (-[WebBackForwardList containsEntry:]):
+	Added new API for 3072505.
+        * WebCoreSupport.subproj/WebBridge.h:
+        * WebCoreSupport.subproj/WebBridge.m:
+        (-[WebBridge reportClientRedirectTo:delay:fireDate:]):
+        (-[WebBridge reportClientRedirectCancelled]):
+        (-[WebBridge loadURL:reload:]):
+	Added logging.  Renamed flag.  Establish the right loadtype and set BF items
+	from the old dataSource onto the new dataSource in the case of a client redirect.
+        * WebView.subproj/WebDataSourcePrivate.h:
+        * WebView.subproj/WebDataSourcePrivate.m:
+        (-[WebDataSource _setRequest:]):
+	Add logging.
+        (-[WebDataSource _addBackForwardItem:]):
+        (-[WebDataSource _addBackForwardItems:]):
+        (-[WebDataSource _backForwardItems]):
+	New setters/getters to support setting up the new dataSource of a client redirect.
+        * WebView.subproj/WebFramePrivate.h:
+	New loadType WebFrameLoadTypeClientRedirect.
+        * WebView.subproj/WebFramePrivate.m:
+        (-[WebFrame _transitionToCommitted]):
+	Update the URL in the BF list in the client redirect case.
+        (-[WebFrame _isLoadComplete]):
+	NOP case for WebFrameLoadTypeClientRedirect
+        (-[WebFrame _goToItem:withFrameLoadType:]):
+	ASSERT_NOT_REACHED case for WebFrameLoadTypeClientRedirect
+
 2002-10-31  Richard Williamson  <rjw at apple.com>
 
         Corrected extern definitions of lookup tables.
@@ -144,7 +182,6 @@
         * Misc.subproj/WebDownloadHandler.m: Removed.
         * WebKit.pbproj/project.pbxproj:
 
->>>>>>> 1.1051
 2002-10-28  Darin Adler  <darin at apple.com>
 
 	- fixed crash I just introduced
diff --git a/WebKit/History.subproj/WebBackForwardList.h b/WebKit/History.subproj/WebBackForwardList.h
index c3ddc86..e34f9e1 100644
--- a/WebKit/History.subproj/WebBackForwardList.h
+++ b/WebKit/History.subproj/WebBackForwardList.h
@@ -70,6 +70,12 @@
 - (WebHistoryItem *)forwardEntry;
 
 /*!
+    @method containsEntry:
+    @result Returns whether the receiver contains the given entry.
+*/
+- (BOOL)containsEntry:(WebHistoryItem *)entry;
+
+/*!
     @method backListWithSizeLimit:
     @param limit A cap on the size of the array returned.
     @result Returns a portion of the list before current entry, or nil if there are none.  The entries are in the order that they were originally visited.
diff --git a/WebKit/History.subproj/WebBackForwardList.m b/WebKit/History.subproj/WebBackForwardList.m
index a5bee3c..facb43b 100644
--- a/WebKit/History.subproj/WebBackForwardList.m
+++ b/WebKit/History.subproj/WebBackForwardList.m
@@ -112,6 +112,11 @@
     }
 }
 
+- (BOOL)containsEntry:(WebHistoryItem *)entry
+{
+    return [_entries indexOfObjectIdenticalTo:entry] != NSNotFound;
+}
+
 - (NSArray *)backListWithSizeLimit:(int)limit;
 {
     if (_current > 0) {
diff --git a/WebKit/WebCoreSupport.subproj/WebBridge.h b/WebKit/WebCoreSupport.subproj/WebBridge.h
index 1f745fe..a54bf6f 100644
--- a/WebKit/WebCoreSupport.subproj/WebBridge.h
+++ b/WebKit/WebCoreSupport.subproj/WebBridge.h
@@ -13,7 +13,7 @@
 @interface WebBridge : WebCoreBridge <WebCoreBridge>
 {
     WebFrame *frame;
-    BOOL _doingInternalLoad;
+    BOOL _doingClientRedirect;
 }
 
 - (void)receivedData:(NSData *)data withDataSource:(WebDataSource *)dataSource;
diff --git a/WebKit/WebCoreSupport.subproj/WebBridge.m b/WebKit/WebCoreSupport.subproj/WebBridge.m
index e0c7348..e0aee0b 100644
--- a/WebKit/WebCoreSupport.subproj/WebBridge.m
+++ b/WebKit/WebCoreSupport.subproj/WebBridge.m
@@ -213,17 +213,18 @@
 
 - (void)reportClientRedirectTo:(NSURL *)URL delay:(NSTimeInterval)seconds fireDate:(NSDate *)date
 {
+    LOG(Redirect, "Client redirect to: %@", URL);
     [[[frame controller] locationChangeDelegate] clientWillRedirectTo:URL delay:seconds fireDate:date forFrame:frame];
     if (seconds == 0.0) {
         // used to set loadType to internal, to prevent a redirect from going in the backforward list
-        _doingInternalLoad = YES;
+        _doingClientRedirect = YES;
     }
 }
 
 - (void)reportClientRedirectCancelled
 {
     [[[frame controller] locationChangeDelegate] clientRedirectCancelledForFrame:frame];
-    _doingInternalLoad = NO;
+    _doingClientRedirect = NO;
 }
 
 - (void)setFrame:(WebFrame *)webFrame
@@ -304,19 +305,36 @@
         [dataSource _addBackForwardItem:backForwardItem];
         [[[frame controller] locationChangeDelegate] locationChangedWithinPageForDataSource:dataSource];
     } else {
+        WebFrameLoadType previousLoadType = [frame _loadType];
+        WebDataSource *oldDataSource = [[frame dataSource] retain];
         WebResourceRequest *request = [[WebResourceRequest alloc] initWithURL:URL];
         [request setReferrer:[self referrer]];
         if (reload) {
             [request setRequestCachePolicy:WebRequestCachePolicyLoadFromOrigin];
         }
-        if (_doingInternalLoad) {
-            // client side redirects shouldn't be treated like user navigations
-            [frame _setLoadType:WebFrameLoadTypeInternal];
-        }
         [self loadRequest:request];
+        if (_doingClientRedirect) {
+            // client side redirects shouldn't make a new BF item like user navigations
+            // NB: must be done after loadRequest:, which sets the provDataSource, which
+            //     inits the load type to Standard
+            if (previousLoadType == WebFrameLoadTypeInternal) {
+                // Re-set back to Internal load type, so redirect doesn't end up in BF list
+                [frame _setLoadType:WebFrameLoadTypeInternal];
+            } else {
+                // Set load type, so redirect will update current item in BF list
+                [frame _setLoadType:WebFrameLoadTypeClientRedirect];
+            }
+
+            // need to transfer BF items from the dataSource that we're replacing
+            WebDataSource *newDataSource = [frame provisionalDataSource];
+            [newDataSource _setProvisionalBackForwardItem:[oldDataSource _provisionalBackForwardItem]];
+            [newDataSource _setPreviousBackForwardItem:[oldDataSource _previousBackForwardItem]];
+            [newDataSource _addBackForwardItems:[oldDataSource _backForwardItems]];
+        }
         [request release];
+        [oldDataSource release];
     }
-    _doingInternalLoad = NO;
+    _doingClientRedirect = NO;
 }
 
 - (void)postWithURL:(NSURL *)URL data:(NSData *)data contentType:(NSString *)contentType
diff --git a/WebKit/WebView.subproj/WebDataSourcePrivate.h b/WebKit/WebView.subproj/WebDataSourcePrivate.h
index 8d9f2e1..89948c5 100644
--- a/WebKit/WebView.subproj/WebDataSourcePrivate.h
+++ b/WebKit/WebView.subproj/WebDataSourcePrivate.h
@@ -113,6 +113,8 @@
 - (void)_setPreviousBackForwardItem: (WebHistoryItem *)item;
 - (WebHistoryItem *)_previousBackForwardItem;
 - (void)_addBackForwardItem:(WebHistoryItem *)item;
+- (void)_addBackForwardItems:(NSArray *)items;
+- (NSArray *)_backForwardItems;
 
 // Convenience interface for getting here from an WebDataSource.
 // This returns nil if the representation is not an WebHTMLRepresentation.
diff --git a/WebKit/WebView.subproj/WebDataSourcePrivate.m b/WebKit/WebView.subproj/WebDataSourcePrivate.m
index b3a87ce..fad4b05 100644
--- a/WebKit/WebView.subproj/WebDataSourcePrivate.m
+++ b/WebKit/WebView.subproj/WebDataSourcePrivate.m
@@ -281,8 +281,10 @@
     _private->request = [request retain];
 
     // Only send serverRedirectedForDataSource: if URL changed.
-    if (![[oldRequest URL] isEqual: [request URL]])
+    if (![[oldRequest URL] isEqual: [request URL]]) {
+        LOG(Redirect, "Server redirect to: %@", [request URL]);
         [[_private->controller locationChangeDelegate] serverRedirectedForDataSource:self];
+    }
         
     [oldRequest release];
 }
@@ -340,6 +342,9 @@
 
 - (void)_addBackForwardItem:(WebHistoryItem *)item
 {
+    if (!item) {
+        return;
+    }
     if (!_private->ourBackForwardItems) {
         _private->ourBackForwardItems = [[NSMutableArray alloc] initWithCapacity:1];
     }
@@ -348,6 +353,23 @@
     }
 }
 
+- (void)_addBackForwardItems:(NSArray *)items
+{
+    if (!items || [items count] == 0) {
+        return;
+    }
+    if (!_private->ourBackForwardItems) {
+        _private->ourBackForwardItems = [items mutableCopy];
+    } else {
+        [_private->ourBackForwardItems addObjectsFromArray:items];
+    }
+}
+
+- (NSArray *)_backForwardItems
+{
+    return _private->ourBackForwardItems;
+}
+
 - (void)_setMainDocumentError: (WebError *)error
 {
     [error retain];
diff --git a/WebKit/WebView.subproj/WebFramePrivate.h b/WebKit/WebView.subproj/WebFramePrivate.h
index c42f68d..6f05ade 100644
--- a/WebKit/WebView.subproj/WebFramePrivate.h
+++ b/WebKit/WebView.subproj/WebFramePrivate.h
@@ -35,6 +35,7 @@ typedef enum {
     WebFrameLoadTypeIndexedBackForward,		// a multi-item hop in the backforward list
     WebFrameLoadTypeReload,
     WebFrameLoadTypeReloadAllowingStaleData,
+    WebFrameLoadTypeClientRedirect,
     WebFrameLoadTypeInternal
 } WebFrameLoadType;
 
diff --git a/WebKit/WebView.subproj/WebFramePrivate.m b/WebKit/WebView.subproj/WebFramePrivate.m
index 413844c..395157e 100644
--- a/WebKit/WebView.subproj/WebFramePrivate.m
+++ b/WebKit/WebView.subproj/WebFramePrivate.m
@@ -356,7 +356,12 @@ static const char * const stateNames[] = {
                     [backForwardItem release];
                     // Scroll to top.
                     break;
-    
+
+                case WebFrameLoadTypeClientRedirect:
+                    // update the URL in the BF list
+                    [[[[self controller] backForwardList] currentEntry] setURL:[[ds request] URL]];
+                    break;
+                    
                 case WebFrameLoadTypeInternal:
                     // Do nothing, this was a frame/iframe non user load.
                 case WebFrameLoadTypeReloadAllowingStaleData:
@@ -523,6 +528,7 @@ static const char * const stateNames[] = {
                         break;
         
                     case WebFrameLoadTypeStandard:
+                    case WebFrameLoadTypeClientRedirect:
                     case WebFrameLoadTypeInternal:
                     case WebFrameLoadTypeReloadAllowingStaleData:
                         // Do nothing.
@@ -743,6 +749,10 @@ static const char * const stateNames[] = {
                 case WebFrameLoadTypeReloadAllowingStaleData:
                     // no-op: leave as protocol default
                     break;
+                case WebFrameLoadTypeClientRedirect:
+                    // should never start out going to an item in redirect mode
+                default:
+                    ASSERT_NOT_REACHED();
             }
         }
 

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list