Index: third_party/WebKit/Source/core/dom/StyleSheetCandidate.cpp |
diff --git a/third_party/WebKit/Source/core/dom/StyleSheetCandidate.cpp b/third_party/WebKit/Source/core/dom/StyleSheetCandidate.cpp |
index e2f7b233e5925814a20eec219fe4a5e04889c29f..d1a15e49a39c50c834b1014a363b69cee214cdb8 100644 |
--- a/third_party/WebKit/Source/core/dom/StyleSheetCandidate.cpp |
+++ b/third_party/WebKit/Source/core/dom/StyleSheetCandidate.cpp |
@@ -88,8 +88,12 @@ bool StyleSheetCandidate::canBeActivated(const String& currentPreferrableName) c |
if (!sheet || sheet->disabled() || !sheet->isCSSStyleSheet()) |
return false; |
- if (sheet->ownerNode() && sheet->ownerNode()->isInShadowTree()) |
- return true; |
+ if (sheet->ownerNode() && sheet->ownerNode()->isInShadowTree()) { |
+ if (isCSSStyle()) |
+ return true; |
+ if (isHTMLLink() && !isImport()) |
+ return !isAlternate(); |
+ } |
const AtomicString& title = this->title(); |
if (!isEnabledViaScript() && !title.isEmpty() && title != currentPreferrableName) |