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

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

Issue 27537009: Avoid always style recalc when removing stylesheets. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 2 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: Source/core/dom/StyleSheetScopingNodeList.cpp
diff --git a/Source/core/dom/StyleSheetScopingNodeList.cpp b/Source/core/dom/StyleSheetScopingNodeList.cpp
index 7510eb01861877015221c9c7d087affc4e4a3f06..e2a5b3da044d13db917210f1a9239bc572c9e72b 100644
--- a/Source/core/dom/StyleSheetScopingNodeList.cpp
+++ b/Source/core/dom/StyleSheetScopingNodeList.cpp
@@ -51,10 +51,11 @@ void StyleSheetScopingNodeList::remove(ContainerNode* node)
if (isTreeScopeRoot(node) || !m_scopingNodes)
return;
- m_scopingNodes->remove(node);
+ // If the node is still working as a scoping node, we cannot remove.
if (node->inDocument() && node->numberOfScopedHTMLStyleChildren())
return;
+ m_scopingNodes->remove(node);
if (!m_scopingNodesRemoved)
m_scopingNodesRemoved = adoptPtr(new ListHashSet<Node*, 4>());
m_scopingNodesRemoved->add(node);

Powered by Google App Engine
This is Rietveld 408576698