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

Unified Diff: Source/core/xml/parser/XMLDocumentParser.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/xml/XSLTProcessor.cpp ('k') | Source/core/xml/parser/XMLErrors.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/xml/parser/XMLDocumentParser.cpp
diff --git a/Source/core/xml/parser/XMLDocumentParser.cpp b/Source/core/xml/parser/XMLDocumentParser.cpp
index 37d889a20265aed4203f654473a0db8e86d5e82b..15bf8a73a65ee7656c244ab7787b78e77c0541c1 100644
--- a/Source/core/xml/parser/XMLDocumentParser.cpp
+++ b/Source/core/xml/parser/XMLDocumentParser.cpp
@@ -100,9 +100,20 @@ static inline AtomicString toAtomicString(const xmlChar* string)
return AtomicString::fromUTF8(reinterpret_cast<const char*>(string));
}
+static bool xsltTransformed(Document* document)
+{
+ if (!RuntimeEnabledFeatures::xsltInPrivateScriptEnabled())
+ return document->transformSourceDocument();
+
+ bool xsltTransformed;
+ if (!V8Document::PrivateScript::xsltTransformedMethod(document->frame(), document, &xsltTransformed))
+ return false;
+ return xsltTransformed;
+}
+
static inline bool hasNoStyleInformation(Document* document)
{
- if (document->sawElementsInKnownNamespaces() || document->transformSourceDocument())
+ if (document->sawElementsInKnownNamespaces() || xsltTransformed(document))
return false;
if (!document->frame() || !document->frame()->page())
@@ -1156,7 +1167,7 @@ void XMLDocumentParser::processingInstruction(const String& target, const String
return;
m_sawXSLTransform = !m_sawFirstElement && pi->isXSL();
- if (m_sawXSLTransform && !document()->transformSourceDocument()) {
+ if (m_sawXSLTransform && !xsltTransformed(document())) {
// This behavior is very tricky. We call stopParsing() here because we
// want to stop processing the document until we're ready to apply the
// transform, but we actually still want to be fed decoded string pieces
« no previous file with comments | « Source/core/xml/XSLTProcessor.cpp ('k') | Source/core/xml/parser/XMLErrors.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698