[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:09:45 UTC 2009
The following commit has been merged in the debian/unstable branch:
commit 181f1b6f50670ce932230519ac15366c0c0c5d5a
Author: rjw <rjw at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Fri Apr 26 00:01:43 2002 +0000
Fixed problem with errors potentially being reported on
wrong data source by moving collected errors from frame
to datasource.
Little changes in preparation for events.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@1077 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/ChangeLog-2002-12-03 b/WebCore/ChangeLog-2002-12-03
index 76e505e..105650d 100644
--- a/WebCore/ChangeLog-2002-12-03
+++ b/WebCore/ChangeLog-2002-12-03
@@ -1,3 +1,12 @@
+2002-04-25 Richard Williamson <rjw at apple.com>
+
+ Little changes in preparation for events.
+
+ * khtml/ecma/kjs_proxy.cpp:
+ (KJSProxyImpl::createHTMLEventHandler):
+ * kwq/KWQKHTMLPart.mm:
+ (KHTMLPart::createHTMLEventListener):
+
2002-04-25 Darin Adler <darin at apple.com>
Add a workaround for Radar 2912404 (kCFStringEncodingInvalidId is negative even
diff --git a/WebCore/ChangeLog-2003-10-25 b/WebCore/ChangeLog-2003-10-25
index 76e505e..105650d 100644
--- a/WebCore/ChangeLog-2003-10-25
+++ b/WebCore/ChangeLog-2003-10-25
@@ -1,3 +1,12 @@
+2002-04-25 Richard Williamson <rjw at apple.com>
+
+ Little changes in preparation for events.
+
+ * khtml/ecma/kjs_proxy.cpp:
+ (KJSProxyImpl::createHTMLEventHandler):
+ * kwq/KWQKHTMLPart.mm:
+ (KHTMLPart::createHTMLEventListener):
+
2002-04-25 Darin Adler <darin at apple.com>
Add a workaround for Radar 2912404 (kCFStringEncodingInvalidId is negative even
diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index 76e505e..105650d 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,3 +1,12 @@
+2002-04-25 Richard Williamson <rjw at apple.com>
+
+ Little changes in preparation for events.
+
+ * khtml/ecma/kjs_proxy.cpp:
+ (KJSProxyImpl::createHTMLEventHandler):
+ * kwq/KWQKHTMLPart.mm:
+ (KHTMLPart::createHTMLEventListener):
+
2002-04-25 Darin Adler <darin at apple.com>
Add a workaround for Radar 2912404 (kCFStringEncodingInvalidId is negative even
diff --git a/WebCore/khtml/ecma/kjs_proxy.cpp b/WebCore/khtml/ecma/kjs_proxy.cpp
index 56ba960..bb5e5dc 100644
--- a/WebCore/khtml/ecma/kjs_proxy.cpp
+++ b/WebCore/khtml/ecma/kjs_proxy.cpp
@@ -169,7 +169,7 @@ DOM::EventListener *KJSProxyImpl::createHTMLEventHandler(QString sourceUrl, QStr
args.append(KJS::String("event"));
args.append(KJS::String(code));
Object handlerFunc = constr.construct(m_script->globalExec(), args); // ### is globalExec ok ?
-
+
return KJS::Window::retrieveWindow(m_part)->getJSEventListener(handlerFunc,true);
}
diff --git a/WebCore/kwq/KWQKHTMLPart.mm b/WebCore/kwq/KWQKHTMLPart.mm
index b91ba7b..08d5049 100644
--- a/WebCore/kwq/KWQKHTMLPart.mm
+++ b/WebCore/kwq/KWQKHTMLPart.mm
@@ -1510,8 +1510,12 @@ void KHTMLPart::selectAll()
DOM::EventListener *KHTMLPart::createHTMLEventListener( QString code )
{
- _logNeverImplemented();
- return 0L;
+ KJSProxy *proxy = jScript();
+
+ if (!proxy)
+ return 0;
+
+ return proxy->createHTMLEventHandler( d->m_url.url(), code );
}
KHTMLPart *KHTMLPart::opener()
diff --git a/WebCore/kwq/KWQKHTMLPartImpl.mm b/WebCore/kwq/KWQKHTMLPartImpl.mm
index b91ba7b..08d5049 100644
--- a/WebCore/kwq/KWQKHTMLPartImpl.mm
+++ b/WebCore/kwq/KWQKHTMLPartImpl.mm
@@ -1510,8 +1510,12 @@ void KHTMLPart::selectAll()
DOM::EventListener *KHTMLPart::createHTMLEventListener( QString code )
{
- _logNeverImplemented();
- return 0L;
+ KJSProxy *proxy = jScript();
+
+ if (!proxy)
+ return 0;
+
+ return proxy->createHTMLEventHandler( d->m_url.url(), code );
}
KHTMLPart *KHTMLPart::opener()
diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog
index 25404a4..4f6d569 100644
--- a/WebKit/ChangeLog
+++ b/WebKit/ChangeLog
@@ -1,3 +1,41 @@
+2002-04-25 Richard Williamson <rjw at apple.com>
+
+ Fixed problem with errors potentially being reported on
+ wrong data source by moving collected errors from frame
+ to datasource.
+
+ Little changes in preparation for events.
+
+ * WebView.subproj/IFBaseWebControllerPrivate.mm:
+ (-[IFBaseWebController _receivedProgress:forResource:fromDataSource:]):
+ (-[IFBaseWebController _mainReceivedProgress:forResource:fromDataSource:]):
+ (-[IFBaseWebController _receivedError:forResource:partialProgress:fromDataSource:]):
+ (-[IFBaseWebController _mainReceivedError:forResource:partialProgress:fromDataSource:]):
+ * WebView.subproj/IFWebDataSource.h:
+ * WebView.subproj/IFWebDataSource.mm:
+ (-[IFWebDataSource errors]):
+ (-[IFWebDataSource mainDocumentError]):
+ * WebView.subproj/IFWebDataSourcePrivate.h:
+ * WebView.subproj/IFWebDataSourcePrivate.mm:
+ (-[IFWebDataSourcePrivate dealloc]):
+ (-[IFWebDataSource _startLoading:]):
+ (-[IFWebDataSource _setMainDocumentError:]):
+ (-[IFWebDataSource _clearErrors]):
+ (-[IFWebDataSource _addError:forResource:]):
+ * WebView.subproj/IFWebFrame.h:
+ * WebView.subproj/IFWebFrame.mm:
+ (-[IFWebFrame reload:]):
+ (-[IFWebFrame reset]):
+ * WebView.subproj/IFWebFramePrivate.h:
+ * WebView.subproj/IFWebFramePrivate.mm:
+ (-[IFWebFramePrivate dealloc]):
+ (-[IFWebFrame _isLoadComplete]):
+ (-[IFWebFrame _checkLoadComplete]):
+ * WebView.subproj/IFWebView.mm:
+ (-[IFWebView acceptsFirstResponder]):
+ (-[IFWebView layout]):
+ (-[IFWebView drawRect:]):
+
2002-04-25 Darin Adler <darin at apple.com>
Rework plugin code to prepare to move more of here from WebCore.
diff --git a/WebKit/ChangeLog-2002-12-03 b/WebKit/ChangeLog-2002-12-03
index 25404a4..4f6d569 100644
--- a/WebKit/ChangeLog-2002-12-03
+++ b/WebKit/ChangeLog-2002-12-03
@@ -1,3 +1,41 @@
+2002-04-25 Richard Williamson <rjw at apple.com>
+
+ Fixed problem with errors potentially being reported on
+ wrong data source by moving collected errors from frame
+ to datasource.
+
+ Little changes in preparation for events.
+
+ * WebView.subproj/IFBaseWebControllerPrivate.mm:
+ (-[IFBaseWebController _receivedProgress:forResource:fromDataSource:]):
+ (-[IFBaseWebController _mainReceivedProgress:forResource:fromDataSource:]):
+ (-[IFBaseWebController _receivedError:forResource:partialProgress:fromDataSource:]):
+ (-[IFBaseWebController _mainReceivedError:forResource:partialProgress:fromDataSource:]):
+ * WebView.subproj/IFWebDataSource.h:
+ * WebView.subproj/IFWebDataSource.mm:
+ (-[IFWebDataSource errors]):
+ (-[IFWebDataSource mainDocumentError]):
+ * WebView.subproj/IFWebDataSourcePrivate.h:
+ * WebView.subproj/IFWebDataSourcePrivate.mm:
+ (-[IFWebDataSourcePrivate dealloc]):
+ (-[IFWebDataSource _startLoading:]):
+ (-[IFWebDataSource _setMainDocumentError:]):
+ (-[IFWebDataSource _clearErrors]):
+ (-[IFWebDataSource _addError:forResource:]):
+ * WebView.subproj/IFWebFrame.h:
+ * WebView.subproj/IFWebFrame.mm:
+ (-[IFWebFrame reload:]):
+ (-[IFWebFrame reset]):
+ * WebView.subproj/IFWebFramePrivate.h:
+ * WebView.subproj/IFWebFramePrivate.mm:
+ (-[IFWebFramePrivate dealloc]):
+ (-[IFWebFrame _isLoadComplete]):
+ (-[IFWebFrame _checkLoadComplete]):
+ * WebView.subproj/IFWebView.mm:
+ (-[IFWebView acceptsFirstResponder]):
+ (-[IFWebView layout]):
+ (-[IFWebView drawRect:]):
+
2002-04-25 Darin Adler <darin at apple.com>
Rework plugin code to prepare to move more of here from WebCore.
diff --git a/WebKit/WebView.subproj/IFBaseWebControllerPrivate.mm b/WebKit/WebView.subproj/IFBaseWebControllerPrivate.mm
index 61cd04a..19e7c1d 100644
--- a/WebKit/WebView.subproj/IFBaseWebControllerPrivate.mm
+++ b/WebKit/WebView.subproj/IFBaseWebControllerPrivate.mm
@@ -69,8 +69,10 @@
if (progress->bytesSoFar == -1 && progress->totalToLoad == -1){
WEBKITDEBUGLEVEL (WEBKIT_LOG_LOADING, "cancelled resource = %s\n", [[[dataSource inputURL] absoluteString] cString]);
if (frame != nil) {
- IFError *error = [[[IFError alloc] initWithErrorCode: IFURLHandleResultCancelled failingURL: [dataSource inputURL]] autorelease];
- [frame _checkLoadCompleteResource: resourceDescription error: error isMainDocument: NO];
+ IFError *error = [[IFError alloc] initWithErrorCode: IFURLHandleResultCancelled failingURL: [dataSource inputURL]];
+ [dataSource _addError: error forResource: resourceDescription];
+ [error release];
+ [frame _checkLoadComplete];
}
return;
}
@@ -81,7 +83,7 @@
if (progress->bytesSoFar == progress->totalToLoad){
if (frame != nil){
[frame _transitionProvisionalToLayoutAcceptable];
- [frame _checkLoadCompleteResource: resourceDescription error: nil isMainDocument: NO];
+ [frame _checkLoadComplete];
}
}
}
@@ -96,8 +98,10 @@
WEBKITDEBUGLEVEL (WEBKIT_LOG_LOADING, "cancelled resource = %s\n", [[[dataSource inputURL] absoluteString] cString]);
[dataSource _setPrimaryLoadComplete: YES];
if (frame != nil) {
- IFError *error = [[[IFError alloc] initWithErrorCode: IFURLHandleResultCancelled failingURL: [dataSource inputURL]] autorelease];
- [frame _checkLoadCompleteResource: resourceDescription error: error isMainDocument: YES];
+ IFError *error = [[IFError alloc] initWithErrorCode: IFURLHandleResultCancelled failingURL: [dataSource inputURL]];
+ [dataSource _setMainDocumentError: error];
+ [error release];
+ [frame _checkLoadComplete];
}
return;
}
@@ -121,7 +125,7 @@
// If the load is complete, mark the primary load as done. The primary load is the load
// of the main document. Other resources may still be arriving.
[dataSource _setPrimaryLoadComplete: YES];
- [frame _checkLoadCompleteResource: resourceDescription error: nil isMainDocument: YES];
+ [frame _checkLoadComplete];
}
else {
// If the frame isn't complete it might be ready for a layout. Perform that check here.
@@ -146,7 +150,9 @@
WEBKIT_ASSERT (frame != nil);
- [frame _checkLoadCompleteResource: resourceDescription error: error isMainDocument: NO];
+ [dataSource _addError: error forResource: resourceDescription];
+
+ [frame _checkLoadComplete];
}
@@ -163,7 +169,8 @@
[dataSource _setPrimaryLoadComplete: YES];
- [frame _checkLoadCompleteResource: resourceDescription error: error isMainDocument: YES];
+ [dataSource _setMainDocumentError: error];
+ [frame _checkLoadComplete];
}
diff --git a/WebKit/WebView.subproj/IFWebDataSource.h b/WebKit/WebView.subproj/IFWebDataSource.h
index 72a921f..5fbb642 100644
--- a/WebKit/WebView.subproj/IFWebDataSource.h
+++ b/WebKit/WebView.subproj/IFWebDataSource.h
@@ -147,4 +147,13 @@
- (IFContentPolicy)contentPolicy;
+/*
+*/
+- (NSDictionary *)errors;
+
+/*
+*/
+- (IFError *)mainDocumentError;
+
+
@end
diff --git a/WebKit/WebView.subproj/IFWebDataSource.mm b/WebKit/WebView.subproj/IFWebDataSource.mm
index 0d54f35..464f2cc 100644
--- a/WebKit/WebView.subproj/IFWebDataSource.mm
+++ b/WebKit/WebView.subproj/IFWebDataSource.mm
@@ -318,4 +318,15 @@ static id IFWebDataSourceMake(void *handle)
return _private->contentPolicy;
}
+- (NSDictionary *)errors
+{
+ return _private->errors;
+}
+
+- (IFError *)mainDocumentError
+{
+ return _private->mainDocumentError;
+}
+
+
@end
diff --git a/WebKit/WebView.subproj/IFWebDataSourcePrivate.h b/WebKit/WebView.subproj/IFWebDataSourcePrivate.h
index 82e38e6..8f39b86 100644
--- a/WebKit/WebView.subproj/IFWebDataSourcePrivate.h
+++ b/WebKit/WebView.subproj/IFWebDataSourcePrivate.h
@@ -52,7 +52,13 @@ class KHTMLPart;
BOOL stopping;
NSString *pageTitle, *downloadPath;
-
+
+ // Errors associated with resources.
+ NSMutableDictionary *errors;
+
+ // Error associated with main document.
+ IFError *mainDocumentError;
+
// The location change handler for this data source.
id <IFLocationChangeHandler>locationChangeHandler;
@@ -89,4 +95,9 @@ class KHTMLPart;
- (IFContentPolicy) _contentPolicy;
- (void) _setContentPolicy:(IFContentPolicy)policy;
- (IFWebDataSource *) _recursiveDataSourceForLocationChangeHandler:(id <IFLocationChangeHandler>)handler;
+
+- (void)_clearErrors;
+- (void)_setMainDocumentError: (IFError *)error;
+- (void)_addError: (IFError *)error forResource: (NSString *)resourceDescription;
+
@end
diff --git a/WebKit/WebView.subproj/IFWebDataSourcePrivate.mm b/WebKit/WebView.subproj/IFWebDataSourcePrivate.mm
index 471b07d..f7267cc 100644
--- a/WebKit/WebView.subproj/IFWebDataSourcePrivate.mm
+++ b/WebKit/WebView.subproj/IFWebDataSourcePrivate.mm
@@ -12,6 +12,7 @@
#import <WebKit/IFException.h>
#import <WebKit/WebKitDebug.h>
#import <WebFoundation/IFURLHandle.h>
+#import <WebFoundation/IFError.h>
#import <WebKit/IFLocationChangeHandler.h>
#import <khtml_part.h>
@@ -53,7 +54,10 @@
[mainURLHandleClient release];
[pageTitle autorelease];
[(NSObject *)locationChangeHandler release];
-
+
+ [errors release];
+ [mainDocumentError release];
+
part->deref();
[super dealloc];
@@ -132,7 +136,7 @@
WEBKIT_ASSERT ([self webFrame] != nil);
- [[self webFrame] _clearErrors];
+ [self _clearErrors];
// FIXME [mjs]: temporary hack to make file: URLs work right
if ([urlString hasPrefix:@"file:/"] && [urlString characterAtIndex:6] != '/') {
@@ -313,4 +317,29 @@
return nil;
}
+- (void)_setMainDocumentError: (IFError *)error
+{
+ [error retain];
+ [_private->mainDocumentError release];
+ _private->mainDocumentError = error;
+}
+
+- (void)_clearErrors
+{
+ [_private->errors release];
+ _private->errors = nil;
+ [_private->mainDocumentError release];
+ _private->mainDocumentError = nil;
+}
+
+- (void)_addError: (IFError *)error forResource: (NSString *)resourceDescription
+{
+ if (_private->errors == 0)
+ _private->errors = [[NSMutableDictionary alloc] init];
+
+ [_private->errors setObject: error forKey: resourceDescription];
+}
+
+
+
@end
diff --git a/WebKit/WebView.subproj/IFWebFrame.h b/WebKit/WebView.subproj/IFWebFrame.h
index 5548a99..7f64570 100644
--- a/WebKit/WebView.subproj/IFWebFrame.h
+++ b/WebKit/WebView.subproj/IFWebFrame.h
@@ -76,14 +76,6 @@
/*
-*/
-- (NSDictionary *)errors;
-
-/*
-*/
-- (IFError *)mainDocumentError;
-
-/*
This method removes references the underlying resources.
FIXME: I think this should be private.
*/
diff --git a/WebKit/WebView.subproj/IFWebFrame.mm b/WebKit/WebView.subproj/IFWebFrame.mm
index 83792c1..8087ce1 100644
--- a/WebKit/WebView.subproj/IFWebFrame.mm
+++ b/WebKit/WebView.subproj/IFWebFrame.mm
@@ -96,6 +96,8 @@
}
+// FIXME: The name of this method is a little misleading, perhaps
+// we could call it prepareProvisionalDataSource?.
- (BOOL)setProvisionalDataSource: (IFWebDataSource *)newDataSource
{
IFWebDataSource *oldDataSource;
@@ -167,7 +169,7 @@
- (void)reload: (BOOL)forceRefresh
{
- [self _clearErrors];
+ [_private->dataSource _clearErrors];
[_private->dataSource startLoading: forceRefresh];
}
@@ -180,14 +182,4 @@
[_private setView: nil];
}
-- (NSDictionary *)errors
-{
- return _private->errors;
-}
-
-- (IFError *)mainDocumentError
-{
- return _private->mainDocumentError;
-}
-
@end
diff --git a/WebKit/WebView.subproj/IFWebFramePrivate.h b/WebKit/WebView.subproj/IFWebFramePrivate.h
index a7c507e..b61bf5e 100644
--- a/WebKit/WebView.subproj/IFWebFramePrivate.h
+++ b/WebKit/WebView.subproj/IFWebFramePrivate.h
@@ -39,8 +39,6 @@ typedef enum {
khtml::RenderPart *renderFramePart;
id <IFWebController>controller;
IFWebFrameState state;
- NSMutableDictionary *errors;
- IFError *mainDocumentError;
BOOL scheduledLayoutPending;
}
@@ -70,8 +68,6 @@ typedef enum {
- (void)_setState: (IFWebFrameState)newState;
+ (void)_recursiveCheckCompleteFromFrame: (IFWebFrame *)fromFrame;
- (void)_isLoadComplete;
-- (void)_checkLoadCompleteResource: (NSString *)resourceDescription error: (IFError *)error isMainDocument: (BOOL)flag;
-- (void)_clearErrors;
-- (void)_setMainDocumentError: (IFError *)error;
+- (void)_checkLoadComplete;
- (void)_timedLayout: userInfo;
@end
diff --git a/WebKit/WebView.subproj/IFWebFramePrivate.mm b/WebKit/WebView.subproj/IFWebFramePrivate.mm
index a6874b9..8c59bf3 100644
--- a/WebKit/WebView.subproj/IFWebFramePrivate.mm
+++ b/WebKit/WebView.subproj/IFWebFramePrivate.mm
@@ -40,8 +40,6 @@ static const char * const stateNames[6] = {
[view autorelease];
[dataSource autorelease];
[provisionalDataSource autorelease];
- [errors release];
- [mainDocumentError release];
if (renderFramePart)
renderFramePart->deref();
[super dealloc];
@@ -273,14 +271,6 @@ static const char * const stateNames[6] = {
_private->state = newState;
}
-- (void)_addError: (IFError *)error forResource: (NSString *)resourceDescription
-{
- if (_private->errors == 0)
- _private->errors = [[NSMutableDictionary alloc] init];
-
- [_private->errors setObject: error forKey: resourceDescription];
-}
-
- (void)_isLoadComplete
{
WEBKIT_ASSERT ([self controller] != nil);
@@ -295,17 +285,18 @@ static const char * const stateNames[6] = {
case IFWEBFRAMESTATE_PROVISIONAL:
{
+ IFWebDataSource *pd = [self provisionalDataSource];
+
WEBKITDEBUGLEVEL (WEBKIT_LOG_LOADING, "%s: checking complete in IFWEBFRAMESTATE_PROVISIONAL\n", [[self name] cString]);
// If we've received any errors we may be stuck in the provisional state and actually
// complete.
- if ([[self errors] count] != 0) {
+ if ([[pd errors] count] != 0) {
// Check all children first.
- WEBKITDEBUGLEVEL (WEBKIT_LOG_LOADING, "%s: checking complete, current state IFWEBFRAMESTATE_PROVISIONAL, %d errors\n", [[self name] cString], [[self errors] count]);
- if (![[self provisionalDataSource] isLoading]) {
+ WEBKITDEBUGLEVEL (WEBKIT_LOG_LOADING, "%s: checking complete, current state IFWEBFRAMESTATE_PROVISIONAL, %d errors\n", [[self name] cString], [[pd errors] count]);
+ if (![pd isLoading]) {
WEBKITDEBUGLEVEL (WEBKIT_LOG_LOADING, "%s: checking complete in IFWEBFRAMESTATE_PROVISIONAL, load done\n", [[self name] cString]);
- [[[self provisionalDataSource] _locationChangeHandler] locationChangeDone: [self mainDocumentError]];
-
+ [[pd _locationChangeHandler] locationChangeDone: [pd mainDocumentError]];
// We now the provisional data source didn't cut the mustard, release it.
[_private setProvisionalDataSource: nil];
@@ -320,16 +311,16 @@ static const char * const stateNames[6] = {
case IFWEBFRAMESTATE_COMMITTED_PAGE:
case IFWEBFRAMESTATE_LAYOUT_ACCEPTABLE:
{
+ IFWebDataSource *ds = [self dataSource];
+
WEBKITDEBUGLEVEL (WEBKIT_LOG_LOADING, "%s: checking complete, current state IFWEBFRAMESTATE_COMMITTED\n", [[self name] cString]);
- if (![[self dataSource] isLoading]) {
+ if (![ds isLoading]) {
id mainView = [[[self controller] mainFrame] view];
id thisView = [self view];
- WEBKIT_ASSERT ([self dataSource] != nil);
-
[self _setState: IFWEBFRAMESTATE_COMPLETE];
- [[self dataSource] _part]->end();
+ [ds _part]->end();
// May need to relayout each time a frame is completely
// loaded.
@@ -351,9 +342,9 @@ static const char * const stateNames[6] = {
}
// Jump to anchor point, if necessary.
- [[self dataSource] _part]->gotoBaseAnchor();
+ [ds _part]->gotoBaseAnchor();
- [[[self dataSource] _locationChangeHandler] locationChangeDone: [self mainDocumentError]];
+ [[ds _locationChangeHandler] locationChangeDone: [ds mainDocumentError]];
return;
}
@@ -404,35 +395,14 @@ static const char * const stateNames[6] = {
}
// Called every time a resource is completely loaded, or an error is received.
-- (void)_checkLoadCompleteResource: (NSString *)resourceDescription error: (IFError *)error isMainDocument: (BOOL)mainDocument
+- (void)_checkLoadComplete
{
WEBKIT_ASSERT ([self controller] != nil);
- if (error) {
- if (mainDocument)
- [self _setMainDocumentError: error];
- [self _addError: error forResource: resourceDescription];
- }
-
// Now walk the frame tree to see if any frame that may have initiated a load is done.
[IFWebFrame _recursiveCheckCompleteFromFrame: [[self controller] mainFrame]];
}
-- (void)_setMainDocumentError: (IFError *)error
-{
- [error retain];
- [_private->mainDocumentError release];
- _private->mainDocumentError = error;
-}
-
-- (void)_clearErrors
-{
- [_private->errors release];
- _private->errors = nil;
- [_private->mainDocumentError release];
- _private->mainDocumentError = nil;
-}
-
@end
diff --git a/WebKit/WebView.subproj/IFWebView.mm b/WebKit/WebView.subproj/IFWebView.mm
index 69f44af..077bf42 100644
--- a/WebKit/WebView.subproj/IFWebView.mm
+++ b/WebKit/WebView.subproj/IFWebView.mm
@@ -43,7 +43,12 @@
[super dealloc];
}
-
+
+- (BOOL)acceptsFirstResponder
+{
+ return YES;
+}
+
// Note that the controller is not retained.
- (id <IFWebController>)controller
{
@@ -137,6 +142,10 @@
{
KHTMLView *widget = _private->widget;
+
+ // Ensure that we will receive mouse move events. Is this the best place to put this?
+ [[self window] setAcceptsMouseMovedEvents: YES];
+
if (widget->part()->xmlDocImpl() &&
widget->part()->xmlDocImpl()->renderer()){
if (_private->needsLayout){
@@ -296,9 +305,6 @@
// WEBKITDEBUGLEVEL (WEBKIT_LOG_VIEW, "not drawing, frame in provisional state.\n");
// return;
//}
-
- // Ensure that we will receive mouse move events. Is this the best place to put this?
- [[self window] setAcceptsMouseMovedEvents: YES];
// Draw plain white bg in empty case, to avoid redraw weirdness when
// no page is yet loaded (2890818). We may need to modify this to always
diff --git a/WebKit/WebView.subproj/WebDataSource.h b/WebKit/WebView.subproj/WebDataSource.h
index 72a921f..5fbb642 100644
--- a/WebKit/WebView.subproj/WebDataSource.h
+++ b/WebKit/WebView.subproj/WebDataSource.h
@@ -147,4 +147,13 @@
- (IFContentPolicy)contentPolicy;
+/*
+*/
+- (NSDictionary *)errors;
+
+/*
+*/
+- (IFError *)mainDocumentError;
+
+
@end
diff --git a/WebKit/WebView.subproj/WebDataSource.m b/WebKit/WebView.subproj/WebDataSource.m
index 0d54f35..464f2cc 100644
--- a/WebKit/WebView.subproj/WebDataSource.m
+++ b/WebKit/WebView.subproj/WebDataSource.m
@@ -318,4 +318,15 @@ static id IFWebDataSourceMake(void *handle)
return _private->contentPolicy;
}
+- (NSDictionary *)errors
+{
+ return _private->errors;
+}
+
+- (IFError *)mainDocumentError
+{
+ return _private->mainDocumentError;
+}
+
+
@end
diff --git a/WebKit/WebView.subproj/WebDataSourcePrivate.h b/WebKit/WebView.subproj/WebDataSourcePrivate.h
index 82e38e6..8f39b86 100644
--- a/WebKit/WebView.subproj/WebDataSourcePrivate.h
+++ b/WebKit/WebView.subproj/WebDataSourcePrivate.h
@@ -52,7 +52,13 @@ class KHTMLPart;
BOOL stopping;
NSString *pageTitle, *downloadPath;
-
+
+ // Errors associated with resources.
+ NSMutableDictionary *errors;
+
+ // Error associated with main document.
+ IFError *mainDocumentError;
+
// The location change handler for this data source.
id <IFLocationChangeHandler>locationChangeHandler;
@@ -89,4 +95,9 @@ class KHTMLPart;
- (IFContentPolicy) _contentPolicy;
- (void) _setContentPolicy:(IFContentPolicy)policy;
- (IFWebDataSource *) _recursiveDataSourceForLocationChangeHandler:(id <IFLocationChangeHandler>)handler;
+
+- (void)_clearErrors;
+- (void)_setMainDocumentError: (IFError *)error;
+- (void)_addError: (IFError *)error forResource: (NSString *)resourceDescription;
+
@end
diff --git a/WebKit/WebView.subproj/WebDataSourcePrivate.m b/WebKit/WebView.subproj/WebDataSourcePrivate.m
index 471b07d..f7267cc 100644
--- a/WebKit/WebView.subproj/WebDataSourcePrivate.m
+++ b/WebKit/WebView.subproj/WebDataSourcePrivate.m
@@ -12,6 +12,7 @@
#import <WebKit/IFException.h>
#import <WebKit/WebKitDebug.h>
#import <WebFoundation/IFURLHandle.h>
+#import <WebFoundation/IFError.h>
#import <WebKit/IFLocationChangeHandler.h>
#import <khtml_part.h>
@@ -53,7 +54,10 @@
[mainURLHandleClient release];
[pageTitle autorelease];
[(NSObject *)locationChangeHandler release];
-
+
+ [errors release];
+ [mainDocumentError release];
+
part->deref();
[super dealloc];
@@ -132,7 +136,7 @@
WEBKIT_ASSERT ([self webFrame] != nil);
- [[self webFrame] _clearErrors];
+ [self _clearErrors];
// FIXME [mjs]: temporary hack to make file: URLs work right
if ([urlString hasPrefix:@"file:/"] && [urlString characterAtIndex:6] != '/') {
@@ -313,4 +317,29 @@
return nil;
}
+- (void)_setMainDocumentError: (IFError *)error
+{
+ [error retain];
+ [_private->mainDocumentError release];
+ _private->mainDocumentError = error;
+}
+
+- (void)_clearErrors
+{
+ [_private->errors release];
+ _private->errors = nil;
+ [_private->mainDocumentError release];
+ _private->mainDocumentError = nil;
+}
+
+- (void)_addError: (IFError *)error forResource: (NSString *)resourceDescription
+{
+ if (_private->errors == 0)
+ _private->errors = [[NSMutableDictionary alloc] init];
+
+ [_private->errors setObject: error forKey: resourceDescription];
+}
+
+
+
@end
diff --git a/WebKit/WebView.subproj/WebFrame.h b/WebKit/WebView.subproj/WebFrame.h
index 5548a99..7f64570 100644
--- a/WebKit/WebView.subproj/WebFrame.h
+++ b/WebKit/WebView.subproj/WebFrame.h
@@ -76,14 +76,6 @@
/*
-*/
-- (NSDictionary *)errors;
-
-/*
-*/
-- (IFError *)mainDocumentError;
-
-/*
This method removes references the underlying resources.
FIXME: I think this should be private.
*/
diff --git a/WebKit/WebView.subproj/WebFrame.m b/WebKit/WebView.subproj/WebFrame.m
index 83792c1..8087ce1 100644
--- a/WebKit/WebView.subproj/WebFrame.m
+++ b/WebKit/WebView.subproj/WebFrame.m
@@ -96,6 +96,8 @@
}
+// FIXME: The name of this method is a little misleading, perhaps
+// we could call it prepareProvisionalDataSource?.
- (BOOL)setProvisionalDataSource: (IFWebDataSource *)newDataSource
{
IFWebDataSource *oldDataSource;
@@ -167,7 +169,7 @@
- (void)reload: (BOOL)forceRefresh
{
- [self _clearErrors];
+ [_private->dataSource _clearErrors];
[_private->dataSource startLoading: forceRefresh];
}
@@ -180,14 +182,4 @@
[_private setView: nil];
}
-- (NSDictionary *)errors
-{
- return _private->errors;
-}
-
-- (IFError *)mainDocumentError
-{
- return _private->mainDocumentError;
-}
-
@end
diff --git a/WebKit/WebView.subproj/WebFramePrivate.h b/WebKit/WebView.subproj/WebFramePrivate.h
index a7c507e..b61bf5e 100644
--- a/WebKit/WebView.subproj/WebFramePrivate.h
+++ b/WebKit/WebView.subproj/WebFramePrivate.h
@@ -39,8 +39,6 @@ typedef enum {
khtml::RenderPart *renderFramePart;
id <IFWebController>controller;
IFWebFrameState state;
- NSMutableDictionary *errors;
- IFError *mainDocumentError;
BOOL scheduledLayoutPending;
}
@@ -70,8 +68,6 @@ typedef enum {
- (void)_setState: (IFWebFrameState)newState;
+ (void)_recursiveCheckCompleteFromFrame: (IFWebFrame *)fromFrame;
- (void)_isLoadComplete;
-- (void)_checkLoadCompleteResource: (NSString *)resourceDescription error: (IFError *)error isMainDocument: (BOOL)flag;
-- (void)_clearErrors;
-- (void)_setMainDocumentError: (IFError *)error;
+- (void)_checkLoadComplete;
- (void)_timedLayout: userInfo;
@end
diff --git a/WebKit/WebView.subproj/WebFramePrivate.m b/WebKit/WebView.subproj/WebFramePrivate.m
index a6874b9..8c59bf3 100644
--- a/WebKit/WebView.subproj/WebFramePrivate.m
+++ b/WebKit/WebView.subproj/WebFramePrivate.m
@@ -40,8 +40,6 @@ static const char * const stateNames[6] = {
[view autorelease];
[dataSource autorelease];
[provisionalDataSource autorelease];
- [errors release];
- [mainDocumentError release];
if (renderFramePart)
renderFramePart->deref();
[super dealloc];
@@ -273,14 +271,6 @@ static const char * const stateNames[6] = {
_private->state = newState;
}
-- (void)_addError: (IFError *)error forResource: (NSString *)resourceDescription
-{
- if (_private->errors == 0)
- _private->errors = [[NSMutableDictionary alloc] init];
-
- [_private->errors setObject: error forKey: resourceDescription];
-}
-
- (void)_isLoadComplete
{
WEBKIT_ASSERT ([self controller] != nil);
@@ -295,17 +285,18 @@ static const char * const stateNames[6] = {
case IFWEBFRAMESTATE_PROVISIONAL:
{
+ IFWebDataSource *pd = [self provisionalDataSource];
+
WEBKITDEBUGLEVEL (WEBKIT_LOG_LOADING, "%s: checking complete in IFWEBFRAMESTATE_PROVISIONAL\n", [[self name] cString]);
// If we've received any errors we may be stuck in the provisional state and actually
// complete.
- if ([[self errors] count] != 0) {
+ if ([[pd errors] count] != 0) {
// Check all children first.
- WEBKITDEBUGLEVEL (WEBKIT_LOG_LOADING, "%s: checking complete, current state IFWEBFRAMESTATE_PROVISIONAL, %d errors\n", [[self name] cString], [[self errors] count]);
- if (![[self provisionalDataSource] isLoading]) {
+ WEBKITDEBUGLEVEL (WEBKIT_LOG_LOADING, "%s: checking complete, current state IFWEBFRAMESTATE_PROVISIONAL, %d errors\n", [[self name] cString], [[pd errors] count]);
+ if (![pd isLoading]) {
WEBKITDEBUGLEVEL (WEBKIT_LOG_LOADING, "%s: checking complete in IFWEBFRAMESTATE_PROVISIONAL, load done\n", [[self name] cString]);
- [[[self provisionalDataSource] _locationChangeHandler] locationChangeDone: [self mainDocumentError]];
-
+ [[pd _locationChangeHandler] locationChangeDone: [pd mainDocumentError]];
// We now the provisional data source didn't cut the mustard, release it.
[_private setProvisionalDataSource: nil];
@@ -320,16 +311,16 @@ static const char * const stateNames[6] = {
case IFWEBFRAMESTATE_COMMITTED_PAGE:
case IFWEBFRAMESTATE_LAYOUT_ACCEPTABLE:
{
+ IFWebDataSource *ds = [self dataSource];
+
WEBKITDEBUGLEVEL (WEBKIT_LOG_LOADING, "%s: checking complete, current state IFWEBFRAMESTATE_COMMITTED\n", [[self name] cString]);
- if (![[self dataSource] isLoading]) {
+ if (![ds isLoading]) {
id mainView = [[[self controller] mainFrame] view];
id thisView = [self view];
- WEBKIT_ASSERT ([self dataSource] != nil);
-
[self _setState: IFWEBFRAMESTATE_COMPLETE];
- [[self dataSource] _part]->end();
+ [ds _part]->end();
// May need to relayout each time a frame is completely
// loaded.
@@ -351,9 +342,9 @@ static const char * const stateNames[6] = {
}
// Jump to anchor point, if necessary.
- [[self dataSource] _part]->gotoBaseAnchor();
+ [ds _part]->gotoBaseAnchor();
- [[[self dataSource] _locationChangeHandler] locationChangeDone: [self mainDocumentError]];
+ [[ds _locationChangeHandler] locationChangeDone: [ds mainDocumentError]];
return;
}
@@ -404,35 +395,14 @@ static const char * const stateNames[6] = {
}
// Called every time a resource is completely loaded, or an error is received.
-- (void)_checkLoadCompleteResource: (NSString *)resourceDescription error: (IFError *)error isMainDocument: (BOOL)mainDocument
+- (void)_checkLoadComplete
{
WEBKIT_ASSERT ([self controller] != nil);
- if (error) {
- if (mainDocument)
- [self _setMainDocumentError: error];
- [self _addError: error forResource: resourceDescription];
- }
-
// Now walk the frame tree to see if any frame that may have initiated a load is done.
[IFWebFrame _recursiveCheckCompleteFromFrame: [[self controller] mainFrame]];
}
-- (void)_setMainDocumentError: (IFError *)error
-{
- [error retain];
- [_private->mainDocumentError release];
- _private->mainDocumentError = error;
-}
-
-- (void)_clearErrors
-{
- [_private->errors release];
- _private->errors = nil;
- [_private->mainDocumentError release];
- _private->mainDocumentError = nil;
-}
-
@end
diff --git a/WebKit/WebView.subproj/WebFrameView.m b/WebKit/WebView.subproj/WebFrameView.m
index 69f44af..077bf42 100644
--- a/WebKit/WebView.subproj/WebFrameView.m
+++ b/WebKit/WebView.subproj/WebFrameView.m
@@ -43,7 +43,12 @@
[super dealloc];
}
-
+
+- (BOOL)acceptsFirstResponder
+{
+ return YES;
+}
+
// Note that the controller is not retained.
- (id <IFWebController>)controller
{
@@ -137,6 +142,10 @@
{
KHTMLView *widget = _private->widget;
+
+ // Ensure that we will receive mouse move events. Is this the best place to put this?
+ [[self window] setAcceptsMouseMovedEvents: YES];
+
if (widget->part()->xmlDocImpl() &&
widget->part()->xmlDocImpl()->renderer()){
if (_private->needsLayout){
@@ -296,9 +305,6 @@
// WEBKITDEBUGLEVEL (WEBKIT_LOG_VIEW, "not drawing, frame in provisional state.\n");
// return;
//}
-
- // Ensure that we will receive mouse move events. Is this the best place to put this?
- [[self window] setAcceptsMouseMovedEvents: YES];
// Draw plain white bg in empty case, to avoid redraw weirdness when
// no page is yet loaded (2890818). We may need to modify this to always
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list