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

darin darin at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 06:19:57 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit 48cb459fd3fc91a91c1e4bc0b295272d8c116873
Author: darin <darin at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Sun Jun 16 07:04:34 2002 +0000

    WebCore:
    
    	Fix frame-related calls. I was always searching all the frames, which was disastrous.
    	Also do name changes.
    
    	* kwq/KWQKHTMLPart.mm:
    	(KWQKHTMLPartImpl::urlSelected): Use descendantFrameNamed rather than frameNamed.
    	(KWQKHTMLPartImpl::requestFrame): Use childFrameNamed rather than frameNamed.
    	(KWQKHTMLPartImpl::frameExists): Use childFrameNamed rather than frameNamed.
    
    	* kwq/KWQScrollView.mm: (QScrollView::addChild): Asserts I used while debugging.
    
    	* kwq/WebCoreBridge.h: Add new calls. Change names of old ones to include the
    	word frame consistently. (Also bits of new work that will do no harm, but are
    	not really needed yet.)
    
    WebKit:
    
    	Update for frame-related changes in WebCore.
    
    	* WebCoreSupport.subproj/IFWebCoreBridge.mm:
    	(-[IFWebFrame _bridge]): Look at provisional data source first.
    	(-[IFWebCoreBridge dealloc]): Release the data source.
    	(-[IFWebCoreBridge parentFrame]): Renamed.
    	(-[IFWebCoreBridge childFrames]): Renamed.
    	(-[IFWebCoreBridge childFrameNamed:]): Added.
    	(-[IFWebCoreBridge descendantFrameNamed:]): Added.
    	(-[IFWebCoreBridge didFinishLoadingWithHandle:]): Don't call _didStopLoading twice
    	when we finish loading.
    
    	Also changed controller getters to call [dataSource controller] and got rid of the
    	[IFWebCoreBridge controller] method.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@1383 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog-2002-12-03 b/WebCore/ChangeLog-2002-12-03
index 5da7a6c..e1f365c 100644
--- a/WebCore/ChangeLog-2002-12-03
+++ b/WebCore/ChangeLog-2002-12-03
@@ -1,5 +1,21 @@
 2002-06-15  Darin Adler  <darin at apple.com>
 
+	Fix frame-related calls. I was always searching all the frames, which was disastrous.
+	Also do name changes.
+
+	* kwq/KWQKHTMLPart.mm:
+	(KWQKHTMLPartImpl::urlSelected): Use descendantFrameNamed rather than frameNamed.
+	(KWQKHTMLPartImpl::requestFrame): Use childFrameNamed rather than frameNamed.
+	(KWQKHTMLPartImpl::frameExists): Use childFrameNamed rather than frameNamed.
+
+	* kwq/KWQScrollView.mm: (QScrollView::addChild): Asserts I used while debugging.
+
+	* kwq/WebCoreBridge.h: Add new calls. Change names of old ones to include the
+	word frame consistently. (Also bits of new work that will do no harm, but are
+	not really needed yet.)
+
+2002-06-15  Darin Adler  <darin at apple.com>
+
 	* kwq/KWQKloader.mm:
 	(-[KWQURLLoadClient IFURLHandle:didRedirectToURL:]):
 	Rolled out an assert I added by accident that will break Deployment builds.
diff --git a/WebCore/ChangeLog-2003-10-25 b/WebCore/ChangeLog-2003-10-25
index 5da7a6c..e1f365c 100644
--- a/WebCore/ChangeLog-2003-10-25
+++ b/WebCore/ChangeLog-2003-10-25
@@ -1,5 +1,21 @@
 2002-06-15  Darin Adler  <darin at apple.com>
 
+	Fix frame-related calls. I was always searching all the frames, which was disastrous.
+	Also do name changes.
+
+	* kwq/KWQKHTMLPart.mm:
+	(KWQKHTMLPartImpl::urlSelected): Use descendantFrameNamed rather than frameNamed.
+	(KWQKHTMLPartImpl::requestFrame): Use childFrameNamed rather than frameNamed.
+	(KWQKHTMLPartImpl::frameExists): Use childFrameNamed rather than frameNamed.
+
+	* kwq/KWQScrollView.mm: (QScrollView::addChild): Asserts I used while debugging.
+
+	* kwq/WebCoreBridge.h: Add new calls. Change names of old ones to include the
+	word frame consistently. (Also bits of new work that will do no harm, but are
+	not really needed yet.)
+
+2002-06-15  Darin Adler  <darin at apple.com>
+
 	* kwq/KWQKloader.mm:
 	(-[KWQURLLoadClient IFURLHandle:didRedirectToURL:]):
 	Rolled out an assert I added by accident that will break Deployment builds.
diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index 5da7a6c..e1f365c 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,5 +1,21 @@
 2002-06-15  Darin Adler  <darin at apple.com>
 
+	Fix frame-related calls. I was always searching all the frames, which was disastrous.
+	Also do name changes.
+
+	* kwq/KWQKHTMLPart.mm:
+	(KWQKHTMLPartImpl::urlSelected): Use descendantFrameNamed rather than frameNamed.
+	(KWQKHTMLPartImpl::requestFrame): Use childFrameNamed rather than frameNamed.
+	(KWQKHTMLPartImpl::frameExists): Use childFrameNamed rather than frameNamed.
+
+	* kwq/KWQScrollView.mm: (QScrollView::addChild): Asserts I used while debugging.
+
+	* kwq/WebCoreBridge.h: Add new calls. Change names of old ones to include the
+	word frame consistently. (Also bits of new work that will do no harm, but are
+	not really needed yet.)
+
+2002-06-15  Darin Adler  <darin at apple.com>
+
 	* kwq/KWQKloader.mm:
 	(-[KWQURLLoadClient IFURLHandle:didRedirectToURL:]):
 	Rolled out an assert I added by accident that will break Deployment builds.
diff --git a/WebCore/kwq/KWQKHTMLPart.mm b/WebCore/kwq/KWQKHTMLPart.mm
index ed03257..ad78963 100644
--- a/WebCore/kwq/KWQKHTMLPart.mm
+++ b/WebCore/kwq/KWQKHTMLPart.mm
@@ -406,14 +406,14 @@ void KWQKHTMLPartImpl::urlSelected( const QString &url, int button, int state, c
     
     if (_target.isEmpty()) {
         // If we're the only frame in a frameset then pop the frame.
-        if ([[[bridge parent] children] count] == 1) {
-            frame = [bridge parent];
+        if ([[[bridge parentFrame] childFrames] count] == 1) {
+            frame = [bridge parentFrame];
         } else {
             frame = bridge;
         }
     }
     else {
-        frame = [bridge frameNamed:_target.getNSString()];
+        frame = [bridge descendantFrameNamed:_target.getNSString()];
         if (frame == nil) {
             // FIXME: What is the correct behavior here? Other browsers seem to open new windows.
             NSLog (@"ERROR: unable to find frame named %@\n", _target.getNSString());
@@ -430,7 +430,7 @@ bool KWQKHTMLPartImpl::requestFrame( khtml::RenderPart *frame, const QString &ur
     NSString *name = frameName.getNSString();
 
     KWQDEBUGLEVEL(KWQ_LOG_FRAMES, "name %s\n", DEBUG_OBJECT(name));
-    WebCoreBridge *framePart = [bridge frameNamed:name];
+    WebCoreBridge *framePart = [bridge childFrameNamed:name];
     if (framePart) {
         KWQDEBUGLEVEL(KWQ_LOG_FRAMES, "found %s\n", DEBUG_OBJECT(name));
         frame->setWidget([framePart widget]);
@@ -445,7 +445,7 @@ bool KWQKHTMLPartImpl::requestFrame( khtml::RenderPart *frame, const QString &ur
         }
         
         HTMLIFrameElementImpl *o = static_cast<HTMLIFrameElementImpl *>(frame->element());
-        if (![bridge createNewFrameNamed:name withURL:childURL
+        if (![bridge createChildFrameNamed:name withURL:childURL
                 renderPart:frame allowsScrolling:o->scrollingMode() != QScrollView::AlwaysOff
                 marginWidth:o->getMarginWidth() marginHeight:o->getMarginHeight()]) {
             return false;
@@ -590,13 +590,13 @@ void KWQKHTMLPartImpl::submitForm( const char *action, const QString &url, const
 
 bool KWQKHTMLPartImpl::frameExists( const QString &frameName )
 {
-    return [bridge frameNamed:frameName.getNSString()];
+    return [bridge childFrameNamed:frameName.getNSString()];
 }
 
 QPtrList<KParts::ReadOnlyPart> KWQKHTMLPartImpl::frames() const
 {
     QPtrList<KParts::ReadOnlyPart> res;
-    NSArray *children = [bridge children];
+    NSArray *children = [bridge childFrames];
     WebCoreBridge *childPart;
     unsigned int i;
     
@@ -636,5 +636,5 @@ void KWQKHTMLPartImpl::setTitle(const DOMString &title)
 
 KHTMLPart *KWQKHTMLPartImpl::parentPart()
 {
-    return [[bridge parent] part];
+    return [[bridge parentFrame] part];
 }
diff --git a/WebCore/kwq/KWQKHTMLPartImpl.mm b/WebCore/kwq/KWQKHTMLPartImpl.mm
index ed03257..ad78963 100644
--- a/WebCore/kwq/KWQKHTMLPartImpl.mm
+++ b/WebCore/kwq/KWQKHTMLPartImpl.mm
@@ -406,14 +406,14 @@ void KWQKHTMLPartImpl::urlSelected( const QString &url, int button, int state, c
     
     if (_target.isEmpty()) {
         // If we're the only frame in a frameset then pop the frame.
-        if ([[[bridge parent] children] count] == 1) {
-            frame = [bridge parent];
+        if ([[[bridge parentFrame] childFrames] count] == 1) {
+            frame = [bridge parentFrame];
         } else {
             frame = bridge;
         }
     }
     else {
-        frame = [bridge frameNamed:_target.getNSString()];
+        frame = [bridge descendantFrameNamed:_target.getNSString()];
         if (frame == nil) {
             // FIXME: What is the correct behavior here? Other browsers seem to open new windows.
             NSLog (@"ERROR: unable to find frame named %@\n", _target.getNSString());
@@ -430,7 +430,7 @@ bool KWQKHTMLPartImpl::requestFrame( khtml::RenderPart *frame, const QString &ur
     NSString *name = frameName.getNSString();
 
     KWQDEBUGLEVEL(KWQ_LOG_FRAMES, "name %s\n", DEBUG_OBJECT(name));
-    WebCoreBridge *framePart = [bridge frameNamed:name];
+    WebCoreBridge *framePart = [bridge childFrameNamed:name];
     if (framePart) {
         KWQDEBUGLEVEL(KWQ_LOG_FRAMES, "found %s\n", DEBUG_OBJECT(name));
         frame->setWidget([framePart widget]);
@@ -445,7 +445,7 @@ bool KWQKHTMLPartImpl::requestFrame( khtml::RenderPart *frame, const QString &ur
         }
         
         HTMLIFrameElementImpl *o = static_cast<HTMLIFrameElementImpl *>(frame->element());
-        if (![bridge createNewFrameNamed:name withURL:childURL
+        if (![bridge createChildFrameNamed:name withURL:childURL
                 renderPart:frame allowsScrolling:o->scrollingMode() != QScrollView::AlwaysOff
                 marginWidth:o->getMarginWidth() marginHeight:o->getMarginHeight()]) {
             return false;
@@ -590,13 +590,13 @@ void KWQKHTMLPartImpl::submitForm( const char *action, const QString &url, const
 
 bool KWQKHTMLPartImpl::frameExists( const QString &frameName )
 {
-    return [bridge frameNamed:frameName.getNSString()];
+    return [bridge childFrameNamed:frameName.getNSString()];
 }
 
 QPtrList<KParts::ReadOnlyPart> KWQKHTMLPartImpl::frames() const
 {
     QPtrList<KParts::ReadOnlyPart> res;
-    NSArray *children = [bridge children];
+    NSArray *children = [bridge childFrames];
     WebCoreBridge *childPart;
     unsigned int i;
     
@@ -636,5 +636,5 @@ void KWQKHTMLPartImpl::setTitle(const DOMString &title)
 
 KHTMLPart *KWQKHTMLPartImpl::parentPart()
 {
-    return [[bridge parent] part];
+    return [[bridge parentFrame] part];
 }
diff --git a/WebCore/kwq/KWQScrollView.mm b/WebCore/kwq/KWQScrollView.mm
index ea9844a..12e3177 100644
--- a/WebCore/kwq/KWQScrollView.mm
+++ b/WebCore/kwq/KWQScrollView.mm
@@ -189,9 +189,11 @@ void QScrollView::addChild(QWidget* child, int x, int y)
 {
     NSView *thisView, *thisDocView, *subView;
 
+    KWQ_ASSERT(child != this);
+
     if (child->x() != x || child->y() != y)
         child->move(x, y);
-        
+    
     thisView = getView();
     thisDocView = [thisView _IF_getDocumentView];
     if (thisDocView)
@@ -201,6 +203,8 @@ void QScrollView::addChild(QWidget* child, int x, int y)
     if ([subView _IF_isScrollView]) {
         subView = [subView superview];
     }
+    
+    KWQ_ASSERT(subView != thisView);
 
     if ([subView superview] == thisView) {
         return;
diff --git a/WebCore/kwq/WebCoreBridge.h b/WebCore/kwq/WebCoreBridge.h
index 69440e3..e10b5da 100644
--- a/WebCore/kwq/WebCoreBridge.h
+++ b/WebCore/kwq/WebCoreBridge.h
@@ -45,10 +45,22 @@ typedef struct KHTMLRenderPart KHTMLRenderPart;
 #endif
 
 @class IFError;
+#ifndef RESOURCE_URL_CLIENT_READY
 @class IFURLHandle;
+#endif
 
 @class WebCoreBridge;
 
+ at protocol WebCoreResourceLoader <NSObject>
+
+- (void)addData:(NSData *)data;
+
+// Either cancel or finish will be called before the loader is released, but never both.
+- (void)cancel;
+- (void)finish;
+
+ at end
+
 // The WebCoreBridge class contains methods for use by the non-WebCore side of the bridge.
 
 @interface WebCoreBridge : NSObject
@@ -79,25 +91,31 @@ typedef struct KHTMLRenderPart KHTMLRenderPart;
 
 @protocol WebCoreBridge
 
-- (WebCoreBridge *)parent;
-- (NSArray *)children; // WebCoreBridge objects
+- (WebCoreBridge *)parentFrame;
+- (NSArray *)childFrames; // WebCoreBridge objects
+- (WebCoreBridge *)childFrameNamed:(NSString *)name;
+- (WebCoreBridge *)descendantFrameNamed:(NSString *)name;
 
 - (WebCoreBridge *)mainFrame;
-- (WebCoreBridge *)frameNamed:(NSString *)name; // always searches entire hierarchy starting with mainFrame
+- (WebCoreBridge *)frameNamed:(NSString *)name; // searches entire hierarchy starting with mainFrame
 
 - (void)setTitle:(NSString *)title;
 
 - (void)loadURL:(NSURL *)URL;
 - (void)postWithURL:(NSURL *)URL data:(NSData *)data;
 
-- (BOOL)createNewFrameNamed:(NSString *)frameName
-    withURL:(NSURL *)URL renderPart:(khtml::RenderPart *)renderPart
+- (BOOL)createChildFrameNamed:(NSString *)frameName
+    withURL:(NSURL *)URL renderPart:(KHTMLRenderPart *)renderPart
     allowsScrolling:(BOOL)allowsScrolling marginWidth:(int)width marginHeight:(int)height;
 
 - (void)openNewWindowWithURL:(NSURL *)URL;
 
 - (KHTMLView *)widget;
 
+- (void)startLoadingResource:(id <WebCoreResourceLoader>)resourceLoader withURL:(NSURL *)URL;
+
+#ifndef RESOURCE_URL_CLIENT_READY
+
 - (void)addHandle:(IFURLHandle *)handle;
 - (void)removeHandle:(IFURLHandle *)handle;
 
@@ -110,6 +128,8 @@ typedef struct KHTMLRenderPart KHTMLRenderPart;
 - (void)didRedirectWithHandle:(IFURLHandle *)handle fromURL:(NSURL *)fromURL;
 - (void)didFailBeforeLoadingWithError:(IFError *)error;
 
+#endif
+
 @end
 
 @interface WebCoreBridge (SubclassResponsibility) <WebCoreBridge>
diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog
index cc88a8c..c1ed603 100644
--- a/WebKit/ChangeLog
+++ b/WebKit/ChangeLog
@@ -1,3 +1,20 @@
+2002-06-15  Darin Adler  <darin at apple.com>
+
+	Update for frame-related changes in WebCore.
+
+	* WebCoreSupport.subproj/IFWebCoreBridge.mm:
+	(-[IFWebFrame _bridge]): Look at provisional data source first.
+	(-[IFWebCoreBridge dealloc]): Release the data source.
+	(-[IFWebCoreBridge parentFrame]): Renamed.
+	(-[IFWebCoreBridge childFrames]): Renamed.
+	(-[IFWebCoreBridge childFrameNamed:]): Added.
+	(-[IFWebCoreBridge descendantFrameNamed:]): Added.
+	(-[IFWebCoreBridge didFinishLoadingWithHandle:]): Don't call _didStopLoading twice
+	when we finish loading.
+	
+	Also changed controller getters to call [dataSource controller] and got rid of the
+	[IFWebCoreBridge controller] method.
+
 2002-06-15  Richard Williamson  <rjw at apple.com>
 
 	* Misc.subproj/IFNSViewExtras.h:
diff --git a/WebKit/ChangeLog-2002-12-03 b/WebKit/ChangeLog-2002-12-03
index cc88a8c..c1ed603 100644
--- a/WebKit/ChangeLog-2002-12-03
+++ b/WebKit/ChangeLog-2002-12-03
@@ -1,3 +1,20 @@
+2002-06-15  Darin Adler  <darin at apple.com>
+
+	Update for frame-related changes in WebCore.
+
+	* WebCoreSupport.subproj/IFWebCoreBridge.mm:
+	(-[IFWebFrame _bridge]): Look at provisional data source first.
+	(-[IFWebCoreBridge dealloc]): Release the data source.
+	(-[IFWebCoreBridge parentFrame]): Renamed.
+	(-[IFWebCoreBridge childFrames]): Renamed.
+	(-[IFWebCoreBridge childFrameNamed:]): Added.
+	(-[IFWebCoreBridge descendantFrameNamed:]): Added.
+	(-[IFWebCoreBridge didFinishLoadingWithHandle:]): Don't call _didStopLoading twice
+	when we finish loading.
+	
+	Also changed controller getters to call [dataSource controller] and got rid of the
+	[IFWebCoreBridge controller] method.
+
 2002-06-15  Richard Williamson  <rjw at apple.com>
 
 	* Misc.subproj/IFNSViewExtras.h:
diff --git a/WebKit/WebCoreSupport.subproj/IFWebCoreBridge.mm b/WebKit/WebCoreSupport.subproj/IFWebCoreBridge.mm
index 1b1bfde..668ef34 100644
--- a/WebKit/WebCoreSupport.subproj/IFWebCoreBridge.mm
+++ b/WebKit/WebCoreSupport.subproj/IFWebCoreBridge.mm
@@ -5,14 +5,14 @@
 
 #import <WebKit/IFWebCoreBridge.h>
 
+#import <WebKit/IFHTMLRepresentation.h>
+#import <WebKit/IFHTMLViewPrivate.h>
+#import <WebKit/IFLoadProgress.h>
+//#import <WebKit/IFResourceURLHandleClient.h>
 #import <WebKit/IFWebControllerPrivate.h>
-#import <WebKit/IFWebFramePrivate.h>
 #import <WebKit/IFWebDataSourcePrivate.h>
 #import <WebKit/IFWebFramePrivate.h>
 #import <WebKit/IFWebViewPrivate.h>
-#import <WebKit/IFHTMLRepresentation.h>
-#import <WebKit/IFHTMLViewPrivate.h>
-#import <WebKit/IFLoadProgress.h>
 #import <WebFoundation/IFURLCacheLoaderConstants.h>
 #import <WebFoundation/IFURLHandle.h>
 
@@ -36,27 +36,29 @@
 
 - (IFWebCoreBridge *)_bridge
 {
-    IFWebCoreBridge *aBridge;
+    IFWebCoreBridge *bridge;
     
-    aBridge = [[self dataSource] _bridge];
-    if (!aBridge)
-        aBridge = [[self provisionalDataSource] _bridge];
-    return aBridge;
+    bridge = [[self provisionalDataSource] _bridge];
+    if (!bridge)
+        bridge = [[self dataSource] _bridge];
+    return bridge;
 }
 
 @end
 
 @implementation IFWebCoreBridge
 
-- (IFWebFrame *)frame
+- (void)dealloc
 {
-    WEBKIT_ASSERT(dataSource);
-    return [dataSource webFrame];
+    [dataSource release];
+    
+    [super dealloc];
 }
 
-- (IFWebController *)controller
+- (IFWebFrame *)frame
 {
-    return [[self frame] controller];
+    WEBKIT_ASSERT(dataSource);
+    return [dataSource webFrame];
 }
 
 - (IFWebView *)view
@@ -69,36 +71,42 @@
     return [[self view] documentView];
 }
 
-- (WebCoreBridge *)parent
+- (WebCoreBridge *)parentFrame
 {
     WEBKIT_ASSERT(dataSource);
     return [[dataSource parent] _bridge];
 }
 
-- (NSArray *)children
+- (NSArray *)childFrames
 {
     WEBKIT_ASSERT(dataSource);
     NSArray *frames = [dataSource children];
     NSEnumerator *e = [frames objectEnumerator];
-    NSMutableArray *children = [NSMutableArray arrayWithCapacity:[frames count]];
+    NSMutableArray *bridges = [NSMutableArray arrayWithCapacity:[frames count]];
     IFWebFrame *frame;
     while ((frame = [e nextObject])) {
         IFWebCoreBridge *bridge = [frame _bridge];
         if (bridge)
-            [children addObject:bridge];
+            [bridges addObject:bridge];
     }
-    return children;
+    return bridges;
+}
+
+- (WebCoreBridge *)childFrameNamed:(NSString *)name
+{
+    return [[dataSource frameNamed:name] _bridge];
+}
+
+- (WebCoreBridge *)descendantFrameNamed:(NSString *)name
+{
+    return [[[self frame] frameNamed:name] _bridge];
 }
 
 - (void)loadURL:(NSURL *)URL attributes:(NSDictionary *)attributes flags:(unsigned)flags inFrame:(IFWebFrame *)frame withParent:(WebCoreBridge *)parent
 {
     IFWebDataSource *newDataSource = [[IFWebDataSource alloc] initWithURL:URL attributes:attributes flags:flags];
     IFWebCoreBridge *parentPrivate = (IFWebCoreBridge *)parent;
-    // Might be loading top frame.  Parent may be nil.
-    if (parentPrivate)
-        [newDataSource _setParent:parentPrivate->dataSource];
-    else
-        [newDataSource _setParent:nil];
+    [newDataSource _setParent:parent ? parentPrivate->dataSource : nil];
     [frame setProvisionalDataSource:newDataSource];
     [newDataSource release];
     [frame startLoading];
@@ -106,7 +114,7 @@
 
 - (void)loadURL:(NSURL *)URL
 {
-    [self loadURL:URL attributes:nil flags:0 inFrame:[self frame] withParent:[self parent]];
+    [self loadURL:URL attributes:nil flags:0 inFrame:[self frame] withParent:[self parentFrame]];
 }
 
 - (void)postWithURL:(NSURL *)URL data:(NSData *)data
@@ -119,17 +127,17 @@
         data, IFHTTPURLHandleRequestData,
         @"POST", IFHTTPURLHandleRequestMethod,
         nil];
-    [self loadURL:URL attributes:attributes flags:IFURLHandleFlagLoadFromOrigin inFrame:[self frame] withParent:[self parent]];
+    [self loadURL:URL attributes:attributes flags:IFURLHandleFlagLoadFromOrigin inFrame:[self frame] withParent:[self parentFrame]];
     [attributes release];
 }
 
-- (BOOL)createNewFrameNamed:(NSString *)frameName
+- (BOOL)createChildFrameNamed:(NSString *)frameName
     withURL:(NSURL *)URL renderPart:(khtml::RenderPart *)renderPart
     allowsScrolling:(BOOL)allowsScrolling marginWidth:(int)width marginHeight:(int)height
 {
     WEBKIT_ASSERT(dataSource);
 
-    IFWebFrame *frame = [[self controller] createFrameNamed:frameName for:nil inParent:dataSource allowsScrolling:allowsScrolling];
+    IFWebFrame *frame = [[dataSource controller] createFrameNamed:frameName for:nil inParent:dataSource allowsScrolling:allowsScrolling];
     if (frame == nil) {
         return NO;
     }
@@ -146,7 +154,7 @@
 
 - (void)openNewWindowWithURL:(NSURL *)url
 {
-    [[self controller] openNewWindowWithURL:url];
+    [[dataSource controller] openNewWindowWithURL:url];
 }
 
 - (void)setTitle:(NSString *)title
@@ -157,12 +165,12 @@
 
 - (WebCoreBridge *)mainFrame
 {
-    return [[[self controller] mainFrame] _bridge];
+    return [[[dataSource controller] mainFrame] _bridge];
 }
 
 - (WebCoreBridge *)frameNamed:(NSString *)name
 {
-    return [[[self controller] frameNamed:name] _bridge];
+    return [[[dataSource controller] frameNamed:name] _bridge];
 }
 
 - (KHTMLView *)widget
@@ -178,7 +186,7 @@
 - (void)receivedData:(NSData *)data withDataSource:(IFWebDataSource *)withDataSource
 {
     if (dataSource == nil) {
-        dataSource = withDataSource;
+        dataSource = [withDataSource retain];
         [self openURL:[dataSource inputURL]];
     } else {
         WEBKIT_ASSERT(dataSource == withDataSource);
@@ -201,14 +209,14 @@
 
 - (void)didStartLoadingWithHandle:(IFURLHandle *)handle
 {
-    [[self controller] _didStartLoading:[handle url]];
+    [[dataSource controller] _didStartLoading:[handle url]];
     [self receivedProgressWithHandle:handle];
 }
 
 - (void)receivedProgressWithHandle:(IFURLHandle *)handle
 {
     WEBKIT_ASSERT(dataSource);
-    [[self controller] _receivedProgress:[IFLoadProgress progressWithURLHandle:handle]
+    [[dataSource controller] _receivedProgress:[IFLoadProgress progressWithURLHandle:handle]
         forResourceHandle:handle fromDataSource:dataSource];
 }
 
@@ -217,34 +225,34 @@
     [self receivedProgressWithHandle:handle];
 
     IFError *nonTerminalError = [handle error];
-    if (nonTerminalError){
+    if (nonTerminalError) {
         [self didFailToLoadWithHandle:handle error:nonTerminalError];
+    } else {
+        [[dataSource controller] _didStopLoading:[handle url]];
     }
-
-    [[self controller] _didStopLoading:[handle url]];
 }
 
 - (void)didCancelLoadingWithHandle:(IFURLHandle *)handle
 {
     WEBKIT_ASSERT(dataSource);
-    [[self controller] _receivedProgress:[IFLoadProgress progress]
+    [[dataSource controller] _receivedProgress:[IFLoadProgress progress]
         forResourceHandle:handle fromDataSource:dataSource];
-    [[self controller] _didStopLoading:[handle url]];
+    [[dataSource controller] _didStopLoading:[handle url]];
 }
 
 - (void)didFailBeforeLoadingWithError:(IFError *)error
 {
     WEBKIT_ASSERT(dataSource);
-    [[self controller] _receivedError:error forResourceHandle:nil
+    [[dataSource controller] _receivedError:error forResourceHandle:nil
         partialProgress:nil fromDataSource:dataSource];
 }
 
 - (void)didFailToLoadWithHandle:(IFURLHandle *)handle error:(IFError *)error
 {
     WEBKIT_ASSERT(dataSource);
-    [[self controller] _receivedError:error forResourceHandle:handle
+    [[dataSource controller] _receivedError:error forResourceHandle:handle
         partialProgress:[IFLoadProgress progressWithURLHandle:handle] fromDataSource:dataSource];
-    [[self controller] _didStopLoading:[handle url]];
+    [[dataSource controller] _didStopLoading:[handle url]];
 }
 
 - (void)didRedirectWithHandle:(IFURLHandle *)handle fromURL:(NSURL *)fromURL
@@ -253,14 +261,21 @@
 
     NSURL *toURL = [handle redirectedURL];
     
-    [[self controller] _didStopLoading:fromURL];
+    [[dataSource controller] _didStopLoading:fromURL];
 
     [dataSource _setFinalURL:toURL];
     [self setURL:toURL];
 
     //[[dataSource _locationChangeHandler] serverRedirectTo:toURL forDataSource:dataSource];
     
-    [[self controller] _didStartLoading:toURL];
+    [[dataSource controller] _didStartLoading:toURL];
+}
+
+- (void)startLoadingResource:(id <WebCoreResourceLoader>)resourceLoader withURL:(NSURL *)URL
+{
+#ifdef RESOURCE_URL_CLIENT_READY
+    [IFResourceURLHandleClient startLoadingResource:resourceLoader withURL:URL dataSource:dataSource];
+#endif
 }
 
 @end
diff --git a/WebKit/WebCoreSupport.subproj/WebBridge.m b/WebKit/WebCoreSupport.subproj/WebBridge.m
index 1b1bfde..668ef34 100644
--- a/WebKit/WebCoreSupport.subproj/WebBridge.m
+++ b/WebKit/WebCoreSupport.subproj/WebBridge.m
@@ -5,14 +5,14 @@
 
 #import <WebKit/IFWebCoreBridge.h>
 
+#import <WebKit/IFHTMLRepresentation.h>
+#import <WebKit/IFHTMLViewPrivate.h>
+#import <WebKit/IFLoadProgress.h>
+//#import <WebKit/IFResourceURLHandleClient.h>
 #import <WebKit/IFWebControllerPrivate.h>
-#import <WebKit/IFWebFramePrivate.h>
 #import <WebKit/IFWebDataSourcePrivate.h>
 #import <WebKit/IFWebFramePrivate.h>
 #import <WebKit/IFWebViewPrivate.h>
-#import <WebKit/IFHTMLRepresentation.h>
-#import <WebKit/IFHTMLViewPrivate.h>
-#import <WebKit/IFLoadProgress.h>
 #import <WebFoundation/IFURLCacheLoaderConstants.h>
 #import <WebFoundation/IFURLHandle.h>
 
@@ -36,27 +36,29 @@
 
 - (IFWebCoreBridge *)_bridge
 {
-    IFWebCoreBridge *aBridge;
+    IFWebCoreBridge *bridge;
     
-    aBridge = [[self dataSource] _bridge];
-    if (!aBridge)
-        aBridge = [[self provisionalDataSource] _bridge];
-    return aBridge;
+    bridge = [[self provisionalDataSource] _bridge];
+    if (!bridge)
+        bridge = [[self dataSource] _bridge];
+    return bridge;
 }
 
 @end
 
 @implementation IFWebCoreBridge
 
-- (IFWebFrame *)frame
+- (void)dealloc
 {
-    WEBKIT_ASSERT(dataSource);
-    return [dataSource webFrame];
+    [dataSource release];
+    
+    [super dealloc];
 }
 
-- (IFWebController *)controller
+- (IFWebFrame *)frame
 {
-    return [[self frame] controller];
+    WEBKIT_ASSERT(dataSource);
+    return [dataSource webFrame];
 }
 
 - (IFWebView *)view
@@ -69,36 +71,42 @@
     return [[self view] documentView];
 }
 
-- (WebCoreBridge *)parent
+- (WebCoreBridge *)parentFrame
 {
     WEBKIT_ASSERT(dataSource);
     return [[dataSource parent] _bridge];
 }
 
-- (NSArray *)children
+- (NSArray *)childFrames
 {
     WEBKIT_ASSERT(dataSource);
     NSArray *frames = [dataSource children];
     NSEnumerator *e = [frames objectEnumerator];
-    NSMutableArray *children = [NSMutableArray arrayWithCapacity:[frames count]];
+    NSMutableArray *bridges = [NSMutableArray arrayWithCapacity:[frames count]];
     IFWebFrame *frame;
     while ((frame = [e nextObject])) {
         IFWebCoreBridge *bridge = [frame _bridge];
         if (bridge)
-            [children addObject:bridge];
+            [bridges addObject:bridge];
     }
-    return children;
+    return bridges;
+}
+
+- (WebCoreBridge *)childFrameNamed:(NSString *)name
+{
+    return [[dataSource frameNamed:name] _bridge];
+}
+
+- (WebCoreBridge *)descendantFrameNamed:(NSString *)name
+{
+    return [[[self frame] frameNamed:name] _bridge];
 }
 
 - (void)loadURL:(NSURL *)URL attributes:(NSDictionary *)attributes flags:(unsigned)flags inFrame:(IFWebFrame *)frame withParent:(WebCoreBridge *)parent
 {
     IFWebDataSource *newDataSource = [[IFWebDataSource alloc] initWithURL:URL attributes:attributes flags:flags];
     IFWebCoreBridge *parentPrivate = (IFWebCoreBridge *)parent;
-    // Might be loading top frame.  Parent may be nil.
-    if (parentPrivate)
-        [newDataSource _setParent:parentPrivate->dataSource];
-    else
-        [newDataSource _setParent:nil];
+    [newDataSource _setParent:parent ? parentPrivate->dataSource : nil];
     [frame setProvisionalDataSource:newDataSource];
     [newDataSource release];
     [frame startLoading];
@@ -106,7 +114,7 @@
 
 - (void)loadURL:(NSURL *)URL
 {
-    [self loadURL:URL attributes:nil flags:0 inFrame:[self frame] withParent:[self parent]];
+    [self loadURL:URL attributes:nil flags:0 inFrame:[self frame] withParent:[self parentFrame]];
 }
 
 - (void)postWithURL:(NSURL *)URL data:(NSData *)data
@@ -119,17 +127,17 @@
         data, IFHTTPURLHandleRequestData,
         @"POST", IFHTTPURLHandleRequestMethod,
         nil];
-    [self loadURL:URL attributes:attributes flags:IFURLHandleFlagLoadFromOrigin inFrame:[self frame] withParent:[self parent]];
+    [self loadURL:URL attributes:attributes flags:IFURLHandleFlagLoadFromOrigin inFrame:[self frame] withParent:[self parentFrame]];
     [attributes release];
 }
 
-- (BOOL)createNewFrameNamed:(NSString *)frameName
+- (BOOL)createChildFrameNamed:(NSString *)frameName
     withURL:(NSURL *)URL renderPart:(khtml::RenderPart *)renderPart
     allowsScrolling:(BOOL)allowsScrolling marginWidth:(int)width marginHeight:(int)height
 {
     WEBKIT_ASSERT(dataSource);
 
-    IFWebFrame *frame = [[self controller] createFrameNamed:frameName for:nil inParent:dataSource allowsScrolling:allowsScrolling];
+    IFWebFrame *frame = [[dataSource controller] createFrameNamed:frameName for:nil inParent:dataSource allowsScrolling:allowsScrolling];
     if (frame == nil) {
         return NO;
     }
@@ -146,7 +154,7 @@
 
 - (void)openNewWindowWithURL:(NSURL *)url
 {
-    [[self controller] openNewWindowWithURL:url];
+    [[dataSource controller] openNewWindowWithURL:url];
 }
 
 - (void)setTitle:(NSString *)title
@@ -157,12 +165,12 @@
 
 - (WebCoreBridge *)mainFrame
 {
-    return [[[self controller] mainFrame] _bridge];
+    return [[[dataSource controller] mainFrame] _bridge];
 }
 
 - (WebCoreBridge *)frameNamed:(NSString *)name
 {
-    return [[[self controller] frameNamed:name] _bridge];
+    return [[[dataSource controller] frameNamed:name] _bridge];
 }
 
 - (KHTMLView *)widget
@@ -178,7 +186,7 @@
 - (void)receivedData:(NSData *)data withDataSource:(IFWebDataSource *)withDataSource
 {
     if (dataSource == nil) {
-        dataSource = withDataSource;
+        dataSource = [withDataSource retain];
         [self openURL:[dataSource inputURL]];
     } else {
         WEBKIT_ASSERT(dataSource == withDataSource);
@@ -201,14 +209,14 @@
 
 - (void)didStartLoadingWithHandle:(IFURLHandle *)handle
 {
-    [[self controller] _didStartLoading:[handle url]];
+    [[dataSource controller] _didStartLoading:[handle url]];
     [self receivedProgressWithHandle:handle];
 }
 
 - (void)receivedProgressWithHandle:(IFURLHandle *)handle
 {
     WEBKIT_ASSERT(dataSource);
-    [[self controller] _receivedProgress:[IFLoadProgress progressWithURLHandle:handle]
+    [[dataSource controller] _receivedProgress:[IFLoadProgress progressWithURLHandle:handle]
         forResourceHandle:handle fromDataSource:dataSource];
 }
 
@@ -217,34 +225,34 @@
     [self receivedProgressWithHandle:handle];
 
     IFError *nonTerminalError = [handle error];
-    if (nonTerminalError){
+    if (nonTerminalError) {
         [self didFailToLoadWithHandle:handle error:nonTerminalError];
+    } else {
+        [[dataSource controller] _didStopLoading:[handle url]];
     }
-
-    [[self controller] _didStopLoading:[handle url]];
 }
 
 - (void)didCancelLoadingWithHandle:(IFURLHandle *)handle
 {
     WEBKIT_ASSERT(dataSource);
-    [[self controller] _receivedProgress:[IFLoadProgress progress]
+    [[dataSource controller] _receivedProgress:[IFLoadProgress progress]
         forResourceHandle:handle fromDataSource:dataSource];
-    [[self controller] _didStopLoading:[handle url]];
+    [[dataSource controller] _didStopLoading:[handle url]];
 }
 
 - (void)didFailBeforeLoadingWithError:(IFError *)error
 {
     WEBKIT_ASSERT(dataSource);
-    [[self controller] _receivedError:error forResourceHandle:nil
+    [[dataSource controller] _receivedError:error forResourceHandle:nil
         partialProgress:nil fromDataSource:dataSource];
 }
 
 - (void)didFailToLoadWithHandle:(IFURLHandle *)handle error:(IFError *)error
 {
     WEBKIT_ASSERT(dataSource);
-    [[self controller] _receivedError:error forResourceHandle:handle
+    [[dataSource controller] _receivedError:error forResourceHandle:handle
         partialProgress:[IFLoadProgress progressWithURLHandle:handle] fromDataSource:dataSource];
-    [[self controller] _didStopLoading:[handle url]];
+    [[dataSource controller] _didStopLoading:[handle url]];
 }
 
 - (void)didRedirectWithHandle:(IFURLHandle *)handle fromURL:(NSURL *)fromURL
@@ -253,14 +261,21 @@
 
     NSURL *toURL = [handle redirectedURL];
     
-    [[self controller] _didStopLoading:fromURL];
+    [[dataSource controller] _didStopLoading:fromURL];
 
     [dataSource _setFinalURL:toURL];
     [self setURL:toURL];
 
     //[[dataSource _locationChangeHandler] serverRedirectTo:toURL forDataSource:dataSource];
     
-    [[self controller] _didStartLoading:toURL];
+    [[dataSource controller] _didStartLoading:toURL];
+}
+
+- (void)startLoadingResource:(id <WebCoreResourceLoader>)resourceLoader withURL:(NSURL *)URL
+{
+#ifdef RESOURCE_URL_CLIENT_READY
+    [IFResourceURLHandleClient startLoadingResource:resourceLoader withURL:URL dataSource:dataSource];
+#endif
 }
 
 @end

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list