Index: Source/core/dom/ProcessingInstruction.cpp |
diff --git a/Source/core/dom/ProcessingInstruction.cpp b/Source/core/dom/ProcessingInstruction.cpp |
index 585454e54fe53b4d59fd27022fa329e107def90e..a80b74ca9d6b192dcc768193bdfa5a42247b0dc5 100644 |
--- a/Source/core/dom/ProcessingInstruction.cpp |
+++ b/Source/core/dom/ProcessingInstruction.cpp |
@@ -21,6 +21,7 @@ |
#include "config.h" |
#include "core/dom/ProcessingInstruction.h" |
+#include "bindings/core/v8/V8ProcessingInstruction.h" |
#include "core/FetchInitiatorTypeNames.h" |
#include "core/css/CSSStyleSheet.h" |
#include "core/css/MediaList.h" |
@@ -33,6 +34,7 @@ |
#include "core/fetch/XSLStyleSheetResource.h" |
#include "core/xml/XSLStyleSheet.h" |
#include "core/xml/parser/XMLDocumentParser.h" // for parseAttributes() |
+#include "platform/EventDispatchForbiddenScope.h" |
namespace blink { |
@@ -65,7 +67,7 @@ ProcessingInstruction::~ProcessingInstruction() |
if (inDocument()) { |
if (m_isCSS) |
document().styleEngine()->removeStyleSheetCandidateNode(this); |
- else if (m_isXSL) |
+ else if (m_isXSL && !RuntimeEnabledFeatures::xsltInPrivateScriptEnabled()) |
document().styleEngine()->removeXSLStyleSheet(this); |
} |
#endif |
@@ -179,7 +181,8 @@ bool ProcessingInstruction::isLoading() const |
bool ProcessingInstruction::sheetLoaded() |
{ |
if (!isLoading()) { |
- document().styleEngine()->removePendingSheet(this); |
+ if (!RuntimeEnabledFeatures::xsltInPrivateScriptEnabled()) |
+ document().styleEngine()->removePendingSheet(this); |
return true; |
} |
return false; |
@@ -256,6 +259,11 @@ Node::InsertionNotificationRequest ProcessingInstruction::insertedInto(Container |
String href; |
String charset; |
bool isValid = checkStyleSheet(href, charset); |
+ if (m_isXSL && RuntimeEnabledFeatures::xsltInPrivateScriptEnabled()) { |
+ EventDispatchForbiddenScope::AllowUserAgentEvents allowUserAgentEvents; |
+ V8ProcessingInstruction::PrivateScript::onProcessingInstructionAvailableMethod(document().frame(), this, href, document().parsing()); |
+ return InsertionDone; |
+ } |
if (m_isCSS) |
document().styleEngine()->addStyleSheetCandidateNode(this, m_createdByParser); |
else if (m_isXSL) |
@@ -273,7 +281,7 @@ void ProcessingInstruction::removedFrom(ContainerNode* insertionPoint) |
if (m_isCSS) |
document().styleEngine()->removeStyleSheetCandidateNode(this); |
- else if (m_isXSL) |
+ else if (m_isXSL && !RuntimeEnabledFeatures::xsltInPrivateScriptEnabled()) |
document().styleEngine()->removeXSLStyleSheet(this); |
RefPtrWillBeRawPtr<StyleSheet> removedSheet = m_sheet; |