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

Unified Diff: third_party/WebKit/Source/core/html/HTMLFormElement.cpp

Issue 1999573003: OOPIFs: Fixing submitting forms targeting a remote frame. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@form-target-is-cross-site-frame
Patch Set: Added a TODO for investigating if remote and local frames can be handled uniformly. Created 4 years, 6 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/html/HTMLFormElement.cpp
diff --git a/third_party/WebKit/Source/core/html/HTMLFormElement.cpp b/third_party/WebKit/Source/core/html/HTMLFormElement.cpp
index f7ea19c53f1eee1af4c92890cace9f99f61136de..07d4e00a492a4eb51ae53c3fae40996e08313b82 100644
--- a/third_party/WebKit/Source/core/html/HTMLFormElement.cpp
+++ b/third_party/WebKit/Source/core/html/HTMLFormElement.cpp
@@ -36,6 +36,7 @@
#include "core/events/ScopedEventQueue.h"
#include "core/frame/LocalDOMWindow.h"
#include "core/frame/LocalFrame.h"
+#include "core/frame/RemoteFrame.h"
#include "core/frame/UseCounter.h"
#include "core/frame/csp/ContentSecurityPolicy.h"
#include "core/html/HTMLCollection.h"
@@ -47,6 +48,7 @@
#include "core/html/RadioNodeList.h"
#include "core/html/forms/FormController.h"
#include "core/inspector/ConsoleMessage.h"
+#include "core/loader/FormSubmission.h"
#include "core/loader/FrameLoader.h"
#include "core/loader/FrameLoaderClient.h"
#include "core/loader/MixedContentChecker.h"
@@ -420,9 +422,15 @@ void HTMLFormElement::scheduleFormSubmission(FormSubmission* submission)
if (MixedContentChecker::isMixedFormAction(document().frame(), submission->action()))
UseCounter::count(document().frame(), UseCounter::MixedContentFormsSubmitted);
- // FIXME: Plumb form submission for remote frames.
- if (targetFrame->isLocalFrame())
+ // TODO(lukasza): Investigate if the code below can uniformly handle remote
+ // and local frames (i.e. by calling virtual Frame::navigate from a timer).
+ // See also https://goo.gl/95d2KA.
+ if (targetFrame->isLocalFrame()) {
toLocalFrame(targetFrame)->navigationScheduler().scheduleFormSubmission(&document(), submission);
+ } else {
+ FrameLoadRequest frameLoadRequest = submission->createFrameLoadRequest(&document());
+ toRemoteFrame(targetFrame)->navigate(frameLoadRequest);
+ }
}
void HTMLFormElement::reset()
« no previous file with comments | « third_party/WebKit/Source/core/frame/RemoteFrame.cpp ('k') | third_party/WebKit/Source/core/loader/FormSubmission.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698