Chromium Code Reviews| Index: Source/core/css/invalidation/StyleSheetInvalidationAnalysis.cpp |
| diff --git a/Source/core/css/invalidation/StyleSheetInvalidationAnalysis.cpp b/Source/core/css/invalidation/StyleSheetInvalidationAnalysis.cpp |
| index c7dd4216b09784827d84ead60231550478099e1e..969f7b3144f69ed2651481bb2010253cb0e719e6 100644 |
| --- a/Source/core/css/invalidation/StyleSheetInvalidationAnalysis.cpp |
| +++ b/Source/core/css/invalidation/StyleSheetInvalidationAnalysis.cpp |
| @@ -94,22 +94,18 @@ static bool hasDistributedRule(StyleSheetContents* styleSheetContents) |
| static Node* determineScopingNodeForStyleScoped(HTMLStyleElement* ownerElement, StyleSheetContents* styleSheetContents) |
|
tasak
2014/06/03 05:57:48
Probably it would be better to rename this functio
kochi
2014/06/03 07:47:05
Done.
|
| { |
| - ASSERT(ownerElement && ownerElement->isRegisteredAsScoped()); |
| - |
| - if (ownerElement->isInShadowTree()) { |
| - if (hasDistributedRule(styleSheetContents)) { |
| - ContainerNode* scope = ownerElement; |
| - do { |
| - scope = scope->containingShadowRoot()->shadowHost(); |
| - } while (scope->isInShadowTree()); |
| - |
| - return scope; |
| - } |
| - if (ownerElement->isRegisteredAsScoped()) |
| - return ownerElement->containingShadowRoot()->shadowHost(); |
| + ASSERT(ownerElement && ownerElement->isScoped()); |
| + ASSERT(ownerElement->isInShadowTree()); |
|
tasak
2014/06/03 05:57:48
Now isScoped() has the same meaning as isInShadowT
kochi
2014/06/03 07:47:05
Reduced to one ASSERT().
|
| + |
| + if (hasDistributedRule(styleSheetContents)) { |
| + ContainerNode* scope = ownerElement; |
| + do { |
| + scope = scope->containingShadowRoot()->shadowHost(); |
| + } while (scope->isInShadowTree()); |
| + return scope; |
| } |
| - return ownerElement->isRegisteredInShadowRoot() ? ownerElement->containingShadowRoot()->shadowHost() : ownerElement->parentNode(); |
| + return ownerElement->containingShadowRoot()->shadowHost(); |
| } |
| static bool ruleAdditionMightRequireDocumentStyleRecalc(StyleRuleBase* rule) |
| @@ -157,7 +153,7 @@ void StyleSheetInvalidationAnalysis::analyzeStyleSheet(StyleSheetContents* style |
| } |
| if (styleSheetContents->hasSingleOwnerNode()) { |
| Node* ownerNode = styleSheetContents->singleOwnerNode(); |
| - if (isHTMLStyleElement(ownerNode) && toHTMLStyleElement(*ownerNode).isRegisteredAsScoped()) { |
| + if (isHTMLStyleElement(ownerNode) && toHTMLStyleElement(*ownerNode).isScoped()) { |
| m_scopingNodes.append(determineScopingNodeForStyleScoped(toHTMLStyleElement(ownerNode), styleSheetContents)); |
| return; |
| } |