Index: third_party/WebKit/Source/core/dom/ProcessingInstruction.cpp |
diff --git a/third_party/WebKit/Source/core/dom/ProcessingInstruction.cpp b/third_party/WebKit/Source/core/dom/ProcessingInstruction.cpp |
index 0c9eb8c53acd5243a3f0774d6857e3dfc482e3b9..38d47f18d9575d6e05f87b26722838e2e58470e8 100644 |
--- a/third_party/WebKit/Source/core/dom/ProcessingInstruction.cpp |
+++ b/third_party/WebKit/Source/core/dom/ProcessingInstruction.cpp |
@@ -205,6 +205,8 @@ void ProcessingInstruction::setCSSStyleSheet(const String& href, const KURL& bas |
CSSStyleSheet* cssSheet = CSSStyleSheet::create(newSheet, this); |
cssSheet->setDisabled(m_alternate); |
cssSheet->setTitle(m_title); |
+ if (!m_alternate && !m_title.isEmpty()) |
+ document().styleEngine().setPreferredStylesheetSetNameIfNotSet(m_title); |
cssSheet->setMediaQueries(MediaQuerySet::create(m_media)); |
m_sheet = cssSheet; |
@@ -270,18 +272,14 @@ void ProcessingInstruction::removedFrom(ContainerNode* insertionPoint) |
if (!DocumentXSLT::processingInstructionRemovedFromDocument(document(), this)) |
document().styleEngine().removeStyleSheetCandidateNode(this); |
- StyleSheet* removedSheet = m_sheet; |
if (m_sheet) { |
DCHECK_EQ(m_sheet->ownerNode(), this); |
clearSheet(); |
+ document().styleEngine().setNeedsActiveStyleUpdate(treeScope()); |
} |
// No need to remove pending sheets. |
clearResource(); |
- |
- // If we're in document teardown, then we don't need to do any notification of our sheet's removal. |
- if (document().isActive()) |
- document().styleEngine().setNeedsActiveStyleUpdate(removedSheet, FullStyleUpdate); |
} |
void ProcessingInstruction::clearSheet() |