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

cblu cblu at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 06:54:32 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit 20be1bdc8bcd33c34a443a55f63c70971540282e
Author: cblu <cblu at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Fri Oct 25 23:41:51 2002 +0000

    WebCore:
    
    	Cleaned up the frame searching shenanigans. Things are much cleaner and clearer now.
    
            * kwq/KWQKHTMLPartBrowserExtension.mm:
            (KHTMLPartBrowserExtension::createNewWindow): call findFrameNamed
            * kwq/KWQKHTMLPartImpl.mm:
            (KWQKHTMLPartImpl::bridgeForFrameName): call findOrCreateFramedNamed
            * kwq/WebCoreBridge.h:
    
    WebKit:
    
    	Cleaned up the frame searching shenanigans. Things are much cleaner and clearer now.
    
            * Plugins.subproj/WebBaseNetscapePluginView.m:
            (-[WebBaseNetscapePluginView loadRequest:inTarget:withNotifyData:]): call findOrCreateFramedNamed
            * Plugins.subproj/WebPluginController.m:
            (-[WebPluginController showURL:inFrame:]): call findOrCreateFramedNamed
            * WebCoreSupport.subproj/WebBridge.m:
            (-[WebBridge childFrames]): moved
            (-[WebBridge mainFrame]): moved
            (-[WebBridge findOrCreateFramedNamed:]): call findOrCreateFramedNamed on the frame
            (-[WebBridge pluginViewWithPackage:attributes:baseURL:]): call _pluginController
            * WebView.subproj/WebControllerPrivate.m:
            (-[WebController _frameInThisWindowNamed:]): call _descendantFrameNamed
            * WebView.subproj/WebFrame.h:
            * WebView.subproj/WebFrame.m:
            (-[WebFrame findFrameNamed:]): was frameNamed. First checks special-case frame names, descendant frames, then the whole controller, then other controllers.
            (-[WebFrame findOrCreateFramedNamed:]): calls findFrameNamed, opens new window if necessary
            * WebView.subproj/WebFramePrivate.h:
            * WebView.subproj/WebFramePrivate.m:
            (-[WebFrame _descendantFrameNamed:]): searches children, children's children etc.
            (-[WebFrame _pluginController]): this method needed an "_"
            * WebView.subproj/WebHTMLView.m:
            (-[WebHTMLView addSubview:]): call _pluginController
            * WebView.subproj/WebHTMLViewPrivate.m:
            (-[WebHTMLView _elementAtPoint:]): no need to special case for "_blank" since findFrameNamed will return nil for that name
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@2469 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog-2002-12-03 b/WebCore/ChangeLog-2002-12-03
index 68bdaee..f1f02f6 100644
--- a/WebCore/ChangeLog-2002-12-03
+++ b/WebCore/ChangeLog-2002-12-03
@@ -1,3 +1,13 @@
+2002-10-25  Chris Blumenberg  <cblu at apple.com>
+
+	Cleaned up the frame searching shenanigans. Things are much cleaner and clearer now.
+
+        * kwq/KWQKHTMLPartBrowserExtension.mm:
+        (KHTMLPartBrowserExtension::createNewWindow): call findFrameNamed
+        * kwq/KWQKHTMLPartImpl.mm:
+        (KWQKHTMLPartImpl::bridgeForFrameName): call findOrCreateFramedNamed
+        * kwq/WebCoreBridge.h:
+
 2002-10-25  Maciej Stachowiak  <mjs at apple.com>
 
 	- fixed 3065638 - "undefined" output to screen on empty document.write()
diff --git a/WebCore/ChangeLog-2003-10-25 b/WebCore/ChangeLog-2003-10-25
index 68bdaee..f1f02f6 100644
--- a/WebCore/ChangeLog-2003-10-25
+++ b/WebCore/ChangeLog-2003-10-25
@@ -1,3 +1,13 @@
+2002-10-25  Chris Blumenberg  <cblu at apple.com>
+
+	Cleaned up the frame searching shenanigans. Things are much cleaner and clearer now.
+
+        * kwq/KWQKHTMLPartBrowserExtension.mm:
+        (KHTMLPartBrowserExtension::createNewWindow): call findFrameNamed
+        * kwq/KWQKHTMLPartImpl.mm:
+        (KWQKHTMLPartImpl::bridgeForFrameName): call findOrCreateFramedNamed
+        * kwq/WebCoreBridge.h:
+
 2002-10-25  Maciej Stachowiak  <mjs at apple.com>
 
 	- fixed 3065638 - "undefined" output to screen on empty document.write()
diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index 68bdaee..f1f02f6 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,3 +1,13 @@
+2002-10-25  Chris Blumenberg  <cblu at apple.com>
+
+	Cleaned up the frame searching shenanigans. Things are much cleaner and clearer now.
+
+        * kwq/KWQKHTMLPartBrowserExtension.mm:
+        (KHTMLPartBrowserExtension::createNewWindow): call findFrameNamed
+        * kwq/KWQKHTMLPartImpl.mm:
+        (KWQKHTMLPartImpl::bridgeForFrameName): call findOrCreateFramedNamed
+        * kwq/WebCoreBridge.h:
+
 2002-10-25  Maciej Stachowiak  <mjs at apple.com>
 
 	- fixed 3065638 - "undefined" output to screen on empty document.write()
diff --git a/WebCore/kwq/KWQKHTMLPart.mm b/WebCore/kwq/KWQKHTMLPart.mm
index 78c7fcf..20d6840 100644
--- a/WebCore/kwq/KWQKHTMLPart.mm
+++ b/WebCore/kwq/KWQKHTMLPart.mm
@@ -112,14 +112,7 @@ WebCoreBridge *KWQKHTMLPartImpl::bridgeForFrameName(const QString &frameName)
             frame = _bridge;
         }
     } else {
-        frame = [_bridge descendantFrameNamed:frameName.getNSString()];
-	if (frame == nil) {
-	    frame = [_bridge frameNamed:frameName.getNSString()];
-	}
-        if (frame == nil) {
-	    frame = [_bridge createWindowWithURL:nil frameName:frameName.getNSString()];
-            [frame showWindow];
-        }
+        frame = [_bridge findOrCreateFramedNamed:frameName.getNSString()];
     }
     
     return frame;
diff --git a/WebCore/kwq/KWQKHTMLPartBrowserExtension.mm b/WebCore/kwq/KWQKHTMLPartBrowserExtension.mm
index 4a42d2b..83d91fd 100644
--- a/WebCore/kwq/KWQKHTMLPartBrowserExtension.mm
+++ b/WebCore/kwq/KWQKHTMLPartBrowserExtension.mm
@@ -66,7 +66,7 @@ void KHTMLPartBrowserExtension::createNewWindow(const KURL &url,
     WebCoreBridge *bridge;
 
     if (frameName != nil) {
-	bridge = [m_part->impl->bridge() frameNamed:frameName];
+	bridge = [m_part->impl->bridge() findFramedNamed:frameName];
 	if (bridge != nil) {
 	    if (!url.isEmpty()) {
 		[bridge openURL:url.getNSURL()];
diff --git a/WebCore/kwq/KWQKHTMLPartImpl.mm b/WebCore/kwq/KWQKHTMLPartImpl.mm
index 78c7fcf..20d6840 100644
--- a/WebCore/kwq/KWQKHTMLPartImpl.mm
+++ b/WebCore/kwq/KWQKHTMLPartImpl.mm
@@ -112,14 +112,7 @@ WebCoreBridge *KWQKHTMLPartImpl::bridgeForFrameName(const QString &frameName)
             frame = _bridge;
         }
     } else {
-        frame = [_bridge descendantFrameNamed:frameName.getNSString()];
-	if (frame == nil) {
-	    frame = [_bridge frameNamed:frameName.getNSString()];
-	}
-        if (frame == nil) {
-	    frame = [_bridge createWindowWithURL:nil frameName:frameName.getNSString()];
-            [frame showWindow];
-        }
+        frame = [_bridge findOrCreateFramedNamed:frameName.getNSString()];
     }
     
     return frame;
diff --git a/WebCore/kwq/WebCoreBridge.h b/WebCore/kwq/WebCoreBridge.h
index aea843e..a06a40f 100644
--- a/WebCore/kwq/WebCoreBridge.h
+++ b/WebCore/kwq/WebCoreBridge.h
@@ -170,10 +170,9 @@ enum FrameBorderStyle {
 @protocol WebCoreBridge
 
 - (NSArray *)childFrames; // WebCoreBridge objects
-- (WebCoreBridge *)descendantFrameNamed:(NSString *)name;
-
 - (WebCoreBridge *)mainFrame;
-- (WebCoreBridge *)frameNamed:(NSString *)name; // searches entire hierarchy starting with mainFrame
+- (WebCoreBridge *)findFramedNamed:(NSString *)name;
+- (WebCoreBridge *)findOrCreateFramedNamed:(NSString *)name;
 
 - (void)loadURL:(NSURL *)URL;
 - (void)postWithURL:(NSURL *)URL data:(NSData *)data contentType:(NSString *)contentType;
diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog
index c6b2894..43389b2 100644
--- a/WebKit/ChangeLog
+++ b/WebKit/ChangeLog
@@ -1,3 +1,31 @@
+2002-10-25  Chris Blumenberg  <cblu at apple.com>
+
+	Cleaned up the frame searching shenanigans. Things are much cleaner and clearer now.
+
+        * Plugins.subproj/WebBaseNetscapePluginView.m:
+        (-[WebBaseNetscapePluginView loadRequest:inTarget:withNotifyData:]): call findOrCreateFramedNamed
+        * Plugins.subproj/WebPluginController.m:
+        (-[WebPluginController showURL:inFrame:]): call findOrCreateFramedNamed
+        * WebCoreSupport.subproj/WebBridge.m:
+        (-[WebBridge childFrames]): moved
+        (-[WebBridge mainFrame]): moved
+        (-[WebBridge findOrCreateFramedNamed:]): call findOrCreateFramedNamed on the frame
+        (-[WebBridge pluginViewWithPackage:attributes:baseURL:]): call _pluginController
+        * WebView.subproj/WebControllerPrivate.m:
+        (-[WebController _frameInThisWindowNamed:]): call _descendantFrameNamed
+        * WebView.subproj/WebFrame.h:
+        * WebView.subproj/WebFrame.m:
+        (-[WebFrame findFrameNamed:]): was frameNamed. First checks special-case frame names, descendant frames, then the whole controller, then other controllers.
+        (-[WebFrame findOrCreateFramedNamed:]): calls findFrameNamed, opens new window if necessary 
+        * WebView.subproj/WebFramePrivate.h:
+        * WebView.subproj/WebFramePrivate.m:
+        (-[WebFrame _descendantFrameNamed:]): searches children, children's children etc.
+        (-[WebFrame _pluginController]): this method needed an "_"
+        * WebView.subproj/WebHTMLView.m:
+        (-[WebHTMLView addSubview:]): call _pluginController
+        * WebView.subproj/WebHTMLViewPrivate.m:
+        (-[WebHTMLView _elementAtPoint:]): no need to special case for "_blank" since findFrameNamed will return nil for that name
+
 2002-10-25  Trey Matteson  <trey at apple.com>
 	
 	2919039 - Implement limit on back/forward history list
diff --git a/WebKit/ChangeLog-2002-12-03 b/WebKit/ChangeLog-2002-12-03
index c6b2894..43389b2 100644
--- a/WebKit/ChangeLog-2002-12-03
+++ b/WebKit/ChangeLog-2002-12-03
@@ -1,3 +1,31 @@
+2002-10-25  Chris Blumenberg  <cblu at apple.com>
+
+	Cleaned up the frame searching shenanigans. Things are much cleaner and clearer now.
+
+        * Plugins.subproj/WebBaseNetscapePluginView.m:
+        (-[WebBaseNetscapePluginView loadRequest:inTarget:withNotifyData:]): call findOrCreateFramedNamed
+        * Plugins.subproj/WebPluginController.m:
+        (-[WebPluginController showURL:inFrame:]): call findOrCreateFramedNamed
+        * WebCoreSupport.subproj/WebBridge.m:
+        (-[WebBridge childFrames]): moved
+        (-[WebBridge mainFrame]): moved
+        (-[WebBridge findOrCreateFramedNamed:]): call findOrCreateFramedNamed on the frame
+        (-[WebBridge pluginViewWithPackage:attributes:baseURL:]): call _pluginController
+        * WebView.subproj/WebControllerPrivate.m:
+        (-[WebController _frameInThisWindowNamed:]): call _descendantFrameNamed
+        * WebView.subproj/WebFrame.h:
+        * WebView.subproj/WebFrame.m:
+        (-[WebFrame findFrameNamed:]): was frameNamed. First checks special-case frame names, descendant frames, then the whole controller, then other controllers.
+        (-[WebFrame findOrCreateFramedNamed:]): calls findFrameNamed, opens new window if necessary 
+        * WebView.subproj/WebFramePrivate.h:
+        * WebView.subproj/WebFramePrivate.m:
+        (-[WebFrame _descendantFrameNamed:]): searches children, children's children etc.
+        (-[WebFrame _pluginController]): this method needed an "_"
+        * WebView.subproj/WebHTMLView.m:
+        (-[WebHTMLView addSubview:]): call _pluginController
+        * WebView.subproj/WebHTMLViewPrivate.m:
+        (-[WebHTMLView _elementAtPoint:]): no need to special case for "_blank" since findFrameNamed will return nil for that name
+
 2002-10-25  Trey Matteson  <trey at apple.com>
 	
 	2919039 - Implement limit on back/forward history list
diff --git a/WebKit/Plugins.subproj/WebBaseNetscapePluginView.m b/WebKit/Plugins.subproj/WebBaseNetscapePluginView.m
index 54b5f7b..907d99b 100644
--- a/WebKit/Plugins.subproj/WebBaseNetscapePluginView.m
+++ b/WebKit/Plugins.subproj/WebBaseNetscapePluginView.m
@@ -791,35 +791,26 @@
             return NPERR_INVALID_URL;
         }
     }else{
-        WebFrame *frame = [[self webFrame] frameNamed:target];
-        if(!frame){
-            // FIXME: Why is it OK to just discard all the attributes in this case?
-            // FIXME: Do we need a referrer here?
-            [[self controller] _openNewWindowWithURL:URL referrer:nil behind:NO];
-            // FIXME: Need to send NPP_URLNotify at the right time.
-            // FIXME: Need to name new frame
-            if(notifyData){
-                NPP_URLNotify(instance, [[URL absoluteString] cString], NPRES_DONE, notifyData);
-            }
-        }else{
-            if(notifyData){
-                if(![target isEqualToString:@"_self"] && ![target isEqualToString:@"_current"] && 
-                    ![target isEqualToString:@"_parent"] && ![target isEqualToString:@"_top"]){
-    
-                    [notificationData setObject:[NSValue valueWithPointer:notifyData] forKey:URL];
-                    [[NSNotificationCenter defaultCenter] addObserver:self 
-                        selector:@selector(frameStateChanged:) name:WebFrameStateChangedNotification object:frame];
-                }
-                // Plug-in docs say to return NPERR_INVALID_PARAM here
-                // but IE allows an NPP_*URLNotify when the target is _self, _current, _parent or _top
-                // so we have to allow this as well. Needed for iTools.
-            }
-            WebDataSource *dataSource = [[WebDataSource alloc] initWithRequest:request];
-            if ([frame setProvisionalDataSource:dataSource]) {
-                [frame startLoading];
+        WebFrame *frame = [[self webFrame] findOrCreateFramedNamed:target];
+
+        if(notifyData){
+            if(![target isEqualToString:@"_self"] && ![target isEqualToString:@"_current"] && 
+                ![target isEqualToString:@"_parent"] && ![target isEqualToString:@"_top"]){
+
+                [notificationData setObject:[NSValue valueWithPointer:notifyData] forKey:URL];
+                [[NSNotificationCenter defaultCenter] addObserver:self 
+                    selector:@selector(frameStateChanged:) name:WebFrameStateChangedNotification object:frame];
             }
-            [dataSource release];
+            // Plug-in docs say to return NPERR_INVALID_PARAM here
+            // but IE allows an NPP_*URLNotify when the target is _self, _current, _parent or _top
+            // so we have to allow this as well. Needed for iTools.
+        }
+        
+        WebDataSource *dataSource = [[WebDataSource alloc] initWithRequest:request];
+        if ([frame setProvisionalDataSource:dataSource]) {
+            [frame startLoading];
         }
+        [dataSource release];
     }
     
     return NPERR_NO_ERROR;
diff --git a/WebKit/Plugins.subproj/WebPluginController.m b/WebKit/Plugins.subproj/WebPluginController.m
index fdc09e2..68fa807 100644
--- a/WebKit/Plugins.subproj/WebPluginController.m
+++ b/WebKit/Plugins.subproj/WebPluginController.m
@@ -97,11 +97,7 @@
         return;
     }
 
-    WebFrame *otherFrame = [frame frameNamed:target];
-    if(!otherFrame){
-        // FIXME: Open new window instead of return.
-        return;
-    }
+    WebFrame *otherFrame = [frame findOrCreateFramedNamed:target];
 
     WebDataSource *dataSource = [[WebDataSource alloc] initWithRequest:[WebResourceRequest requestWithURL:URL]];
     if(!dataSource){
diff --git a/WebKit/WebCoreSupport.subproj/WebBridge.m b/WebKit/WebCoreSupport.subproj/WebBridge.m
index 86168c3..a70a5c2 100644
--- a/WebKit/WebCoreSupport.subproj/WebBridge.m
+++ b/WebKit/WebCoreSupport.subproj/WebBridge.m
@@ -62,6 +62,7 @@
 
 - (NSArray *)childFrames
 {
+    ASSERT(frame != nil);
     NSArray *frames = [frame children];
     NSEnumerator *e = [frames objectEnumerator];
     NSMutableArray *frameBridges = [NSMutableArray arrayWithCapacity:[frames count]];
@@ -74,10 +75,22 @@
     return frameBridges;
 }
 
-- (WebCoreBridge *)descendantFrameNamed:(NSString *)name
+- (WebCoreBridge *)mainFrame
+{
+    ASSERT(frame != nil);
+    return [[[frame controller] mainFrame] _bridge];
+}
+
+- (WebCoreBridge *)findFramedNamed:(NSString *)name;
+{
+    ASSERT(frame != nil);
+    return [[frame findFrameNamed:name] _bridge];
+}
+
+- (WebCoreBridge *)findOrCreateFramedNamed:(NSString *)name
 {
     ASSERT(frame != nil);
-    return [[frame frameNamed:name] _bridge];
+    return [[frame findOrCreateFramedNamed:name] _bridge];
 }
 
 - (WebCoreBridge *)createWindowWithURL:(NSURL *)URL frameName:(NSString *)name
@@ -153,18 +166,6 @@
     [[[frame controller] windowOperationsDelegate] setStatusText:status];
 }
 
-- (WebCoreBridge *)mainFrame
-{
-    ASSERT(frame != nil);
-    return [[[frame controller] mainFrame] _bridge];
-}
-
-- (WebCoreBridge *)frameNamed:(NSString *)name
-{
-    ASSERT(frame != nil);
-    return [[[frame controller] frameNamed:name] _bridge];
-}
-
 - (void)receivedData:(NSData *)data withDataSource:(WebDataSource *)withDataSource
 {
     ASSERT([self dataSource] == withDataSource);
@@ -429,7 +430,7 @@
                                    attributes:(NSDictionary *)attributes
                                       baseURL:(NSURL *)baseURL
 {
-    WebPluginController *pluginController = [frame pluginController];
+    WebPluginController *pluginController = [frame _pluginController];
     
     NSDictionary *arguments = [NSDictionary dictionaryWithObjectsAndKeys:
         baseURL, WebPluginBaseURLKey,
diff --git a/WebKit/WebView.subproj/WebControllerPrivate.m b/WebKit/WebView.subproj/WebControllerPrivate.m
index d03fd7e..3903f23 100644
--- a/WebKit/WebView.subproj/WebControllerPrivate.m
+++ b/WebKit/WebView.subproj/WebControllerPrivate.m
@@ -224,7 +224,7 @@
     if ([_private->topLevelFrameName isEqualToString:name]) {
 	return [self mainFrame];
     } else {
-	return [[self mainFrame] frameNamed:name];
+	return [[self mainFrame] _descendantFrameNamed:name];
     }
 }
 
diff --git a/WebKit/WebView.subproj/WebFrame.h b/WebKit/WebView.subproj/WebFrame.h
index 14f7472..97d76cd 100644
--- a/WebKit/WebView.subproj/WebFrame.h
+++ b/WebKit/WebView.subproj/WebFrame.h
@@ -119,15 +119,26 @@
 - (void)reload;
 
 /*!
-    @method frameNamed:
-    @discussion This method returns a frame with the given name. frameNamed returns self 
+    @method findFrameNamed:
+    @discussion This method returns a frame with the given name. findFrameNamed returns self 
     for _self and _current, the parent frame for _parent and the main frame for _top. 
-    frameNamed returns self for _parent and _top if the receiver it is the mainFrame. 
-    nil is returned if a frame with the given name is not found.
+    findFrameNamed returns self for _parent and _top if the receiver it is the mainFrame.
+    findFrameNamed first searches from the current frame to all descending frames then the
+    rest of the frames in the controller. If still not found, findFrameNamed searches the
+    frames of the other controllers.
     @param name The name of the frame to find.
-    @result The frame matching the provided name.
+    @result The frame matching the provided name. nil if the frame is not found.
 */
-- (WebFrame *)frameNamed:(NSString *)name;
+- (WebFrame *)findFrameNamed:(NSString *)name;
+
+/*!
+     @method findOrCreateFramedNamed:
+     @discussion This method calls findFrameNamed but if no frame is found, a new window is opened
+     and the main frame of the new window is named with the given name.
+     @param name The name of the frame to find.
+     @result The frame matching the provided name. Won't be nil.
+*/
+- (WebFrame *)findOrCreateFramedNamed:(NSString *)name;
 
 /*!
     @method parent
@@ -142,4 +153,5 @@
 */
 - (NSArray *)children;
 
+
 @end
diff --git a/WebKit/WebView.subproj/WebFrame.m b/WebKit/WebView.subproj/WebFrame.m
index 642dc27..5670ef8 100644
--- a/WebKit/WebView.subproj/WebFrame.m
+++ b/WebKit/WebView.subproj/WebFrame.m
@@ -199,33 +199,7 @@
     [newDataSource release];
 }
 
-
-+ _frameNamed:(NSString *)name fromFrame: (WebFrame *)aFrame
-{
-    int i, count;
-    WebFrame *foundFrame;
-    NSArray *children;
-
-    if ([[aFrame name] isEqualToString: name])
-        return aFrame;
-
-    children = [aFrame children];
-    count = [children count];
-    for (i = 0; i < count; i++){
-        aFrame = [children objectAtIndex: i];
-        foundFrame = [WebFrame _frameNamed: name fromFrame: aFrame];
-        if (foundFrame)
-            return foundFrame;
-    }
-    
-    // FIXME:  Need to look in other controller's frame namespaces.
-
-    // FIXME:  What do we do if a frame name isn't found?  create a new window
-    
-    return nil;
-}
-
-- (WebFrame *)frameNamed:(NSString *)name
+- (WebFrame *)findFrameNamed:(NSString *)name
 {
     // First, deal with 'special' names.
     if ([name isEqualToString:@"_self"] || [name isEqualToString:@"_current"]){
@@ -242,11 +216,40 @@
     }
     
     if ([name isEqualToString:@"_blank"]) {
-        return [[[self controller] _openNewWindowWithURL:nil referrer:nil behind:NO] mainFrame];
+        return nil;
     }
+
+    // Search from this frame down.
+    WebFrame *frame = [self _descendantFrameNamed:name];
+
+    if(!frame){
+        // Search in this controller and other controllers.
+        frame = [[self controller] frameNamed:name];
+    }
+
+    return frame;
+}
+
+- (WebFrame *)findOrCreateFramedNamed:(NSString *)name
+{
+    WebFrame *frame = [self findFrameNamed:name];
+
+    if(!frame){
+        WebController *controller = [[[self controller] windowOperationsDelegate]
+                                        createWindowWithURL:nil referrer:[[self _bridge] referrer]];
+        
+        if(![name isEqualToString:@"_blank"]){
+            [controller _setTopLevelFrameName:name];
+        }
+        
+        [[controller windowOperationsDelegate] showWindow];
+        
+        frame = [controller mainFrame];
+    }
+
+    ASSERT(frame);
     
-    // Now search the name space associated with this frame's controller.
-    return [WebFrame _frameNamed:name fromFrame:[[self controller] mainFrame]];
+    return frame;
 }
 
 - (WebFrame *)parent
diff --git a/WebKit/WebView.subproj/WebFramePrivate.h b/WebKit/WebView.subproj/WebFramePrivate.h
index 60dd2fa..102587c 100644
--- a/WebKit/WebView.subproj/WebFramePrivate.h
+++ b/WebKit/WebView.subproj/WebFramePrivate.h
@@ -78,10 +78,9 @@ typedef enum {
 @end
 
 @interface WebFrame (WebPrivate)
-
+- (WebFrame *)_descendantFrameNamed:(NSString *)name;
 - (void)_controllerWillBeDeallocated;
 - (void)_detachFromParent;
-
 - (void)_setController: (WebController *)controller;
 - (void)_setDataSource: (WebDataSource *)d;
 - (void)_transitionToCommitted;
@@ -110,6 +109,6 @@ typedef enum {
 
 - (void)_addChild:(WebFrame *)child;
 
-- (WebPluginController *)pluginController;
+- (WebPluginController *)_pluginController;
 
 @end
diff --git a/WebKit/WebView.subproj/WebFramePrivate.m b/WebKit/WebView.subproj/WebFramePrivate.m
index 44c60ab..a005244 100644
--- a/WebKit/WebView.subproj/WebFramePrivate.m
+++ b/WebKit/WebView.subproj/WebFramePrivate.m
@@ -132,6 +132,27 @@ static const char * const stateNames[] = {
 
 @implementation WebFrame (WebPrivate)
 
+- (WebFrame *)_descendantFrameNamed:(NSString *)name
+{
+    if ([[self name] isEqualToString: name]){
+        return self;
+    }
+
+    NSArray *children = [self children];
+    WebFrame *frame;
+    unsigned i;
+
+    for (i = 0; i < [children count]; i++){
+        frame = [children objectAtIndex: i];
+        frame = [frame _descendantFrameNamed:name];
+        if (frame){
+            return frame;
+        }
+    }
+
+    return nil;
+}
+
 - (void)_controllerWillBeDeallocated
 {
     [self _detachFromParent];
@@ -830,7 +851,7 @@ static const char * const stateNames[] = {
     [[child dataSource] _setOverrideEncoding:[[self dataSource] _overrideEncoding]];   
 }
 
-- (WebPluginController *)pluginController
+- (WebPluginController *)_pluginController
 {
     if(!_private->pluginController){
         _private->pluginController = [[WebPluginController alloc] initWithWebFrame:self];
diff --git a/WebKit/WebView.subproj/WebHTMLView.m b/WebKit/WebView.subproj/WebHTMLView.m
index 9a0d54c..c86cfb9 100644
--- a/WebKit/WebView.subproj/WebHTMLView.m
+++ b/WebKit/WebView.subproj/WebHTMLView.m
@@ -239,7 +239,7 @@
     [super addSubview:view];
 
     if([view conformsToProtocol:@protocol(WebPlugin)]){
-        [[[self _frame] pluginController] didAddPluginView:view];
+        [[[self _frame] _pluginController] didAddPluginView:view];
     }
 }
 
diff --git a/WebKit/WebView.subproj/WebHTMLViewPrivate.m b/WebKit/WebView.subproj/WebHTMLViewPrivate.m
index 45f2a4c..5086ca9 100644
--- a/WebKit/WebView.subproj/WebHTMLViewPrivate.m
+++ b/WebKit/WebView.subproj/WebHTMLViewPrivate.m
@@ -149,8 +149,8 @@ BOOL _modifierTrackingEnabled = FALSE;
     NSString *frameName = [elementInfoWC objectForKey:WebCoreElementLinkTarget];
     if ([frameName length] == 0) {
         [elementInfo setObject:webFrame forKey:WebElementLinkTargetFrameKey];
-    } else if (![frameName isEqualToString:@"_blank"]) {
-        [elementInfo _web_setObjectIfNotNil:[webFrame frameNamed:frameName] forKey:WebElementLinkTargetFrameKey];
+    } else {
+        [elementInfo _web_setObjectIfNotNil:[webFrame findFrameNamed:frameName] forKey:WebElementLinkTargetFrameKey];
     }
 
     [elementInfo setObject:webFrame forKey:WebElementFrameKey];
diff --git a/WebKit/WebView.subproj/WebViewPrivate.m b/WebKit/WebView.subproj/WebViewPrivate.m
index d03fd7e..3903f23 100644
--- a/WebKit/WebView.subproj/WebViewPrivate.m
+++ b/WebKit/WebView.subproj/WebViewPrivate.m
@@ -224,7 +224,7 @@
     if ([_private->topLevelFrameName isEqualToString:name]) {
 	return [self mainFrame];
     } else {
-	return [[self mainFrame] frameNamed:name];
+	return [[self mainFrame] _descendantFrameNamed:name];
     }
 }
 

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list