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

Unified Diff: Source/core/css/resolver/ScopedStyleResolver.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/resolver/ScopedStyleResolver.cpp
diff --git a/Source/core/css/resolver/ScopedStyleResolver.cpp b/Source/core/css/resolver/ScopedStyleResolver.cpp
index 3190423c3475c843f8b945b41a9dc98ec57d7d73..ff52d8e89a5db3054c940b190359c642920a256c 100644
--- a/Source/core/css/resolver/ScopedStyleResolver.cpp
+++ b/Source/core/css/resolver/ScopedStyleResolver.cpp
@@ -46,25 +46,15 @@ ContainerNode* ScopedStyleResolver::scopingNodeFor(Document& document, const CSS
{
ASSERT(sheet);
- Document* sheetDocument = sheet->ownerDocument();
- if (!sheetDocument)
- return 0;
tasak 2014/06/03 05:57:48 I think, this code is not related to style scoped.
kochi 2014/06/03 07:47:05 Thanks for the explanation. I'll separate changes
Node* ownerNode = sheet->ownerNode();
if (!isHTMLStyleElement(ownerNode))
return &document;
HTMLStyleElement& styleElement = toHTMLStyleElement(*ownerNode);
- if (!styleElement.scoped()) {
- if (styleElement.isInShadowTree())
- return styleElement.containingShadowRoot();
- return &document;
- }
-
- ContainerNode* parent = styleElement.parentNode();
- if (!parent)
- return 0;
+ if (styleElement.isInShadowTree())
tasak 2014/06/03 05:57:48 If we keep isScoped method in HTMLStyleElement, it
kochi 2014/06/03 07:47:05 As I removed isScoepd(), isInShadowTree() is fine
+ return styleElement.containingShadowRoot();
- return (parent->isElementNode() || parent->isShadowRoot()) ? parent : 0;
+ return &document;
}
void ScopedStyleResolver::addRulesFromSheet(CSSStyleSheet* cssSheet, const MediaQueryEvaluator& medium, StyleResolver* resolver)

Powered by Google App Engine
This is Rietveld 408576698