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

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

Issue 507583002: XSLImportRule should not be ResourceClient. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Use UTF8Encoding().decode() 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/XSLStyleSheet.h ('k') | Source/core/xml/XSLTProcessor.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/xml/XSLStyleSheetLibxslt.cpp
diff --git a/Source/core/xml/XSLStyleSheetLibxslt.cpp b/Source/core/xml/XSLStyleSheetLibxslt.cpp
index 489108479b863942216d913c5ac6e61b543c423f..ec6f0b9f126ee1d3266b0707a1ab587079d79443 100644
--- a/Source/core/xml/XSLStyleSheetLibxslt.cpp
+++ b/Source/core/xml/XSLStyleSheetLibxslt.cpp
@@ -50,6 +50,7 @@ XSLStyleSheet::XSLStyleSheet(XSLImportRule* parentRule, const String& originalUR
, m_stylesheetDocTaken(false)
, m_compilationFailed(false)
, m_parentStyleSheet(parentRule ? parentRule->parentStyleSheet() : 0)
+ , m_ownerDocument(nullptr)
{
}
@@ -64,6 +65,22 @@ XSLStyleSheet::XSLStyleSheet(Node* parentNode, const String& originalURL, const
, m_stylesheetDocTaken(false)
, m_compilationFailed(false)
, m_parentStyleSheet(nullptr)
+ , m_ownerDocument(nullptr)
+{
+}
+
+XSLStyleSheet::XSLStyleSheet(Document* ownerDocument, Node* styleSheetRootNode, const String& originalURL, const KURL& finalURL, bool embedded)
+ : m_ownerNode(styleSheetRootNode)
+ , m_originalURL(originalURL)
+ , m_finalURL(finalURL)
+ , m_isDisabled(false)
+ , m_embedded(embedded)
+ , m_processed(true) // The root sheet starts off processed.
+ , m_stylesheetDoc(0)
+ , m_stylesheetDocTaken(false)
+ , m_compilationFailed(false)
+ , m_parentStyleSheet(nullptr)
+ , m_ownerDocument(ownerDocument)
{
}
@@ -254,6 +271,8 @@ void XSLStyleSheet::setParentStyleSheet(XSLStyleSheet* parent)
Document* XSLStyleSheet::ownerDocument()
{
for (XSLStyleSheet* styleSheet = this; styleSheet; styleSheet = styleSheet->parentStyleSheet()) {
+ if (styleSheet->m_ownerDocument)
+ return styleSheet->m_ownerDocument.get();
Node* node = styleSheet->ownerNode();
if (node)
return &node->document();
« no previous file with comments | « Source/core/xml/XSLStyleSheet.h ('k') | Source/core/xml/XSLTProcessor.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698