Index: Source/core/dom/StyleSheetCollection.cpp |
diff --git a/Source/core/dom/StyleSheetCollection.cpp b/Source/core/dom/StyleSheetCollection.cpp |
index 52fbaed865e45042e4a6af0721859fe9a6215bac..80ca3d2a96764e872e2b7d9936a23de390a8d203 100644 |
--- a/Source/core/dom/StyleSheetCollection.cpp |
+++ b/Source/core/dom/StyleSheetCollection.cpp |
@@ -97,14 +97,14 @@ void StyleSheetCollection::collectStyleSheets(DocumentStyleSheetCollection* coll |
Node* n = *it; |
StyleSheet* sheet = 0; |
CSSStyleSheet* activeSheet = 0; |
- if (n->nodeType() == Node::PROCESSING_INSTRUCTION_NODE) { |
+ if (n->nodeType() == Node::PROCESSING_INSTRUCTION_NODE && !document()->isHTMLDocument()) { |
// Processing instruction (XML documents only). |
// We don't support linking to embedded CSS stylesheets, see <https://bugs.webkit.org/show_bug.cgi?id=49281> for discussion. |
ProcessingInstruction* pi = static_cast<ProcessingInstruction*>(n); |
// Don't apply XSL transforms to already transformed documents -- <rdar://problem/4132806> |
if (pi->isXSL() && !document()->transformSourceDocument()) { |
// Don't apply XSL transforms until loading is finished. |
- if (!document()->parsing()) |
+ if (!document()->parsing() && !pi->isLoading()) |
document()->applyXSLTransform(pi); |
return; |
} |