| Index: Source/core/css/resolver/ScopedStyleResolver.cpp
|
| diff --git a/Source/core/css/resolver/ScopedStyleResolver.cpp b/Source/core/css/resolver/ScopedStyleResolver.cpp
|
| index ff18794ba7ce7845da87c7edeb2270e654ab908f..3190423c3475c843f8b945b41a9dc98ec57d7d73 100644
|
| --- a/Source/core/css/resolver/ScopedStyleResolver.cpp
|
| +++ b/Source/core/css/resolver/ScopedStyleResolver.cpp
|
| @@ -49,15 +49,22 @@
|
| Document* sheetDocument = sheet->ownerDocument();
|
| if (!sheetDocument)
|
| return 0;
|
| -
|
| Node* ownerNode = sheet->ownerNode();
|
| if (!isHTMLStyleElement(ownerNode))
|
| return &document;
|
|
|
| HTMLStyleElement& styleElement = toHTMLStyleElement(*ownerNode);
|
| - if (styleElement.isInShadowTree())
|
| - return styleElement.containingShadowRoot();
|
| - return &document;
|
| + if (!styleElement.scoped()) {
|
| + if (styleElement.isInShadowTree())
|
| + return styleElement.containingShadowRoot();
|
| + return &document;
|
| + }
|
| +
|
| + ContainerNode* parent = styleElement.parentNode();
|
| + if (!parent)
|
| + return 0;
|
| +
|
| + return (parent->isElementNode() || parent->isShadowRoot()) ? parent : 0;
|
| }
|
|
|
| void ScopedStyleResolver::addRulesFromSheet(CSSStyleSheet* cssSheet, const MediaQueryEvaluator& medium, StyleResolver* resolver)
|
|
|