[SCM] WebKit Debian packaging branch, webkit-1.1, updated. upstream/1.1.21-584-g1e41756
eric at webkit.org
eric at webkit.org
Fri Feb 26 22:17:34 UTC 2010
The following commit has been merged in the webkit-1.1 branch:
commit c2a67832cac18c124117b3828b7d64bd0891d469
Author: eric at webkit.org <eric at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Thu Feb 11 07:32:08 2010 +0000
2010-02-10 Adam Barth <abarth at webkit.org>
Reviewed by Darin Adler.
Address last round of review comments on r53607
https://bugs.webkit.org/show_bug.cgi?id=33940
Mostly renaming and cleaning up.
* css/CSSImportRule.cpp:
(WebCore::CSSImportRule::insertedIntoParent):
* css/CSSStyleSheet.h:
(WebCore::CSSStyleSheet::create):
(WebCore::CSSStyleSheet::createInline):
* css/StyleBase.cpp:
(WebCore::StyleBase::baseURL):
* css/StyleSheet.cpp:
(WebCore::StyleSheet::StyleSheet):
* css/StyleSheet.h:
(WebCore::StyleSheet::href):
(WebCore::StyleSheet::setFinalURL):
(WebCore::StyleSheet::finalURL):
* dom/Document.cpp:
(WebCore::Document::updateBaseURL):
* dom/ProcessingInstruction.cpp:
(WebCore::ProcessingInstruction::checkStyleSheet):
* xml/XSLImportRule.cpp:
(WebCore::XSLImportRule::loadSheet):
* xml/XSLStyleSheet.h:
(WebCore::XSLStyleSheet::create):
(WebCore::XSLStyleSheet::createInline):
* xml/XSLStyleSheetLibxslt.cpp:
(WebCore::XSLStyleSheet::XSLStyleSheet):
(WebCore::XSLStyleSheet::parseString):
(WebCore::XSLStyleSheet::loadChildSheets):
* xml/XSLStyleSheetQt.cpp:
(WebCore::XSLStyleSheet::XSLStyleSheet):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@54645 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 9412e78..e57d842 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,41 @@
+2010-02-10 Adam Barth <abarth at webkit.org>
+
+ Reviewed by Darin Adler.
+
+ Address last round of review comments on r53607
+ https://bugs.webkit.org/show_bug.cgi?id=33940
+
+ Mostly renaming and cleaning up.
+
+ * css/CSSImportRule.cpp:
+ (WebCore::CSSImportRule::insertedIntoParent):
+ * css/CSSStyleSheet.h:
+ (WebCore::CSSStyleSheet::create):
+ (WebCore::CSSStyleSheet::createInline):
+ * css/StyleBase.cpp:
+ (WebCore::StyleBase::baseURL):
+ * css/StyleSheet.cpp:
+ (WebCore::StyleSheet::StyleSheet):
+ * css/StyleSheet.h:
+ (WebCore::StyleSheet::href):
+ (WebCore::StyleSheet::setFinalURL):
+ (WebCore::StyleSheet::finalURL):
+ * dom/Document.cpp:
+ (WebCore::Document::updateBaseURL):
+ * dom/ProcessingInstruction.cpp:
+ (WebCore::ProcessingInstruction::checkStyleSheet):
+ * xml/XSLImportRule.cpp:
+ (WebCore::XSLImportRule::loadSheet):
+ * xml/XSLStyleSheet.h:
+ (WebCore::XSLStyleSheet::create):
+ (WebCore::XSLStyleSheet::createInline):
+ * xml/XSLStyleSheetLibxslt.cpp:
+ (WebCore::XSLStyleSheet::XSLStyleSheet):
+ (WebCore::XSLStyleSheet::parseString):
+ (WebCore::XSLStyleSheet::loadChildSheets):
+ * xml/XSLStyleSheetQt.cpp:
+ (WebCore::XSLStyleSheet::XSLStyleSheet):
+
2010-02-10 Noam Rosenthal <noam.rosenthal at nokia.com>
Reviewed by Ariya Hidayat.
diff --git a/WebCore/css/CSSImportRule.cpp b/WebCore/css/CSSImportRule.cpp
index d50ecf7..6259a9b 100644
--- a/WebCore/css/CSSImportRule.cpp
+++ b/WebCore/css/CSSImportRule.cpp
@@ -117,16 +117,16 @@ void CSSImportRule::insertedIntoParent()
return;
String absHref = m_strHref;
- if (!parentSheet->putativeBaseURL().isNull())
+ if (!parentSheet->finalURL().isNull())
// use parent styleheet's URL as the base URL
- absHref = KURL(parentSheet->putativeBaseURL(), m_strHref).string();
+ absHref = KURL(parentSheet->finalURL(), 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.
StyleBase* root = this;
for (StyleBase* curr = parent(); curr; curr = curr->parent()) {
- // FIXME: This is wrong if the putativeBaseURL was updated via document::updateBaseURL.
- if (curr->isCSSStyleSheet() && absHref == static_cast<CSSStyleSheet*>(curr)->putativeBaseURL().string())
+ // FIXME: This is wrong if the finalURL was updated via document::updateBaseURL.
+ if (curr->isCSSStyleSheet() && absHref == static_cast<CSSStyleSheet*>(curr)->finalURL().string())
return;
root = curr;
}
diff --git a/WebCore/css/CSSStyleSheet.h b/WebCore/css/CSSStyleSheet.h
index 2d8a912..bb14e28 100644
--- a/WebCore/css/CSSStyleSheet.h
+++ b/WebCore/css/CSSStyleSheet.h
@@ -44,21 +44,21 @@ public:
{
return adoptRef(new CSSStyleSheet(ownerNode, String(), KURL(), String()));
}
- static PassRefPtr<CSSStyleSheet> create(Node* ownerNode, const String& href, const KURL& baseURL)
+ static PassRefPtr<CSSStyleSheet> create(Node* ownerNode, const String& originalURL, const KURL& finalURL)
{
- return adoptRef(new CSSStyleSheet(ownerNode, href, baseURL, String()));
+ return adoptRef(new CSSStyleSheet(ownerNode, originalURL, finalURL, String()));
}
- static PassRefPtr<CSSStyleSheet> create(Node* ownerNode, const String& href, const KURL& baseURL, const String& charset)
+ static PassRefPtr<CSSStyleSheet> create(Node* ownerNode, const String& originalURL, const KURL& finalURL, const String& charset)
{
- return adoptRef(new CSSStyleSheet(ownerNode, href, baseURL, charset));
+ return adoptRef(new CSSStyleSheet(ownerNode, originalURL, finalURL, charset));
}
- static PassRefPtr<CSSStyleSheet> create(CSSRule* ownerRule, const String& href, const KURL& baseURL, const String& charset)
+ static PassRefPtr<CSSStyleSheet> create(CSSRule* ownerRule, const String& originalURL, const KURL& finalURL, const String& charset)
{
- return adoptRef(new CSSStyleSheet(ownerRule, href, baseURL, charset));
+ return adoptRef(new CSSStyleSheet(ownerRule, originalURL, finalURL, charset));
}
- static PassRefPtr<CSSStyleSheet> createInline(Node* ownerNode, const KURL& baseURL)
+ static PassRefPtr<CSSStyleSheet> createInline(Node* ownerNode, const KURL& finalURL)
{
- return adoptRef(new CSSStyleSheet(ownerNode, baseURL.string(), baseURL, String()));
+ return adoptRef(new CSSStyleSheet(ownerNode, finalURL.string(), finalURL, String()));
}
virtual ~CSSStyleSheet();
@@ -103,9 +103,9 @@ public:
bool hasSyntacticallyValidCSSHeader() const { return m_hasSyntacticallyValidCSSHeader; }
private:
- CSSStyleSheet(Node* ownerNode, const String& href, const KURL& baseURL, const String& charset);
- CSSStyleSheet(CSSStyleSheet* parentSheet, const String& href, const KURL& baseURL, const String& charset);
- CSSStyleSheet(CSSRule* ownerRule, const String& href, const KURL& baseURL, const String& charset);
+ CSSStyleSheet(Node* ownerNode, const String& originalURL, const KURL& finalURL, const String& charset);
+ CSSStyleSheet(CSSStyleSheet* parentSheet, const String& originalURL, const KURL& finalURL, const String& charset);
+ CSSStyleSheet(CSSRule* ownerRule, const String& originalURL, const KURL& finalURL, const String& charset);
virtual bool isCSSStyleSheet() const { return true; }
virtual String type() const { return "text/css"; }
diff --git a/WebCore/css/StyleBase.cpp b/WebCore/css/StyleBase.cpp
index 93bc57d..93dbda0 100644
--- a/WebCore/css/StyleBase.cpp
+++ b/WebCore/css/StyleBase.cpp
@@ -56,8 +56,8 @@ KURL StyleBase::baseURL() const
StyleSheet* sheet = const_cast<StyleBase*>(this)->stylesheet();
if (!sheet)
return KURL();
- if (!sheet->putativeBaseURL().isNull())
- return sheet->putativeBaseURL();
+ if (!sheet->finalURL().isNull())
+ return sheet->finalURL();
if (sheet->parent())
return sheet->parent()->baseURL();
if (!sheet->ownerNode())
diff --git a/WebCore/css/StyleSheet.cpp b/WebCore/css/StyleSheet.cpp
index 15e1c3b..4f20a20 100644
--- a/WebCore/css/StyleSheet.cpp
+++ b/WebCore/css/StyleSheet.cpp
@@ -24,30 +24,29 @@
namespace WebCore {
-StyleSheet::StyleSheet(StyleSheet* parentSheet, const String& href, const KURL& baseURL)
+StyleSheet::StyleSheet(StyleSheet* parentSheet, const String& originalURL, const KURL& finalURL)
: StyleList(parentSheet)
, m_parentNode(0)
- , m_href(href)
- , m_baseURL(baseURL)
+ , m_originalURL(originalURL)
+ , m_finalURL(finalURL)
, m_disabled(false)
{
}
-
-StyleSheet::StyleSheet(Node* parentNode, const String& href, const KURL& baseURL)
+StyleSheet::StyleSheet(Node* parentNode, const String& originalURL, const KURL& finalURL)
: StyleList(0)
, m_parentNode(parentNode)
- , m_href(href)
- , m_baseURL(baseURL)
+ , m_originalURL(originalURL)
+ , m_finalURL(finalURL)
, m_disabled(false)
{
}
-StyleSheet::StyleSheet(StyleBase* owner, const String& href, const KURL& baseURL)
+StyleSheet::StyleSheet(StyleBase* owner, const String& originalURL, const KURL& finalURL)
: StyleList(owner)
, m_parentNode(0)
- , m_href(href)
- , m_baseURL(baseURL)
+ , m_originalURL(originalURL)
+ , m_finalURL(finalURL)
, m_disabled(false)
{
}
diff --git a/WebCore/css/StyleSheet.h b/WebCore/css/StyleSheet.h
index 5f8ad78..621733d 100644
--- a/WebCore/css/StyleSheet.h
+++ b/WebCore/css/StyleSheet.h
@@ -45,13 +45,10 @@ public:
// Note that href is the URL that started the redirect chain that led to
// this style sheet. This property probably isn't useful for much except
// the JavaScript binding (which needs to use this value for security).
- const String& href() const { return m_href; }
+ const String& href() const { return m_originalURL; }
- void setBaseURL(const KURL& baseURL) { m_baseURL = baseURL; }
-
- // Notice that this object inherits a baseURL function from StyleBase that
- // crawls the parent() relation looking for a non-0 putativeBaseURL.
- const KURL& putativeBaseURL() const { return m_baseURL; }
+ void setFinalURL(const KURL& finalURL) { m_finalURL = finalURL; }
+ const KURL& finalURL() const { return m_finalURL; }
const String& title() const { return m_strTitle; }
void setTitle(const String& s) { m_strTitle = s; }
@@ -68,16 +65,16 @@ public:
virtual bool parseString(const String&, bool strict = true) = 0;
protected:
- StyleSheet(Node* ownerNode, const String& href, const KURL& baseURL);
- StyleSheet(StyleSheet* parentSheet, const String& href, const KURL& baseURL);
- StyleSheet(StyleBase* owner, const String& href, const KURL& baseURL);
+ StyleSheet(Node* ownerNode, const String& href, const KURL& finalURL);
+ StyleSheet(StyleSheet* parentSheet, const String& href, const KURL& finalURL);
+ StyleSheet(StyleBase* owner, const String& href, const KURL& finalURL);
private:
virtual bool isStyleSheet() const { return true; }
Node* m_parentNode;
- String m_href;
- KURL m_baseURL;
+ String m_originalURL;
+ KURL m_finalURL;
String m_strTitle;
RefPtr<MediaList> m_media;
bool m_disabled;
diff --git a/WebCore/dom/Document.cpp b/WebCore/dom/Document.cpp
index 6ce3ecf..b103e31 100644
--- a/WebCore/dom/Document.cpp
+++ b/WebCore/dom/Document.cpp
@@ -2001,9 +2001,9 @@ void Document::updateBaseURL()
m_baseURL = KURL();
if (m_elemSheet)
- m_elemSheet->setBaseURL(m_baseURL);
+ m_elemSheet->setFinalURL(m_baseURL);
if (m_mappedElementSheet)
- m_mappedElementSheet->setBaseURL(m_baseURL);
+ m_mappedElementSheet->setFinalURL(m_baseURL);
}
String Document::userAgent(const KURL& url) const
diff --git a/WebCore/dom/ProcessingInstruction.cpp b/WebCore/dom/ProcessingInstruction.cpp
index bca7c2c..92a2b40 100644
--- a/WebCore/dom/ProcessingInstruction.cpp
+++ b/WebCore/dom/ProcessingInstruction.cpp
@@ -139,8 +139,8 @@ void ProcessingInstruction::checkStyleSheet()
// We need to make a synthetic XSLStyleSheet that is embedded. It needs to be able
// to kick off import/include loads that can hang off some parent sheet.
if (m_isXSL) {
- KURL baseURL = KURL(ParsedURLString, m_localHref);
- m_sheet = XSLStyleSheet::createEmbedded(this, m_localHref, baseURL);
+ KURL finalURL(ParsedURLString, m_localHref);
+ m_sheet = XSLStyleSheet::createInline(this, finalURL);
m_loading = false;
}
#endif
diff --git a/WebCore/xml/XSLImportRule.cpp b/WebCore/xml/XSLImportRule.cpp
index c0f6363..0908d75 100644
--- a/WebCore/xml/XSLImportRule.cpp
+++ b/WebCore/xml/XSLImportRule.cpp
@@ -87,14 +87,14 @@ void XSLImportRule::loadSheet()
String absHref = m_strHref;
XSLStyleSheet* parentSheet = parentStyleSheet();
- if (!parentSheet->putativeBaseURL().isNull())
+ if (!parentSheet->finalURL().isNull())
// use parent styleheet's URL as the base URL
- absHref = KURL(parentSheet->putativeBaseURL(), m_strHref).string();
+ absHref = KURL(parentSheet->finalURL(), 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 = this->parent(); parent; parent = parent->parent()) {
- if (parent->isXSLStyleSheet() && absHref == static_cast<XSLStyleSheet*>(parent)->putativeBaseURL().string())
+ if (parent->isXSLStyleSheet() && absHref == static_cast<XSLStyleSheet*>(parent)->finalURL().string())
return;
}
diff --git a/WebCore/xml/XSLStyleSheet.h b/WebCore/xml/XSLStyleSheet.h
index b3861a0..e6e4063 100644
--- a/WebCore/xml/XSLStyleSheet.h
+++ b/WebCore/xml/XSLStyleSheet.h
@@ -43,18 +43,18 @@ class XSLImportRule;
class XSLStyleSheet : public StyleSheet {
public:
#if !USE(QXMLQUERY)
- static PassRefPtr<XSLStyleSheet> create(XSLImportRule* parentImport, const String& href, const KURL& baseURL)
+ static PassRefPtr<XSLStyleSheet> create(XSLImportRule* parentImport, const String& originalURL, const KURL& finalURL)
{
- return adoptRef(new XSLStyleSheet(parentImport, href, baseURL));
+ return adoptRef(new XSLStyleSheet(parentImport, originalURL, finalURL));
}
#endif
- static PassRefPtr<XSLStyleSheet> create(Node* parentNode, const String& href, const KURL& baseURL)
+ static PassRefPtr<XSLStyleSheet> create(Node* parentNode, const String& originalURL, const KURL& finalURL)
{
- return adoptRef(new XSLStyleSheet(parentNode, href, baseURL, false));
+ return adoptRef(new XSLStyleSheet(parentNode, originalURL, finalURL, false));
}
- static PassRefPtr<XSLStyleSheet> createEmbedded(Node* parentNode, const String& href, const KURL& baseURL)
+ static PassRefPtr<XSLStyleSheet> createInline(Node* parentNode, const KURL& finalURL)
{
- return adoptRef(new XSLStyleSheet(parentNode, href, baseURL, true));
+ return adoptRef(new XSLStyleSheet(parentNode, finalURL.string(), finalURL, true));
}
virtual ~XSLStyleSheet();
@@ -90,9 +90,9 @@ public:
bool processed() const { return m_processed; }
private:
- XSLStyleSheet(Node* parentNode, const String& href, const KURL& baseURL, bool embedded);
+ XSLStyleSheet(Node* parentNode, const String& originalURL, const KURL& finalURL, bool embedded);
#if !USE(QXMLQUERY)
- XSLStyleSheet(XSLImportRule* parentImport, const String& href, const KURL& baseURL);
+ XSLStyleSheet(XSLImportRule* parentImport, const String& originalURL, const KURL& finalURL);
#endif
Document* m_ownerDocument;
diff --git a/WebCore/xml/XSLStyleSheetLibxslt.cpp b/WebCore/xml/XSLStyleSheetLibxslt.cpp
index 4122aa1..dbd806a 100644
--- a/WebCore/xml/XSLStyleSheetLibxslt.cpp
+++ b/WebCore/xml/XSLStyleSheetLibxslt.cpp
@@ -55,8 +55,8 @@ SOFT_LINK(libxslt, xsltLoadStylesheetPI, xsltStylesheetPtr, (xmlDocPtr doc), (do
namespace WebCore {
-XSLStyleSheet::XSLStyleSheet(XSLImportRule* parentRule, const String& href, const KURL& baseURL)
- : StyleSheet(parentRule, href, baseURL)
+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.
@@ -66,8 +66,8 @@ XSLStyleSheet::XSLStyleSheet(XSLImportRule* parentRule, const String& href, cons
{
}
-XSLStyleSheet::XSLStyleSheet(Node* parentNode, const String& href, const KURL& baseURL, bool embedded)
- : StyleSheet(parentNode, href, baseURL)
+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.
@@ -168,7 +168,7 @@ bool XSLStyleSheet::parseString(const String& string, bool)
}
m_stylesheetDoc = xmlCtxtReadMemory(ctxt, buffer, size,
- putativeBaseURL().string().utf8().data(),
+ finalURL().string().utf8().data(),
BOMHighByte == 0xFF ? "UTF-16LE" : "UTF-16BE",
XML_PARSE_NOENT | XML_PARSE_DTDATTR | XML_PARSE_NOWARNING | XML_PARSE_NOCDATA);
xmlFreeParserCtxt(ctxt);
@@ -192,7 +192,7 @@ void XSLStyleSheet::loadChildSheets()
if (m_embedded) {
// We have to locate (by ID) the appropriate embedded stylesheet element, so that we can walk the
// import/include list.
- xmlAttrPtr idNode = xmlGetID(document(), (const xmlChar*)(putativeBaseURL().string().utf8().data()));
+ xmlAttrPtr idNode = xmlGetID(document(), (const xmlChar*)(finalURL().string().utf8().data()));
if (!idNode)
return;
stylesheetRoot = idNode->parent;
diff --git a/WebCore/xml/XSLStyleSheetQt.cpp b/WebCore/xml/XSLStyleSheetQt.cpp
index 4151be4..cb55993 100644
--- a/WebCore/xml/XSLStyleSheetQt.cpp
+++ b/WebCore/xml/XSLStyleSheetQt.cpp
@@ -33,8 +33,8 @@
namespace WebCore {
-XSLStyleSheet::XSLStyleSheet(Node* parentNode, const String& href, const KURL& baseURL, bool embedded)
- : StyleSheet(parentNode, href, baseURL)
+XSLStyleSheet::XSLStyleSheet(Node* parentNode, const String& originalURL, const KURL& finalURL, bool embedded)
+ : StyleSheet(parentNode, originalURL, finalURL)
, m_ownerDocument(parentNode->document())
, m_embedded(embedded)
{
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list