Title: [98208] trunk/Source/WebCore
Revision
98208
Author
[email protected]
Date
2011-10-23 18:49:50 -0700 (Sun, 23 Oct 2011)

Log Message

Move StyleSheet::addSubresourceStyleURLs() to CSSStyleSheet.
https://bugs.webkit.org/show_bug.cgi?id=70690

Patch by Andreas Kling <[email protected]> on 2011-10-23
Reviewed by Antti Koivisto.

This method isn't part of the StyleSheet DOM interface, nor is it used by
XSLStyleSheet, so move it down to CSSStyleSheet and make it non-virtual.
Also remove some nearby unneeded casts from CSSStyleSheet* to StyleSheet*.

* css/CSSStyleSheet.h:
* css/StyleSheet.h:
* html/HTMLLinkElement.cpp:
(WebCore::HTMLLinkElement::isLoading):
(WebCore::HTMLLinkElement::addSubresourceAttributeURLs):
* html/HTMLStyleElement.cpp:
(WebCore::HTMLStyleElement::addSubresourceAttributeURLs):
(WebCore::HTMLStyleElement::disabled):
(WebCore::HTMLStyleElement::setDisabled):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (98207 => 98208)


--- trunk/Source/WebCore/ChangeLog	2011-10-24 01:42:08 UTC (rev 98207)
+++ trunk/Source/WebCore/ChangeLog	2011-10-24 01:49:50 UTC (rev 98208)
@@ -1,5 +1,26 @@
 2011-10-23  Andreas Kling  <[email protected]>
 
+        Move StyleSheet::addSubresourceStyleURLs() to CSSStyleSheet.
+        https://bugs.webkit.org/show_bug.cgi?id=70690
+
+        Reviewed by Antti Koivisto.
+
+        This method isn't part of the StyleSheet DOM interface, nor is it used by
+        XSLStyleSheet, so move it down to CSSStyleSheet and make it non-virtual.
+        Also remove some nearby unneeded casts from CSSStyleSheet* to StyleSheet*.
+
+        * css/CSSStyleSheet.h:
+        * css/StyleSheet.h:
+        * html/HTMLLinkElement.cpp:
+        (WebCore::HTMLLinkElement::isLoading):
+        (WebCore::HTMLLinkElement::addSubresourceAttributeURLs):
+        * html/HTMLStyleElement.cpp:
+        (WebCore::HTMLStyleElement::addSubresourceAttributeURLs):
+        (WebCore::HTMLStyleElement::disabled):
+        (WebCore::HTMLStyleElement::setDisabled):
+
+2011-10-23  Andreas Kling  <[email protected]>
+
         Remove style sheet constructors that take a style sheet parent.
         https://bugs.webkit.org/show_bug.cgi?id=70692
 

Modified: trunk/Source/WebCore/css/CSSStyleSheet.h (98207 => 98208)


--- trunk/Source/WebCore/css/CSSStyleSheet.h	2011-10-24 01:42:08 UTC (rev 98207)
+++ trunk/Source/WebCore/css/CSSStyleSheet.h	2011-10-24 01:49:50 UTC (rev 98208)
@@ -95,7 +95,7 @@
     bool loadCompleted() const { return m_loadCompleted; }
 
     virtual KURL completeURL(const String& url) const;
-    virtual void addSubresourceStyleURLs(ListHashSet<KURL>&);
+    void addSubresourceStyleURLs(ListHashSet<KURL>&);
 
     void setStrictParsing(bool b) { m_strictParsing = b; }
     bool useStrictParsing() const { return m_strictParsing; }

Modified: trunk/Source/WebCore/css/StyleSheet.h (98207 => 98208)


--- trunk/Source/WebCore/css/StyleSheet.h	2011-10-24 01:42:08 UTC (rev 98207)
+++ trunk/Source/WebCore/css/StyleSheet.h	2011-10-24 01:49:50 UTC (rev 98208)
@@ -61,8 +61,6 @@
     virtual void styleSheetChanged() { }
 
     virtual KURL completeURL(const String& url) const;
-    virtual void addSubresourceStyleURLs(ListHashSet<KURL>&) { }
-
     virtual bool parseString(const String&, bool strict = true) = 0;
 
 protected:

Modified: trunk/Source/WebCore/html/HTMLLinkElement.cpp (98207 => 98208)


--- trunk/Source/WebCore/html/HTMLLinkElement.cpp	2011-10-24 01:42:08 UTC (rev 98207)
+++ trunk/Source/WebCore/html/HTMLLinkElement.cpp	2011-10-24 01:49:50 UTC (rev 98208)
@@ -339,7 +339,7 @@
         return true;
     if (!m_sheet)
         return false;
-    return static_cast<CSSStyleSheet *>(m_sheet.get())->isLoading();
+    return m_sheet->isLoading();
 }
 
 void HTMLLinkElement::linkLoaded()
@@ -408,7 +408,7 @@
     addSubresourceURL(urls, href());
     
     // Walk the URLs linked by the linked-to stylesheet.
-    if (StyleSheet* styleSheet = const_cast<HTMLLinkElement*>(this)->sheet())
+    if (CSSStyleSheet* styleSheet = const_cast<HTMLLinkElement*>(this)->sheet())
         styleSheet->addSubresourceStyleURLs(urls);
 }
 

Modified: trunk/Source/WebCore/html/HTMLStyleElement.cpp (98207 => 98208)


--- trunk/Source/WebCore/html/HTMLStyleElement.cpp	2011-10-24 01:42:08 UTC (rev 98207)
+++ trunk/Source/WebCore/html/HTMLStyleElement.cpp	2011-10-24 01:49:50 UTC (rev 98208)
@@ -98,22 +98,21 @@
 {    
     HTMLElement::addSubresourceAttributeURLs(urls);
 
-    if (StyleSheet* styleSheet = const_cast<HTMLStyleElement*>(this)->sheet())
+    if (CSSStyleSheet* styleSheet = const_cast<HTMLStyleElement*>(this)->sheet())
         styleSheet->addSubresourceStyleURLs(urls);
 }
 
 bool HTMLStyleElement::disabled() const
 {
-    StyleSheet* styleSheet = sheet();
-    if (!styleSheet)
+    if (!m_sheet)
         return false;
 
-    return styleSheet->disabled();
+    return m_sheet->disabled();
 }
 
 void HTMLStyleElement::setDisabled(bool setDisabled)
 {
-    if (StyleSheet* styleSheet = sheet())
+    if (CSSStyleSheet* styleSheet = sheet())
         styleSheet->setDisabled(setDisabled);
 }
 
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to