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

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: WIP: async XHR, rewriting layout tests Created 6 years, 3 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
« no previous file with comments | « Source/core/core_generated.gyp ('k') | Source/core/dom/ProcessingInstruction.idl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
« no previous file with comments | « Source/core/core_generated.gyp ('k') | Source/core/dom/ProcessingInstruction.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698