[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 07:37:12 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit d6da92f28dc3431bcef160a1a940eb8081c1c467
Author: trey <trey at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Tue Apr 15 20:44:56 2003 +0000

    WebKit:
    
    	3227514 Open window in "Same Page" should copy entire back/forward list
    
    	New support to load a new view by copying the whole backforward
    	list and driving the new view to the current item.
    
            Reviewed by John.
    
            * WebView.subproj/WebViewPrivate.h:
            * WebView.subproj/WebViewPrivate.m:
            (-[WebView _loadItem:]):  Old routine, which only loaded an item.
            (-[WebView _loadItemsFromOtherView:]):  New routine that does the works.
    
    WebBrowser:
    
    	3227514 Open window in "Same Page" should copy entire back/forward list
    
    	Just call new method in WebKit.
    
            Reviewed by John.
    
            * BrowserDocument.h:
            * BrowserDocument.m:
            (-[BrowserDocument loadCloneOfView:]):  Renamed goToHistoryItem:inView:.
            * BrowserWindowController.m:
            (-[BrowserWindowController windowDidLoad]):  Call above method instead of old one.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@4109 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog
index f93b18e..4820c2c 100644
--- a/WebKit/ChangeLog
+++ b/WebKit/ChangeLog
@@ -1,3 +1,17 @@
+2003-04-15  Trey Matteson  <trey at apple.com>
+
+	3227514 Open window in "Same Page" should copy entire back/forward list
+
+	New support to load a new view by copying the whole backforward
+	list and driving the new view to the current item.
+
+        Reviewed by John.
+
+        * WebView.subproj/WebViewPrivate.h:
+        * WebView.subproj/WebViewPrivate.m:
+        (-[WebView _loadItem:]):  Old routine, which only loaded an item.
+        (-[WebView _loadItemsFromOtherView:]):  New routine that does the works.
+
 2003-04-15  Ken Kocienda  <kocienda at apple.com>
 
         Reviewed by John
diff --git a/WebKit/WebView.subproj/WebViewPrivate.h b/WebKit/WebView.subproj/WebViewPrivate.h
index a729bf5..24de03a 100644
--- a/WebKit/WebView.subproj/WebViewPrivate.h
+++ b/WebKit/WebView.subproj/WebViewPrivate.h
@@ -136,16 +136,20 @@ typedef struct _WebResourceDelegateImplementationCache {
 
 /*!
 Could be worth adding to the API.
-    @method loadItem:showingInView:
+    @method loadItem:
     @abstract Loads the view with the contents described by the item, including frame content
         described by child items.
     @param item   The item to load.  It is not retained, but a copy will appear in the
         BackForwardList on this WebView.
-    @param otherView   An optional WebView where the item is currently showing.  If this is
-        specified, the resulting load will have the same scroll position and form state
-        as present in otherView.
 */
-- (void)_loadItem:(WebHistoryItem *)item showingInView:(WebView *)otherView;
+- (void)_loadItem:(WebHistoryItem *)item;
+/*!
+Could be worth adding to the API.
+    @method loadItemsFromOtherView:
+    @abstract Loads the view with the contents of the other view, including its backforward list.
+    @param otherView   The WebView from which to copy contents.
+*/
+- (void)_loadBackForwardListFromOtherView:(WebView *)otherView;
 
 - (void)_goToItem: (WebHistoryItem *)item withLoadType: (WebFrameLoadType)type;
 
diff --git a/WebKit/WebView.subproj/WebViewPrivate.m b/WebKit/WebView.subproj/WebViewPrivate.m
index 393644c..aa909f5 100644
--- a/WebKit/WebView.subproj/WebViewPrivate.m
+++ b/WebKit/WebView.subproj/WebViewPrivate.m
@@ -355,27 +355,46 @@
     [[self mainFrame] _goToItem:item withLoadType:type];
 }
 
-- (void)_loadItem:(WebHistoryItem *)item showingInView:(WebView *)otherView
+// Not used now, but could be if we ever store frames in bookmarks or history
+- (void)_loadItem:(WebHistoryItem *)item
+{
+    WebHistoryItem *newItem = [item copy];	// Makes a deep copy, happily
+    [[self backForwardList] addItem:newItem];
+    [self _goToItem:newItem withLoadType:WebFrameLoadTypeIndexedBackForward];
+}
+
+- (void)_loadBackForwardListFromOtherView:(WebView *)otherView
 {
     // It turns out the right combination of behavior is done with the back/forward load
-    // type.  (See behavior matrix at the top of WebFramePrivate.)  So we put this item in
-    // the back forward list, and go there.
+    // type.  (See behavior matrix at the top of WebFramePrivate.)  So we copy all the items
+    // in the back forward list, and go to the current one.
 
-    if (otherView && [[otherView backForwardList] currentItem] == item) {
-        // If this item is showing somewhere, save away its current scroll and form state
-        [[otherView mainFrame] _saveDocumentAndScrollState];
+    WebBackForwardList *bfList = [self backForwardList];
+    ASSERT(![bfList currentItem]);	// destination list should be empty
+
+    WebBackForwardList *otherBFList = [otherView backForwardList];
+    if (![otherBFList currentItem]) {
+        return;		// empty back forward list, bail
     }
 
-    WebHistoryItem *newItem = [item copy];	// Makes a deep copy, happily
-    // Make the top item the target.  This ensures we reload all frames if we go forward and
-    // back to this item later, which seems good for the first page of a window, where this
-    // feature is typically used.
-    [[item targetItem] setIsTargetItem:NO];
-    [item setIsTargetItem:YES];
+    WebHistoryItem *newItemToGoTo;
+    int lastItemIndex = [otherBFList forwardListCount];
+    int i;
+    for (i = -[otherBFList backListCount]; i <= lastItemIndex; i++) {
+        if (i == 0) {
+            // If this item is showing , save away its current scroll and form state,
+            // since that might have changed since loading and it is normally not saved
+            // until we leave that page.
+            [[otherView mainFrame] _saveDocumentAndScrollState];
+        }
+        WebHistoryItem *newItem = [[otherBFList itemAtIndex:i] copy];
+        [bfList addItem:newItem];
+        if (i == 0) {
+            newItemToGoTo = newItem;
+        }
+    }
     
-    [[self backForwardList] addItem:newItem];
-
-    [self _goToItem:newItem withLoadType:WebFrameLoadTypeIndexedBackForward];
+    [self _goToItem:newItemToGoTo withLoadType:WebFrameLoadTypeIndexedBackForward];
 }
 
 - (void)_setFormDelegate: (id<WebFormDelegate>)delegate

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list