summaryrefslogtreecommitdiffstats
path: root/WebCore/xml/XSLImportRule.cpp
diff options
context:
space:
mode:
authorThe Android Open Source Project <initial-contribution@android.com>2008-12-17 18:05:15 -0800
committerThe Android Open Source Project <initial-contribution@android.com>2008-12-17 18:05:15 -0800
commit1cbdecfa9fc428ac2d8aca0fa91c9580b3d57353 (patch)
tree4457a7306ea5acb43fe05bfe0973b1f7faf97ba2 /WebCore/xml/XSLImportRule.cpp
parent9364f22aed35e1a1e9d07c121510f80be3ab0502 (diff)
downloadexternal_webkit-1cbdecfa9fc428ac2d8aca0fa91c9580b3d57353.zip
external_webkit-1cbdecfa9fc428ac2d8aca0fa91c9580b3d57353.tar.gz
external_webkit-1cbdecfa9fc428ac2d8aca0fa91c9580b3d57353.tar.bz2
Code drop from //branches/cupcake/...@124589
Diffstat (limited to 'WebCore/xml/XSLImportRule.cpp')
-rw-r--r--WebCore/xml/XSLImportRule.cpp21
1 files changed, 11 insertions, 10 deletions
diff --git a/WebCore/xml/XSLImportRule.cpp b/WebCore/xml/XSLImportRule.cpp
index bfdec20..2efafa3 100644
--- a/WebCore/xml/XSLImportRule.cpp
+++ b/WebCore/xml/XSLImportRule.cpp
@@ -1,7 +1,7 @@
-/**
+/*
* This file is part of the XSL implementation.
*
- * Copyright (C) 2004, 2005, 2006 Apple Computer, Inc.
+ * Copyright (C) 2004, 2005, 2006, 2008 Apple Inc. All rights reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
@@ -30,7 +30,7 @@
namespace WebCore {
-XSLImportRule::XSLImportRule(StyleBase* parent, const String& href)
+XSLImportRule::XSLImportRule(XSLStyleSheet* parent, const String& href)
: StyleBase(parent)
, m_strHref(href)
, m_cachedSheet(0)
@@ -44,7 +44,7 @@ XSLImportRule::~XSLImportRule()
m_styleSheet->setParent(0);
if (m_cachedSheet)
- m_cachedSheet->deref(this);
+ m_cachedSheet->removeClient(this);
}
XSLStyleSheet* XSLImportRule::parentStyleSheet() const
@@ -57,7 +57,7 @@ void XSLImportRule::setXSLStyleSheet(const String& url, const String& sheet)
if (m_styleSheet)
m_styleSheet->setParent(0);
- m_styleSheet = new XSLStyleSheet(this, url);
+ m_styleSheet = XSLStyleSheet::create(this, url);
XSLStyleSheet* parent = parentStyleSheet();
if (parent)
@@ -66,7 +66,8 @@ void XSLImportRule::setXSLStyleSheet(const String& url, const String& sheet)
m_styleSheet->parseString(sheet);
m_loading = false;
- checkLoaded();
+ if (parent)
+ parent->checkLoaded();
}
bool XSLImportRule::isLoading()
@@ -88,19 +89,19 @@ void XSLImportRule::loadSheet()
XSLStyleSheet* parentSheet = parentStyleSheet();
if (!parentSheet->href().isNull())
// use parent styleheet's URL as the base URL
- absHref = KURL(parentSheet->href().deprecatedString(), m_strHref.deprecatedString()).string();
+ absHref = KURL(KURL(parentSheet->href()), m_strHref).string();
// Check for a cycle in our import chain. If we encounter a stylesheet
// in our parent chain with the same URL, then just bail.
- for (parent = static_cast<StyleBase*>(this)->parent(); parent; parent = parent->parent()) {
- if (absHref == parent->baseURL())
+ for (parent = this->parent(); parent; parent = parent->parent()) {
+ if (parent->isXSLStyleSheet() && absHref == static_cast<XSLStyleSheet*>(parent)->href())
return;
}
m_cachedSheet = docLoader->requestXSLStyleSheet(absHref);
if (m_cachedSheet) {
- m_cachedSheet->ref(this);
+ m_cachedSheet->addClient(this);
// If the imported sheet is in the cache, then setXSLStyleSheet gets called,
// and the sheet even gets parsed (via parseString). In this case we have