Index: Source/core/dom/ShadowTreeStyleSheetCollection.cpp |
diff --git a/Source/core/dom/ShadowTreeStyleSheetCollection.cpp b/Source/core/dom/ShadowTreeStyleSheetCollection.cpp |
index 3e819928f682563f59ad05d4799d7d80e77992bf..38f05b3ccee3c0098d8c73f6a3cd66d81a9f649f 100644 |
--- a/Source/core/dom/ShadowTreeStyleSheetCollection.cpp |
+++ b/Source/core/dom/ShadowTreeStyleSheetCollection.cpp |
@@ -67,18 +67,16 @@ void ShadowTreeStyleSheetCollection::collectStyleSheets(StyleEngine* engine, Sty |
// FIXME: clarify how PREFERRED or ALTERNATE works in shadow trees. |
// Should we set preferred/selected stylesheets name in shadow trees and |
// use the name in document? |
- const AtomicString& rel = element->fastGetAttribute(relAttr); |
if (!enabledViaScript && sheet && !title.isEmpty()) { |
if (engine->preferredStylesheetSetName().isEmpty()) { |
- if (element->hasLocalName(styleTag) || !rel.contains("alternate")) { |
- engine->setPreferredStylesheetSetName(title); |
- engine->setSelectedStylesheetSetName(title); |
- } |
+ engine->setPreferredStylesheetSetName(title); |
+ engine->setSelectedStylesheetSetName(title); |
} |
if (title != engine->preferredStylesheetSetName()) |
activeSheet = 0; |
} |
+ const AtomicString& rel = element->fastGetAttribute(relAttr); |
if (rel.contains("alternate") && title.isEmpty()) |
activeSheet = 0; |