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

Unified Diff: Source/core/css/invalidation/StyleSheetInvalidationAnalysis.cpp

Issue 310443002: Remove scoped styles. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix layout test Created 6 years, 7 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/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;
}

Powered by Google App Engine
This is Rietveld 408576698