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

Unified Diff: third_party/WebKit/Source/core/html/parser/HTMLTreeBuilder.cpp

Issue 2628723004: Experiment with restricting form submission with open elements. (Closed)
Patch Set: Rebase. Created 3 years, 11 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/parser/HTMLTreeBuilder.cpp
diff --git a/third_party/WebKit/Source/core/html/parser/HTMLTreeBuilder.cpp b/third_party/WebKit/Source/core/html/parser/HTMLTreeBuilder.cpp
index 16fb629c4bba4203492db46f55bb96f4cf0472a0..b7cec90696711cadc138a282e20bb86f55d9ec27 100644
--- a/third_party/WebKit/Source/core/html/parser/HTMLTreeBuilder.cpp
+++ b/third_party/WebKit/Source/core/html/parser/HTMLTreeBuilder.cpp
@@ -37,6 +37,7 @@
#include "core/dom/DocumentFragment.h"
#include "core/dom/ElementTraversal.h"
#include "core/frame/UseCounter.h"
+#include "core/html/HTMLFormControlElement.h"
#include "core/html/HTMLFormElement.h"
#include "core/html/HTMLTemplateElement.h"
#include "core/html/parser/AtomicHTMLToken.h"
@@ -2430,17 +2431,21 @@ void HTMLTreeBuilder::processEndOfFile(AtomicHTMLToken* token) {
defaultForInTableText();
processEndOfFile(token);
return;
- case TextMode:
+ case TextMode: {
parseError(token);
if (m_tree.currentStackItem()->hasTagName(scriptTag)) {
// Mark the script element as "already started".
DVLOG(1) << "Not implemented.";
}
+ Element* el = m_tree.openElements()->top();
+ if (isHTMLTextAreaElement(el))
+ toHTMLFormControlElement(el)->setBlocksFormSubmission(true);
m_tree.openElements()->pop();
ASSERT(m_originalInsertionMode != TextMode);
setInsertionMode(m_originalInsertionMode);
processEndOfFile(token);
return;
+ }
case TemplateContentsMode:
if (processEndOfFileForInTemplateContents(token))
return;

Powered by Google App Engine
This is Rietveld 408576698