| Index: Source/core/dom/ProcessingInstruction.cpp
|
| diff --git a/Source/core/dom/ProcessingInstruction.cpp b/Source/core/dom/ProcessingInstruction.cpp
|
| index cfa280d811f4463e34c9cb0c34d7992bab4b8eb5..8ee37811f490b12215479c3052c54893e84251b7 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"
|
| @@ -65,8 +66,6 @@ ProcessingInstruction::~ProcessingInstruction()
|
| if (inDocument()) {
|
| if (m_isCSS)
|
| document().styleEngine()->removeStyleSheetCandidateNode(this);
|
| - else if (m_isXSL)
|
| - document().styleEngine()->removeXSLStyleSheet(this);
|
| }
|
| #endif
|
| }
|
| @@ -178,7 +177,11 @@ bool ProcessingInstruction::isLoading() const
|
| bool ProcessingInstruction::sheetLoaded()
|
| {
|
| if (!isLoading()) {
|
| - document().styleEngine()->removePendingSheet(this);
|
| + if (m_isCSS) {
|
| + document().styleEngine()->removePendingSheet(this);
|
| + } else if (RuntimeEnabledFeatures::xsltEnabled() && m_isXSL) {
|
| + V8ProcessingInstruction::sheetLoadedCallbackMethodImplementedInPrivateScript(document().frame(), this);
|
| + }
|
| return true;
|
| }
|
| return false;
|
| @@ -252,10 +255,14 @@ Node::InsertionNotificationRequest ProcessingInstruction::insertedInto(Container
|
| bool isValid = checkStyleSheet(href, charset);
|
| if (m_isCSS)
|
| document().styleEngine()->addStyleSheetCandidateNode(this, m_createdByParser);
|
| - else if (m_isXSL)
|
| - document().styleEngine()->addXSLStyleSheet(this, m_createdByParser);
|
| if (isValid)
|
| process(href, charset);
|
| +
|
| + if (RuntimeEnabledFeatures::xsltEnabled() && m_isXSL) {
|
| + V8ProcessingInstruction::registerSheetMethodImplementedInPrivateScript(document().frame(), this, document().parsing());
|
| + if (!m_loading)
|
| + V8ProcessingInstruction::sheetLoadedCallbackMethodImplementedInPrivateScript(document().frame(), this);
|
| + }
|
| return InsertionDone;
|
| }
|
|
|
| @@ -265,10 +272,11 @@ void ProcessingInstruction::removedFrom(ContainerNode* insertionPoint)
|
| if (!insertionPoint->inDocument())
|
| return;
|
|
|
| - if (m_isCSS)
|
| + if (m_isCSS) {
|
| document().styleEngine()->removeStyleSheetCandidateNode(this);
|
| - else if (m_isXSL)
|
| - document().styleEngine()->removeXSLStyleSheet(this);
|
| + } else if (RuntimeEnabledFeatures::xsltEnabled() && m_isXSL) {
|
| + V8ProcessingInstruction::unregisterSheetMethodImplementedInPrivateScript(document().frame(), this);
|
| + }
|
|
|
| RefPtrWillBeRawPtr<StyleSheet> removedSheet = m_sheet;
|
|
|
|
|