Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(305)

Unified Diff: third_party/WebKit/Source/core/loader/FrameLoader.cpp

Issue 2417983002: Form submissions opening in a new window don't need special treatment anymore. (Closed)
Patch Set: Using params.source_site_instance for consistency with //chrome layer. Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/loader/FrameLoader.cpp
diff --git a/third_party/WebKit/Source/core/loader/FrameLoader.cpp b/third_party/WebKit/Source/core/loader/FrameLoader.cpp
index 0d747116c33fbd3a16e46ee4bd2f29bc1b866f28..515f0d5e08b88673a881be2d1c1a36f1872f7f39 100644
--- a/third_party/WebKit/Source/core/loader/FrameLoader.cpp
+++ b/third_party/WebKit/Source/core/loader/FrameLoader.cpp
@@ -958,17 +958,6 @@ bool FrameLoader::prepareRequestForThisFrame(FrameLoadRequest& request) {
return true;
}
-static bool shouldOpenInNewWindow(Frame* targetFrame,
- const FrameLoadRequest& request,
- NavigationPolicy policy) {
- if (!targetFrame && !request.frameName().isEmpty())
- return true;
- // FIXME: This case is a workaround for the fact that ctrl+clicking a form
- // submission incorrectly sends as a GET rather than a POST if it creates a
- // new window in a different process.
- return request.form() && policy != NavigationPolicyCurrentTab;
-}
-
static bool shouldNavigateTargetFrame(NavigationPolicy policy) {
switch (policy) {
case NavigationPolicyCurrentTab:
@@ -1101,6 +1090,8 @@ void FrameLoader::load(const FrameLoadRequest& passedRequest,
m_provisionalItem = historyItem;
}
+ // Form submissions appear to need their special-case of finding the target at
+ // schedule rather than at fire.
Frame* targetFrame = request.form()
? nullptr
: m_frame->findFrameForNavigation(
@@ -1120,7 +1111,7 @@ void FrameLoader::load(const FrameLoadRequest& passedRequest,
setReferrerForFrameRequest(request);
- if (shouldOpenInNewWindow(targetFrame, request, policy)) {
+ if (!targetFrame && !request.frameName().isEmpty()) {
if (policy == NavigationPolicyDownload) {
client()->loadURLExternally(request.resourceRequest(),
NavigationPolicyDownload, String(), false);

Powered by Google App Engine
This is Rietveld 408576698