Reviewed by Brady.
authordarin <darin@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 9 Oct 2006 18:04:35 +0000 (18:04 +0000)
committerdarin <darin@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 9 Oct 2006 18:04:35 +0000 (18:04 +0000)
        - removed almost all direct use of WebView from WebFrameLoader

        * Loader/WebFrameLoader.m:
        (-[WebFrameLoader defersCallbacksChanged]):
        (-[WebFrameLoader defersCallbacks]):
        (-[WebFrameLoader clearProvisionalLoad]):
        (-[WebFrameLoader _willSendRequest:forResource:redirectResponse:]):
        (-[WebFrameLoader _didReceiveResponse:forResource:]):
        (-[WebFrameLoader _didReceiveData:contentLength:forResource:]):
        (-[WebFrameLoader _didFinishLoadingForResource:]):
        (-[WebFrameLoader _didFailLoadingWithError:forResource:]):
        (-[WebFrameLoader closeOldDataSources]):
        (-[WebFrameLoader _notifyIconChanged:]):
        (-[WebFrameLoader prepareForLoadStart]):
        (-[WebFrameLoader willChangeTitleForDocument:]):
        (-[WebFrameLoader didChangeTitleForDocument:]):
        (-[WebFrameLoader continueAfterNewWindowPolicy:]):
        (-[WebFrameLoader continueAfterNavigationPolicy:]):
        (-[WebFrameLoader continueLoadRequestAfterNavigationPolicy:formState:]):
        (-[WebFrameLoader didFirstLayout]):
        (-[WebFrameLoader transitionToCommitted:]):
        (-[WebFrameLoader checkLoadCompleteForThisFrame]):
        (-[WebFrameLoader addExtraFieldsToRequest:mainResource:alwaysFromRequest:]):
        * Loader/WebFrameLoaderClient.h:
        * WebKit.xcodeproj/project.pbxproj:
        * WebView/WebFrame.m:
        (-[WebFrame _currentBackForwardListItemToResetTo]):
        (-[WebFrame _hasBackForwardList]):
        (-[WebFrame _resetBackForwardList]):
        (-[WebFrame _dispatchDidReceiveIcon:]):
        (-[WebFrame _dispatchDidStartProvisionalLoadForFrame]):
        (-[WebFrame _dispatchDidCommitLoadForFrame]):
        (-[WebFrame _dispatchDidFailProvisionalLoadWithError:]):
        (-[WebFrame _dispatchDidFailLoadWithError:]):
        (-[WebFrame _dispatchDidFinishLoadForFrame]):
        (-[WebFrame _progressStarted]):
        (-[WebFrame _progressCompleted]):
        (-[WebFrame _incrementProgressForIdentifier:response:]):
        (-[WebFrame _incrementProgressForIdentifier:data:]):
        (-[WebFrame _completeProgressForIdentifier:]):
        (-[WebFrame _setMainFrameDocumentReady:]):
        (-[WebFrame _willChangeTitleForDocument:]):
        (-[WebFrame _didChangeTitleForDocument:]):
        (-[WebFrame _startDownloadWithRequest:]):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@16930 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebKit/ChangeLog
WebKit/Loader/WebFrameLoader.m
WebKit/Loader/WebFrameLoaderClient.h
WebKit/WebKit.xcodeproj/project.pbxproj
WebKit/WebView/WebFrame.m
WebKit/WebView/WebFramePrivate.h

index 207d685bc45813981b802836662efd34adcd9ac3..10d0b858af56592229ae3f5a2675064254a46d0d 100644 (file)
@@ -1,3 +1,52 @@
+2006-10-09  Darin Adler  <darin@apple.com>
+
+        Reviewed by Brady.
+
+        - removed almost all direct use of WebView from WebFrameLoader
+
+        * Loader/WebFrameLoader.m:
+        (-[WebFrameLoader defersCallbacksChanged]):
+        (-[WebFrameLoader defersCallbacks]):
+        (-[WebFrameLoader clearProvisionalLoad]):
+        (-[WebFrameLoader _willSendRequest:forResource:redirectResponse:]):
+        (-[WebFrameLoader _didReceiveResponse:forResource:]):
+        (-[WebFrameLoader _didReceiveData:contentLength:forResource:]):
+        (-[WebFrameLoader _didFinishLoadingForResource:]):
+        (-[WebFrameLoader _didFailLoadingWithError:forResource:]):
+        (-[WebFrameLoader closeOldDataSources]):
+        (-[WebFrameLoader _notifyIconChanged:]):
+        (-[WebFrameLoader prepareForLoadStart]):
+        (-[WebFrameLoader willChangeTitleForDocument:]):
+        (-[WebFrameLoader didChangeTitleForDocument:]):
+        (-[WebFrameLoader continueAfterNewWindowPolicy:]):
+        (-[WebFrameLoader continueAfterNavigationPolicy:]):
+        (-[WebFrameLoader continueLoadRequestAfterNavigationPolicy:formState:]):
+        (-[WebFrameLoader didFirstLayout]):
+        (-[WebFrameLoader transitionToCommitted:]):
+        (-[WebFrameLoader checkLoadCompleteForThisFrame]):
+        (-[WebFrameLoader addExtraFieldsToRequest:mainResource:alwaysFromRequest:]):
+        * Loader/WebFrameLoaderClient.h:
+        * WebKit.xcodeproj/project.pbxproj:
+        * WebView/WebFrame.m:
+        (-[WebFrame _currentBackForwardListItemToResetTo]):
+        (-[WebFrame _hasBackForwardList]):
+        (-[WebFrame _resetBackForwardList]):
+        (-[WebFrame _dispatchDidReceiveIcon:]):
+        (-[WebFrame _dispatchDidStartProvisionalLoadForFrame]):
+        (-[WebFrame _dispatchDidCommitLoadForFrame]):
+        (-[WebFrame _dispatchDidFailProvisionalLoadWithError:]):
+        (-[WebFrame _dispatchDidFailLoadWithError:]):
+        (-[WebFrame _dispatchDidFinishLoadForFrame]):
+        (-[WebFrame _progressStarted]):
+        (-[WebFrame _progressCompleted]):
+        (-[WebFrame _incrementProgressForIdentifier:response:]):
+        (-[WebFrame _incrementProgressForIdentifier:data:]):
+        (-[WebFrame _completeProgressForIdentifier:]):
+        (-[WebFrame _setMainFrameDocumentReady:]):
+        (-[WebFrame _willChangeTitleForDocument:]):
+        (-[WebFrame _didChangeTitleForDocument:]):
+        (-[WebFrame _startDownloadWithRequest:]):
+
 2006-10-09  Maciej Stachowiak  <mjs@apple.com>
 
         Reviewed by Alice.
index 155ffb6ed19f1dd94ad3d7bfce4eb24760c642bd..e8854efb521972f54c700149053f10092e17efda 100644 (file)
@@ -121,14 +121,14 @@ BOOL isBackForwardLoadType(FrameLoadType type)
 
 - (void)defersCallbacksChanged
 {
-    BOOL defers = [[client webView] defersCallbacks];
+    BOOL defers = [[client _bridge] defersLoading];
     for (WebFrame *frame = client; frame; frame = [frame _traverseNextFrameStayWithin:client])
         [[frame _frameLoader] setDefersCallbacks:defers];
 }
 
 - (BOOL)defersCallbacks
 {
-    return [[client webView] defersCallbacks];
+    return [[client _bridge] defersLoading];
 }
 
 - (void)setDefersCallbacks:(BOOL)defers
@@ -329,7 +329,7 @@ static CFAbsoluteTime _timeOfLastCompletedLoad;
 - (void)clearProvisionalLoad
 {
     [self setProvisionalDocumentLoader:nil];
-    [[client webView] _progressCompleted:client];
+    [client _progressCompleted];
     [self setState:WebFrameStateComplete];
 }
 
@@ -417,8 +417,7 @@ static CFAbsoluteTime _timeOfLastCompletedLoad;
 
 - (NSURLRequest *)_willSendRequest:(NSMutableURLRequest *)clientRequest forResource:(id)identifier redirectResponse:(NSURLResponse *)redirectResponse
 {
-    WebView *webView = [client webView];
-    [clientRequest setValue:[webView userAgentForURL:[clientRequest URL]] forHTTPHeaderField:@"User-Agent"];
+    [clientRequest setValue:[[client _bridge] userAgentForURL:[clientRequest URL]] forHTTPHeaderField:@"User-Agent"];
     return [client _dispatchResource:identifier willSendRequest:clientRequest redirectResponse:redirectResponse fromDocumentLoader:[self activeDocumentLoader]];
 }
 
@@ -436,31 +435,25 @@ static CFAbsoluteTime _timeOfLastCompletedLoad;
 {
     [[self activeDocumentLoader] addResponse:r];
     
-    [[client webView] _incrementProgressForIdentifier:identifier response:r];
+    [client _incrementProgressForIdentifier:identifier response:r];
     [client _dispatchResource:identifier didReceiveResponse:r fromDocumentLoader:[self activeDocumentLoader]];
 }
 
 - (void)_didReceiveData:(NSData *)data contentLength:(int)lengthReceived forResource:(id)identifier
 {
-    WebView *webView = [client webView];
-    [webView _incrementProgressForIdentifier:identifier data:data];
-
+    [client _incrementProgressForIdentifier:identifier data:data];
     [client _dispatchResource:identifier didReceiveContentLength:lengthReceived fromDocumentLoader:[self activeDocumentLoader]];
 }
 
 - (void)_didFinishLoadingForResource:(id)identifier
 {    
-    WebView *webView = [client webView];
-    [webView _completeProgressForIdentifier:identifier];
+    [client _completeProgressForIdentifier:identifier];
     [client _dispatchResource:identifier didFinishLoadingFromDocumentLoader:[self activeDocumentLoader]];
 }
 
 - (void)_didFailLoadingWithError:(NSError *)error forResource:(id)identifier
 {
-    WebView *webView = [client webView];
-        
-    [webView _completeProgressForIdentifier:identifier];
-        
+    [client _completeProgressForIdentifier:identifier];
     if (error)
         [client _dispatchResource:identifier didFailLoadingWithError:error fromDocumentLoader:[self activeDocumentLoader]];
 }
@@ -708,7 +701,7 @@ static CFAbsoluteTime _timeOfLastCompletedLoad;
     if (documentLoader)
         [client _dispatchWillCloseFrame];
 
-    [[client webView] setMainFrameDocumentReady:NO];  // stop giving out the actual DOMDocument to observers
+    [client _setMainFrameDocumentReady:NO]; // stop giving out the actual DOMDocument to observers
 }
 
 // Called after we send an openURL:... down to WebCore.
@@ -863,15 +856,8 @@ static CFAbsoluteTime _timeOfLastCompletedLoad;
 - (void)_notifyIconChanged:(NSURL *)iconURL
 {
     ASSERT([[WebIconDatabase sharedIconDatabase] _isEnabled]);
-    ASSERT(client == [[client webView] mainFrame]);
-
-    [[client webView] _willChangeValueForKey:_WebMainFrameIconKey];
-    
     NSImage *icon = [[WebIconDatabase sharedIconDatabase] iconForURL:[[[self activeDocumentLoader] URL] _web_originalDataAsString] withSize:WebIconSmallSize];
-    
     [client _dispatchDidReceiveIcon:icon];
-    
-    [[client webView] _didChangeValueForKey:_WebMainFrameIconKey];
 }
 
 - (NSURL *)_URL
@@ -1225,8 +1211,7 @@ static CFAbsoluteTime _timeOfLastCompletedLoad;
 
 - (void)prepareForLoadStart
 {
-    [[client webView] _progressStarted:client];
-    [[client webView] _didStartProvisionalLoadForFrame:client];
+    [client _progressStarted];
     [client _dispatchDidStartProvisionalLoadForFrame];
 }
 
@@ -1241,14 +1226,12 @@ static CFAbsoluteTime _timeOfLastCompletedLoad;
 
 - (void)willChangeTitleForDocument:(WebDocumentLoader *)loader
 {
-    // FIXME: should do this only in main frame case, right?
-    [[client webView] _willChangeValueForKey:_WebMainFrameTitleKey];
+    [client _willChangeTitleForDocument:loader];
 }
 
 - (void)didChangeTitleForDocument:(WebDocumentLoader *)loader
 {
-    // FIXME: should do this only in main frame case, right?
-    [[client webView] _didChangeValueForKey:_WebMainFrameTitleKey];
+    [client _didChangeTitleForDocument:loader];
 
     // The title doesn't get communicated to the WebView until we are committed.
     if ([loader isCommitted]) {
@@ -1257,8 +1240,7 @@ static CFAbsoluteTime _timeOfLastCompletedLoad;
             // Must update the entries in the back-forward list too.
             // This must go through the WebFrame because it has the right notion of the current b/f item.
             [client _setTitle:[loader title] forURL:URLForHistory];
-            [[client webView] setMainFrameDocumentReady:YES]; // update observers with new DOMDocument
-
+            [client _setMainFrameDocumentReady:YES]; // update observers with new DOMDocument
             [client _dispatchDidReceiveTitle:[loader title]];
         }
     }
@@ -1333,23 +1315,19 @@ static CFAbsoluteTime _timeOfLastCompletedLoad;
     // will release policy* objects, hence the above retains
     [self invalidatePendingPolicyDecisionCallingDefaultAction:NO];
 
-    BOOL shouldContinue = NO;
-
     switch (policy) {
-    case WebPolicyIgnore:
-        break;
-    case WebPolicyDownload:
-        // FIXME: should download full request
-        [[client webView] _downloadURL:[request URL]];
-        break;
-    case WebPolicyUse:
-        shouldContinue = YES;
-        break;
-    default:
-        ASSERT_NOT_REACHED();
+        case WebPolicyIgnore:
+            request = nil;
+            break;
+        case WebPolicyDownload:
+            [client _startDownloadWithRequest:request];
+            request = nil;
+            break;
+        case WebPolicyUse:
+            break;
     }
 
-    objc_msgSend(target, selector, shouldContinue ? request : nil, frameName, formState);
+    objc_msgSend(target, selector, request, frameName, formState);
 }
 
 - (void)checkNavigationPolicyForRequest:(NSURLRequest *)request
@@ -1412,27 +1390,23 @@ static CFAbsoluteTime _timeOfLastCompletedLoad;
     // will release policy* objects, hence the above retains
     [self invalidatePendingPolicyDecisionCallingDefaultAction:NO];
 
-    BOOL shouldContinue = NO;
-
     switch (policy) {
-    case WebPolicyIgnore:
-        break;
-    case WebPolicyDownload:
-        // FIXME: should download full request
-        [[client webView] _downloadURL:[request URL]];
-        break;
-    case WebPolicyUse:
-        if (![WebView _canHandleRequest:request]) {
-            [self handleUnimplementablePolicyWithErrorCode:WebKitErrorCannotShowURL forURL:[request URL]];
-        } else {
-            shouldContinue = YES;
-        }
-        break;
-    default:
-        ASSERT_NOT_REACHED();
+        case WebPolicyIgnore:
+            request = nil;
+            break;
+        case WebPolicyDownload:
+            [client _startDownloadWithRequest:request];
+            request = nil;
+            break;
+        case WebPolicyUse:
+            if (![WebView _canHandleRequest:request]) {
+                [self handleUnimplementablePolicyWithErrorCode:WebKitErrorCannotShowURL forURL:[request URL]];
+                request = nil;
+            }
+            break;
     }
 
-    [target performSelector:selector withObject:(shouldContinue ? request : nil) withObject:formState];
+    [target performSelector:selector withObject:request withObject:formState];
 }
 
 // Called after the FormsDelegate is done processing willSubmitForm:
@@ -1460,7 +1434,7 @@ static CFAbsoluteTime _timeOfLastCompletedLoad;
     //       is the user responding Cancel to the form repost nag sheet.
     //    2) User responded Cancel to an alert popped up by the before unload event handler.
     // The "before unload" event handler runs only for the main frame.
-    BOOL canContinue = request && ([[client webView] mainFrame] != client || [[self bridge] shouldClose]);
+    BOOL canContinue = request && (![self isLoadingMainFrame] || [[self bridge] shouldClose]);
 
     if (!canContinue) {
         // If we were waiting for a quick redirect, but the policy delegate decided to ignore it, then we 
@@ -1473,8 +1447,8 @@ static CFAbsoluteTime _timeOfLastCompletedLoad;
         // If the navigation request came from the back/forward menu, and we punt on it, we have the 
         // problem that we have optimistically moved the b/f cursor already, so move it back.  For sanity, 
         // we only do this when punting a navigation for the target frame or top-level frame.  
-        if ((isTargetItem || [[client webView] mainFrame] == client) && isBackForwardLoadType(policyLoadType))
-            [(WebFrame <WebFrameLoaderClient> *)[[client webView] mainFrame] _resetBackForwardList];
+        if ((isTargetItem || [self isLoadingMainFrame]) && isBackForwardLoadType(policyLoadType))
+            [client _resetBackForwardList];
 
         return;
     }
@@ -1500,10 +1474,8 @@ static CFAbsoluteTime _timeOfLastCompletedLoad;
         // mechanism across the willSubmitForm callout.
         listener = [[WebPolicyDecisionListener alloc] _initWithTarget:self action:@selector(continueAfterWillSubmitForm:)];
         [[[client webView] _formDelegate] frame:client sourceFrame:[(WebFrameBridge *)[formState sourceFrame] webFrame] willSubmitForm:[formState form] withValues:[formState values] submissionListener:listener];
-    } 
-    else {
+    } else
         [self continueAfterWillSubmitForm:WebPolicyUse];
-    }
 }
 
 - (void)loadDocumentLoader:(WebDocumentLoader *)loader withLoadType:(FrameLoadType)type formState:(WebFormState *)formState
@@ -1544,10 +1516,8 @@ static CFAbsoluteTime _timeOfLastCompletedLoad;
 
 - (void)didFirstLayout
 {
-    if ([[client webView] backForwardList]) {
-        if (isBackForwardLoadType(loadType))
-            [client _restoreScrollPositionAndViewState];
-    }
+    if (isBackForwardLoadType(loadType) && [client _hasBackForwardList])
+        [client _restoreScrollPositionAndViewState];
 
     firstLayoutDone = YES;
     [client _dispatchDidFirstLayoutInFrame];
@@ -1575,20 +1545,10 @@ static CFAbsoluteTime _timeOfLastCompletedLoad;
 - (void)transitionToCommitted:(NSDictionary *)pageCache
 {
     ASSERT([client webView] != nil);
-    
-    switch ([self state]) {
-        case WebFrameStateProvisional:
-            goto keepGoing;
-        
-        case WebFrameStateCommittedPage:
-        case WebFrameStateComplete:
-            break;
-    }
+    ASSERT([self state] == WebFrameStateProvisional);
 
-    ASSERT_NOT_REACHED();
-    return;
-
-keepGoing:
+    if ([self state] != WebFrameStateProvisional)
+        return;
 
     [client _setCopiesOnScroll];
     [client _updateHistoryForCommit];
@@ -1611,7 +1571,7 @@ keepGoing:
     case WebFrameLoadTypeForward:
     case WebFrameLoadTypeBack:
     case WebFrameLoadTypeIndexedBackForward:
-        if ([[client webView] backForwardList]) {
+        if ([client _hasBackForwardList]) {
             [client _updateHistoryForBackForwardNavigation];
 
             // Create a document view for this document, or used the cached view.
@@ -1652,7 +1612,6 @@ keepGoing:
 
     // Tell the client we've committed this URL.
     ASSERT([[client frameView] documentView] != nil);
-    [[client webView] _didCommitLoadForFrame:client];
     [client _dispatchDidCommitLoadForFrame];
     
     // If we have a title let the WebView know about it.
@@ -1678,12 +1637,9 @@ keepGoing:
                 LoadErrorResetToken *resetToken = [client _tokenForLoadErrorReset];
                 BOOL shouldReset = YES;
                 if (![pdl isLoadingInAPISense]) {
-                    [[client webView] _didFailProvisionalLoadWithError:error forFrame:client];
                     delegateIsHandlingProvisionalLoadError = YES;
                     [client _dispatchDidFailProvisionalLoadWithError:error];
-
                     delegateIsHandlingProvisionalLoadError = NO;
-                    [[client _internalLoadDelegate] webFrame:client didFinishLoadWithError:error];
 
                     // FIXME: can stopping loading here possibly have
                     // any effect, if isLoading is false, which it
@@ -1723,44 +1679,18 @@ keepGoing:
 
                 [client _forceLayoutForNonHTML];
                  
-                // If the user had a scroll point scroll to it.  This will override
-                // the anchor point.  After much discussion it was decided by folks
-                // that the user scroll point should override the anchor point.
-                if ([[client webView] backForwardList]) {
-                    switch ([self loadType]) {
-                    case WebFrameLoadTypeForward:
-                    case WebFrameLoadTypeBack:
-                    case WebFrameLoadTypeIndexedBackForward:
-                    case WebFrameLoadTypeReload:
-                        [client _restoreScrollPositionAndViewState];
-                        break;
-
-                    case WebFrameLoadTypeStandard:
-                    case WebFrameLoadTypeInternal:
-                    case WebFrameLoadTypeReloadAllowingStaleData:
-                    case WebFrameLoadTypeSame:
-                    case WebFrameLoadTypeReplace:
-                        // Do nothing.
-                        break;
-
-                    default:
-                        ASSERT_NOT_REACHED();
-                        break;
-                    }
-                }
+                // If the user had a scroll point, scroll to it, overriding the anchor point if any.
+                if ((isBackForwardLoadType([self loadType]) || [self loadType] == WebFrameLoadTypeReload)
+                        && [client _hasBackForwardList])
+                    [client _restoreScrollPositionAndViewState];
 
                 NSError *error = [dl mainDocumentError];
-                if (error != nil) {
-                    [[client webView] _didFailLoadWithError:error forFrame:client];
+                if (error != nil)
                     [client _dispatchDidFailLoadWithError:error];
-                    [[client _internalLoadDelegate] webFrame:client didFinishLoadWithError:error];
-                } else {
-                    [[client webView] _didFinishLoadForFrame:client];
+                else
                     [client _dispatchDidFinishLoadForFrame];
-                    [[client _internalLoadDelegate] webFrame:client didFinishLoadWithError:nil];
-                }
                 
-                [[client webView] _progressCompleted:client];
+                [client _progressCompleted];
  
                 return;
             }
@@ -1921,14 +1851,14 @@ exit:
 
 - (void)addExtraFieldsToRequest:(NSMutableURLRequest *)request mainResource:(BOOL)mainResource alwaysFromRequest:(BOOL)f
 {
-    [request setValue:[[client webView] userAgentForURL:[request URL]] forHTTPHeaderField:@"User-Agent"];
+    [request setValue:[[client _bridge] userAgentForURL:[request URL]] forHTTPHeaderField:@"User-Agent"];
     
     if ([self loadType] == FrameLoadTypeReload)
         [request setValue:@"max-age=0" forHTTPHeaderField:@"Cache-Control"];
     
     // Don't set the cookie policy URL if it's already been set.
     if ([request mainDocumentURL] == nil) {
-        if (mainResource && (client == [[client webView] mainFrame] || f))
+        if (mainResource && ([self isLoadingMainFrame] || f))
             [request setMainDocumentURL:[request URL]];
         else
             [request setMainDocumentURL:[[[[client webView] mainFrame] dataSource] _URL]];
index 2ebd6a33e0e8f765ab528ab6d2f01c2b47978ef7..fdeed6df8db8ae3046b0326d74c29f1c69478f56 100644 (file)
@@ -36,6 +36,7 @@ typedef struct LoadErrorResetToken LoadErrorResetToken;
 
 @protocol WebFrameLoaderClient
 
+- (BOOL)_hasBackForwardList;
 - (void)_resetBackForwardList;
 
 - (BOOL)_provisionalItemIsTarget;
@@ -112,4 +113,18 @@ typedef struct LoadErrorResetToken LoadErrorResetToken;
 - (void)_clearLoadingFromPageCacheForDocumentLoader:(WebDocumentLoader *)loader;
 - (BOOL)_isDocumentLoaderLoadingFromPageCache:(WebDocumentLoader *)documentLoader;
 
+- (void)_progressStarted;
+- (void)_progressCompleted;
+
+- (void)_incrementProgressForIdentifier:(id)identifier response:(NSURLResponse *)response;
+- (void)_incrementProgressForIdentifier:(id)identifier data:(NSData *)data;
+- (void)_completeProgressForIdentifier:(id)identifier;
+
+- (void)_setMainFrameDocumentReady:(BOOL)ready;
+
+- (void)_willChangeTitleForDocument:(WebDocumentLoader *)loader;
+- (void)_didChangeTitleForDocument:(WebDocumentLoader *)loader;
+
+- (void)_startDownloadWithRequest:(NSURLRequest *)request;
+
 @end
index 52597e05ef4827bc8c7a1a1c2098c272e5be161d..a60512b2cfe1a5a7c3aebf332084c08af659212f 100644 (file)
                0867D690FE84028FC02AAC07 /* Project object */ = {
                        isa = PBXProject;
                        buildConfigurationList = 149C283208902B0F008A9EFC /* Build configuration list for PBXProject "WebKit" */;
+                       compatibilityVersion = "Xcode 2.4";
                        hasScannedForEncodings = 1;
                        knownRegions = (
                                English,
                        mainGroup = 0867D691FE84028FC02AAC07 /* WebKit */;
                        productRefGroup = 034768DFFF38A50411DB9C8B /* Products */;
                        projectDirPath = "";
+                       projectRoot = "";
+                       shouldCheckCompatibility = 1;
                        targets = (
                                9398100A0824BF01008DF038 /* WebKit */,
                        );
index 06e5a64ee2c5838f568bc30c82b5971e5535bd45..179ca7946182db01995fc8881c78d77ddf76cf1a 100644 (file)
@@ -786,7 +786,7 @@ static inline WebFrame *Frame(WebCoreFrameBridge *bridge)
 // Return the item that we would reset to, so we can decide later whether to actually reset.
 - (WebHistoryItem *)_currentBackForwardListItemToResetTo
 {
-    if (isBackForwardLoadType([[self _frameLoader] loadType]) && self == [[self webView] mainFrame])
+    if (isBackForwardLoadType([[self _frameLoader] loadType]) && [self _isMainFrame])
         return _private->currentItem;
     return nil;
 }
@@ -1381,12 +1381,17 @@ static inline WebDataSource *dataSource(WebDocumentLoader *loader)
 
 @implementation WebFrame (WebFrameLoaderClient)
 
+- (BOOL)_hasBackForwardList
+{
+    return [[self webView] backForwardList] != nil;
+}
+
 - (void)_resetBackForwardList
 {
     // Note this doesn't verify the current load type as a b/f operation because it is called from
     // a subframe in the case of a delegate bailing out of the nav before it even gets to provisional state.
-    ASSERT(self == [[self webView] mainFrame]);
-    WebHistoryItem *resetItem = _private->currentItem;
+    WebFrame *mainFrame = [[self webView] mainFrame];
+    WebHistoryItem *resetItem = mainFrame->_private->currentItem;
     if (resetItem)
         [[[self webView] backForwardList] goToItem:resetItem];
 }
@@ -1690,12 +1695,16 @@ static inline WebDataSource *dataSource(WebDocumentLoader *loader)
 - (void)_dispatchDidReceiveIcon:(NSImage *)icon
 {
     WebView *webView = [self webView];   
+    ASSERT([self _isMainFrame]);
+    [webView _willChangeValueForKey:_WebMainFrameIconKey];
     [[webView _frameLoadDelegateForwarder] webView:webView didReceiveIcon:icon forFrame:self];
+    [webView _didChangeValueForKey:_WebMainFrameIconKey];
 }
 
 - (void)_dispatchDidStartProvisionalLoadForFrame
 {
     WebView *webView = [self webView];   
+    [webView _didStartProvisionalLoadForFrame:self];
     [[webView _frameLoadDelegateForwarder] webView:webView didStartProvisionalLoadForFrame:self];    
 }
 
@@ -1708,25 +1717,32 @@ static inline WebDataSource *dataSource(WebDocumentLoader *loader)
 - (void)_dispatchDidCommitLoadForFrame
 {
     WebView *webView = [self webView];   
+    [webView _didCommitLoadForFrame:self];
     [[webView _frameLoadDelegateForwarder] webView:webView didCommitLoadForFrame:self];
 }
 
 - (void)_dispatchDidFailProvisionalLoadWithError:(NSError *)error
 {
     WebView *webView = [self webView];   
+    [webView _didFailProvisionalLoadWithError:error forFrame:self];
     [[webView _frameLoadDelegateForwarder] webView:webView didFailProvisionalLoadWithError:error forFrame:self];
+    [_private->internalLoadDelegate webFrame:self didFinishLoadWithError:error];
 }
 
 - (void)_dispatchDidFailLoadWithError:(NSError *)error
 {
     WebView *webView = [self webView];   
+    [webView _didFailLoadWithError:error forFrame:self];
     [[webView _frameLoadDelegateForwarder] webView:webView didFailLoadWithError:error forFrame:self];
+    [_private->internalLoadDelegate webFrame:self didFinishLoadWithError:error];
 }
 
 - (void)_dispatchDidFinishLoadForFrame
 {
     WebView *webView = [self webView];   
+    [webView _didFinishLoadForFrame:self];
     [[webView _frameLoadDelegateForwarder] webView:webView didFinishLoadForFrame:self];
+    [_private->internalLoadDelegate webFrame:self didFinishLoadWithError:nil];
 }
 
 - (void)_dispatchDidFirstLayoutInFrame
@@ -1886,4 +1902,52 @@ static inline WebDataSource *dataSource(WebDocumentLoader *loader)
     [dataSource(loader) _makeRepresentation];
 }
 
+- (void)_progressStarted
+{
+    [[self webView] _progressStarted:self];
+}
+
+- (void)_progressCompleted
+{
+    [[self webView] _progressCompleted:self];
+}
+
+- (void)_incrementProgressForIdentifier:(id)identifier response:(NSURLResponse *)response
+{
+    [[self webView] _incrementProgressForIdentifier:identifier response:response];
+}
+
+- (void)_incrementProgressForIdentifier:(id)identifier data:(NSData *)data
+{
+    [[self webView] _incrementProgressForIdentifier:identifier data:data];
+}
+
+- (void)_completeProgressForIdentifier:(id)identifier
+{
+    [[self webView] _completeProgressForIdentifier:identifier];
+}
+
+- (void)_setMainFrameDocumentReady:(BOOL)ready
+{
+    [[self webView] setMainFrameDocumentReady:ready];
+}
+
+- (void)_willChangeTitleForDocument:(WebDocumentLoader *)loader
+{
+    // FIXME: Should do this only in main frame case, right?
+    [[self webView] _willChangeValueForKey:_WebMainFrameTitleKey];
+}
+
+- (void)_didChangeTitleForDocument:(WebDocumentLoader *)loader
+{
+    // FIXME: Should do this only in main frame case, right?
+    [[self webView] _didChangeValueForKey:_WebMainFrameTitleKey];
+}
+
+- (void)_startDownloadWithRequest:(NSURLRequest *)request
+{
+    // FIXME: Should download full request.
+    [[self webView] _downloadURL:[request URL]];
+}
+
 @end
index 81583d97f02139b92373acd6f0bbf808938b85ed..37f8afae869fc8e8134fb6562268bab4a0d9e377 100644 (file)
@@ -28,8 +28,6 @@
 
 // This header contains the WebFrame SPI.
 
-// But it also contains a bunch of internal stuff that should be moved to WebFrameInternal.h
-
 #import <WebKit/WebFrame.h>
 
 // Keys for accessing the values in the page cache dictionary.