Title: [99722] trunk/Source/WebCore
Revision
99722
Author
[email protected]
Date
2011-11-09 08:19:29 -0800 (Wed, 09 Nov 2011)

Log Message

StyleSheet: Devirtualize styleSheetChanged().
<http://webkit.org/b/71913>

Reviewed by Antti Koivisto.

Since this mechanism is only used by CSSStyleSheet, move it there.
Out-of-lined StyleSheet::setDisabled() so we can do a type check
before invoking it from there.

* css/CSSStyleSheet.h:
* css/StyleSheet.cpp:
(WebCore::StyleSheet::setDisabled):
* css/StyleSheet.h:

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (99721 => 99722)


--- trunk/Source/WebCore/ChangeLog	2011-11-09 16:12:20 UTC (rev 99721)
+++ trunk/Source/WebCore/ChangeLog	2011-11-09 16:19:29 UTC (rev 99722)
@@ -1,3 +1,19 @@
+2011-11-09  Andreas Kling  <[email protected]>
+
+        StyleSheet: Devirtualize styleSheetChanged().
+        <http://webkit.org/b/71913>
+
+        Reviewed by Antti Koivisto.
+
+        Since this mechanism is only used by CSSStyleSheet, move it there.
+        Out-of-lined StyleSheet::setDisabled() so we can do a type check
+        before invoking it from there.
+
+        * css/CSSStyleSheet.h:
+        * css/StyleSheet.cpp:
+        (WebCore::StyleSheet::setDisabled):
+        * css/StyleSheet.h:
+
 2011-11-09  Simon Hausmann  <[email protected]>
 
         [Qt] Unreviewed, adding missing files to the build.

Modified: trunk/Source/WebCore/css/CSSStyleSheet.h (99721 => 99722)


--- trunk/Source/WebCore/css/CSSStyleSheet.h	2011-11-09 16:12:20 UTC (rev 99721)
+++ trunk/Source/WebCore/css/CSSStyleSheet.h	2011-11-09 16:19:29 UTC (rev 99722)
@@ -84,7 +84,7 @@
     void addNamespace(CSSParser*, const AtomicString& prefix, const AtomicString& uri);
     const AtomicString& determineNamespace(const AtomicString& prefix);
 
-    virtual void styleSheetChanged();
+    void styleSheetChanged();
 
     virtual bool parseString(const String&, bool strict = true);
 

Modified: trunk/Source/WebCore/css/StyleSheet.cpp (99721 => 99722)


--- trunk/Source/WebCore/css/StyleSheet.cpp	2011-11-09 16:12:20 UTC (rev 99721)
+++ trunk/Source/WebCore/css/StyleSheet.cpp	2011-11-09 16:19:29 UTC (rev 99722)
@@ -91,4 +91,11 @@
     return KURL(baseURL(), url);
 }
 
+void StyleSheet::setDisabled(bool disabled)
+{
+     m_disabled = disabled;
+     if (isCSSStyleSheet())
+         static_cast<CSSStyleSheet*>(this)->styleSheetChanged();
 }
+
+}

Modified: trunk/Source/WebCore/css/StyleSheet.h (99721 => 99722)


--- trunk/Source/WebCore/css/StyleSheet.h	2011-11-09 16:12:20 UTC (rev 99721)
+++ trunk/Source/WebCore/css/StyleSheet.h	2011-11-09 16:19:29 UTC (rev 99722)
@@ -38,7 +38,7 @@
     virtual ~StyleSheet();
 
     bool disabled() const { return m_disabled; }
-    void setDisabled(bool disabled) { m_disabled = disabled; styleSheetChanged(); }
+    void setDisabled(bool);
 
     Node* ownerNode() const { return m_parentNode; }
     void clearOwnerNode() { m_parentNode = 0; }
@@ -63,7 +63,6 @@
 
     virtual String type() const = 0;
     virtual bool isLoading() = 0;
-    virtual void styleSheetChanged() { }
 
     virtual KURL completeURL(const String& url) const;
     virtual bool parseString(const String&, bool strict = true) = 0;
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to