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

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

Issue 2191493002: Form submission should abort before constraint validation if sandboxed forms flag is set. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Form submission should abort before constraint validation if sandboxed forms flag is set. Created 4 years, 5 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
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/frames/resources/sandboxed-iframe-src.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 74f3f106150e0d12189e8154076f81e77a99dc13..17fb9256c083edd26ec577f6af8f3d1f1d0d6100 100644
--- a/third_party/WebKit/Source/core/html/HTMLFormElement.cpp
+++ b/third_party/WebKit/Source/core/html/HTMLFormElement.cpp
@@ -296,6 +296,12 @@ void HTMLFormElement::prepareForSubmission(Event* event)
if (!frame || m_isSubmittingOrInUserJSSubmitEvent)
return;
+ if (document().isSandboxed(SandboxForms)) {
+ // FIXME: This message should be moved off the console once a solution to https://bugs.webkit.org/show_bug.cgi?id=103274 exists.
Mike West 2016/07/28 09:26:47 Drop this comment; at this point, I don't think we
ramya.v 2016/07/28 09:37:15 Done.
+ document().addConsoleMessage(ConsoleMessage::create(SecurityMessageSource, ErrorMessageLevel, "Blocked form submission to '" + m_attributes.action() + "' because the form's frame is sandboxed and the 'allow-forms' permission is not set."));
+ return;
+ }
+
bool skipValidation = !document().page() || noValidate();
ASSERT(event);
HTMLFormControlElement* submitElement = submitElementFromEvent(event);
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/frames/resources/sandboxed-iframe-src.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698