summaryrefslogtreecommitdiffstats
path: root/WebCore/xml/XSLStyleSheetLibxslt.cpp
diff options
context:
space:
mode:
authorSteve Block <steveblock@google.com>2011-02-17 09:06:39 -0800
committerAndroid (Google) Code Review <android-gerrit@google.com>2011-02-17 09:06:39 -0800
commit7aed021d3442e74aedc738192c55d8978b2d9643 (patch)
tree7801e8554b642ef58b280135c847003f833bb70e /WebCore/xml/XSLStyleSheetLibxslt.cpp
parent990373e4c55ba4f0312b5ab7974388d717d1907c (diff)
parentf7f6d6409be37f76dc308902285d24806dc87ef2 (diff)
downloadexternal_webkit-7aed021d3442e74aedc738192c55d8978b2d9643.zip
external_webkit-7aed021d3442e74aedc738192c55d8978b2d9643.tar.gz
external_webkit-7aed021d3442e74aedc738192c55d8978b2d9643.tar.bz2
Merge "Merge WebKit at Chromium 9.0.597.106: Initial merge by Git"
Diffstat (limited to 'WebCore/xml/XSLStyleSheetLibxslt.cpp')
-rw-r--r--WebCore/xml/XSLStyleSheetLibxslt.cpp19
1 files changed, 13 insertions, 6 deletions
diff --git a/WebCore/xml/XSLStyleSheetLibxslt.cpp b/WebCore/xml/XSLStyleSheetLibxslt.cpp
index 3fb9eb5..447ba1e 100644
--- a/WebCore/xml/XSLStyleSheetLibxslt.cpp
+++ b/WebCore/xml/XSLStyleSheetLibxslt.cpp
@@ -57,7 +57,6 @@ namespace WebCore {
XSLStyleSheet::XSLStyleSheet(XSLImportRule* parentRule, const String& originalURL, const KURL& finalURL)
: StyleSheet(parentRule, originalURL, finalURL)
- , m_ownerDocument(0)
, m_embedded(false)
, m_processed(false) // Child sheets get marked as processed when the libxslt engine has finally seen them.
, m_stylesheetDoc(0)
@@ -68,7 +67,6 @@ XSLStyleSheet::XSLStyleSheet(XSLImportRule* parentRule, const String& originalUR
XSLStyleSheet::XSLStyleSheet(Node* parentNode, const String& originalURL, const KURL& finalURL, bool embedded)
: StyleSheet(parentNode, originalURL, finalURL)
- , m_ownerDocument(parentNode->document())
, m_embedded(embedded)
, m_processed(true) // The root sheet starts off processed.
, m_stylesheetDoc(0)
@@ -130,9 +128,10 @@ void XSLStyleSheet::clearDocuments()
CachedResourceLoader* XSLStyleSheet::cachedResourceLoader()
{
- if (!m_ownerDocument)
+ Document* document = ownerDocument();
+ if (!document)
return 0;
- return m_ownerDocument->cachedResourceLoader();
+ return document->cachedResourceLoader();
}
bool XSLStyleSheet::parseString(const String& string, bool)
@@ -258,8 +257,16 @@ xsltStylesheetPtr XSLStyleSheet::compileStyleSheet()
void XSLStyleSheet::setParentStyleSheet(XSLStyleSheet* parent)
{
m_parentStyleSheet = parent;
- if (parent)
- m_ownerDocument = parent->ownerDocument();
+}
+
+Document* XSLStyleSheet::ownerDocument()
+{
+ for (XSLStyleSheet* styleSheet = this; styleSheet; styleSheet = styleSheet->parentStyleSheet()) {
+ Node* node = styleSheet->ownerNode();
+ if (node)
+ return node->document();
+ }
+ return 0;
}
xmlDocPtr XSLStyleSheet::locateStylesheetSubResource(xmlDocPtr parentDoc, const xmlChar* uri)