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

Unified Diff: Source/core/html/parser/HTMLScriptRunner.cpp

Issue 14660019: Run Mutation Observer and Custom Element callbacks consistently at microtask checkpoint (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Patch for landing. Created 7 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
« no previous file with comments | « Source/core/dom/Microtask.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/parser/HTMLScriptRunner.cpp
diff --git a/Source/core/html/parser/HTMLScriptRunner.cpp b/Source/core/html/parser/HTMLScriptRunner.cpp
index d5ca07ccd05ab7b049e6c80266b0d5c795909ec0..0429e96c6c5828782c84fe4cb622a17dd839ec25 100644
--- a/Source/core/html/parser/HTMLScriptRunner.cpp
+++ b/Source/core/html/parser/HTMLScriptRunner.cpp
@@ -27,11 +27,10 @@
#include "core/html/parser/HTMLScriptRunner.h"
#include "bindings/v8/ScriptSourceCode.h"
-#include "core/dom/CustomElementRegistry.h"
#include "core/dom/Element.h"
#include "core/dom/Event.h"
#include "core/dom/IgnoreDestructiveWriteCountIncrementer.h"
-#include "core/dom/MutationObserver.h"
+#include "core/dom/Microtask.h"
#include "core/dom/ScriptElement.h"
#include "core/html/parser/HTMLInputStream.h"
#include "core/html/parser/HTMLScriptRunnerHost.h"
@@ -126,10 +125,8 @@ void HTMLScriptRunner::executePendingScriptAndDispatchEvent(PendingScript& pendi
if (pendingScript.cachedScript() && pendingScript.watchingForLoad())
stopWatchingForLoad(pendingScript);
- if (!isExecutingScript()) {
- CustomElementRegistry::deliverAllLifecycleCallbacks();
- MutationObserver::deliverAllMutations();
- }
+ if (!isExecutingScript())
+ Microtask::performCheckpoint();
// Clear the pending script before possible rentrancy from executeScript()
RefPtr<Element> element = pendingScript.releaseElementAndClear();
@@ -292,10 +289,8 @@ void HTMLScriptRunner::runScript(Element* script, const TextPosition& scriptStar
// every script element, even if it's not ready to execute yet. There's
// unfortuantely no obvious way to tell if prepareScript is going to
// execute the script from out here.
- if (!isExecutingScript()) {
- CustomElementRegistry::deliverAllLifecycleCallbacks();
- MutationObserver::deliverAllMutations();
- }
+ if (!isExecutingScript())
+ Microtask::performCheckpoint();
InsertionPointRecord insertionPointRecord(m_host->inputStream());
NestingLevelIncrementer nestingLevelIncrementer(m_scriptNestingLevel);
« no previous file with comments | « Source/core/dom/Microtask.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698