[SCM] WebKit Debian packaging branch, debian/unstable, updated. debian/1.1.15-1-40151-g37bb677
sullivan
sullivan at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 08:29:18 UTC 2009
The following commit has been merged in the debian/unstable branch:
commit df4b946ee0d9a2f891a8689cc2a3be72f6b4b7cc
Author: sullivan <sullivan at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Thu Mar 11 20:12:54 2004 +0000
WebKit:
- fixed <rdar://problem/3585056>: Assertion failure if error page is loaded from
webView:unableToImplementPolicyWithError:
- also added HeaderDoc comments to could-be-API-soon methods and fixed a
conceptual problem with said methods
Reviewed by Darin.
* WebView.subproj/WebDataSourcePrivate.h:
added HeaderDoc comment for -unreachableURL
* WebView.subproj/WebFramePrivate.h:
added HeaderDoc comment for -loadAlternateHTMLString:baseURL:forUnreachableURL:;
also added boolean delegateIsHandlingUnimplementablePolicy ivar to WebFramePrivate
* WebView.subproj/WebFrame.m:
(-[WebFrame _shouldReloadToHandleUnreachableURLFromRequest:]):
treat delegateIsHandlingUnimplementablePolicy like delegateIsDecidingNavigationPolicy.
Safari serves up error pages during the latter but clients are equally or more likely
to do so during the former.
(-[WebFrame _handleUnimplementablePolicyWithErrorCode:forURL:]):
set delegateIsHandlingUnimplementablePolicy during delegate callback
(-[WebFrame _continueLoadRequestAfterNavigationPolicy:formState:]):
tweaked assertion so it doesn't erroneously fire for clients that call
loadAlternateHTML:baseURL:forUnreachableURL: while processing
webView:unableToImplementPolicyWithError:
WebBrowser:
Removed obsolete comment I happened to notice.
Reviewed by Darin..
* BrowserWebController.m:
(-[BrowserWebView webView:unableToImplementPolicyWithError:frame:]):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@6205 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog
index 763e5bc..6f0444e 100644
--- a/WebKit/ChangeLog
+++ b/WebKit/ChangeLog
@@ -1,3 +1,30 @@
+2004-03-11 John Sullivan <sullivan at apple.com>
+
+ - fixed <rdar://problem/3585056>: Assertion failure if error page is loaded from
+ webView:unableToImplementPolicyWithError:
+ - also added HeaderDoc comments to could-be-API-soon methods and fixed a
+ conceptual problem with said methods
+
+ Reviewed by Darin.
+
+ * WebView.subproj/WebDataSourcePrivate.h:
+ added HeaderDoc comment for -unreachableURL
+
+ * WebView.subproj/WebFramePrivate.h:
+ added HeaderDoc comment for -loadAlternateHTMLString:baseURL:forUnreachableURL:;
+ also added boolean delegateIsHandlingUnimplementablePolicy ivar to WebFramePrivate
+ * WebView.subproj/WebFrame.m:
+ (-[WebFrame _shouldReloadToHandleUnreachableURLFromRequest:]):
+ treat delegateIsHandlingUnimplementablePolicy like delegateIsDecidingNavigationPolicy.
+ Safari serves up error pages during the latter but clients are equally or more likely
+ to do so during the former.
+ (-[WebFrame _handleUnimplementablePolicyWithErrorCode:forURL:]):
+ set delegateIsHandlingUnimplementablePolicy during delegate callback
+ (-[WebFrame _continueLoadRequestAfterNavigationPolicy:formState:]):
+ tweaked assertion so it doesn't erroneously fire for clients that call
+ loadAlternateHTML:baseURL:forUnreachableURL: while processing
+ webView:unableToImplementPolicyWithError:
+
2004-03-11 Chris Blumenberg <cblu at apple.com>
Made WebArchive a class instead of a data object. This allows clients to easily get the main resource and subresources from a WebArchive.
diff --git a/WebKit/WebView.subproj/WebDataSourcePrivate.h b/WebKit/WebView.subproj/WebDataSourcePrivate.h
index 3d95e64..0e85ed3 100644
--- a/WebKit/WebView.subproj/WebDataSourcePrivate.h
+++ b/WebKit/WebView.subproj/WebDataSourcePrivate.h
@@ -120,8 +120,16 @@
- (WebResource *)subresourceForURL:(NSURL *)URL;
- (void)addSubresource:(WebResource *)subresource;
- (void)addSubresources:(NSArray *)subresources;
+
+/*!
+ @method unreachableURL
+ @discussion This will be non-nil only for dataSources created by calls to the
+ WebFrame method loadAlternateHTMLString:baseURL:forUnreachableURL:.
+ @result returns the unreachableURL for which this dataSource is showing alternate content, or nil
+ */
- (NSURL *)unreachableURL;
+// Other private methods
- (NSDictionary *)_subresourcesDictionary;
- (NSFileWrapper *)_fileWrapperForURL:(NSURL *)URL;
diff --git a/WebKit/WebView.subproj/WebFrame.m b/WebKit/WebView.subproj/WebFrame.m
index 4512525..054bda7 100644
--- a/WebKit/WebView.subproj/WebFrame.m
+++ b/WebKit/WebView.subproj/WebFrame.m
@@ -307,7 +307,7 @@ NSString *WebPageCacheDocumentViewKey = @"WebPageCacheDocumentViewKey";
// case handles malformed URLs and unknown schemes. Loading alternate content
// at other times behaves like a standard load.
WebDataSource *compareDataSource = nil;
- if (_private->delegateIsDecidingNavigationPolicy) {
+ if (_private->delegateIsDecidingNavigationPolicy || _private->delegateIsHandlingUnimplementablePolicy) {
compareDataSource = _private->policyDataSource;
} else if (_private->delegateIsHandlingProvisionalLoadError) {
compareDataSource = [self provisionalDataSource];
@@ -1214,7 +1214,9 @@ static CFAbsoluteTime _timeOfLastCompletedLoad;
{
NSError *error = [NSError _webKitErrorWithDomain:WebKitErrorDomain code:code URL:URL];
WebView *wv = [self webView];
+ _private->delegateIsHandlingUnimplementablePolicy = YES;
[[wv _policyDelegateForwarder] webView:wv unableToImplementPolicyWithError:error frame:self];
+ _private->delegateIsHandlingUnimplementablePolicy = NO;
}
- (void)_clearProvisionalDataSource
@@ -2217,13 +2219,16 @@ static CFAbsoluteTime _timeOfLastCompletedLoad;
-(void)_continueLoadRequestAfterNavigationPolicy:(NSURLRequest *)request formState:(WebFormState *)formState
{
- ASSERT(_private->policyDataSource);
-
+ // If we loaded an alternate page to replace an unreachableURL, we'll get in here with a
+ // nil _private->policyDataSource because loading the alternate page will have passed
+ // through this method already, nested; otherwise, _private->policyDataSource should still be set.
+ ASSERT(_private->policyDataSource || [[self provisionalDataSource] unreachableURL] != nil);
+
if (!request) {
[self _setPolicyDataSource:nil];
return;
}
-
+
WebFrameLoadType loadType = _private->policyLoadType;
WebDataSource *dataSource = [_private->policyDataSource retain];
diff --git a/WebKit/WebView.subproj/WebFramePrivate.h b/WebKit/WebView.subproj/WebFramePrivate.h
index 1b67d18..67b58e6 100644
--- a/WebKit/WebView.subproj/WebFramePrivate.h
+++ b/WebKit/WebView.subproj/WebFramePrivate.h
@@ -91,6 +91,7 @@ extern NSString *WebPageCacheDocumentViewKey;
BOOL isStoppingLoad;
BOOL delegateIsHandlingProvisionalLoadError;
BOOL delegateIsDecidingNavigationPolicy;
+ BOOL delegateIsHandlingUnimplementablePolicy;
}
- (void)setName:(NSString *)name;
@@ -120,9 +121,22 @@ extern NSString *WebPageCacheDocumentViewKey;
// API Considerations:
- (void)loadWebArchive:(WebArchive *)webArchive;
-// unreachableURL represents a URL that couldn't be loaded; the HTML string acts as an error page for that URL
-- (void)loadAlternateHTMLString:(NSString *)string baseURL:(NSURL *)URL forUnreachableURL:(NSURL *)unreachableURL;
+/*!
+ @method loadAlternateHTMLString:baseURL:forUnreachableURL:
+ @abstract Loads a page to display as a substitute for a URL that could not be reached.
+ @discussion This allows clients to display page-loading errors in the webview itself.
+ This is typically called while processing the WebFrameLoadDelegate method
+ -webView:didFailProvisionalLoadWithError:forFrame: or one of the the WebPolicyDelegate methods
+ -webView:decidePolicyForMIMEType:request:frame:decisionListener: or
+ -webView:unableToImplementPolicyWithError:frame:. If it is called from within one of those
+ three delegate methods then the back/forward list will be maintained appropriately.
+ @param string The string to use for the main page of the document.
+ @param baseURL The baseURL to apply to relative URLs within the document.
+ @param unreachableURL The URL for which this page will serve as alternate content.
+*/
+- (void)loadAlternateHTMLString:(NSString *)string baseURL:(NSURL *)baseURL forUnreachableURL:(NSURL *)unreachableURL;
+// Other private methods
- (NSURLRequest *)_webDataRequestForData:(NSData *)data MIMEType:(NSString *)MIMEType textEncodingName:(NSString *)encodingName baseURL:(NSURL *)URL unreachableURL:(NSURL *)unreachableURL;
- (void)_loadRequest:(NSURLRequest *)request subresources:(NSArray *)subresources;
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list