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

Unified Diff: Source/core/loader/FormSubmission.cpp

Issue 339593005: Set the target type when creating the request for main resource (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 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: Source/core/loader/FormSubmission.cpp
diff --git a/Source/core/loader/FormSubmission.cpp b/Source/core/loader/FormSubmission.cpp
index 8b6c22b22009bdf4d5b5dbe6a017a6e6987aadcb..74acc78415184a29f4b055d6af9f921a31991138 100644
--- a/Source/core/loader/FormSubmission.cpp
+++ b/Source/core/loader/FormSubmission.cpp
@@ -34,6 +34,7 @@
#include "core/HTMLNames.h"
#include "core/dom/Document.h"
#include "core/events/Event.h"
+#include "core/frame/LocalFrame.h"
#include "core/html/DOMFormData.h"
#include "core/html/HTMLFormControlElement.h"
#include "core/html/HTMLFormElement.h"
@@ -263,6 +264,10 @@ KURL FormSubmission::requestURL() const
void FormSubmission::populateFrameLoadRequest(FrameLoadRequest& frameRequest)
{
+ LocalFrame* frame = frameRequest.originDocument()->frame();
+ if (frame)
+ frameRequest.resourceRequest().initializeForMainResource(frame->isMainFrame());
+
if (!m_target.isEmpty())
frameRequest.setFrameName(m_target);

Powered by Google App Engine
This is Rietveld 408576698