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


The following commit has been merged in the debian/unstable branch:
commit 03fa87db591639e45daef54a95f219423e4beb9b
Author: rjw <rjw at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Tue Jul 30 01:08:53 2002 +0000

            Changes to support the migration of back/forward list to WebKit.
            Back/forward in frames now works (2946164), still not done w/
            restoring scroll positions (2927633).
    
            * History.subproj/WebHistoryItem.h:
            * History.subproj/WebHistoryItem.m:
            (+[WebHistoryItem entryWithURL:]):
            * WebCoreSupport.subproj/WebBridge.m:
            (-[WebBridge createChildFrameNamed:withURL:renderPart:allowsScrolling:marginWidth:marginHeight:]):
            * WebView.subproj/WebController.h:
            * WebView.subproj/WebController.m:
            (-[WebController initWithView:provisionalDataSource:]):
            (-[WebController setUseBackForwardList:]):
            (-[WebController useBackForwardList]):
            (-[WebController goBack]):
            (-[WebController goForward]):
            * WebView.subproj/WebControllerPrivate.h:
            * WebView.subproj/WebFrame.m:
            (-[WebFrame setProvisionalDataSource:]):
            * WebView.subproj/WebFramePrivate.h:
            * WebView.subproj/WebFramePrivate.m:
            (-[WebFrame _transitionToCommitted]):
            (-[WebFrame _setProvisionalDataSource:]):
            (-[WebFrame _goToURL:withFrameLoadType:]):
            * WebView.subproj/WebViewPrivate.m:
            (-[WebView _goBack]):
            (-[WebView _goForward]):
    
            Changes to support the migration of back/forward list to WebKit.
            Back/forward in frames now works (2946164), still not done w/
            restoring scroll positions (2927633).
    
            * History.subproj/WebHistoryItem.h:
            * BackForwardListEntry.h: Removed.
            * BackForwardListEntry.m: Removed.
            * BrowserDocument.m:
            (-[BrowserDocument _goToURL:withFrameLoadType:fallbackURLs:]):
            (-[BrowserDocument goBack:]):
            (-[BrowserDocument goForward:]):
            * BrowserWebController.m:
            * LocationChangeHandler.m:
            (-[LocationChangeHandler _saveScrollPosition]):
            (-[LocationChangeHandler _restoreScrollPosition]):
            (-[LocationChangeHandler locationChangeCommittedForDataSource:]):
            * WebBrowser.pbproj/project.pbxproj:
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@1692 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog
index c1d7b06..1eb6d8a 100644
--- a/WebKit/ChangeLog
+++ b/WebKit/ChangeLog
@@ -1,5 +1,35 @@
 2002-07-29  Richard Williamson  <rjw at apple.com>
 
+        Changes to support the migration of back/forward list to WebKit.
+        Back/forward in frames now works (2946164), still not done w/
+        restoring scroll positions (2927633).
+        
+        * History.subproj/WebHistoryItem.h:
+        * History.subproj/WebHistoryItem.m:
+        (+[WebHistoryItem entryWithURL:]):
+        * WebCoreSupport.subproj/WebBridge.m:
+        (-[WebBridge createChildFrameNamed:withURL:renderPart:allowsScrolling:marginWidth:marginHeight:]):
+        * WebView.subproj/WebController.h:
+        * WebView.subproj/WebController.m:
+        (-[WebController initWithView:provisionalDataSource:]):
+        (-[WebController setUseBackForwardList:]):
+        (-[WebController useBackForwardList]):
+        (-[WebController goBack]):
+        (-[WebController goForward]):
+        * WebView.subproj/WebControllerPrivate.h:
+        * WebView.subproj/WebFrame.m:
+        (-[WebFrame setProvisionalDataSource:]):
+        * WebView.subproj/WebFramePrivate.h:
+        * WebView.subproj/WebFramePrivate.m:
+        (-[WebFrame _transitionToCommitted]):
+        (-[WebFrame _setProvisionalDataSource:]):
+        (-[WebFrame _goToURL:withFrameLoadType:]):
+        * WebView.subproj/WebViewPrivate.m:
+        (-[WebView _goBack]):
+        (-[WebView _goForward]):
+
+2002-07-29  Richard Williamson  <rjw at apple.com>
+
         Fixed 3009074.  Added [WebHTMLView jumpToSelection:] and related user interface
         item validation.
         
diff --git a/WebKit/ChangeLog-2002-12-03 b/WebKit/ChangeLog-2002-12-03
index c1d7b06..1eb6d8a 100644
--- a/WebKit/ChangeLog-2002-12-03
+++ b/WebKit/ChangeLog-2002-12-03
@@ -1,5 +1,35 @@
 2002-07-29  Richard Williamson  <rjw at apple.com>
 
+        Changes to support the migration of back/forward list to WebKit.
+        Back/forward in frames now works (2946164), still not done w/
+        restoring scroll positions (2927633).
+        
+        * History.subproj/WebHistoryItem.h:
+        * History.subproj/WebHistoryItem.m:
+        (+[WebHistoryItem entryWithURL:]):
+        * WebCoreSupport.subproj/WebBridge.m:
+        (-[WebBridge createChildFrameNamed:withURL:renderPart:allowsScrolling:marginWidth:marginHeight:]):
+        * WebView.subproj/WebController.h:
+        * WebView.subproj/WebController.m:
+        (-[WebController initWithView:provisionalDataSource:]):
+        (-[WebController setUseBackForwardList:]):
+        (-[WebController useBackForwardList]):
+        (-[WebController goBack]):
+        (-[WebController goForward]):
+        * WebView.subproj/WebControllerPrivate.h:
+        * WebView.subproj/WebFrame.m:
+        (-[WebFrame setProvisionalDataSource:]):
+        * WebView.subproj/WebFramePrivate.h:
+        * WebView.subproj/WebFramePrivate.m:
+        (-[WebFrame _transitionToCommitted]):
+        (-[WebFrame _setProvisionalDataSource:]):
+        (-[WebFrame _goToURL:withFrameLoadType:]):
+        * WebView.subproj/WebViewPrivate.m:
+        (-[WebView _goBack]):
+        (-[WebView _goForward]):
+
+2002-07-29  Richard Williamson  <rjw at apple.com>
+
         Fixed 3009074.  Added [WebHTMLView jumpToSelection:] and related user interface
         item validation.
         
diff --git a/WebKit/History.subproj/WebHistoryItem.h b/WebKit/History.subproj/WebHistoryItem.h
index 5efdd1f..499987c 100644
--- a/WebKit/History.subproj/WebHistoryItem.h
+++ b/WebKit/History.subproj/WebHistoryItem.h
@@ -16,6 +16,8 @@
     NSPoint _scrollPoint;
 }
 
++(WebHistoryItem *)entryWithURL:(NSURL *)url;
+
 -(id)init;
 -(id)initWithURL:(NSURL *)url title:(NSString *)title;
 -(id)initWithURL:(NSURL *)url title:(NSString *)title image:(NSImage *)image;
diff --git a/WebKit/History.subproj/WebHistoryItem.m b/WebKit/History.subproj/WebHistoryItem.m
index 42c5403..2596765 100644
--- a/WebKit/History.subproj/WebHistoryItem.m
+++ b/WebKit/History.subproj/WebHistoryItem.m
@@ -11,6 +11,11 @@
 
 @implementation WebHistoryItem
 
++(WebHistoryItem *)entryWithURL:(NSURL *)url
+{
+    return [[[self alloc] initWithURL:url title:nil] autorelease];
+}
+
 -(id)init
 {
     return [self initWithURL:nil title:nil image:nil];
diff --git a/WebKit/WebCoreSupport.subproj/WebBridge.m b/WebKit/WebCoreSupport.subproj/WebBridge.m
index 0bdffe3..1efa2f7 100644
--- a/WebKit/WebCoreSupport.subproj/WebBridge.m
+++ b/WebKit/WebCoreSupport.subproj/WebBridge.m
@@ -77,9 +77,13 @@
     
     [[newFrame webView] _setMarginWidth:width];
     [[newFrame webView] _setMarginHeight:height];
-
+    
     [[newFrame _bridge] loadURL:URL attributes:nil flags:0 withParent:[self dataSource]];
     
+    // Set the load type so this load doesn't end up in the back
+    // forward list.
+    [newFrame _setLoadType: WebFrameLoadTypeInternal];
+
     return YES;
 }
 
diff --git a/WebKit/WebView.subproj/WebController.h b/WebKit/WebView.subproj/WebController.h
index efc97bb..c6326f4 100644
--- a/WebKit/WebView.subproj/WebController.h
+++ b/WebKit/WebView.subproj/WebController.h
@@ -97,12 +97,6 @@
    
 - (NSWindow *)window;
 
-// FIXME: This is temporary. It's used to tell the client to "go back"
-// when the delete key or command-arrows are pressed. But we are going to move back/forward
-// handling into WebKit, and then these can be removed.
-- (void)goBack;
-- (void)goForward;
-
 @end
 
 
@@ -201,4 +195,10 @@
 
 - (WebBackForwardList *)backForwardList;
 
+- (void)setUseBackForwardList: (BOOL)flag;
+- (BOOL)useBackForwardList;
+- (BOOL)goBack;
+- (BOOL)goForward;
+
+ 
 @end
diff --git a/WebKit/WebView.subproj/WebController.m b/WebKit/WebView.subproj/WebController.m
index 9303f9e..4c1ffd7 100644
--- a/WebKit/WebView.subproj/WebController.m
+++ b/WebKit/WebView.subproj/WebController.m
@@ -5,6 +5,7 @@
 
 #import <WebKit/WebController.h>
 
+#import <WebKit/WebBackForwardList.h>
 #import <WebKit/WebController.h>
 #import <WebKit/WebControllerPolicyHandler.h>
 #import <WebKit/WebControllerPrivate.h>
@@ -15,6 +16,7 @@
 #import <WebKit/WebException.h>
 #import <WebKit/WebFrame.h>
 #import <WebKit/WebFramePrivate.h>
+#import <WebKit/WebHistoryItem.h>
 #import <WebKit/WebKitErrors.h>
 #import <WebKit/WebKitStatisticsPrivate.h>
 #import <WebKit/WebKitDebug.h>
@@ -37,6 +39,8 @@
     _private = [[WebControllerPrivate alloc] init];
     _private->mainFrame = [[WebFrame alloc] initWithName: @"_top" webView: view provisionalDataSource: dataSource controller: self];
 
+    [self setUseBackForwardList: YES];
+    
     ++WebControllerCount;
 
     return self;
@@ -304,5 +308,43 @@
     return _private->backForwardList;
 }
 
+- (void)setUseBackForwardList: (BOOL)flag
+{
+    _private->useBackForwardList = flag;
+}
+
+- (BOOL)useBackForwardList
+{
+    return _private->useBackForwardList;
+}
+
+
+- (BOOL)goBack
+{
+    WebHistoryItem *item = [[self backForwardList] backEntry];
+    WebFrame *targetFrame;
+    
+    if (item){
+        targetFrame = [self frameNamed: [item target]];
+        [targetFrame _goToURL: [item url] withFrameLoadType: WebFrameLoadTypeBack];
+        return YES;
+    }
+    return NO;
+}
+
+- (BOOL)goForward
+{
+    WebHistoryItem *item = [[self backForwardList] forwardEntry];
+    WebFrame *targetFrame;
+    
+    if (item){
+        targetFrame = [self frameNamed: [item target]];
+        [targetFrame _goToURL: [item url] withFrameLoadType: WebFrameLoadTypeForward];
+        return YES;
+    }
+    return NO;
+}
+
+
 @end
 
diff --git a/WebKit/WebView.subproj/WebControllerPrivate.h b/WebKit/WebView.subproj/WebControllerPrivate.h
index c3c99f6..3e10185 100644
--- a/WebKit/WebView.subproj/WebControllerPrivate.h
+++ b/WebKit/WebView.subproj/WebControllerPrivate.h
@@ -21,7 +21,9 @@
     id<WebControllerPolicyHandler> policyHandler;
     id<WebLocationChangeHandler> locationChangeHandler;
     WebBackForwardList *backForwardList;
+    // FIX ME use a bit field;
     BOOL openedByScript;
+    BOOL useBackForwardList;
 }
 @end
 
diff --git a/WebKit/WebView.subproj/WebFrame.m b/WebKit/WebView.subproj/WebFrame.m
index 0e0776c..5672174 100644
--- a/WebKit/WebView.subproj/WebFrame.m
+++ b/WebKit/WebView.subproj/WebFrame.m
@@ -158,6 +158,14 @@
         [self stopLoading];
     }
 
+    // May be reset later if this is a back, forward, or refresh.
+    // Hack on hack, get rid of this check when MJS removes the dummy
+    // data source.
+    if ([newDataSource _isDummy])
+       [self _setLoadType: WebFrameLoadTypeUninitialized];
+    else
+       [self _setLoadType: WebFrameLoadTypeStandard];
+
     // _shouldShowDataSource asks the client for the URL policies and reports errors if there are any
     // returns YES if we should show the data source
     if([self _shouldShowDataSource:newDataSource]){
diff --git a/WebKit/WebView.subproj/WebFramePrivate.h b/WebKit/WebView.subproj/WebFramePrivate.h
index 2023f7a..aa07724 100644
--- a/WebKit/WebView.subproj/WebFramePrivate.h
+++ b/WebKit/WebView.subproj/WebFramePrivate.h
@@ -36,7 +36,8 @@ typedef enum {
     WebFrameLoadTypeForward = 3,
     WebFrameLoadTypeIndexedBack = 4,
     WebFrameLoadTypeIndexedForward = 5,
-    WebFrameLoadTypeRefresh = 6
+    WebFrameLoadTypeRefresh = 6,
+    WebFrameLoadTypeInternal = 7
 } WebFrameLoadType;
 
 #define WebFrameStateChangedNotification @"WebFrameStateChangedNotification"
@@ -87,4 +88,7 @@ typedef enum {
 - (WebBridge *)_bridge;
 - (BOOL)_shouldShowDataSource:(WebDataSource *)dataSource;
 - (void)_setProvisionalDataSource:(WebDataSource *)d;
+- (void)_setLoadType: (WebFrameLoadType)loadType;
+- (WebFrameLoadType)_loadType;
+- (void)_goToURL: (NSURL *)url withFrameLoadType: (WebFrameLoadType)type;
 @end
diff --git a/WebKit/WebView.subproj/WebFramePrivate.m b/WebKit/WebView.subproj/WebFramePrivate.m
index 8c3c9fa..ac2fe8d 100644
--- a/WebKit/WebView.subproj/WebFramePrivate.m
+++ b/WebKit/WebView.subproj/WebFramePrivate.m
@@ -237,6 +237,8 @@ static const char * const stateNames[6] = {
 {
     WEBKIT_ASSERT ([self controller] != nil);
     NSView <WebDocumentView> *documentView = [[self webView] documentView];
+    WebHistoryItem *backForwardItem;
+    WebBackForwardList *backForwardList = [[self controller] backForwardList];
     
     switch ([self _state]) {
     	case WebFrameStateProvisional:
@@ -264,10 +266,42 @@ static const char * const stateNames[6] = {
             [self _setState: WebFrameStateCommittedPage];
         
             // Handle adding the URL to the back/forward list.
-            if ([self _loadType] == WebFrameLoadTypeStandard){
-                WebHistoryItem *item = [[WebHistoryItem alloc] initWithURL:[[self dataSource] inputURL] target: [self name] title:[[self dataSource] pageTitle] image: nil];
-                [[[self controller] backForwardList] addEntry: item];
-                [item release];
+            if ([[self controller] useBackForwardList]){
+                switch ([self _loadType]) {
+                case WebFrameLoadTypeForward:
+                    [backForwardList goForward];
+                    // restore scroll position.
+                    break;
+    
+                case WebFrameLoadTypeBack:
+                    [backForwardList goBack];
+                    // restore scroll position.
+                    break;
+                    
+                case WebFrameLoadTypeRefresh:
+                    // restore scroll position.
+                    break;
+    
+                case WebFrameLoadTypeStandard:
+                    backForwardItem = [[WebHistoryItem alloc] initWithURL:[[self dataSource] inputURL] target: [self name] title:[[self dataSource] pageTitle] image: nil];
+                    [[[self controller] backForwardList] addEntry: backForwardItem];
+                    [backForwardItem release];
+                    // Scroll to top.
+                    break;
+    
+                case WebFrameLoadTypeInternal:
+                    // Do nothing, this was a frame/iframe non user load.
+                    break;
+                    
+                // FIXME Remove this check when dummy ds is removed.
+                case WebFrameLoadTypeUninitialized:
+                    NSLog (@"temporary check for WebFrameLoadTypeUninitialized until dummy ds is removed, should never encounter this type.");
+                    break;
+                    
+                default:
+                    [[NSException exceptionWithName:NSGenericException reason:@"invalid load type during commit transition" userInfo: nil] raise];
+                    break;
+                }
             }
             
             // Tell the client we've committed this URL.
@@ -581,4 +615,14 @@ static const char * const stateNames[6] = {
     [_private setProvisionalDataSource:d];
 }
 
+
+- (void)_goToURL: (NSURL *)url withFrameLoadType: (WebFrameLoadType)type
+{
+    WebDataSource *dataSource = [[WebDataSource alloc] initWithURL:url];
+    [self setProvisionalDataSource: dataSource];
+    [self _setLoadType: type];
+    [self startLoading];
+    [dataSource release];
+}
+
 @end
diff --git a/WebKit/WebView.subproj/WebFrameViewPrivate.m b/WebKit/WebView.subproj/WebFrameViewPrivate.m
index bb90d28..3cbf849 100644
--- a/WebKit/WebView.subproj/WebFrameViewPrivate.m
+++ b/WebKit/WebView.subproj/WebFrameViewPrivate.m
@@ -238,12 +238,12 @@
 
 - (void)_goBack
 {
-    [[[self _controller] windowContext] goBack];
+    [[self _controller] goBack];
 }
 
 - (void)_goForward
 {
-    [[[self _controller] windowContext] goForward];
+    [[self _controller] goForward];
 }
 
 @end
diff --git a/WebKit/WebView.subproj/WebView.h b/WebKit/WebView.subproj/WebView.h
index efc97bb..c6326f4 100644
--- a/WebKit/WebView.subproj/WebView.h
+++ b/WebKit/WebView.subproj/WebView.h
@@ -97,12 +97,6 @@
    
 - (NSWindow *)window;
 
-// FIXME: This is temporary. It's used to tell the client to "go back"
-// when the delete key or command-arrows are pressed. But we are going to move back/forward
-// handling into WebKit, and then these can be removed.
-- (void)goBack;
-- (void)goForward;
-
 @end
 
 
@@ -201,4 +195,10 @@
 
 - (WebBackForwardList *)backForwardList;
 
+- (void)setUseBackForwardList: (BOOL)flag;
+- (BOOL)useBackForwardList;
+- (BOOL)goBack;
+- (BOOL)goForward;
+
+ 
 @end
diff --git a/WebKit/WebView.subproj/WebView.m b/WebKit/WebView.subproj/WebView.m
index 9303f9e..4c1ffd7 100644
--- a/WebKit/WebView.subproj/WebView.m
+++ b/WebKit/WebView.subproj/WebView.m
@@ -5,6 +5,7 @@
 
 #import <WebKit/WebController.h>
 
+#import <WebKit/WebBackForwardList.h>
 #import <WebKit/WebController.h>
 #import <WebKit/WebControllerPolicyHandler.h>
 #import <WebKit/WebControllerPrivate.h>
@@ -15,6 +16,7 @@
 #import <WebKit/WebException.h>
 #import <WebKit/WebFrame.h>
 #import <WebKit/WebFramePrivate.h>
+#import <WebKit/WebHistoryItem.h>
 #import <WebKit/WebKitErrors.h>
 #import <WebKit/WebKitStatisticsPrivate.h>
 #import <WebKit/WebKitDebug.h>
@@ -37,6 +39,8 @@
     _private = [[WebControllerPrivate alloc] init];
     _private->mainFrame = [[WebFrame alloc] initWithName: @"_top" webView: view provisionalDataSource: dataSource controller: self];
 
+    [self setUseBackForwardList: YES];
+    
     ++WebControllerCount;
 
     return self;
@@ -304,5 +308,43 @@
     return _private->backForwardList;
 }
 
+- (void)setUseBackForwardList: (BOOL)flag
+{
+    _private->useBackForwardList = flag;
+}
+
+- (BOOL)useBackForwardList
+{
+    return _private->useBackForwardList;
+}
+
+
+- (BOOL)goBack
+{
+    WebHistoryItem *item = [[self backForwardList] backEntry];
+    WebFrame *targetFrame;
+    
+    if (item){
+        targetFrame = [self frameNamed: [item target]];
+        [targetFrame _goToURL: [item url] withFrameLoadType: WebFrameLoadTypeBack];
+        return YES;
+    }
+    return NO;
+}
+
+- (BOOL)goForward
+{
+    WebHistoryItem *item = [[self backForwardList] forwardEntry];
+    WebFrame *targetFrame;
+    
+    if (item){
+        targetFrame = [self frameNamed: [item target]];
+        [targetFrame _goToURL: [item url] withFrameLoadType: WebFrameLoadTypeForward];
+        return YES;
+    }
+    return NO;
+}
+
+
 @end
 
diff --git a/WebKit/WebView.subproj/WebViewPrivate.h b/WebKit/WebView.subproj/WebViewPrivate.h
index c3c99f6..3e10185 100644
--- a/WebKit/WebView.subproj/WebViewPrivate.h
+++ b/WebKit/WebView.subproj/WebViewPrivate.h
@@ -21,7 +21,9 @@
     id<WebControllerPolicyHandler> policyHandler;
     id<WebLocationChangeHandler> locationChangeHandler;
     WebBackForwardList *backForwardList;
+    // FIX ME use a bit field;
     BOOL openedByScript;
+    BOOL useBackForwardList;
 }
 @end
 

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list