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

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

Issue 2369853002: HTML parser: implementing throw-on-dynamic-markup-insertion counter (Closed)
Patch Set: copyright comment update Created 4 years, 3 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/Source/core/dom/ThrowOnDynamicMarkupInsertionCountIncrementer.h ('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/parser/HTMLConstructionSite.cpp
diff --git a/third_party/WebKit/Source/core/html/parser/HTMLConstructionSite.cpp b/third_party/WebKit/Source/core/html/parser/HTMLConstructionSite.cpp
index ce0c04906fefd85a38222153317939e4df4e08fd..d0744ad1efacccf16742ded99b850d928d6c4a62 100644
--- a/third_party/WebKit/Source/core/html/parser/HTMLConstructionSite.cpp
+++ b/third_party/WebKit/Source/core/html/parser/HTMLConstructionSite.cpp
@@ -39,6 +39,7 @@
#include "core/dom/ScriptLoader.h"
#include "core/dom/TemplateContentDocumentFragment.h"
#include "core/dom/Text.h"
+#include "core/dom/ThrowOnDynamicMarkupInsertionCountIncrementer.h"
#include "core/dom/custom/CEReactionsScope.h"
#include "core/dom/custom/CustomElementDefinition.h"
#include "core/dom/custom/CustomElementDescriptor.h"
@@ -809,28 +810,21 @@ HTMLElement* HTMLConstructionSite::createHTMLElement(AtomicHTMLToken* token)
HTMLElement* element;
if (willExecuteScript) {
- // "6.1 Increment the parser's script nesting level."
- HTMLParserReentryPermit::ScriptNestingLevelIncrementer incrementScriptNestingLevel = m_reentryPermit->incrementScriptNestingLevel();
-
- // "6.2 Set the parser pause flag to true."
- m_reentryPermit->pause();
-
- // TODO(dominicc): Change this once resolved:
- // https://github.com/whatwg/html/issues/1630
- IgnoreDestructiveWriteCountIncrementer ignoreDestructiveWrites(
+ // "6.1 Increment the document's throw-on-dynamic-insertion counter."
+ ThrowOnDynamicMarkupInsertionCountIncrementer throwOnDynamicMarkupInsertions(
&document);
- // "6.3 If the JavaScript execution context stack is empty,
+ // "6.2 If the JavaScript execution context stack is empty,
// then perform a microtask checkpoint."
// TODO(dominicc): This is the way the Blink HTML parser
// performs checkpoints, but note the spec is different--it
// talks about the JavaScript stack, not the script nesting
// level.
- if (1u == m_reentryPermit->scriptNestingLevel())
+ if (0u == m_reentryPermit->scriptNestingLevel())
Microtask::performCheckpoint(V8PerIsolateData::mainThreadIsolate());
- // "6.4 Push a new element queue onto the custom element
+ // "6.3 Push a new element queue onto the custom element
// reactions stack."
CEReactionsScope reactions;
@@ -845,8 +839,8 @@ HTMLElement* HTMLConstructionSite::createHTMLElement(AtomicHTMLToken* token)
element->setAttribute(attribute.name(), attribute.value());
// "9. If will execute script is true, then ..." etc. The
- // CEReactionsScope and ScriptNestingLevelIncrementer
- // destructors implement steps 9.1-4.
+ // CEReactionsScope and ThrowOnDynamicMarkupInsertionCountIncrementer
+ // destructors implement steps 9.1-3.
} else {
// FIXME: This can't use
// HTMLConstructionSite::createElement because we have to
« no previous file with comments | « third_party/WebKit/Source/core/dom/ThrowOnDynamicMarkupInsertionCountIncrementer.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698