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

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

Issue 178333005: Avoid calling Node::numberOfScopedHTMLStyleChildren() to check for existence (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 10 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 | « no previous file | Source/core/dom/StyleSheetScopingNodeList.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/Node.cpp
diff --git a/Source/core/dom/Node.cpp b/Source/core/dom/Node.cpp
index 63dd1935cc7dc1452b07f22e7becee1113658d3c..f917097592686ade40ed6f6628729bd759088a94 100644
--- a/Source/core/dom/Node.cpp
+++ b/Source/core/dom/Node.cpp
@@ -2465,7 +2465,11 @@ void Node::registerScopedHTMLStyleChild()
void Node::unregisterScopedHTMLStyleChild()
{
ASSERT(hasScopedHTMLStyleChild());
- setHasScopedHTMLStyleChild(numberOfScopedHTMLStyleChildren());
+ for (Element* child = ElementTraversal::firstWithin(*this); child; child = ElementTraversal::nextSibling(*child)) {
+ if (child->hasTagName(HTMLNames::styleTag) && toHTMLStyleElement(child)->isRegisteredAsScoped())
+ return;
+ }
+ setHasScopedHTMLStyleChild(false);
}
size_t Node::numberOfScopedHTMLStyleChildren() const
« no previous file with comments | « no previous file | Source/core/dom/StyleSheetScopingNodeList.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698