Index: third_party/WebKit/Source/core/html/HTMLLinkElement.cpp |
diff --git a/third_party/WebKit/Source/core/html/HTMLLinkElement.cpp b/third_party/WebKit/Source/core/html/HTMLLinkElement.cpp |
index f8ce12194284324ffa41a7c1d1e18dbf57e7ccb1..746d39840603a7113a7b7394a440b9757aeb2af3 100644 |
--- a/third_party/WebKit/Source/core/html/HTMLLinkElement.cpp |
+++ b/third_party/WebKit/Source/core/html/HTMLLinkElement.cpp |
@@ -305,13 +305,8 @@ void HTMLLinkElement::removedFrom(ContainerNode* insertionPoint) |
return; |
} |
document().styleEngine().removeStyleSheetCandidateNode(this); |
- |
- StyleSheet* removedSheet = sheet(); |
- |
if (m_link) |
m_link->ownerRemoved(); |
- |
- document().styleEngine().setNeedsActiveStyleUpdate(removedSheet, FullStyleUpdate); |
} |
void HTMLLinkElement::finishParsingChildren() |
@@ -761,11 +756,14 @@ void LinkStyle::process() |
removePendingSheet(); |
notifyLoadedSheetAndAllCriticalSubresources(Node::ErrorOccurredLoadingSubresource); |
} |
+ String title = m_owner->title(); |
+ if (!title.isEmpty() && !m_owner->isAlternate() && m_disabledState != EnabledViaScript) |
+ document().styleEngine().setPreferredStylesheetSetNameIfNotSet(title); |
} else if (m_sheet) { |
// we no longer contain a stylesheet, e.g. perhaps rel or type was changed |
- StyleSheet* removedSheet = m_sheet.get(); |
clearSheet(); |
- document().styleEngine().setNeedsActiveStyleUpdate(removedSheet, FullStyleUpdate); |
+ if (m_owner->inShadowIncludingDocument()) |
+ document().styleEngine().setNeedsActiveStyleUpdate(m_owner->treeScope()); |
} |
} |