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

mjs mjs at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 07:28:23 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit 100a7f2cf0c18451b7e35d2e73b4430f0260e802
Author: mjs <mjs at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Sat Mar 8 02:19:17 2003 +0000

    WebCore:
    
            Reviewed by Richard.
    
    	- fixed 3127705 - don't open new window on opt-click even if the link requests it
    	- fixed 3143971 - cmd-click should override the target="_blank" and target="_new" (important for tabs)
    
            * kwq/KWQKHTMLPart.h:
            * kwq/KWQKHTMLPart.mm:
            (KWQKHTMLPart::openURL): Don't use findOrCreateFrameNamed, instead pass target along.
            (KWQKHTMLPart::openURLRequest): Likewise.
            (KWQKHTMLPart::submitForm): Likewise.
            (KWQKHTMLPart::urlSelected): Likewise.
            * kwq/KWQKHTMLPartBrowserExtension.mm:
            (KHTMLPartBrowserExtension::createNewWindow): Likewise.
            * kwq/WebCoreBridge.h:
    
    WebKit:
    
            Reviewed by Richard.
    
    	- fixed 3127705 - don't open new window on opt-click even if the link requests it
    	- fixed 3143971 - cmd-click should override the target="_blank" and target="_new" (important for tabs)
    
    	- removed open new window and open new window behind policies
    	- removed [WebFrame findOrCreateFrameNamed:] from API
    	- remved showWindowBehind from window operations delegate
    	- added decideNewWindowPolicyForAction:andRequest:newFrameName:decisionListener: delegate method
    
            * Plugins.subproj/WebBaseNetscapePluginView.m:
            (-[WebBaseNetscapePluginView loadPluginRequest:]):
            (-[WebBaseNetscapePluginView loadRequest:inTarget:withNotifyData:]):
            (-[WebPluginRequest initWithRequest:frameName:notifyData:]):
            (-[WebPluginRequest dealloc]):
            (-[WebPluginRequest frameName]):
            * Plugins.subproj/WebPluginController.m:
            (-[WebPluginController showURL:inFrame:]):
            * WebCoreSupport.subproj/WebBridge.m:
            (-[WebBridge loadURL:referrer:reload:target:triggeringEvent:form:formValues:]):
            (-[WebBridge postWithURL:referrer:target:data:contentType:triggeringEvent:form:formValues:]):
            * WebView.subproj/WebControllerPolicyDelegate.h:
            * WebView.subproj/WebControllerPrivate.h:
            * WebView.subproj/WebControllerPrivate.m:
            (-[WebController _openNewWindowWithRequest:]):
            * WebView.subproj/WebDefaultContextMenuDelegate.m:
            (-[WebDefaultContextMenuDelegate openNewWindowWithURL:]):
            * WebView.subproj/WebDefaultPolicyDelegate.m:
            (-[WebDefaultPolicyDelegate decideNewWindowPolicyForAction:andRequest:newFrameName:decisionListener:]):
            * WebView.subproj/WebFrame.h:
            * WebView.subproj/WebFrame.m:
            * WebView.subproj/WebFramePrivate.h:
            * WebView.subproj/WebFramePrivate.m:
            (-[NSObject performSelector:withObject:withObject:withObject:]):
            * WebView.subproj/WebWindowOperationsDelegate.h:
    
    WebBrowser:
    
            Reviewed by Richard.
    
    	- fixed 3127705 - don't open new window on opt-click even if the link requests it
    	- fixed 3143971 - cmd-click should override the target="_blank" and target="_new" (important for tabs)
    	- updated for various WebKit API changes.
    
            * BrowserDocument.h:
            * BrowserDocument.m:
            (-[BrowserDocument initWithContentsOfRequest:frameName:]):
            (-[BrowserDocument init]):
            (-[BrowserDocument initWithContentsOfURL:ofType:]):
            (-[BrowserDocument createWebController]):
            * BrowserDocumentController.h:
            * BrowserDocumentController.m:
            (-[BrowserDocumentController _openDocumentWithContentsOfRequest:behind:display:frameName:]):
            (-[BrowserDocumentController openDocumentWithContentsOfRequest:behind:display:]):
            (-[BrowserDocumentController _goToEachRequest:windowPolicy:frameName:]):
            (-[BrowserDocumentController openDocument:]):
            (-[BrowserDocumentController goToRequest:windowPolicy:frameName:]):
            (-[BrowserDocumentController goToRequest:windowPolicy:]):
            * BrowserWebController.h:
            * BrowserWebController.m:
            (-[BrowserWebController initWithDocument:request:frameName:]):
            (-[BrowserWebController decidePolicyForAction:andRequest:inFrame:newFrameName:decisionListener:]):
            (-[BrowserWebController decideNavigationPolicyForAction:andRequest:inFrame:decisionListener:]):
            (-[BrowserWebController decideNewWindowPolicyForAction:andRequest:newFrameName:decisionListener:]):
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@3785 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog-2003-10-25 b/WebCore/ChangeLog-2003-10-25
index e4c8334..79c1361 100644
--- a/WebCore/ChangeLog-2003-10-25
+++ b/WebCore/ChangeLog-2003-10-25
@@ -1,3 +1,20 @@
+2003-03-07  Maciej Stachowiak  <mjs at apple.com>
+
+        Reviewed by Richard.
+
+	- fixed 3127705 - don't open new window on opt-click even if the link requests it
+	- fixed 3143971 - cmd-click should override the target="_blank" and target="_new" (important for tabs)
+	
+        * kwq/KWQKHTMLPart.h:
+        * kwq/KWQKHTMLPart.mm:
+        (KWQKHTMLPart::openURL): Don't use findOrCreateFrameNamed, instead pass target along.
+        (KWQKHTMLPart::openURLRequest): Likewise.
+        (KWQKHTMLPart::submitForm): Likewise.
+        (KWQKHTMLPart::urlSelected): Likewise.
+        * kwq/KWQKHTMLPartBrowserExtension.mm:
+        (KHTMLPartBrowserExtension::createNewWindow): Likewise.
+        * kwq/WebCoreBridge.h:
+
 2003-03-07  David Hyatt  <hyatt at apple.com>
 
         better fix for text-decoration issue on time.com.  
diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index e4c8334..79c1361 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,3 +1,20 @@
+2003-03-07  Maciej Stachowiak  <mjs at apple.com>
+
+        Reviewed by Richard.
+
+	- fixed 3127705 - don't open new window on opt-click even if the link requests it
+	- fixed 3143971 - cmd-click should override the target="_blank" and target="_new" (important for tabs)
+	
+        * kwq/KWQKHTMLPart.h:
+        * kwq/KWQKHTMLPart.mm:
+        (KWQKHTMLPart::openURL): Don't use findOrCreateFrameNamed, instead pass target along.
+        (KWQKHTMLPart::openURLRequest): Likewise.
+        (KWQKHTMLPart::submitForm): Likewise.
+        (KWQKHTMLPart::urlSelected): Likewise.
+        * kwq/KWQKHTMLPartBrowserExtension.mm:
+        (KHTMLPartBrowserExtension::createNewWindow): Likewise.
+        * kwq/WebCoreBridge.h:
+
 2003-03-07  David Hyatt  <hyatt at apple.com>
 
         better fix for text-decoration issue on time.com.  
diff --git a/WebCore/kwq/KWQKHTMLPart.h b/WebCore/kwq/KWQKHTMLPart.h
index a5811ce..e786cb1 100644
--- a/WebCore/kwq/KWQKHTMLPart.h
+++ b/WebCore/kwq/KWQKHTMLPart.h
@@ -207,8 +207,6 @@ private:
     
     NSView *mouseDownViewIfStillGood();
 
-    WebCoreBridge *bridgeForFrameName(const QString &frameName);
-
     QString generateFrameName();
 
     NSView *nextKeyViewInFrame(DOM::NodeImpl *startingPoint, KWQSelectionDirection);
diff --git a/WebCore/kwq/KWQKHTMLPart.mm b/WebCore/kwq/KWQKHTMLPart.mm
index e84f614..7623a22 100644
--- a/WebCore/kwq/KWQKHTMLPart.mm
+++ b/WebCore/kwq/KWQKHTMLPart.mm
@@ -157,23 +157,6 @@ void KWQKHTMLPart::setSettings (KHTMLSettings *settings)
     d->m_settings = settings;
 }
 
-WebCoreBridge *KWQKHTMLPart::bridgeForFrameName(const QString &frameName)
-{
-    WebCoreBridge *frame;
-    if (frameName.isEmpty()) {
-        // If we're the only frame in a frameset then pop the frame.
-        KHTMLPart *parent = parentPart();
-        frame = parent ? KWQ(parent)->_bridge : nil;
-        if ([[frame childFrames] count] != 1) {
-            frame = _bridge;
-        }
-    } else {
-        frame = [_bridge findOrCreateFrameNamed:frameName.getNSString()];
-    }
-    
-    return frame;
-}
-
 QString KWQKHTMLPart::generateFrameName()
 {
     return QString::fromNSString([_bridge generateFrameName]);
@@ -184,13 +167,13 @@ bool KWQKHTMLPart::openURL(const KURL &url)
     // FIXME: The lack of args here to get the reload flag from
     // indicates a problem in how we use KHTMLPart::processObjectRequest,
     // where we are opening the URL before the args are set up.
-    [_bridge loadURL:url.url().getNSString() referrer:[_bridge referrer] reload:NO triggeringEvent:nil form:nil formValues:nil];
+    [_bridge loadURL:url.url().getNSString() referrer:[_bridge referrer] reload:NO target:nil triggeringEvent:nil form:nil formValues:nil];
     return true;
 }
 
 void KWQKHTMLPart::openURLRequest(const KURL &url, const URLArgs &args)
 {
-    [bridgeForFrameName(args.frameName) loadURL:url.url().getNSString() referrer:[_bridge referrer] reload:args.reload triggeringEvent:nil form:nil formValues:nil];
+    [_bridge loadURL:url.url().getNSString() referrer:[_bridge referrer] reload:args.reload target:args.frameName.getNSString() triggeringEvent:nil form:nil formValues:nil];
 }
 
 void KWQKHTMLPart::didNotOpenURL(const QString &URL)
@@ -401,7 +384,7 @@ void KWQKHTMLPart::recordFormValue(const QString &name, const QString &value, HT
 void KWQKHTMLPart::submitForm(const KURL &url, const URLArgs &args)
 {
     QString URLString = url.url();    
-    WebCoreBridge *target = bridgeForFrameName(args.frameName);
+    WebCoreBridge *target = [_bridge findFrameNamed:args.frameName.getNSString()];
     KHTMLPart *targetPart = [target part];
     
     // The form multi-submit logic here is only right when we are submitting a form that affects this frame.
@@ -429,6 +412,7 @@ void KWQKHTMLPart::submitForm(const KURL &url, const URLArgs &args)
         [target loadURL:URLString.getNSString()
 	       referrer:[_bridge referrer] 
                  reload:args.reload
+  	         target:args.frameName.getNSString()
         triggeringEvent:_currentEvent
                    form:_formAboutToBeSubmitted
              formValues:_formValuesAboutToBeSubmitted];
@@ -437,6 +421,7 @@ void KWQKHTMLPart::submitForm(const KURL &url, const URLArgs &args)
         ASSERT(contentType.startsWith("Content-Type: "));
         [target postWithURL:URLString.getNSString()
 	           referrer:[_bridge referrer] 
+	             target:args.frameName.getNSString()
                        data:[NSData dataWithBytes:args.postData.data() length:args.postData.size()]
                 contentType:contentType.mid(14).getNSString()
             triggeringEvent:_currentEvent
@@ -466,7 +451,7 @@ void KWQKHTMLPart::slotData(NSString *encoding, bool forceEncoding, const char *
 
 void KWQKHTMLPart::urlSelected(const KURL &url, int button, int state, const URLArgs &args)
 {
-    [bridgeForFrameName(args.frameName) loadURL:url.url().getNSString() referrer:[_bridge referrer] reload:args.reload triggeringEvent:_currentEvent form:nil formValues:nil];
+    [_bridge loadURL:url.url().getNSString() referrer:[_bridge referrer] reload:args.reload target:args.frameName.getNSString() triggeringEvent:_currentEvent form:nil formValues:nil];
 }
 
 class KWQPluginPart : public ReadOnlyPart
diff --git a/WebCore/kwq/KWQKHTMLPartBrowserExtension.mm b/WebCore/kwq/KWQKHTMLPartBrowserExtension.mm
index 93d5a99..699824c 100644
--- a/WebCore/kwq/KWQKHTMLPartBrowserExtension.mm
+++ b/WebCore/kwq/KWQKHTMLPartBrowserExtension.mm
@@ -83,10 +83,10 @@ void KHTMLPartBrowserExtension::createNewWindow(const KURL &url,
     WebCoreBridge *bridge;
 
     if (frameName != nil) {
-	bridge = [_part->bridge() findFramedNamed:frameName];
+	bridge = [_part->bridge() findFrameNamed:frameName];
 	if (bridge != nil) {
 	    if (!url.isEmpty()) {
-		[bridge loadURL:url.url().getNSString() referrer:[_part->bridge() referrer] reload:urlArgs.reload triggeringEvent:nil form:nil formValues:nil];
+		[bridge loadURL:url.url().getNSString() referrer:[_part->bridge() referrer] reload:urlArgs.reload target:nil triggeringEvent:nil form:nil formValues:nil];
 	    }
 	    *partResult = [bridge part];
 	    return;
diff --git a/WebCore/kwq/WebCoreBridge.h b/WebCore/kwq/WebCoreBridge.h
index 3e3500a..ec8e1c0 100644
--- a/WebCore/kwq/WebCoreBridge.h
+++ b/WebCore/kwq/WebCoreBridge.h
@@ -211,13 +211,12 @@ enum FrameBorderStyle {
 
 - (NSArray *)childFrames; // WebCoreBridge objects
 - (WebCoreBridge *)mainFrame;
-- (WebCoreBridge *)findFramedNamed:(NSString *)name;
-- (WebCoreBridge *)findOrCreateFrameNamed:(NSString *)name;
+- (WebCoreBridge *)findFrameNamed:(NSString *)name;
 /* Creates a name for an frame unnamed in the HTML.  It should produce repeatable results for loads of the same frameset. */
 - (NSString *)generateFrameName;
 
-- (void)loadURL:(NSString *)URL referrer:(NSString *)referrer reload:(BOOL)reload triggeringEvent:(NSEvent *)event form:(id <WebDOMElement>)form formValues:(NSDictionary *)values;
-- (void)postWithURL:(NSString *)URL referrer:(NSString *)referrer data:(NSData *)data contentType:(NSString *)contentType triggeringEvent:(NSEvent *)event form:(id <WebDOMElement>)form formValues:(NSDictionary *)values;
+- (void)loadURL:(NSString *)URL referrer:(NSString *)referrer reload:(BOOL)reload target:(NSString *)target triggeringEvent:(NSEvent *)event form:(id <WebDOMElement>)form formValues:(NSDictionary *)values;
+- (void)postWithURL:(NSString *)URL referrer:(NSString *)referrer target:(NSString *)target data:(NSData *)data contentType:(NSString *)contentType triggeringEvent:(NSEvent *)event form:(id <WebDOMElement>)form formValues:(NSDictionary *)values;
 
 - (WebCoreBridge *)createWindowWithURL:(NSString *)URL frameName:(NSString *)name;
 - (void)showWindow;
diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog
index 4358baf..a1502b1 100644
--- a/WebKit/ChangeLog
+++ b/WebKit/ChangeLog
@@ -1,3 +1,41 @@
+2003-03-07  Maciej Stachowiak  <mjs at apple.com>
+
+        Reviewed by Richard.
+
+	- fixed 3127705 - don't open new window on opt-click even if the link requests it
+	- fixed 3143971 - cmd-click should override the target="_blank" and target="_new" (important for tabs)
+
+	- removed open new window and open new window behind policies
+	- removed [WebFrame findOrCreateFrameNamed:] from API
+	- remved showWindowBehind from window operations delegate
+	- added decideNewWindowPolicyForAction:andRequest:newFrameName:decisionListener: delegate method
+	
+        * Plugins.subproj/WebBaseNetscapePluginView.m:
+        (-[WebBaseNetscapePluginView loadPluginRequest:]):
+        (-[WebBaseNetscapePluginView loadRequest:inTarget:withNotifyData:]):
+        (-[WebPluginRequest initWithRequest:frameName:notifyData:]):
+        (-[WebPluginRequest dealloc]):
+        (-[WebPluginRequest frameName]):
+        * Plugins.subproj/WebPluginController.m:
+        (-[WebPluginController showURL:inFrame:]):
+        * WebCoreSupport.subproj/WebBridge.m:
+        (-[WebBridge loadURL:referrer:reload:target:triggeringEvent:form:formValues:]):
+        (-[WebBridge postWithURL:referrer:target:data:contentType:triggeringEvent:form:formValues:]):
+        * WebView.subproj/WebControllerPolicyDelegate.h:
+        * WebView.subproj/WebControllerPrivate.h:
+        * WebView.subproj/WebControllerPrivate.m:
+        (-[WebController _openNewWindowWithRequest:]):
+        * WebView.subproj/WebDefaultContextMenuDelegate.m:
+        (-[WebDefaultContextMenuDelegate openNewWindowWithURL:]):
+        * WebView.subproj/WebDefaultPolicyDelegate.m:
+        (-[WebDefaultPolicyDelegate decideNewWindowPolicyForAction:andRequest:newFrameName:decisionListener:]):
+        * WebView.subproj/WebFrame.h:
+        * WebView.subproj/WebFrame.m:
+        * WebView.subproj/WebFramePrivate.h:
+        * WebView.subproj/WebFramePrivate.m:
+        (-[NSObject performSelector:withObject:withObject:withObject:]):
+        * WebView.subproj/WebWindowOperationsDelegate.h:
+
 2003-03-07  Chris Blumenberg  <cblu at apple.com>
 
 	Updated header doc comments.
@@ -26,7 +64,6 @@
         * WebView.subproj/WebView.h:
         * WebView.subproj/WebView.m:
 
-=======
 2003-03-07  John Sullivan  <sullivan at apple.com>
 
 	WebKit part of fixes to these two synching-related bugs:
diff --git a/WebKit/Plugins.subproj/WebBaseNetscapePluginView.m b/WebKit/Plugins.subproj/WebBaseNetscapePluginView.m
index 0d9c1e4..00324cd 100644
--- a/WebKit/Plugins.subproj/WebBaseNetscapePluginView.m
+++ b/WebKit/Plugins.subproj/WebBaseNetscapePluginView.m
@@ -49,14 +49,14 @@ typedef struct {
 @interface WebPluginRequest : NSObject
 {
     WebRequest *_request;
-    WebFrame *_frame;
+    NSString *_frameName;
     void *_notifyData;
 }
 
-- (id)initWithRequest:(WebRequest *)request frame:(WebFrame *)frame notifyData:(void *)notifyData;
+- (id)initWithRequest:(WebRequest *)request frameName:(NSString *)frameName notifyData:(void *)notifyData;
 
 - (WebRequest *)request;
-- (WebFrame *)webFrame;
+- (NSString *)frameName;
 - (void *)notifyData;
 
 @end
@@ -1013,11 +1013,21 @@ typedef struct {
 - (void)loadPluginRequest:(WebPluginRequest *)pluginRequest
 {
     WebRequest *request = [pluginRequest request];
-    WebFrame *frame = [pluginRequest webFrame];
+    NSString *frameName = [pluginRequest frameName];
     void *notifyData = [pluginRequest notifyData];
 
+    // FIXME - need to get rid of this window creation which
+    // bypasses normal targeted link handling
+    WebController *controller = nil;
+    id wd = [[self controller] windowOperationsDelegate];
+    if ([wd respondsToSelector:@selector(createWindowWithRequest:)])
+	controller = [wd createWindowWithRequest:nil];
+        
+    [controller _setTopLevelFrameName:frameName];
+    [[controller _windowOperationsDelegateForwarder] showWindow];
+    WebFrame *frame = [controller mainFrame];
+
     NSURL *URL = [request URL];
-    
     NSString *JSString = [URL _web_scriptIfJavaScriptURL];
     if (JSString) {
         [[frame _bridge] stringByEvaluatingJavaScriptFromString:JSString];
@@ -1027,7 +1037,7 @@ typedef struct {
             NPP_URLNotify(instance, [[URL absoluteString] cString], NPRES_DONE, notifyData);
         }
     } else {
-        [frame loadRequest:request];
+        [[self webFrame] loadRequest:request];
         if (notifyData) {
             // FIXME: How do we notify about failures? It seems this will only notify about success.
         
@@ -1064,14 +1074,13 @@ typedef struct {
     } else {
         // Find the frame given the target string.
         NSString *target = (NSString *)CFStringCreateWithCString(kCFAllocatorDefault, cTarget, kCFStringEncodingWindowsLatin1);
-        WebFrame *frame = [[self webFrame] findOrCreateFrameNamed:target];
-        [target release];
 
         // Make a request, but don't do it right away because it could make the plugin view go away.
         WebPluginRequest *pluginRequest = [[WebPluginRequest alloc]
-            initWithRequest:request frame:frame notifyData:notifyData];
+            initWithRequest:request frameName:target notifyData:notifyData];
         [self performSelector:@selector(loadPluginRequest:) withObject:pluginRequest afterDelay:0];
         [pluginRequest release];
+	[target release];
     }
     
     return NPERR_NO_ERROR;
@@ -1215,11 +1224,11 @@ typedef struct {
 
 @implementation WebPluginRequest
 
-- (id)initWithRequest:(WebRequest *)request frame:(WebFrame *)frame notifyData:(void *)notifyData
+- (id)initWithRequest:(WebRequest *)request frameName:(NSString *)frameName notifyData:(void *)notifyData
 {
     [super init];
     _request = [request retain];
-    _frame = [frame retain];
+    _frameName = [frameName retain];
     _notifyData = notifyData;
     return self;
 }
@@ -1227,7 +1236,7 @@ typedef struct {
 - (void)dealloc
 {
     [_request release];
-    [_frame release];
+    [_frameName release];
     [super dealloc];
 }
 
@@ -1236,9 +1245,9 @@ typedef struct {
     return _request;
 }
 
-- (WebFrame *)webFrame
+- (NSString *)frameName
 {
-    return _frame;
+    return _frameName;
 }
 
 - (void *)notifyData
diff --git a/WebKit/Plugins.subproj/WebPluginController.m b/WebKit/Plugins.subproj/WebPluginController.m
index b9337de..fa3398e 100644
--- a/WebKit/Plugins.subproj/WebPluginController.m
+++ b/WebKit/Plugins.subproj/WebPluginController.m
@@ -10,6 +10,7 @@
 
 #import <WebKit/WebControllerPrivate.h>
 #import <WebKit/WebFrame.h>
+#import <WebKit/WebFramePrivate.h>
 #import <WebKit/WebHTMLView.h>
 #import <WebKit/WebHTMLViewPrivate.h>
 #import <WebKit/WebKitLogging.h>
@@ -107,7 +108,7 @@
         ERROR("could not load URL %@", URL);
         return;
     }
-    [[frame findOrCreateFrameNamed:target] loadRequest:request];
+    [frame _loadRequest:request inFrameNamed:target];
 }
 
 - (void)showStatus:(NSString *)message
diff --git a/WebKit/WebCoreSupport.subproj/WebBridge.m b/WebKit/WebCoreSupport.subproj/WebBridge.m
index 34e7b08..f734be3 100644
--- a/WebKit/WebCoreSupport.subproj/WebBridge.m
+++ b/WebKit/WebCoreSupport.subproj/WebBridge.m
@@ -93,18 +93,12 @@
     return [[[frame controller] mainFrame] _bridge];
 }
 
-- (WebCoreBridge *)findFramedNamed:(NSString *)name;
+- (WebCoreBridge *)findFrameNamed:(NSString *)name;
 {
     ASSERT(frame != nil);
     return [[frame findFrameNamed:name] _bridge];
 }
 
-- (WebCoreBridge *)findOrCreateFrameNamed:(NSString *)name
-{
-    ASSERT(frame != nil);
-    return [[frame findOrCreateFrameNamed:name] _bridge];
-}
-
 - (WebCoreBridge *)createWindowWithURL:(NSString *)URL frameName:(NSString *)name
 {
     ASSERT(frame != nil);
@@ -329,14 +323,22 @@
     [[self dataSource] _setIconURL:[NSURL _web_URLWithString:URL] withType:type];
 }
 
-- (void)loadURL:(NSString *)URL referrer:(NSString *)referrer reload:(BOOL)reload triggeringEvent:(NSEvent *)event form:(id <WebDOMElement>)form formValues:(NSDictionary *)values
+- (void)loadURL:(NSString *)URL referrer:(NSString *)referrer reload:(BOOL)reload target:(NSString *)target triggeringEvent:(NSEvent *)event form:(id <WebDOMElement>)form formValues:(NSDictionary *)values
 {
-    [frame _loadURL:[NSURL _web_URLWithString:URL] referrer:referrer loadType:(reload ? WebFrameLoadTypeReload : WebFrameLoadTypeStandard)  triggeringEvent:event form:form formValues:values];
+    if ([target length] == 0) {
+	target = nil;
+    }
+
+    [frame _loadURL:[NSURL _web_URLWithString:URL] referrer:referrer loadType:(reload ? WebFrameLoadTypeReload : WebFrameLoadTypeStandard) target:target triggeringEvent:event form:form formValues:values];
 }
 
-- (void)postWithURL:(NSString *)URL referrer:(NSString *)referrer data:(NSData *)data contentType:(NSString *)contentType triggeringEvent:(NSEvent *)event form:(id <WebDOMElement>)form formValues:(NSDictionary *)values
+- (void)postWithURL:(NSString *)URL referrer:(NSString *)referrer target:(NSString *)target data:(NSData *)data contentType:(NSString *)contentType triggeringEvent:(NSEvent *)event form:(id <WebDOMElement>)form formValues:(NSDictionary *)values
 {
-    [frame _postWithURL:[NSURL _web_URLWithString:URL] referrer:(NSString *)referrer data:data contentType:contentType triggeringEvent:event form:form formValues:values];
+    if ([target length] == 0) {
+	target = nil;
+    }
+
+    [frame _postWithURL:[NSURL _web_URLWithString:URL] referrer:(NSString *)referrer target:target data:data contentType:contentType triggeringEvent:event form:form formValues:values];
 }
 
 - (NSString *)generateFrameName
diff --git a/WebKit/WebView.subproj/WebControllerPolicyDelegate.h b/WebKit/WebView.subproj/WebControllerPolicyDelegate.h
index 68a5769..a4599e1 100644
--- a/WebKit/WebView.subproj/WebControllerPolicyDelegate.h
+++ b/WebKit/WebView.subproj/WebControllerPolicyDelegate.h
@@ -47,15 +47,11 @@ extern NSString *WebActionOriginalURLKey; // NSURL
     @abstract Potential actions to take when loading a URL
     @constant WebPolicyUse Have WebKit use the resource.
     @constant WebPolicySave Save the resource to disk.
-    @constant WebPolicyOpenNewWindow Open the resource in another window.
-    @constant WebPolicyOpenNewWindowBehind Open the resource in another window behind this window.
     @constant WebPolicyIgnore Do nothing with the resource.
 */
 typedef enum {
     WebPolicyUse,
     WebPolicySave,
-    WebPolicyOpenNewWindow,
-    WebPolicyOpenNewWindowBehind,
     WebPolicyIgnore,
 } WebPolicyAction;
 
@@ -75,28 +71,51 @@ typedef enum {
 
 /*!
     @category WebPolicyDelegate
-    @discussion While loading a URL, WebKit asks the WebPolicyDelegate for
+    @discussion While loading a URL, WebKit asks the WebControllerPolicyDelegate for
     policies that determine the action of what to do with the URL or the data that
     the URL represents. Typically, the policy handler methods are called in this order:
 
-    decideNavigationPolicyForAction:andRequest:inFrame:decisionListener:<BR>
-    contentPolicyForMIMEType:andRequest:inFrame:<BR>
+    decideNewWindowPolicyForAction:andRequest:newFrameName:decisionListener: (at most once)<BR>
+    decideNavigationPolicyForAction:inFrame::decisionListener: (one or more times)<BR>
+    contentPolicyForMIMEType:andRequest:inFrame: (at most once)<BR>
 */
 @interface NSObject (WebPolicyDelegate)
 
 /*!
-     @method decideNavigationPolicyForAction:andRequest:inFrame:decisionListener:
-     @discussion Called right after the user clicks on a link.
-     @param actionInformation Dictionary that describes the action that triggered this navigation.
-     @param request The request for the proposed navigation
-     @param frame The frame in which the navigation is taking place
-     @param listener The object to call when the decision is made
+   @method decideNavigationPolicyForAction:andRequest:inFrame:decisionListener:
+   @abstract This method is called to decide what to do with a proposed navigation.
+   @param actionInformation Dictionary that describes the action that triggered this navigation.
+   @param request The request for the proposed navigation
+   @param frame The WebFrame in which the navigation is happening
+   @param listener The object to call when the decision is made
+   @discussion This method will be called before loading starts, and
+   on every redirect.
 */
 - (void)decideNavigationPolicyForAction:(NSDictionary *)actionInformation
                              andRequest:(WebRequest *)request
                                 inFrame:(WebFrame *)frame
                        decisionListener:(WebPolicyDecisionListener *)listener;
 
+/*!
+     @method decideNewWindowPolicyForAction:andRequest:newFrameName:decisionListener:
+     @discussion This method is called to decide what to do with an targetted nagivation that would open a new window.
+     @param actionInformation Dictionary that describes the action that triggered this navigation.
+     @param request The request for the proposed navigation
+     @param frame The frame in which the navigation is taking place
+     @param listener The object to call when the decision is made
+     @discussion This method is provided so that modified clicks on a targetted link which
+     opens a new frame can prevent the new window from being opened if they decide to
+     do something else, like download or present the new frame in a specialized way. 
+
+     <p>If this method picks a policy of Use, the new window will be
+     opened, and decideNavigationPolicyForAction:andRequest:inFrame:decisionListner:
+     will be called with a WebNavigationType of WebNavigationTypeOther
+     in its action. This is to avoid possible confusion about the modifiers.
+*/
+- (void)decideNewWindowPolicyForAction:(NSDictionary *)actionInformation
+                            andRequest:(WebRequest *)request
+                          newFrameName:(NSString *)frameName
+                      decisionListener:(WebPolicyDecisionListener *)listener;
 
 /*!
     @method contentPolicyForMIMEType:andRequest:inFrame:
diff --git a/WebKit/WebView.subproj/WebControllerPrivate.h b/WebKit/WebView.subproj/WebControllerPrivate.h
index 488154c..3e41538 100644
--- a/WebKit/WebView.subproj/WebControllerPrivate.h
+++ b/WebKit/WebView.subproj/WebControllerPrivate.h
@@ -92,7 +92,7 @@ enum { NumUserAgentStringTypes = WinIE + 1 };
 - (WebFrame *)_findFrameInThisWindowNamed: (NSString *)name;
 - (WebFrame *)_findFrameNamed: (NSString *)name;
 
-- (WebController *)_openNewWindowWithRequest:(WebRequest *)request behind:(BOOL)behind;
+- (WebController *)_openNewWindowWithRequest:(WebRequest *)request;
 
 - (NSMenu *)_menuForElement:(NSDictionary *)element;
 
diff --git a/WebKit/WebView.subproj/WebControllerPrivate.m b/WebKit/WebView.subproj/WebControllerPrivate.m
index 2ebca6b..37bb551 100644
--- a/WebKit/WebView.subproj/WebControllerPrivate.m
+++ b/WebKit/WebView.subproj/WebControllerPrivate.m
@@ -293,7 +293,7 @@
     return frame;
 }
 
-- (WebController *)_openNewWindowWithRequest:(WebRequest *)request behind:(BOOL)behind
+- (WebController *)_openNewWindowWithRequest:(WebRequest *)request
 {
     id wd = [self windowOperationsDelegate];
     WebController *newWindowController = nil;
@@ -302,11 +302,9 @@
     else {
         [[WebDefaultWindowOperationsDelegate sharedWindowOperationsDelegate] createWindowWithRequest: request];
     }
-    if (behind) {
-        [[newWindowController _windowOperationsDelegateForwarder] showWindowBehindFrontmost];
-    } else {
-        [[newWindowController _windowOperationsDelegateForwarder] showWindow];
-    }
+
+    [[newWindowController _windowOperationsDelegateForwarder] showWindow];
+
     return newWindowController;
 }
 
diff --git a/WebKit/WebView.subproj/WebDefaultContextMenuDelegate.m b/WebKit/WebView.subproj/WebDefaultContextMenuDelegate.m
index d17b0b5..93b36a7 100644
--- a/WebKit/WebView.subproj/WebDefaultContextMenuDelegate.m
+++ b/WebKit/WebView.subproj/WebDefaultContextMenuDelegate.m
@@ -148,7 +148,7 @@ static WebDefaultContextMenuDelegate *sharedDelegate = nil;
 	[request setReferrer:referrer];
     }
     
-    [controller _openNewWindowWithRequest:request behind:NO];
+    [controller _openNewWindowWithRequest:request];
 }
 
 - (void)downloadURL:(NSURL *)URL
diff --git a/WebKit/WebView.subproj/WebDefaultPolicyDelegate.m b/WebKit/WebView.subproj/WebDefaultPolicyDelegate.m
index 1e0d001..7541345 100644
--- a/WebKit/WebView.subproj/WebDefaultPolicyDelegate.m
+++ b/WebKit/WebView.subproj/WebDefaultPolicyDelegate.m
@@ -71,5 +71,13 @@ static WebDefaultPolicyDelegate *sharedDelegate = nil;
     }
 }
 
+- (void)decideNewWindowPolicyForAction:(NSDictionary *)actionInformation 
+			     andRequest:(WebRequest *)request
+			   newFrameName:(NSString *)frameName
+		       decisionListener:(WebPolicyDecisionListener *)listener
+{
+    [listener usePolicy:WebPolicyUse];
+}
+
 @end
 
diff --git a/WebKit/WebView.subproj/WebFrame.h b/WebKit/WebView.subproj/WebFrame.h
index dd727ea..1c9cbf9 100644
--- a/WebKit/WebView.subproj/WebFrame.h
+++ b/WebKit/WebView.subproj/WebFrame.h
@@ -103,15 +103,6 @@
 - (WebFrame *)findFrameNamed:(NSString *)name;
 
 /*!
-    @method findOrCreateFrameNamed:
-    @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 *)findOrCreateFrameNamed:(NSString *)name;
-
-/*!
     @method parent
     @result The frame containing this frame, or nil if this is a top level frame.
 */
diff --git a/WebKit/WebView.subproj/WebFrame.m b/WebKit/WebView.subproj/WebFrame.m
index 6a4ef4f..682be77 100644
--- a/WebKit/WebView.subproj/WebFrame.m
+++ b/WebKit/WebView.subproj/WebFrame.m
@@ -184,28 +184,6 @@
     return frame;
 }
 
-- (WebFrame *)findOrCreateFrameNamed:(NSString *)name
-{
-    WebFrame *frame = [self findFrameNamed:name];
-
-    if(!frame){
-        id wd = [[self controller] windowOperationsDelegate];
-        WebController *controller = nil;
-        
-        if ([wd respondsToSelector:@selector(createWindowWithRequest:)])
-            controller = [wd createWindowWithRequest:nil];
-        
-        [controller _setTopLevelFrameName:name];
-        [[controller _windowOperationsDelegateForwarder] showWindow];
-        frame = [controller mainFrame];
-	[frame _setJustOpenedForTargetedLink:YES];
-    }
-
-    ASSERT(frame);
-    
-    return frame;
-}
-
 - (WebFrame *)parent
 {
     return [[_private->parent retain] autorelease];
diff --git a/WebKit/WebView.subproj/WebFramePrivate.h b/WebKit/WebView.subproj/WebFramePrivate.h
index 8d9ac12..bded20f 100644
--- a/WebKit/WebView.subproj/WebFramePrivate.h
+++ b/WebKit/WebView.subproj/WebFramePrivate.h
@@ -68,6 +68,7 @@ typedef enum {
     WebPolicyDecisionListener *listener;
     // state we'll need to continue after waiting for the policy delegate's decision
     WebRequest *policyRequest;
+    NSString *policyFrameName;
     id policyTarget;
     SEL policySelector;
     WebFormState *policyFormState;
@@ -122,14 +123,19 @@ typedef enum {
 
 - (void)_addExtraFieldsToRequest:(WebRequest *)request alwaysFromRequest: (BOOL)f;
 
+
+- (void)_checkNewWindowPolicyForRequest:(WebRequest *)request action:(NSDictionary *)action frameName:(NSString *)frameName formState:(WebFormState *)formState andCall:(id)target withSelector:(SEL)selector;
+
 - (void)_checkNavigationPolicyForRequest:(WebRequest *)request dataSource:(WebDataSource *)dataSource formState:(WebFormState *)formState andCall:(id)target withSelector:(SEL)selector;
 
 - (void)_invalidatePendingPolicyDecisionCallingDefaultAction:(BOOL)call;
 
 - (void)_goToItem: (WebHistoryItem *)item withLoadType: (WebFrameLoadType)type;
-- (void)_loadURL:(NSURL *)URL referrer:(NSString *)referrer loadType:(WebFrameLoadType)loadType triggeringEvent:(NSEvent *)event form:(id <WebDOMElement>)form formValues:(NSDictionary *)values;
+- (void)_loadURL:(NSURL *)URL referrer:(NSString *)referrer loadType:(WebFrameLoadType)loadType target:(NSString *)target triggeringEvent:(NSEvent *)event form:(id <WebDOMElement>)form formValues:(NSDictionary *)values;
 - (void)_loadURL:(NSURL *)URL intoChild:(WebFrame *)childFrame;
-- (void)_postWithURL:(NSURL *)URL referrer:(NSString *)referrer data:(NSData *)data contentType:(NSString *)contentType triggeringEvent:(NSEvent *)event form:(id <WebDOMElement>)form formValues:(NSDictionary *)values;
+- (void)_postWithURL:(NSURL *)URL referrer:(NSString *)referrer target:(NSString *)target data:(NSData *)data contentType:(NSString *)contentType triggeringEvent:(NSEvent *)event form:(id <WebDOMElement>)form formValues:(NSDictionary *)values;
+
+- (void)_loadRequest:(WebRequest *)request inFrameNamed:(NSString *)frameName;
 
 - (void)_clientRedirectedTo:(NSURL *)URL delay:(NSTimeInterval)seconds fireDate:(NSDate *)date lockHistory:(BOOL)lockHistory;
 - (void)_clientRedirectCancelled;
diff --git a/WebKit/WebView.subproj/WebFramePrivate.m b/WebKit/WebView.subproj/WebFramePrivate.m
index 243279f..db66c18 100644
--- a/WebKit/WebView.subproj/WebFramePrivate.m
+++ b/WebKit/WebView.subproj/WebFramePrivate.m
@@ -37,6 +37,8 @@
 #import <WebFoundation/WebHTTPRequest.h>
 #import <WebFoundation/WebSynchronousResult.h>
 
+#import <objc/objc-runtime.h>
+
 #ifndef NDEBUG
 static const char * const stateNames[] = {
     "WebFrameStateProvisional",
@@ -89,6 +91,22 @@ Repeat load of the same URL (by any other means of navigation other than the rel
  Add to back/forward list: NO
 */
 
+ at interface NSObject (WebExtraPerformMethod)
+
+- (id)performSelector:(SEL)aSelector withObject:(id)object1 withObject:(id)object2 withObject:(id)object3;
+
+ at end
+
+ at implementation NSObject (WebExtraPerformMethod)
+
+- (id)performSelector:(SEL)aSelector withObject:(id)object1 withObject:(id)object2 withObject:(id)object3
+{
+    return objc_msgSend(self, aSelector, object1, object2, object3);
+}
+
+ at end
+
+
 // One day we might want to expand the use of this kind of class such that we'd receive one
 // over the bridge, and possibly hand it on through to the FormsDelegate.
 // Today it is just used internally to keep some state as we make our way through a bunch
@@ -151,6 +169,7 @@ Repeat load of the same URL (by any other means of navigation other than the rel
     
     ASSERT(listener == nil);
     ASSERT(policyRequest == nil);
+    ASSERT(policyFrameName == nil);
     ASSERT(policyTarget == nil);
     ASSERT(policyFormState == nil);
 
@@ -1035,7 +1054,7 @@ static CFAbsoluteTime _timeOfLastCompletedLoad;
     // check for all that as an additional optimization.
     // We also do not do anchor-style navigation if we're posting a form.
     
-    // FIXME: These checks don't match the ones in _loadURL:referrer:loadType:triggeringEvent:isFormSubmission:
+    // FIXME: These checks don't match the ones in _loadURL:referrer:loadType:target:triggeringEvent:isFormSubmission:
     // Perhaps they should.
     
     if (!formData
@@ -1265,24 +1284,83 @@ static CFAbsoluteTime _timeOfLastCompletedLoad;
     _private->listener = nil;
 
     WebRequest *request = _private->policyRequest;
+    NSString *frameName = _private->policyFrameName;
     id target = _private->policyTarget;
     SEL selector = _private->policySelector;
     WebFormState *formState = _private->policyFormState;
 
     _private->policyRequest = nil;
+    _private->policyFrameName = nil;
     _private->policyTarget = nil;
     _private->policySelector = nil;
     _private->policyFormState = nil;
 
     if (call) {
-        [target performSelector:selector withObject:nil withObject:nil];
+	if (frameName) {
+	    [target performSelector:selector withObject:nil withObject:nil withObject:nil];
+	} else {
+	    [target performSelector:selector withObject:nil withObject:nil];
+	}
     }
 
     [request release];
+    [frameName release];
     [target release];
     [formState release];
 }
 
+- (void)_checkNewWindowPolicyForRequest:(WebRequest *)request action:(NSDictionary *)action frameName:(NSString *)frameName formState:(WebFormState *)formState andCall:(id)target withSelector:(SEL)selector
+{
+    WebPolicyDecisionListener *listener = [[WebPolicyDecisionListener alloc]
+        _initWithTarget:self action:@selector(_continueAfterNewWindowPolicy:)];
+
+    _private->policyRequest = [request retain];
+    _private->policyTarget = [target retain];
+    _private->policyFrameName = [frameName retain];
+    _private->policySelector = selector;
+    _private->listener = [listener retain];
+    _private->policyFormState = [formState retain];
+
+    [[[self controller] _policyDelegateForwarder] decideNewWindowPolicyForAction:action
+						                      andRequest:request
+						                    newFrameName:frameName
+						                decisionListener:listener];
+    
+    [listener release];
+}
+
+-(void)_continueAfterNewWindowPolicy:(WebPolicyAction)policy
+{
+    WebRequest *request = [[_private->policyRequest retain] autorelease];
+    NSString *frameName = [[_private->policyFrameName retain] autorelease];
+    id target = [[_private->policyTarget retain] autorelease];
+    SEL selector = _private->policySelector;
+    WebFormState *formState = [[_private->policyFormState retain] autorelease];
+
+    // will release _private->policy* objects, hence the above retains
+    [self _invalidatePendingPolicyDecisionCallingDefaultAction:NO];
+
+    BOOL shouldContinue = NO;
+
+    switch (policy) {
+    case WebPolicyIgnore:
+        break;
+    case WebPolicySave:
+	// FIXME: should download full request
+        [[self controller] _downloadURL:[request URL]];
+        break;
+    case WebPolicyUse:
+	shouldContinue = YES;
+        break;
+    default:
+        [NSException raise:NSInvalidArgumentException
+                    format:@"clickPolicyForElement:button:modifierFlags: returned an invalid WebClickPolicy"];
+    }
+
+    [target performSelector:selector withObject:(shouldContinue ? request : nil) withObject:frameName withObject:formState];
+}
+
+
 - (void)_checkNavigationPolicyForRequest:(WebRequest *)request dataSource:(WebDataSource *)dataSource formState:(WebFormState *)formState andCall:(id)target withSelector:(SEL)selector
 {
     NSDictionary *action = [dataSource _triggeringAction];
@@ -1335,23 +1413,11 @@ static CFAbsoluteTime _timeOfLastCompletedLoad;
 
     BOOL shouldContinue = NO;
 
-    // If we've just opened a new window as part of finding the right frame to load, no point
-    // in immediately opening another window.
-    if ([[self provisionalDataSource] _justOpenedForTargetedLink] && 
-	(policy == WebPolicyOpenNewWindow || policy == WebPolicyOpenNewWindowBehind)) {
-	policy = WebPolicyUse;
-    }
-
     switch (policy) {
     case WebPolicyIgnore:
         break;
-    case WebPolicyOpenNewWindow:
-        [[self controller] _openNewWindowWithRequest:request behind:NO];
-        break;
-    case WebPolicyOpenNewWindowBehind:
-        [[self controller] _openNewWindowWithRequest:request behind:YES];
-        break;
     case WebPolicySave:
+	// FIXME: should download full request
         [[self controller] _downloadURL:[request URL]];
         break;
     case WebPolicyUse:
@@ -1422,16 +1488,39 @@ static CFAbsoluteTime _timeOfLastCompletedLoad;
     }
 }
 
+
+
+-(void)_continueLoadRequestAfterNewWindowPolicy:(WebRequest *)request frameName:(NSString *)frameName formState:(WebFormState *)formState
+{
+    if (!request) {
+        return;
+    }
+    
+    WebController *controller = nil;
+    id wd = [[self controller] windowOperationsDelegate];
+    if ([wd respondsToSelector:@selector(createWindowWithRequest:)])
+	controller = [wd createWindowWithRequest:nil];
+        
+    [controller _setTopLevelFrameName:frameName];
+    [[controller _windowOperationsDelegateForwarder] showWindow];
+    WebFrame *frame = [controller mainFrame];
+
+    [frame _loadRequest:request triggeringAction:nil loadType:WebFrameLoadTypeStandard formState:formState];
+}
+
+
 // main funnel for navigating via callback from WebCore (e.g., clicking a link, redirect)
-- (void)_loadURL:(NSURL *)URL referrer:(NSString *)referrer loadType:(WebFrameLoadType)loadType triggeringEvent:(NSEvent *)event form:(id <WebDOMElement>)form formValues:(NSDictionary *)values
+- (void)_loadURL:(NSURL *)URL referrer:(NSString *)referrer loadType:(WebFrameLoadType)loadType target:(NSString *)target triggeringEvent:(NSEvent *)event form:(id <WebDOMElement>)form formValues:(NSDictionary *)values
 {
     BOOL isFormSubmission = (values != nil);
+
     WebRequest *request = [[WebRequest alloc] initWithURL:URL];
     [request setReferrer:referrer];
     [self _addExtraFieldsToRequest:request alwaysFromRequest: (event != nil || isFormSubmission)];
     if (loadType == WebFrameLoadTypeReload) {
         [request setRequestCachePolicy:WebRequestCachePolicyLoadFromOrigin];
     }
+
     // I believe this is never called with LoadSame.  If it is, we probably want to set the cache
     // policy of LoadFromOrigin, but I didn't test that.
     ASSERT(loadType != WebFrameLoadTypeSame);
@@ -1439,6 +1528,18 @@ static CFAbsoluteTime _timeOfLastCompletedLoad;
     NSDictionary *action = [self _actionInformationForLoadType:loadType isFormSubmission:isFormSubmission event:event originalURL:URL];
     WebFormState *formState = [[WebFormState alloc] initWithForm:form values:values];
 
+    if (target != nil) {
+	WebFrame *targetFrame = [self findFrameNamed:target];
+	if (targetFrame != nil) {
+	    [targetFrame _loadURL:URL referrer:referrer loadType:loadType target:nil triggeringEvent:event form:form formValues:values];
+	} else {
+	    [self _checkNewWindowPolicyForRequest:request action:action frameName:target formState:formState andCall:self withSelector:@selector(_continueLoadRequestAfterNewWindowPolicy:frameName:formState:)];
+	}
+	[request release];
+	[formState release];
+	return;
+    }
+
     WebDataSource *oldDataSource = [[self dataSource] retain];
 
     BOOL sameURL = [self _shouldTreatURLAsSameAsCurrent:URL];
@@ -1529,10 +1630,10 @@ static CFAbsoluteTime _timeOfLastCompletedLoad;
     }
 
     // FIXME: is this the right referrer?
-    [childFrame _loadURL:URL referrer:[[self _bridge] referrer] loadType:childLoadType triggeringEvent:nil form:nil formValues:nil];
+    [childFrame _loadURL:URL referrer:[[self _bridge] referrer] loadType:childLoadType target:nil triggeringEvent:nil form:nil formValues:nil];
 }
 
-- (void)_postWithURL:(NSURL *)URL referrer:(NSString *)referrer data:(NSData *)data contentType:(NSString *)contentType triggeringEvent:(NSEvent *)event form:(id <WebDOMElement>)form formValues:(NSDictionary *)values
+- (void)_postWithURL:(NSURL *)URL referrer:(NSString *)referrer target:(NSString *)target data:(NSData *)data contentType:(NSString *)contentType triggeringEvent:(NSEvent *)event form:(id <WebDOMElement>)form formValues:(NSDictionary *)values
 {
     // When posting, use the WebResourceHandleFlagLoadFromOrigin load flag.
     // This prevents a potential bug which may cause a page with a form that uses itself
@@ -1548,7 +1649,19 @@ static CFAbsoluteTime _timeOfLastCompletedLoad;
     NSDictionary *action = [self _actionInformationForLoadType:WebFrameLoadTypeStandard isFormSubmission:YES event:event originalURL:URL];
     WebFormState *formState = [[WebFormState alloc] initWithForm:form values:values];
 
-    [self _loadRequest:request triggeringAction:action loadType:WebFrameLoadTypeStandard formState:formState];
+    WebFrame *targetFrame = self;
+
+    if (target != nil) {
+	WebFrame *targetFrame = [self findFrameNamed:target];
+	if (targetFrame == nil) {
+	    [self _checkNewWindowPolicyForRequest:request action:action frameName:target formState:formState andCall:self withSelector:@selector(_continueLoadRequestAfterNewWindowPolicy:frameName:formState:)];
+	    [request release];
+	    [formState release];
+	    return;
+	}
+    }
+
+    [targetFrame _loadRequest:request triggeringAction:action loadType:WebFrameLoadTypeStandard formState:formState];
 
     [request release];
     [formState release];
@@ -1810,6 +1923,24 @@ static CFAbsoluteTime _timeOfLastCompletedLoad;
     return [URLString isEqual:[item URLString]] || [URLString isEqual:[item originalURLString]];
 }    
 
+- (void)_loadRequest:(WebRequest *)request inFrameNamed:(NSString *)frameName
+{
+    if (frameName == nil) {
+	[self loadRequest:request];
+	return;
+    }
+
+    WebFrame *frame = [self findFrameNamed:frameName];
+    
+    if (frame != nil) {
+	[frame loadRequest:request];
+	return;
+    }
+
+    NSDictionary *action = [self _actionInformationForNavigationType:WebNavigationTypeOther event:nil originalURL:[request URL]];
+    [self _checkNewWindowPolicyForRequest:request action:(NSDictionary *)action frameName:frameName formState:nil andCall:self withSelector:@selector(_continueLoadRequestAfterNewWindowPolicy:frameName:formState:)];
+}
+
 @end
 
 @implementation WebFormState : NSObject
diff --git a/WebKit/WebView.subproj/WebPolicyDelegate.h b/WebKit/WebView.subproj/WebPolicyDelegate.h
index 68a5769..a4599e1 100644
--- a/WebKit/WebView.subproj/WebPolicyDelegate.h
+++ b/WebKit/WebView.subproj/WebPolicyDelegate.h
@@ -47,15 +47,11 @@ extern NSString *WebActionOriginalURLKey; // NSURL
     @abstract Potential actions to take when loading a URL
     @constant WebPolicyUse Have WebKit use the resource.
     @constant WebPolicySave Save the resource to disk.
-    @constant WebPolicyOpenNewWindow Open the resource in another window.
-    @constant WebPolicyOpenNewWindowBehind Open the resource in another window behind this window.
     @constant WebPolicyIgnore Do nothing with the resource.
 */
 typedef enum {
     WebPolicyUse,
     WebPolicySave,
-    WebPolicyOpenNewWindow,
-    WebPolicyOpenNewWindowBehind,
     WebPolicyIgnore,
 } WebPolicyAction;
 
@@ -75,28 +71,51 @@ typedef enum {
 
 /*!
     @category WebPolicyDelegate
-    @discussion While loading a URL, WebKit asks the WebPolicyDelegate for
+    @discussion While loading a URL, WebKit asks the WebControllerPolicyDelegate for
     policies that determine the action of what to do with the URL or the data that
     the URL represents. Typically, the policy handler methods are called in this order:
 
-    decideNavigationPolicyForAction:andRequest:inFrame:decisionListener:<BR>
-    contentPolicyForMIMEType:andRequest:inFrame:<BR>
+    decideNewWindowPolicyForAction:andRequest:newFrameName:decisionListener: (at most once)<BR>
+    decideNavigationPolicyForAction:inFrame::decisionListener: (one or more times)<BR>
+    contentPolicyForMIMEType:andRequest:inFrame: (at most once)<BR>
 */
 @interface NSObject (WebPolicyDelegate)
 
 /*!
-     @method decideNavigationPolicyForAction:andRequest:inFrame:decisionListener:
-     @discussion Called right after the user clicks on a link.
-     @param actionInformation Dictionary that describes the action that triggered this navigation.
-     @param request The request for the proposed navigation
-     @param frame The frame in which the navigation is taking place
-     @param listener The object to call when the decision is made
+   @method decideNavigationPolicyForAction:andRequest:inFrame:decisionListener:
+   @abstract This method is called to decide what to do with a proposed navigation.
+   @param actionInformation Dictionary that describes the action that triggered this navigation.
+   @param request The request for the proposed navigation
+   @param frame The WebFrame in which the navigation is happening
+   @param listener The object to call when the decision is made
+   @discussion This method will be called before loading starts, and
+   on every redirect.
 */
 - (void)decideNavigationPolicyForAction:(NSDictionary *)actionInformation
                              andRequest:(WebRequest *)request
                                 inFrame:(WebFrame *)frame
                        decisionListener:(WebPolicyDecisionListener *)listener;
 
+/*!
+     @method decideNewWindowPolicyForAction:andRequest:newFrameName:decisionListener:
+     @discussion This method is called to decide what to do with an targetted nagivation that would open a new window.
+     @param actionInformation Dictionary that describes the action that triggered this navigation.
+     @param request The request for the proposed navigation
+     @param frame The frame in which the navigation is taking place
+     @param listener The object to call when the decision is made
+     @discussion This method is provided so that modified clicks on a targetted link which
+     opens a new frame can prevent the new window from being opened if they decide to
+     do something else, like download or present the new frame in a specialized way. 
+
+     <p>If this method picks a policy of Use, the new window will be
+     opened, and decideNavigationPolicyForAction:andRequest:inFrame:decisionListner:
+     will be called with a WebNavigationType of WebNavigationTypeOther
+     in its action. This is to avoid possible confusion about the modifiers.
+*/
+- (void)decideNewWindowPolicyForAction:(NSDictionary *)actionInformation
+                            andRequest:(WebRequest *)request
+                          newFrameName:(NSString *)frameName
+                      decisionListener:(WebPolicyDecisionListener *)listener;
 
 /*!
     @method contentPolicyForMIMEType:andRequest:inFrame:
diff --git a/WebKit/WebView.subproj/WebUIDelegate.h b/WebKit/WebView.subproj/WebUIDelegate.h
index aeffb80..31b0670 100644
--- a/WebKit/WebView.subproj/WebUIDelegate.h
+++ b/WebKit/WebView.subproj/WebUIDelegate.h
@@ -46,7 +46,7 @@
     @method createWindowWithRequest:
     @abstract Create a new window and begin to load the specified request.
     @discussion The newly created window is hidden, and the window operations delegate on the
-    new controllers will get a showWindow or showWindowBehindFrontmost call.
+    new controllers will get a showWindow call.
     @param request The request to load.
     @result The WebController for the WebView in the new window.
 */
@@ -62,15 +62,6 @@
 - (void)showWindow;
 
 /*!
-    @method showWindowBehindFrontmost
-    @abstract Show the window that contains the top level view of the controller,
-    ordering it behind the main window.
-    @discussion This will only be called just after createWindowWithRequest:
-    is used to create a new window.
-*/
-- (void)showWindowBehindFrontmost;
-
-/*!
     @method closeWindow
     @abstract Close the current window. 
     @discussion Clients showing multiple views in one window may
diff --git a/WebKit/WebView.subproj/WebViewPrivate.h b/WebKit/WebView.subproj/WebViewPrivate.h
index 488154c..3e41538 100644
--- a/WebKit/WebView.subproj/WebViewPrivate.h
+++ b/WebKit/WebView.subproj/WebViewPrivate.h
@@ -92,7 +92,7 @@ enum { NumUserAgentStringTypes = WinIE + 1 };
 - (WebFrame *)_findFrameInThisWindowNamed: (NSString *)name;
 - (WebFrame *)_findFrameNamed: (NSString *)name;
 
-- (WebController *)_openNewWindowWithRequest:(WebRequest *)request behind:(BOOL)behind;
+- (WebController *)_openNewWindowWithRequest:(WebRequest *)request;
 
 - (NSMenu *)_menuForElement:(NSDictionary *)element;
 
diff --git a/WebKit/WebView.subproj/WebViewPrivate.m b/WebKit/WebView.subproj/WebViewPrivate.m
index 2ebca6b..37bb551 100644
--- a/WebKit/WebView.subproj/WebViewPrivate.m
+++ b/WebKit/WebView.subproj/WebViewPrivate.m
@@ -293,7 +293,7 @@
     return frame;
 }
 
-- (WebController *)_openNewWindowWithRequest:(WebRequest *)request behind:(BOOL)behind
+- (WebController *)_openNewWindowWithRequest:(WebRequest *)request
 {
     id wd = [self windowOperationsDelegate];
     WebController *newWindowController = nil;
@@ -302,11 +302,9 @@
     else {
         [[WebDefaultWindowOperationsDelegate sharedWindowOperationsDelegate] createWindowWithRequest: request];
     }
-    if (behind) {
-        [[newWindowController _windowOperationsDelegateForwarder] showWindowBehindFrontmost];
-    } else {
-        [[newWindowController _windowOperationsDelegateForwarder] showWindow];
-    }
+
+    [[newWindowController _windowOperationsDelegateForwarder] showWindow];
+
     return newWindowController;
 }
 
diff --git a/WebKit/WebView.subproj/WebWindowOperationsDelegate.h b/WebKit/WebView.subproj/WebWindowOperationsDelegate.h
index aeffb80..31b0670 100644
--- a/WebKit/WebView.subproj/WebWindowOperationsDelegate.h
+++ b/WebKit/WebView.subproj/WebWindowOperationsDelegate.h
@@ -46,7 +46,7 @@
     @method createWindowWithRequest:
     @abstract Create a new window and begin to load the specified request.
     @discussion The newly created window is hidden, and the window operations delegate on the
-    new controllers will get a showWindow or showWindowBehindFrontmost call.
+    new controllers will get a showWindow call.
     @param request The request to load.
     @result The WebController for the WebView in the new window.
 */
@@ -62,15 +62,6 @@
 - (void)showWindow;
 
 /*!
-    @method showWindowBehindFrontmost
-    @abstract Show the window that contains the top level view of the controller,
-    ordering it behind the main window.
-    @discussion This will only be called just after createWindowWithRequest:
-    is used to create a new window.
-*/
-- (void)showWindowBehindFrontmost;
-
-/*!
     @method closeWindow
     @abstract Close the current window. 
     @discussion Clients showing multiple views in one window may

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list