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

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: Updated as per review comments 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..5726e586baa9fb4da9f3d02d036c79edd8a020a0 100644
--- a/third_party/WebKit/Source/core/html/HTMLFormElement.cpp
+++ b/third_party/WebKit/Source/core/html/HTMLFormElement.cpp
@@ -296,6 +296,11 @@ void HTMLFormElement::prepareForSubmission(Event* event)
if (!frame || m_isSubmittingOrInUserJSSubmitEvent)
return;
+ if (document().isSandboxed(SandboxForms)) {
+ 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