Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(668)

Unified Diff: Source/core/dom/ProcessingInstruction.cpp

Issue 365873002: Implement a part of ProcessingInstruction by using PrivateScript (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Use PrivateScript to invoke XSLTransform Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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;

Powered by Google App Engine
This is Rietveld 408576698