[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:55:25 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit 73b18e1ebb2d354de953ebd6c9e70ac71a319f76
Author: trey <trey at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Mon Oct 28 18:49:39 2002 +0000

    WebKit:
    
    	Finished 2998200 - access to most-recent in submenu of back & forward buttons
    
            * WebView.subproj/WebDataSourcePrivate.h:
    	The BF items we are going to and from were moved here from
    	WebFrame because of timing problems among multiple data sources
    	when using the BF buttons during a load.
    	In addition, the datasource has a list of relevant BF items for
    	which it keeps their titles up to date.
            * WebView.subproj/WebDataSourcePrivate.m:
            (-[WebDataSourcePrivate dealloc]):
    	Free new state.
            (-[WebDataSource _setTitle:]):
    	Update titles of BF items.
            (-[WebDataSource _provisionalBackForwardItem]):
            (-[WebDataSource _setProvisionalBackForwardItem:]):
            (-[WebDataSource _previousBackForwardItem]):
            (-[WebDataSource _setPreviousBackForwardItem:]):
            (-[WebDataSource _addBackForwardItem:]):
    	Maintain new state.
            (-[WebDataSource _commitIfReady]):
    	Free up previous and provisional BF items after commit.
            * WebCoreSupport.subproj/WebBridge.m:
            (-[WebBridge loadURL:]):
    	Add the new BF item to the datasource.
            (-[WebBridge saveDocumentState:]):
    	Use the right BF item to save the doc state.
            * WebView.subproj/WebFramePrivate.h:
    	Previous and provisional BF are moved to datasource.
            * WebView.subproj/WebFramePrivate.m:
            (-[WebFrame _transitionToCommitted]):
    	Use provisional BF from datasource to set position in BF list.
    	Add new BF item to datasource.
            (-[WebFrame _isLoadComplete]):
            (-[WebFrame _checkLoadComplete]):
    	Comments, whitespace.
            (-[WebFrame _goToItem:withFrameLoadType:]):
    	Set item we will use to saveDocState at commit time.
    
    WebBrowser:
    
    	Finished 2998200 - access to most-recent in submenu of back & forward buttons
    
            * BrowserDocument.m:
            (-[BrowserDocument _addItem:toMenu:]):
    	Center-truncate menu items to reasonable width
            * Defaults.plist:
    	Set Back-forward max size to 200.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@2490 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog
index 7fda612..269817e 100644
--- a/WebKit/ChangeLog
+++ b/WebKit/ChangeLog
@@ -1,3 +1,43 @@
+2002-10-28  Trey Matteson  <trey at apple.com>
+
+	Finished 2998200 - access to most-recent in submenu of back & forward buttons
+
+        * WebView.subproj/WebDataSourcePrivate.h:
+	The BF items we are going to and from were moved here from
+	WebFrame because of timing problems among multiple data sources
+	when using the BF buttons during a load.
+	In addition, the datasource has a list of relevant BF items for
+	which it keeps their titles up to date.
+        * WebView.subproj/WebDataSourcePrivate.m:
+        (-[WebDataSourcePrivate dealloc]):
+	Free new state.
+        (-[WebDataSource _setTitle:]):
+	Update titles of BF items.
+        (-[WebDataSource _provisionalBackForwardItem]):
+        (-[WebDataSource _setProvisionalBackForwardItem:]):
+        (-[WebDataSource _previousBackForwardItem]):
+        (-[WebDataSource _setPreviousBackForwardItem:]):
+        (-[WebDataSource _addBackForwardItem:]):
+	Maintain new state.
+        (-[WebDataSource _commitIfReady]):
+	Free up previous and provisional BF items after commit.
+        * WebCoreSupport.subproj/WebBridge.m:
+        (-[WebBridge loadURL:]):
+	Add the new BF item to the datasource.
+        (-[WebBridge saveDocumentState:]):
+	Use the right BF item to save the doc state.
+        * WebView.subproj/WebFramePrivate.h:
+	Previous and provisional BF are moved to datasource.
+        * WebView.subproj/WebFramePrivate.m:
+        (-[WebFrame _transitionToCommitted]):
+	Use provisional BF from datasource to set position in BF list.
+	Add new BF item to datasource.
+        (-[WebFrame _isLoadComplete]):
+        (-[WebFrame _checkLoadComplete]):
+	Comments, whitespace.
+        (-[WebFrame _goToItem:withFrameLoadType:]):
+	Set item we will use to saveDocState at commit time.
+
 2002-10-27  Darin Adler  <darin at apple.com>
 
 	- WebKit part of filename width fix
diff --git a/WebKit/ChangeLog-2002-12-03 b/WebKit/ChangeLog-2002-12-03
index 7fda612..269817e 100644
--- a/WebKit/ChangeLog-2002-12-03
+++ b/WebKit/ChangeLog-2002-12-03
@@ -1,3 +1,43 @@
+2002-10-28  Trey Matteson  <trey at apple.com>
+
+	Finished 2998200 - access to most-recent in submenu of back & forward buttons
+
+        * WebView.subproj/WebDataSourcePrivate.h:
+	The BF items we are going to and from were moved here from
+	WebFrame because of timing problems among multiple data sources
+	when using the BF buttons during a load.
+	In addition, the datasource has a list of relevant BF items for
+	which it keeps their titles up to date.
+        * WebView.subproj/WebDataSourcePrivate.m:
+        (-[WebDataSourcePrivate dealloc]):
+	Free new state.
+        (-[WebDataSource _setTitle:]):
+	Update titles of BF items.
+        (-[WebDataSource _provisionalBackForwardItem]):
+        (-[WebDataSource _setProvisionalBackForwardItem:]):
+        (-[WebDataSource _previousBackForwardItem]):
+        (-[WebDataSource _setPreviousBackForwardItem:]):
+        (-[WebDataSource _addBackForwardItem:]):
+	Maintain new state.
+        (-[WebDataSource _commitIfReady]):
+	Free up previous and provisional BF items after commit.
+        * WebCoreSupport.subproj/WebBridge.m:
+        (-[WebBridge loadURL:]):
+	Add the new BF item to the datasource.
+        (-[WebBridge saveDocumentState:]):
+	Use the right BF item to save the doc state.
+        * WebView.subproj/WebFramePrivate.h:
+	Previous and provisional BF are moved to datasource.
+        * WebView.subproj/WebFramePrivate.m:
+        (-[WebFrame _transitionToCommitted]):
+	Use provisional BF from datasource to set position in BF list.
+	Add new BF item to datasource.
+        (-[WebFrame _isLoadComplete]):
+        (-[WebFrame _checkLoadComplete]):
+	Comments, whitespace.
+        (-[WebFrame _goToItem:withFrameLoadType:]):
+	Set item we will use to saveDocState at commit time.
+
 2002-10-27  Darin Adler  <darin at apple.com>
 
 	- WebKit part of filename width fix
diff --git a/WebKit/WebCoreSupport.subproj/WebBridge.m b/WebKit/WebCoreSupport.subproj/WebBridge.m
index a70a5c2..7349999 100644
--- a/WebKit/WebCoreSupport.subproj/WebBridge.m
+++ b/WebKit/WebCoreSupport.subproj/WebBridge.m
@@ -288,14 +288,15 @@
     if ([[URL _web_URLByRemovingFragment] isEqual:[[self URL] _web_URLByRemovingFragment]]) {
         [self openURL:URL];
 
+        WebDataSource *dataSource = [frame dataSource];
         WebHistoryItem *backForwardItem = [[WebHistoryItem alloc] initWithURL:URL
-            target:[frame name] parent:[[frame parent] name] title:[[frame dataSource] pageTitle]];
+            target:[frame name] parent:[[frame parent] name] title:[dataSource pageTitle]];
         [backForwardItem setAnchor:[URL fragment]];
         [[[frame controller] backForwardList] addEntry:backForwardItem];
         [backForwardItem release];
 
-        WebDataSource *dataSource = [frame dataSource];
-        [dataSource _setURL:URL];        
+        [dataSource _setURL:URL];
+        [dataSource _addBackForwardItem:backForwardItem];
         [[[frame controller] locationChangeDelegate] locationChangedWithinPageForDataSource:dataSource];
     } else {
         WebResourceRequest *request = [[WebResourceRequest alloc] initWithURL:URL];
@@ -359,13 +360,11 @@
 
 - (void)saveDocumentState: (NSArray *)documentState
 {
-//??? does this need a case for WebFrameLoadTypeIndexedBackForward?
-    WebHistoryItem *item;
-    
-    if ([frame _loadType] == WebFrameLoadTypeBack)
-        item = [[[frame controller] backForwardList] forwardEntry];
-    else
+    WebHistoryItem *item = [[frame dataSource] _previousBackForwardItem];
+    // If there wasn't a previous item explicitly set, assume it's the backEntry
+    if (!item) {
         item = [[[frame controller] backForwardList] backEntry];
+    }
 
     [item setDocumentState: documentState];
 }
diff --git a/WebKit/WebView.subproj/WebDataSourcePrivate.h b/WebKit/WebView.subproj/WebDataSourcePrivate.h
index e303e42..e78f6e3 100644
--- a/WebKit/WebView.subproj/WebDataSourcePrivate.h
+++ b/WebKit/WebView.subproj/WebDataSourcePrivate.h
@@ -16,6 +16,7 @@
 @class WebResourceRequest;
 @class WebResourceResponse;
 @class WebSubresourceClient;
+ at class WebHistoryItem;
 
 @protocol WebDocumentRepresentation;
 
@@ -66,6 +67,13 @@
     
     NSURL *iconURL;
     WebIconLoader *iconLoader;
+
+    // item we are about to go to - used to set position in BFList on commit
+    WebHistoryItem *provisionalBackForwardItem;
+    // item we just left - will receive saved doc state on commit
+    WebHistoryItem *previousBackForwardItem;
+    // BF items that reference what we loaded - we must keep their titles up to date
+    NSMutableArray *ourBackForwardItems;
     
     BOOL defersCallbacks;
 }
@@ -101,6 +109,11 @@
 - (void)_setIconURL:(NSURL *)URL withType:(NSString *)iconType;
 - (void)_setOverrideEncoding:(NSString *)overrideEncoding;
 - (NSString *)_overrideEncoding;
+- (void)_setProvisionalBackForwardItem: (WebHistoryItem *)item;
+- (WebHistoryItem *)_provisionalBackForwardItem;
+- (void)_setPreviousBackForwardItem: (WebHistoryItem *)item;
+- (WebHistoryItem *)_previousBackForwardItem;
+- (void)_addBackForwardItem:(WebHistoryItem *)item;
 
 // Convenience interface for getting here from an WebDataSource.
 // This returns nil if the representation is not an WebHTMLRepresentation.
@@ -112,6 +125,7 @@
 - (void)_receivedData:(NSData *)data;
 - (void)_finishedLoading;
 
+
 - (void)_defersCallbacksChanged;
 - (WebResourceRequest *)_originalRequest;
 
diff --git a/WebKit/WebView.subproj/WebDataSourcePrivate.m b/WebKit/WebView.subproj/WebDataSourcePrivate.m
index 7ea3909..1352a3a 100644
--- a/WebKit/WebView.subproj/WebDataSourcePrivate.m
+++ b/WebKit/WebView.subproj/WebDataSourcePrivate.m
@@ -59,6 +59,9 @@
     [iconLoader setDelegate:nil];
     [iconLoader release];
     [iconURL release];
+    [provisionalBackForwardItem release];
+    [previousBackForwardItem release];
+    [ourBackForwardItems release];
 
     [super dealloc];
 }
@@ -255,10 +258,8 @@
         entry = [[WebHistory sharedHistory] entryForURL: canonURL];
         [entry setTitle: _private->pageTitle];
 
-        // Must update the entry in the back-forward list too.
-        //WebBackForwardList *bfList = [_private->controller backForwardList];
-        //entry = [bfList entryForURL: canonURL];
-        //[entry setTitle: _private->pageTitle];
+        // Must update the entries in the back-forward list too.
+        [_private->ourBackForwardItems makeObjectsPerformSelector:@selector(setTitle:) withObject:_private->pageTitle];
 
         [[_private->controller locationChangeDelegate] receivedPageTitle:_private->pageTitle forDataSource:self];
     }
@@ -316,6 +317,42 @@
     return [[_private->overrideEncoding copy] autorelease];
 }
 
+- (WebHistoryItem *)_provisionalBackForwardItem
+{
+    return _private->provisionalBackForwardItem;
+}
+
+- (void)_setProvisionalBackForwardItem: (WebHistoryItem *)item
+{
+    if (_private->provisionalBackForwardItem != item) {
+        [_private->provisionalBackForwardItem release];
+        _private->provisionalBackForwardItem = [item retain];
+    }
+}
+
+- (WebHistoryItem *)_previousBackForwardItem
+{
+    return _private->previousBackForwardItem;
+}
+
+- (void)_setPreviousBackForwardItem: (WebHistoryItem *)item
+{
+    if (_private->previousBackForwardItem != item) {
+        [_private->previousBackForwardItem release];
+        _private->previousBackForwardItem = [item retain];
+    }
+}
+
+- (void)_addBackForwardItem:(WebHistoryItem *)item
+{
+    if (!_private->ourBackForwardItems) {
+        _private->ourBackForwardItems = [[NSMutableArray alloc] initWithCapacity:1];
+    }
+    if ([_private->ourBackForwardItems indexOfObjectIdenticalTo:item] == NSNotFound) {
+        [_private->ourBackForwardItems addObject:item];
+    }
+}
+
 - (void)_setMainDocumentError: (WebError *)error
 {
     [error retain];
@@ -391,6 +428,9 @@
 	[self _makeRepresentation];
         [[self webFrame] _transitionToCommitted];
 	[[self _bridge] dataSourceChanged];
+        // we're done with these after committing
+        [self _setProvisionalBackForwardItem: nil];
+        [self _setPreviousBackForwardItem: nil];
     }
 }
 
diff --git a/WebKit/WebView.subproj/WebFramePrivate.h b/WebKit/WebView.subproj/WebFramePrivate.h
index 102587c..cb18ad4 100644
--- a/WebKit/WebView.subproj/WebFramePrivate.h
+++ b/WebKit/WebView.subproj/WebFramePrivate.h
@@ -54,7 +54,6 @@ typedef enum {
     WebFrameState state;
     NSTimer *scheduledLayoutTimer;
     WebFrameLoadType loadType;
-    WebHistoryItem *backForwardItem;
     WebFrame *parent;
     NSMutableArray *children;
     WebPluginController *pluginController;
@@ -72,8 +71,6 @@ typedef enum {
 - (WebDataSource *)provisionalDataSource;
 - (WebFrameLoadType)loadType;
 - (void)setLoadType:(WebFrameLoadType)loadType;
-- (void)setBackForwardItem: (WebHistoryItem *)item;
-- (WebHistoryItem *)backForwardItem;
 
 @end
 
@@ -96,8 +93,6 @@ typedef enum {
 - (void)_setProvisionalDataSource:(WebDataSource *)d;
 - (void)_setLoadType: (WebFrameLoadType)loadType;
 - (WebFrameLoadType)_loadType;
-- (void)_setBackForwardItem: (WebHistoryItem *)item;
-- (WebHistoryItem *)_backForwardItem;
 - (void)_goToItem: (WebHistoryItem *)item withFrameLoadType: (WebFrameLoadType)type;
 - (void)_restoreScrollPosition;
 - (void)_scrollToTop;
diff --git a/WebKit/WebView.subproj/WebFramePrivate.m b/WebKit/WebView.subproj/WebFramePrivate.m
index a005244..30d3e5c 100644
--- a/WebKit/WebView.subproj/WebFramePrivate.m
+++ b/WebKit/WebView.subproj/WebFramePrivate.m
@@ -118,16 +118,6 @@ static const char * const stateNames[] = {
     loadType = t;
 }
 
-- (WebHistoryItem *)backForwardItem { return backForwardItem; }
-- (void)setBackForwardItem: (WebHistoryItem *)item
-{
-    if (backForwardItem != item) {
-        [backForwardItem release];
-        backForwardItem = [item retain];
-    }
-}
-
-
 @end
 
 @implementation WebFrame (WebPrivate)
@@ -208,16 +198,6 @@ static const char * const stateNames[] = {
     return [_private loadType];
 }
 
-- (void)_setBackForwardItem: (WebHistoryItem *)item
-{
-    [_private setBackForwardItem: item];
-}
-
-- (WebHistoryItem *)_backForwardItem
-{
-    return [_private backForwardItem];
-}
-
 - (void)_scheduleLayout:(NSTimeInterval)inSeconds
 {
     // FIXME: Maybe this should have the code to move up the deadline if the new interval brings the time even closer.
@@ -349,18 +329,9 @@ static const char * const stateNames[] = {
             if ([[self controller] usesBackForwardList]){
                 switch ([self _loadType]) {
                 case WebFrameLoadTypeForward:
-                    [backForwardList goForward];
-                    [self _restoreScrollPosition];
-                    break;
-
                 case WebFrameLoadTypeBack:
-                    [backForwardList goBack];
-                    [self _restoreScrollPosition];
-                    break;
-                    
                 case WebFrameLoadTypeIndexedBackForward:
-                    [backForwardList goToEntry: [self _backForwardItem]];
-                    [self _setBackForwardItem: nil];
+                    [backForwardList goToEntry: [ds _provisionalBackForwardItem]];
                     [self _restoreScrollPosition];
                     break;
                     
@@ -376,11 +347,12 @@ static const char * const stateNames[] = {
                 
                     // Add item to back/forward list.
                     parentFrame = [self parent]; 
-                    backForwardItem = [[WebHistoryItem alloc] initWithURL:[[[self dataSource] request] URL]
+                    backForwardItem = [[WebHistoryItem alloc] initWithURL:[[ds request] URL]
                                                                    target:[self name]
                                                                    parent:[parentFrame name]
-                                                                    title:[[self dataSource] pageTitle]];
+                                                                    title:ptitle];
                     [[[self controller] backForwardList] addEntry: backForwardItem];
+                    [ds _addBackForwardItem:backForwardItem];
                     [backForwardItem release];
                     // Scroll to top.
                     break;
@@ -479,7 +451,7 @@ static const char * const stateNames[] = {
 
                     [[[self controller] locationChangeDelegate] locationChangeDone: [pd mainDocumentError] forDataSource:pd];
 
-                    // We now the provisional data source didn't cut the mustard, release it.
+                    // We know the provisional data source didn't cut the mustard, release it.
                     [_private setProvisionalDataSource: nil];
                     
                     [self _setState: WebFrameStateComplete];
@@ -617,7 +589,6 @@ static const char * const stateNames[] = {
 // Called every time a resource is completely loaded, or an error is received.
 - (void)_checkLoadComplete
 {
-
     ASSERT([self controller] != nil);
 
     // Now walk the frame tree to see if any frame that may have initiated a load is done.
@@ -729,11 +700,10 @@ static const char * const stateNames[] = {
     NSURL *itemURL = [item URL];
     WebResourceRequest *request;
     NSURL *originalURL = [[[self dataSource] request] URL];
+    WebBackForwardList *backForwardList = [[self controller] backForwardList];
 
     // Are we navigating to an anchor within the page?
     if ([item anchor] && [[itemURL _web_URLByRemovingFragment] isEqual: [originalURL _web_URLByRemovingFragment]]) {
-        WebBackForwardList *backForwardList = [[self controller] backForwardList];
-
         if (type == WebFrameLoadTypeForward)
             [backForwardList goForward];
         else if (type == WebFrameLoadTypeBack)
@@ -778,13 +748,13 @@ static const char * const stateNames[] = {
         WebDataSource *newDataSource = [[WebDataSource alloc] initWithRequest:request];
         [request release];
         [self setProvisionalDataSource: newDataSource];
+        // Remember this item in order to set the position in the BFList later.
+        // Important that this happens after our provDataSrc is set, since setting
+        // provDataSrc results in isLoadComplete, which clears provLink!
+        [newDataSource _setProvisionalBackForwardItem: item];
+        // Set the item for which we will save document state
+        [newDataSource _setPreviousBackForwardItem: [backForwardList currentEntry]];
         [self _setLoadType: type];
-        // we need to remember this item in order to set the position in the BFList later
-        if (type == WebFrameLoadTypeIndexedBackForward) {
-            [self _setBackForwardItem: item];
-        } else {
-            [self _setBackForwardItem: nil];
-        }
         [self startLoading];
         [newDataSource release];
     }

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list