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 |