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

mjs mjs at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 06:28:31 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit a3b7f071d35d3a9781f49b111dde5daa6958d092
Author: mjs <mjs at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Thu Aug 1 07:52:26 2002 +0000

    	Changed things around so that WebFrame, not WebDataSource, owns
    	WebBridge. This allows us to remove the dummy data source.
    
            * WebView.subproj/WebFrame.m:
            (-[WebFrame
    	initWithName:webView:provisionalDataSource:controller:]): Remove
    	all dummy data source-related crud, but call _changeBridge to
    	create the initial bridge.
            (-[WebFrame setProvisionalDataSource:]): Remove dummy data
    	source-related epicycles.
            * WebView.subproj/WebFramePrivate.h: Add bridge member to private class.
            * WebView.subproj/WebFramePrivate.m:
            (-[WebFramePrivate setDataSource:]): Don't remove old data source from frame,
    	this is no longer needed and may even be harmful.
            (-[WebFrame _transitionToCommitted]): Remove much now-unneeded code.
            (-[WebFrame _isLoadComplete]): Get location change handler from controller.
    	Don't call end on the bridge if the document is not html.
            (-[WebFrame _changeBridge]): Free the old bridge and make a new one.
            (-[WebFrame _bridge]): Get it directly, not from the data source.
    
    	* WebView.subproj/WebDataSourcePrivate.h: Remove everything related to the
    	`dummy' concept.
            * WebView.subproj/WebDataSourcePrivate.m:
            (-[WebDataSource _setFinalURL:]): Reorder code a bit.
            (-[WebDataSource _bridge]): Get bridge from frame.
            (-[WebDataSource _commitIfReady]): No more need to set the bridge's frame.
            (-[WebDataSource _makeRepresentation]): Set data source on the rep.
            (-[WebDataSource _startLoading:]): Get location change handler from controller.
            (-[WebDataSource _setTitle:]): Likewise.
            (-[WebDataSource receivedPageIcon:]): Likewise.
            (-[WebDataSource _loadIcon]): Likewise.
    
    	* WebView.subproj/WebMainResourceClient.m:
            (-[WebMainResourceClient
    	WebResourceHandle:dataDidBecomeAvailable:]): Get location change
    	handler from the controller.
    
            * WebView.subproj/WebViewPrivate.m:
            (-[WebView _makeDocumentViewForDataSource:]): Change *and* commit
    	the data source. This could probably be collapsed down to one
    	method now.
    
            * WebView.subproj/WebDocument.h: Added setDataSource: method to
    	the WebDocumentRepresenation protocol. For now it is only useful
    	for the HTML representation, but could potentially be useful for
    	other representation classes. It should also allow the data source
    	to be removed as a parameter from other methods, but I have not
    	done that yet. It may be even better still to pass the data source
    	as a paremeter to the init method.
    
            * WebView.subproj/WebHTMLRepresentation.m:
            (-[WebHTMLRepresentation init]): Remove allocation of bridge.
            (-[WebHTMLRepresentation dealloc]): Remove release of bridge.
            (-[WebHTMLRepresentation setDataSource:]): Store unretained reference
    	to the data source's frame's bridge.
            * WebView.subproj/WebHTMLViewPrivate.m:
            (-[WebHTMLView _bridge]): Fetch the bridge from the frame, not the
    	data source.
            * WebView.subproj/WebImageRepresentation.m:
            (-[WebImageRepresentation setDataSource:]): Added empty
    	implementation.
            * WebView.subproj/WebTextRepresentation.m:
            (-[WebTextRepresentation setDataSource:]): Added empty
    	implementation.
            * Plugins.subproj/WebPluginStream.m:
            (-[WebPluginStream setDataSource:]): Added empty implementation.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@1708 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog
index 8199b0f..62481ea 100644
--- a/WebKit/ChangeLog
+++ b/WebKit/ChangeLog
@@ -1,3 +1,72 @@
+2002-07-31  Maciej Stachowiak  <mjs at apple.com>
+
+	Changed things around so that WebFrame, not WebDataSource, owns
+	WebBridge. This allows us to remove the dummy data source.
+	
+        * WebView.subproj/WebFrame.m:
+        (-[WebFrame
+	initWithName:webView:provisionalDataSource:controller:]): Remove
+	all dummy data source-related crud, but call _changeBridge to
+	create the initial bridge.
+        (-[WebFrame setProvisionalDataSource:]): Remove dummy data
+	source-related epicycles.
+        * WebView.subproj/WebFramePrivate.h: Add bridge member to private class.
+        * WebView.subproj/WebFramePrivate.m:
+        (-[WebFramePrivate setDataSource:]): Don't remove old data source from frame,
+	this is no longer needed and may even be harmful.
+        (-[WebFrame _transitionToCommitted]): Remove much now-unneeded code.
+        (-[WebFrame _isLoadComplete]): Get location change handler from controller.
+	Don't call end on the bridge if the document is not html.
+        (-[WebFrame _changeBridge]): Free the old bridge and make a new one.
+        (-[WebFrame _bridge]): Get it directly, not from the data source.
+        
+	* WebView.subproj/WebDataSourcePrivate.h: Remove everything related to the
+	`dummy' concept.
+        * WebView.subproj/WebDataSourcePrivate.m:
+        (-[WebDataSource _setFinalURL:]): Reorder code a bit.
+        (-[WebDataSource _bridge]): Get bridge from frame.
+        (-[WebDataSource _commitIfReady]): No more need to set the bridge's frame.
+        (-[WebDataSource _makeRepresentation]): Set data source on the rep.
+        (-[WebDataSource _startLoading:]): Get location change handler from controller.
+        (-[WebDataSource _setTitle:]): Likewise.
+        (-[WebDataSource receivedPageIcon:]): Likewise.
+        (-[WebDataSource _loadIcon]): Likewise.
+        
+	* WebView.subproj/WebMainResourceClient.m:
+        (-[WebMainResourceClient
+	WebResourceHandle:dataDidBecomeAvailable:]): Get location change
+	handler from the controller.
+
+        * WebView.subproj/WebViewPrivate.m:
+        (-[WebView _makeDocumentViewForDataSource:]): Change *and* commit
+	the data source. This could probably be collapsed down to one
+	method now.
+
+        * WebView.subproj/WebDocument.h: Added setDataSource: method to
+	the WebDocumentRepresenation protocol. For now it is only useful
+	for the HTML representation, but could potentially be useful for
+	other representation classes. It should also allow the data source
+	to be removed as a parameter from other methods, but I have not
+	done that yet. It may be even better still to pass the data source
+	as a paremeter to the init method.
+
+        * WebView.subproj/WebHTMLRepresentation.m:
+        (-[WebHTMLRepresentation init]): Remove allocation of bridge.
+        (-[WebHTMLRepresentation dealloc]): Remove release of bridge.
+        (-[WebHTMLRepresentation setDataSource:]): Store unretained reference
+	to the data source's frame's bridge.
+        * WebView.subproj/WebHTMLViewPrivate.m:
+        (-[WebHTMLView _bridge]): Fetch the bridge from the frame, not the
+	data source.
+        * WebView.subproj/WebImageRepresentation.m:
+        (-[WebImageRepresentation setDataSource:]): Added empty
+	implementation.
+        * WebView.subproj/WebTextRepresentation.m:
+        (-[WebTextRepresentation setDataSource:]): Added empty
+	implementation.
+        * Plugins.subproj/WebPluginStream.m:
+        (-[WebPluginStream setDataSource:]): Added empty implementation.
+
 2002-07-30  Maciej Stachowiak  <mjs at apple.com>
 
 	Fixes of various bugs that prevented Alexander from running the
diff --git a/WebKit/ChangeLog-2002-12-03 b/WebKit/ChangeLog-2002-12-03
index 8199b0f..62481ea 100644
--- a/WebKit/ChangeLog-2002-12-03
+++ b/WebKit/ChangeLog-2002-12-03
@@ -1,3 +1,72 @@
+2002-07-31  Maciej Stachowiak  <mjs at apple.com>
+
+	Changed things around so that WebFrame, not WebDataSource, owns
+	WebBridge. This allows us to remove the dummy data source.
+	
+        * WebView.subproj/WebFrame.m:
+        (-[WebFrame
+	initWithName:webView:provisionalDataSource:controller:]): Remove
+	all dummy data source-related crud, but call _changeBridge to
+	create the initial bridge.
+        (-[WebFrame setProvisionalDataSource:]): Remove dummy data
+	source-related epicycles.
+        * WebView.subproj/WebFramePrivate.h: Add bridge member to private class.
+        * WebView.subproj/WebFramePrivate.m:
+        (-[WebFramePrivate setDataSource:]): Don't remove old data source from frame,
+	this is no longer needed and may even be harmful.
+        (-[WebFrame _transitionToCommitted]): Remove much now-unneeded code.
+        (-[WebFrame _isLoadComplete]): Get location change handler from controller.
+	Don't call end on the bridge if the document is not html.
+        (-[WebFrame _changeBridge]): Free the old bridge and make a new one.
+        (-[WebFrame _bridge]): Get it directly, not from the data source.
+        
+	* WebView.subproj/WebDataSourcePrivate.h: Remove everything related to the
+	`dummy' concept.
+        * WebView.subproj/WebDataSourcePrivate.m:
+        (-[WebDataSource _setFinalURL:]): Reorder code a bit.
+        (-[WebDataSource _bridge]): Get bridge from frame.
+        (-[WebDataSource _commitIfReady]): No more need to set the bridge's frame.
+        (-[WebDataSource _makeRepresentation]): Set data source on the rep.
+        (-[WebDataSource _startLoading:]): Get location change handler from controller.
+        (-[WebDataSource _setTitle:]): Likewise.
+        (-[WebDataSource receivedPageIcon:]): Likewise.
+        (-[WebDataSource _loadIcon]): Likewise.
+        
+	* WebView.subproj/WebMainResourceClient.m:
+        (-[WebMainResourceClient
+	WebResourceHandle:dataDidBecomeAvailable:]): Get location change
+	handler from the controller.
+
+        * WebView.subproj/WebViewPrivate.m:
+        (-[WebView _makeDocumentViewForDataSource:]): Change *and* commit
+	the data source. This could probably be collapsed down to one
+	method now.
+
+        * WebView.subproj/WebDocument.h: Added setDataSource: method to
+	the WebDocumentRepresenation protocol. For now it is only useful
+	for the HTML representation, but could potentially be useful for
+	other representation classes. It should also allow the data source
+	to be removed as a parameter from other methods, but I have not
+	done that yet. It may be even better still to pass the data source
+	as a paremeter to the init method.
+
+        * WebView.subproj/WebHTMLRepresentation.m:
+        (-[WebHTMLRepresentation init]): Remove allocation of bridge.
+        (-[WebHTMLRepresentation dealloc]): Remove release of bridge.
+        (-[WebHTMLRepresentation setDataSource:]): Store unretained reference
+	to the data source's frame's bridge.
+        * WebView.subproj/WebHTMLViewPrivate.m:
+        (-[WebHTMLView _bridge]): Fetch the bridge from the frame, not the
+	data source.
+        * WebView.subproj/WebImageRepresentation.m:
+        (-[WebImageRepresentation setDataSource:]): Added empty
+	implementation.
+        * WebView.subproj/WebTextRepresentation.m:
+        (-[WebTextRepresentation setDataSource:]): Added empty
+	implementation.
+        * Plugins.subproj/WebPluginStream.m:
+        (-[WebPluginStream setDataSource:]): Added empty implementation.
+
 2002-07-30  Maciej Stachowiak  <mjs at apple.com>
 
 	Fixes of various bugs that prevented Alexander from running the
diff --git a/WebKit/Plugins.subproj/WebPluginStream.m b/WebKit/Plugins.subproj/WebPluginStream.m
index c86652a..43676e0 100644
--- a/WebKit/Plugins.subproj/WebPluginStream.m
+++ b/WebKit/Plugins.subproj/WebPluginStream.m
@@ -212,6 +212,10 @@ static NSString *getCarbonPath(NSString *posixPath);
 
 #pragma mark WebDocumentRepresentation
 
+- (void)setDataSource:(WebDataSource *)dataSource
+{
+}
+
 - (void)receivedData:(NSData *)data withDataSource:(WebDataSource *)dataSource
 {
     if(isFirstChunk){
diff --git a/WebKit/WebView.subproj/WebDataSourcePrivate.h b/WebKit/WebView.subproj/WebDataSourcePrivate.h
index e751837..f8da943 100644
--- a/WebKit/WebView.subproj/WebDataSourcePrivate.h
+++ b/WebKit/WebView.subproj/WebDataSourcePrivate.h
@@ -7,13 +7,11 @@
 */
 
 #import <WebKit/WebDataSource.h>
-#import <WebKit/WebLocationChangeHandler.h>
 #import <WebKit/WebBridge.h>
 
 @class WebIconLoader;
 @class WebResourceHandle;
 @class WebMainResourceClient;
- at protocol WebLocationChangeHandler;
 @protocol WebDocumentRepresentation;
 
 @interface WebDataSourcePrivate : NSObject
@@ -75,13 +73,6 @@
     
     NSURL *iconURL;
     WebIconLoader *iconLoader;
-    
-    
-    // Horrible hack to workaround another horrible hack.
-    // A 'fake' data source is created for every frame to guarantee
-    // that it has a part.  This flag is set if the data source
-    // in a 'fake' data source.
-    BOOL _isDummy;
 }
 
 @end
@@ -102,7 +93,6 @@
 - (double)_loadingStartedTime;
 - (void)_setTitle: (NSString *)title;
 - (void)_setFinalURL: (NSURL *)url;
-- (id <WebLocationChangeHandler>)_locationChangeHandler;
 - (void)_setContentPolicy:(WebContentPolicy *)policy;
 - (void)_setContentType:(NSString *)type;
 - (void)_setEncoding:(NSString *)encoding;
@@ -112,12 +102,9 @@
 - (void)_addError: (WebError *)error forResource: (NSString *)resourceDescription;
 + (NSMutableDictionary *)_repTypes;
 + (BOOL)_canShowMIMEType:(NSString *)MIMEType;
-- (void)_removeFromFrame;
 - (void)_loadIcon;
 - (void)_setIconURL:(NSURL *)url;
 - (void)_setIconURL:(NSURL *)url withType:(NSString *)iconType;
-- (BOOL)_isDummy;
-- (void)_setIsDummy: (BOOL)f;
 - (WebResourceHandle*)_mainHandle;
 
 // Convenience interface for getting here from an WebDataSource.
diff --git a/WebKit/WebView.subproj/WebDataSourcePrivate.m b/WebKit/WebView.subproj/WebDataSourcePrivate.m
index 19f33d4..f05932f 100644
--- a/WebKit/WebView.subproj/WebDataSourcePrivate.m
+++ b/WebKit/WebView.subproj/WebDataSourcePrivate.m
@@ -174,7 +174,7 @@
     
     [self _setLoading:YES];
     
-    [[self _locationChangeHandler] locationChangeStartedForDataSource:self];
+    [[_private->controller locationChangeHandler] locationChangeStartedForDataSource:self];
 
     // Fire this guy up.
     [_private->mainHandle loadInBackground];
@@ -276,38 +276,21 @@
     // The title doesn't get communicated to the controller until
     // we reach the committed state for this data source's frame.
     if ([[self webFrame] _state] >= WebFrameStateCommittedPage)
-        [[self _locationChangeHandler] receivedPageTitle:_private->pageTitle forDataSource:self];
+        [[_private->controller locationChangeHandler] receivedPageTitle:_private->pageTitle forDataSource:self];
 }
 
 - (void)_setFinalURL: (NSURL *)url
 {
-    [url retain];
-    [_private->finalURL release];
-    _private->finalURL = url;
-
     // We should never be getting a redirect callback after the data
     // source is committed. It would be a WebFoundation bug if it sent
     // a redirect callback after commit.
     WEBKIT_ASSERT(!_private->committed);
 
-    [[self _locationChangeHandler] serverRedirectTo:url forDataSource:self];
-}
-
-- (void)_setIsDummy: (BOOL)f
-{
-    _private->_isDummy = f;
-}
-
-- (BOOL)_isDummy
-{
-    return _private->_isDummy;
-}
+    [url retain];
+    [_private->finalURL release];
+    _private->finalURL = url;
 
-- (id <WebLocationChangeHandler>)_locationChangeHandler
-{
-    if ([self _isDummy])
-        return nil;
-    return [_private->controller locationChangeHandler];
+    [[_private->controller locationChangeHandler] serverRedirectTo:url forDataSource:self];
 }
 
 - (void) _setContentPolicy:(WebContentPolicy *)policy
@@ -394,18 +377,10 @@
     return [[self _repTypes] _web_objectForMIMEType:MIMEType] != nil;
 }
 
-- (void)_removeFromFrame
-{
-    WEBKIT_ASSERT(_private->committed);
-    [[self _bridge] removeFromFrame];
-    [self _setController:nil];
-}
-
 - (WebBridge *)_bridge
 {
     WEBKIT_ASSERT(_private->committed);
-    id representation = [self representation];
-    return [representation respondsToSelector:@selector(_bridge)] ? [representation _bridge] : nil;
+    return [[self webFrame] _bridge];
 }
 
 - (BOOL)_isCommitted
@@ -419,7 +394,6 @@
         WEBKITDEBUGLEVEL (WEBKIT_LOG_LOADING, "committed resource = %s\n", [[[self inputURL] absoluteString] cString]);
 	_private->committed = TRUE;
 	[self _makeRepresentation];
-	[[self _bridge] setFrame:[self webFrame]];
         [[self webFrame] _transitionToCommitted];
 	[[self _bridge] dataSourceChanged];
     }
@@ -436,6 +410,8 @@
         [newRep release];
     }
 
+    [_private->representation setDataSource:self];
+
     [[[self webFrame] webView] _makeDocumentViewForDataSource:self];
 }
 
@@ -465,7 +441,7 @@
 
 - (void)receivedPageIcon:(NSImage *)image
 {
-    [[self _locationChangeHandler] receivedPageIcon:image forDataSource:self];
+    [[_private->controller locationChangeHandler] receivedPageIcon:image forDataSource:self];
 }
 
 - (void)_loadIcon
@@ -481,7 +457,7 @@
     
             if([dataSourceURL isFileURL]){
                 NSImage *icon = [[NSWorkspace sharedWorkspace] iconForFile:[dataSourceURL path]];
-                [[self _locationChangeHandler] receivedPageIcon:icon forDataSource:self];
+                [[_private->controller locationChangeHandler] receivedPageIcon:icon forDataSource:self];
             } else {
                 _private->iconURL = [[NSURL _web_URLWithString:@"/favicon.ico" relativeToURL:dataSourceURL] retain];
             }
diff --git a/WebKit/WebView.subproj/WebDocument.h b/WebKit/WebView.subproj/WebDocument.h
index 153e1d5..75abe37 100644
--- a/WebKit/WebView.subproj/WebDocument.h
+++ b/WebKit/WebView.subproj/WebDocument.h
@@ -27,7 +27,8 @@
 @end
 
 @protocol WebDocumentRepresentation <NSObject>
+- (void)setDataSource:(WebDataSource *)dataSource;
 - (void)receivedData:(NSData *)data withDataSource:(WebDataSource *)dataSource;
 - (void)receivedError:(WebError *)error withDataSource:(WebDataSource *)dataSource;
 - (void)finishedLoadingWithDataSource:(WebDataSource *)dataSource;
- at end
\ No newline at end of file
+ at end
diff --git a/WebKit/WebView.subproj/WebFrame.m b/WebKit/WebView.subproj/WebFrame.m
index 5672174..d2ed8c7 100644
--- a/WebKit/WebView.subproj/WebFrame.m
+++ b/WebKit/WebView.subproj/WebFrame.m
@@ -35,38 +35,8 @@
 
     [self setController: c];
 
-    // set a dummy data source so that the main from for a
-    // newly-created empty window has a KHTMLPart. JavaScript
-    // always creates new windows initially empty, and then wants
-    // to use the main frame's part to make the new window load
-    // it's URL, so we need to make sure empty frames have a part.
-    // However, we don't want to do the spinner, so we do this
-    // weird thing:
-    
-    // FIXME: HACK ALERT!!!
-    // We need to keep a shadow part for all frames, even in the case
-    // of a non HTML representation.  This is required khtml
-    // can reference the frame (window.frames, targeting, etc.).
-    
-    WebDataSource *dummyDataSource = [[WebDataSource alloc] initWithURL:nil];
-    [dummyDataSource _setController: [self controller]];
-    [_private setProvisionalDataSource: dummyDataSource];
-    [self _setState: WebFrameStateProvisional];
-     
-    [dummyDataSource _setIsDummy:YES];	// hack on hack!
-    [dummyDataSource _setContentType:@"text/html"];
-    [dummyDataSource _setContentPolicy:[WebContentPolicy webPolicyWithContentAction:WebContentPolicyShow andPath:nil]];
-    [dummyDataSource _receivedData:[NSData data]];
-
-    // We have to do the next two steps manually, because the above
-    // data source won't be hooked up to its frame yet. Fortunately,
-    // this is only needed temporarily...
-
-    [[dummyDataSource _bridge] setFrame:self];
-    [self _transitionToCommitted];
-
-    [dummyDataSource release];
-        
+    [self _changeBridge];
+
     if (d != nil && [self setProvisionalDataSource: d] == NO){
         [self release];
         return nil;
@@ -158,13 +128,7 @@
         [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];
+    [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
diff --git a/WebKit/WebView.subproj/WebFramePrivate.h b/WebKit/WebView.subproj/WebFramePrivate.h
index aa07724..b77254c 100644
--- a/WebKit/WebView.subproj/WebFramePrivate.h
+++ b/WebKit/WebView.subproj/WebFramePrivate.h
@@ -52,6 +52,7 @@ typedef enum {
     WebView *webView;
     WebDataSource *dataSource;
     WebDataSource *provisionalDataSource;
+    WebBridge *bridge;
     WebController *controller;
     WebFrameState state;
     NSTimer *scheduledLayoutTimer;
@@ -85,6 +86,7 @@ typedef enum {
 - (void)_isLoadComplete;
 - (void)_checkLoadComplete;
 - (void)_timedLayout: userInfo;
+- (void)_changeBridge;
 - (WebBridge *)_bridge;
 - (BOOL)_shouldShowDataSource:(WebDataSource *)dataSource;
 - (void)_setProvisionalDataSource:(WebDataSource *)d;
diff --git a/WebKit/WebView.subproj/WebFramePrivate.m b/WebKit/WebView.subproj/WebFramePrivate.m
index 621f907..e10983d 100644
--- a/WebKit/WebView.subproj/WebFramePrivate.m
+++ b/WebKit/WebView.subproj/WebFramePrivate.m
@@ -45,6 +45,7 @@ static const char * const stateNames[6] = {
     [dataSource _setController: nil];
     [provisionalDataSource _setController: nil];
 
+    [bridge release];
     [name release];
     [webView release];
     [dataSource release];
@@ -73,7 +74,6 @@ static const char * const stateNames[6] = {
 - (void)setDataSource: (WebDataSource *)d
 {
     if (dataSource != d) {
-        [dataSource _removeFromFrame];
         [dataSource release];
         dataSource = [d retain];
     }
@@ -243,23 +243,11 @@ static const char * const stateNames[6] = {
     switch ([self _state]) {
     	case WebFrameStateProvisional:
         {
-	    // FIXME: allow documentView to be nil for now if webView is,
-	    // to handle the case of the special data source in a just created
-	    // frame. This is temporary, eventually the frame will hang on to
-	    // a bridge without the need for a dummy data source
-            WEBKIT_ASSERT (documentView != nil || [self webView] == nil);
-
-	    if ([[_private->dataSource _bridge] renderPart] != nil) {
-		[[_private->provisionalDataSource _bridge] setRenderPart:[[_private->dataSource _bridge] renderPart]]; 
-	    }
+	    WEBKIT_ASSERT (documentView != nil);
 
             // Set the committed data source on the frame.
             [self _setDataSource: _private->provisionalDataSource];
 
-            // provisionalDataSourceCommitted: will reset the view and begin trying to
-            // display the new new datasource.
-            [documentView provisionalDataSourceCommitted: _private->provisionalDataSource];
-
             // Now that the provisional data source is committed, release it.
             [_private setProvisionalDataSource: nil];
         
@@ -305,12 +293,11 @@ static const char * const stateNames[6] = {
             }
             
             // Tell the client we've committed this URL.
-            [[[self dataSource] _locationChangeHandler] locationChangeCommittedForDataSource:[self dataSource]];
+	    [[[self controller] locationChangeHandler] locationChangeCommittedForDataSource:[self dataSource]];
             
             // If we have a title let the controller know about it.
             if ([[self dataSource] pageTitle])
-                [[[self dataSource] _locationChangeHandler] receivedPageTitle:[[self dataSource] pageTitle] forDataSource:[self dataSource]];
-
+		[[[self controller] locationChangeHandler] receivedPageTitle:[[self dataSource] pageTitle] forDataSource:[self dataSource]];
             break;
         }
         
@@ -385,7 +372,7 @@ static const char * const stateNames[6] = {
                 if (![pd isLoading]) {
                     WEBKITDEBUGLEVEL (WEBKIT_LOG_LOADING, "%s:  checking complete in WebFrameStateProvisional, load done\n", [[self name] cString]);
 
-                    [[pd _locationChangeHandler] locationChangeDone: [pd mainDocumentError] forDataSource:pd];
+                    [[[self controller] locationChangeHandler] locationChangeDone: [pd mainDocumentError] forDataSource:pd];
 
                     // We now the provisional data source didn't cut the mustard, release it.
                     [_private setProvisionalDataSource: nil];
@@ -408,8 +395,15 @@ static const char * const stateNames[6] = {
                 NSView <WebDocumentView> *thisDocumentView = [thisView documentView];
 
                 [self _setState: WebFrameStateComplete];
-                
-                [[ds _bridge] end];
+
+		// FIXME: need to avoid doing this in the non-HTML
+		// case or the bridge may assert. Should make sure
+		// there is a bridge/part in the proper state even for
+		// non-HTML content.
+
+                if ([ds isDocumentHTML]) {
+		    [[ds _bridge] end];
+		}
 
                 // Unfortunately we have to get our parent to adjust the frames in this
                 // frameset so this frame's geometry is set correctly.  This should
@@ -442,7 +436,7 @@ static const char * const stateNames[6] = {
                 // Jump to anchor point, if necessary.
                 [[ds _bridge] scrollToBaseAnchor];
 
-                [[ds _locationChangeHandler] locationChangeDone: [ds mainDocumentError] forDataSource:ds];
+                [[[self controller] locationChangeHandler] locationChangeDone: [ds mainDocumentError] forDataSource:ds];
  
                 //if ([ds isDocumentHTML])
                 //    [[ds representation] part]->closeURL();        
@@ -505,9 +499,22 @@ static const char * const stateNames[6] = {
     [WebFrame _recursiveCheckCompleteFromFrame: [[self controller] mainFrame]];
 }
 
+- (void)_changeBridge
+{
+    WebBridge *oldBridge = _private->bridge;
+    //[oldBridge removeFromFrame];
+    _private->bridge = [[WebBridge alloc] init];
+    [_private->bridge setFrame:self];
+    if ([oldBridge renderPart] != nil) {
+	[_private->bridge setRenderPart:[oldBridge renderPart]]; 
+    }
+
+    [oldBridge release];
+}
+
 - (WebBridge *)_bridge
 {
-    return [[self dataSource] _bridge];
+    return _private->bridge;
 }
 
 - (BOOL)_shouldShowDataSource:(WebDataSource *)dataSource
diff --git a/WebKit/WebView.subproj/WebFrameViewPrivate.m b/WebKit/WebView.subproj/WebFrameViewPrivate.m
index 3cbf849..a955160 100644
--- a/WebKit/WebView.subproj/WebFrameViewPrivate.m
+++ b/WebKit/WebView.subproj/WebFrameViewPrivate.m
@@ -75,6 +75,7 @@
     [documentView release];
 
     [[self documentView] provisionalDataSourceChanged:dataSource];
+    [[self documentView] provisionalDataSourceCommitted:dataSource];
 }
 
 - (void)_setController: (WebController *)controller
diff --git a/WebKit/WebView.subproj/WebHTMLRepresentation.m b/WebKit/WebView.subproj/WebHTMLRepresentation.m
index 492e518..cca17b5 100644
--- a/WebKit/WebView.subproj/WebHTMLRepresentation.m
+++ b/WebKit/WebView.subproj/WebHTMLRepresentation.m
@@ -8,6 +8,7 @@
 #import <WebKit/WebDataSource.h>
 #import <WebKit/WebBridge.h>
 #import <WebKit/WebKitStatisticsPrivate.h>
+#import <WebKit/WebFramePrivate.h>
 
 @interface WebHTMLRepresentationPrivate : NSObject
 {
@@ -26,7 +27,6 @@
     [super init];
     
     _private = [[WebHTMLRepresentationPrivate alloc] init];
-    _private->bridge = [[WebBridge alloc] init];
     
     ++WebHTMLRepresentationCount;
     
@@ -37,7 +37,6 @@
 {
     --WebHTMLRepresentationCount;
     
-    [_private->bridge release];
     [_private release];
 
     [super dealloc];
@@ -48,6 +47,13 @@
     return _private->bridge;
 }
 
+- (void)setDataSource:(WebDataSource *)dataSource
+{
+    [[dataSource webFrame] _changeBridge];
+    _private->bridge = [[dataSource webFrame] _bridge];
+}
+
+
 - (void)receivedData:(NSData *)data withDataSource:(WebDataSource *)dataSource
 {
     [_private->bridge receivedData:data withDataSource:dataSource];
diff --git a/WebKit/WebView.subproj/WebHTMLViewPrivate.m b/WebKit/WebView.subproj/WebHTMLViewPrivate.m
index d7f8a79..f3884e3 100644
--- a/WebKit/WebView.subproj/WebHTMLViewPrivate.m
+++ b/WebKit/WebView.subproj/WebHTMLViewPrivate.m
@@ -83,7 +83,7 @@
 {
     WebView *webView = [self _web_parentWebView];
     WebFrame *webFrame = [[webView _controller] frameForView:webView];
-    return [[webFrame dataSource] _bridge];
+    return [webFrame _bridge];
 }
 
 BOOL _modifierTrackingEnabled = FALSE;
diff --git a/WebKit/WebView.subproj/WebImageRepresentation.m b/WebKit/WebView.subproj/WebImageRepresentation.m
index d1c7c33..c1861d2 100644
--- a/WebKit/WebView.subproj/WebImageRepresentation.m
+++ b/WebKit/WebView.subproj/WebImageRepresentation.m
@@ -31,6 +31,10 @@
     return image;
 }
 
+- (void)setDataSource:(WebDataSource *)dataSource
+{
+}
+
 - (void)receivedData:(NSData *)data withDataSource:(WebDataSource *)dataSource
 {
     //[image incrementalLoadWithBytes:[data bytes] length:[data length] complete:isComplete];
diff --git a/WebKit/WebView.subproj/WebMainResourceClient.m b/WebKit/WebView.subproj/WebMainResourceClient.m
index 0559ef6..e55c16e 100644
--- a/WebKit/WebView.subproj/WebMainResourceClient.m
+++ b/WebKit/WebView.subproj/WebMainResourceClient.m
@@ -205,7 +205,7 @@
     case WebContentPolicySaveAndOpenExternally:
         if (!downloadHandler) {
             [frame _setProvisionalDataSource:nil];
-            [[dataSource _locationChangeHandler] locationChangeDone:nil forDataSource:dataSource];
+	    [[[dataSource controller] locationChangeHandler] locationChangeDone:nil forDataSource:dataSource];
             downloadHandler = [[WebDownloadHandler alloc] initWithDataSource:dataSource];
         }
         [downloadHandler receivedData:data];
@@ -213,7 +213,7 @@
     case WebContentPolicyIgnore:
         [handle cancelLoadInBackground];
         [frame _setProvisionalDataSource:nil];
-        [[dataSource _locationChangeHandler] locationChangeDone:nil forDataSource:dataSource];
+	[[[dataSource controller] locationChangeHandler] locationChangeDone:nil forDataSource:dataSource];
         break;
     default:
         [NSException raise:NSInvalidArgumentException format:
diff --git a/WebKit/WebView.subproj/WebMainResourceLoader.m b/WebKit/WebView.subproj/WebMainResourceLoader.m
index 0559ef6..e55c16e 100644
--- a/WebKit/WebView.subproj/WebMainResourceLoader.m
+++ b/WebKit/WebView.subproj/WebMainResourceLoader.m
@@ -205,7 +205,7 @@
     case WebContentPolicySaveAndOpenExternally:
         if (!downloadHandler) {
             [frame _setProvisionalDataSource:nil];
-            [[dataSource _locationChangeHandler] locationChangeDone:nil forDataSource:dataSource];
+	    [[[dataSource controller] locationChangeHandler] locationChangeDone:nil forDataSource:dataSource];
             downloadHandler = [[WebDownloadHandler alloc] initWithDataSource:dataSource];
         }
         [downloadHandler receivedData:data];
@@ -213,7 +213,7 @@
     case WebContentPolicyIgnore:
         [handle cancelLoadInBackground];
         [frame _setProvisionalDataSource:nil];
-        [[dataSource _locationChangeHandler] locationChangeDone:nil forDataSource:dataSource];
+	[[[dataSource controller] locationChangeHandler] locationChangeDone:nil forDataSource:dataSource];
         break;
     default:
         [NSException raise:NSInvalidArgumentException format:
diff --git a/WebKit/WebView.subproj/WebTextRepresentation.m b/WebKit/WebView.subproj/WebTextRepresentation.m
index 0a8fedd..b35caac 100644
--- a/WebKit/WebView.subproj/WebTextRepresentation.m
+++ b/WebKit/WebView.subproj/WebTextRepresentation.m
@@ -8,6 +8,10 @@
 
 @implementation WebTextRepresentation
 
+- (void)setDataSource:(WebDataSource *)dataSource
+{
+}
+
 - (void)receivedData:(NSData *)data withDataSource:(WebDataSource *)dataSource
 {
 

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list