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

Unified Diff: WebCore/xml/XSLStyleSheetLibxslt.cpp

Issue 6508005: Revert 78366 - Revert 78101 - Merge r76728, crbug 68263 (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/597/
Patch Set: Created 9 years, 10 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 | « WebCore/xml/XSLStyleSheet.h ('k') | WebCore/xml/XSLStyleSheetQt.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: WebCore/xml/XSLStyleSheetLibxslt.cpp
===================================================================
--- WebCore/xml/XSLStyleSheetLibxslt.cpp (revision 78377)
+++ WebCore/xml/XSLStyleSheetLibxslt.cpp (working copy)
@@ -57,7 +57,6 @@
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(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 @@
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,10 +257,18 @@
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)
{
bool matchedParent = (parentDoc == document());
« no previous file with comments | « WebCore/xml/XSLStyleSheet.h ('k') | WebCore/xml/XSLStyleSheetQt.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698