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

Unified Diff: Source/core/xml/XSLTProcessorLibxslt.cpp

Issue 507583002: XSLImportRule should not be ResourceClient. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: 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
« Source/core/xml/XSLImportRule.cpp ('K') | « Source/core/xml/XSLTProcessor.idl ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/xml/XSLTProcessorLibxslt.cpp
diff --git a/Source/core/xml/XSLTProcessorLibxslt.cpp b/Source/core/xml/XSLTProcessorLibxslt.cpp
index 5945d4a87538347fe7e9a4efa9ce0da401cfb690..a2ee29434a3cd926d346d49621db6652f699a372 100644
--- a/Source/core/xml/XSLTProcessorLibxslt.cpp
+++ b/Source/core/xml/XSLTProcessorLibxslt.cpp
@@ -218,11 +218,13 @@ static void freeXsltParamArray(const char** params)
fastFree(params);
}
-static xsltStylesheetPtr xsltStylesheetPointer(RefPtrWillBeMember<XSLStyleSheet>& cachedStylesheet, Node* stylesheetRootNode)
+static xsltStylesheetPtr xsltStylesheetPointer(Document* document, RefPtrWillBeMember<XSLStyleSheet>& cachedStylesheet, Node* stylesheetRootNode)
{
if (!cachedStylesheet && stylesheetRootNode) {
+ // When using importStylesheet, we will use the given document as the imported stylesheet's owner.
cachedStylesheet = XSLStyleSheet::createForXSLTProcessor(
- stylesheetRootNode->parentNode() ? stylesheetRootNode->parentNode() : stylesheetRootNode,
+ stylesheetRootNode->parentNode() ? &stylesheetRootNode->parentNode()->document() : document,
+ stylesheetRootNode,
stylesheetRootNode->document().url().string(),
stylesheetRootNode->document().url()); // FIXME: Should we use baseURL here?
@@ -278,7 +280,7 @@ bool XSLTProcessor::transformToString(Node* sourceNode, String& mimeType, String
RefPtrWillBeRawPtr<Document> ownerDocument(sourceNode->document());
setXSLTLoadCallBack(docLoaderFunc, this, ownerDocument->fetcher());
- xsltStylesheetPtr sheet = xsltStylesheetPointer(m_stylesheet, m_stylesheetRootNode.get());
+ xsltStylesheetPtr sheet = xsltStylesheetPointer(m_document.get(), m_stylesheet, m_stylesheetRootNode.get());
if (!sheet) {
setXSLTLoadCallBack(0, 0, 0);
m_stylesheet = nullptr;
« Source/core/xml/XSLImportRule.cpp ('K') | « Source/core/xml/XSLTProcessor.idl ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698