Title: [98861] trunk/Source/WebCore
Revision
98861
Author
[email protected]
Date
2011-10-31 10:02:49 -0700 (Mon, 31 Oct 2011)

Log Message

CSSRule: Devirtualize insertedIntoParent()
https://bugs.webkit.org/show_bug.cgi?id=71223

Reviewed by Antti Koivisto.

Moved insertedIntoParent() down into CSSImportRule and renamed it to
requestStyleSheet(). CSSImportRule is the only user of this function.

* css/CSSImportRule.cpp:
(WebCore::CSSImportRule::requestStyleSheet):
* css/CSSImportRule.h:
* css/CSSRule.h:
* css/CSSStyleSheet.cpp:
(WebCore::CSSStyleSheet::append):
(WebCore::CSSStyleSheet::insertRule):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (98860 => 98861)


--- trunk/Source/WebCore/ChangeLog	2011-10-31 16:35:56 UTC (rev 98860)
+++ trunk/Source/WebCore/ChangeLog	2011-10-31 17:02:49 UTC (rev 98861)
@@ -1,3 +1,21 @@
+2011-10-31  Andreas Kling  <[email protected]>
+
+        CSSRule: Devirtualize insertedIntoParent()
+        https://bugs.webkit.org/show_bug.cgi?id=71223
+
+        Reviewed by Antti Koivisto.
+
+        Moved insertedIntoParent() down into CSSImportRule and renamed it to
+        requestStyleSheet(). CSSImportRule is the only user of this function.
+
+        * css/CSSImportRule.cpp:
+        (WebCore::CSSImportRule::requestStyleSheet):
+        * css/CSSImportRule.h:
+        * css/CSSRule.h:
+        * css/CSSStyleSheet.cpp:
+        (WebCore::CSSStyleSheet::append):
+        (WebCore::CSSStyleSheet::insertRule):
+
 2011-10-31  Anna Cavender  <[email protected]>
 
         Implement load notification and events for <track>.

Modified: trunk/Source/WebCore/css/CSSImportRule.cpp (98860 => 98861)


--- trunk/Source/WebCore/css/CSSImportRule.cpp	2011-10-31 16:35:56 UTC (rev 98860)
+++ trunk/Source/WebCore/css/CSSImportRule.cpp	2011-10-31 17:02:49 UTC (rev 98861)
@@ -109,7 +109,7 @@
     return m_loading || (m_styleSheet && m_styleSheet->isLoading());
 }
 
-void CSSImportRule::insertedIntoParent()
+void CSSImportRule::requestStyleSheet()
 {
     CSSStyleSheet* parentSheet = parentStyleSheet();
     if (!parentSheet || !parentSheet->document())

Modified: trunk/Source/WebCore/css/CSSImportRule.h (98860 => 98861)


--- trunk/Source/WebCore/css/CSSImportRule.h	2011-10-31 16:35:56 UTC (rev 98860)
+++ trunk/Source/WebCore/css/CSSImportRule.h	2011-10-31 17:02:49 UTC (rev 98861)
@@ -54,11 +54,11 @@
 
     virtual void addSubresourceStyleURLs(ListHashSet<KURL>& urls);
 
+    void requestStyleSheet();
+
 private:
     CSSImportRule(CSSStyleSheet* parent, const String& href, PassRefPtr<MediaList>);
 
-    virtual void insertedIntoParent();
-
     // from CachedResourceClient
     virtual void setCSSStyleSheet(const String& href, const KURL& baseURL, const String& charset, const CachedCSSStyleSheet*);
 

Modified: trunk/Source/WebCore/css/CSSRule.h (98860 => 98861)


--- trunk/Source/WebCore/css/CSSRule.h	2011-10-31 16:35:56 UTC (rev 98860)
+++ trunk/Source/WebCore/css/CSSRule.h	2011-10-31 17:02:49 UTC (rev 98861)
@@ -96,8 +96,6 @@
 
     virtual void addSubresourceStyleURLs(ListHashSet<KURL>&) { }
 
-    virtual void insertedIntoParent() { }
-
     KURL baseURL() const
     {
         if (CSSStyleSheet* parentSheet = parentStyleSheet())

Modified: trunk/Source/WebCore/css/CSSStyleSheet.cpp (98860 => 98861)


--- trunk/Source/WebCore/css/CSSStyleSheet.cpp	2011-10-31 16:35:56 UTC (rev 98860)
+++ trunk/Source/WebCore/css/CSSStyleSheet.cpp	2011-10-31 17:02:49 UTC (rev 98861)
@@ -88,7 +88,8 @@
 {
     CSSRule* c = child.get();
     m_children.append(child);
-    c->insertedIntoParent();
+    if (c->isImportRule())
+        static_cast<CSSImportRule*>(c)->requestStyleSheet();
 }
 
 void CSSStyleSheet::remove(unsigned index)
@@ -136,7 +137,8 @@
 
     CSSRule* c = r.get();
     m_children.insert(index, r.release());
-    c->insertedIntoParent();
+    if (c->isImportRule())
+        static_cast<CSSImportRule*>(c)->requestStyleSheet();
 
     styleSheetChanged();
 
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to