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

Unified Diff: Source/core/dom/ScriptElement.cpp

Issue 15871005: Avoid N^2 walk placing renderers when building the render tree (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Adding a mitigation for the perf regression to Element::recalcStyle. 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/ScriptElement.h ('k') | Source/core/dom/Text.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/ScriptElement.cpp
diff --git a/Source/core/dom/ScriptElement.cpp b/Source/core/dom/ScriptElement.cpp
index b2c13ae43da8b6111dbca7627fdec7c76871bc73..b9d68d8cb643730459000801117343c37cb9e766 100644
--- a/Source/core/dom/ScriptElement.cpp
+++ b/Source/core/dom/ScriptElement.cpp
@@ -77,10 +77,16 @@ ScriptElement::~ScriptElement()
stopLoadRequest();
}
+void ScriptElement::prepareScriptCallback(Element* element)
+{
+ ASSERT(toScriptElementIfPossible(element));
+ toScriptElementIfPossible(element)->prepareScript();
+}
+
void ScriptElement::insertedInto(ContainerNode* insertionPoint)
{
if (insertionPoint->inDocument() && !m_parserInserted)
- prepareScript(); // FIXME: Provide a real starting line number here.
+ ContainerNode::queueInsertionCallback(prepareScriptCallback, m_element); // FIXME: Provide a real starting line number here.
}
void ScriptElement::childrenChanged()
« no previous file with comments | « Source/core/dom/ScriptElement.h ('k') | Source/core/dom/Text.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698