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

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

Issue 703193004: XSLT-in-PrivateScript (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 1 month 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 d0112335a1b8409dcfbefff4dcc78bc5107fc488..e85fae66f2c6d113a807326c3c9274bab817db10 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"
@@ -34,6 +35,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,8 +67,6 @@ ProcessingInstruction::~ProcessingInstruction()
if (inDocument()) {
if (m_isCSS)
document().styleEngine()->removeStyleSheetCandidateNode(this);
- else if (m_isXSL)
- document().styleEngine()->removeXSLStyleSheet(this);
}
#endif
}
@@ -179,7 +179,8 @@ bool ProcessingInstruction::isLoading() const
bool ProcessingInstruction::sheetLoaded()
{
if (!isLoading()) {
- document().styleEngine()->removePendingSheet(this);
+ if (m_isCSS)
+ document().styleEngine()->removePendingSheet(this);
return true;
}
return false;
@@ -258,10 +259,13 @@ Node::InsertionNotificationRequest ProcessingInstruction::insertedInto(Container
String href;
String charset;
bool isValid = checkStyleSheet(href, charset);
+ if (m_isXSL) {
+ 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)
- document().styleEngine()->addXSLStyleSheet(this, m_createdByParser);
if (isValid)
process(href, charset);
return InsertionDone;
@@ -275,8 +279,6 @@ void ProcessingInstruction::removedFrom(ContainerNode* insertionPoint)
if (m_isCSS)
document().styleEngine()->removeStyleSheetCandidateNode(this);
- else if (m_isXSL)
- document().styleEngine()->removeXSLStyleSheet(this);
RefPtrWillBeRawPtr<StyleSheet> removedSheet = m_sheet;

Powered by Google App Engine
This is Rietveld 408576698