Title: [97742] trunk/Source/WebCore
Revision
97742
Author
[email protected]
Date
2011-10-18 05:46:06 -0700 (Tue, 18 Oct 2011)

Log Message

Move CSSRule specific virtuals from StyleBase down into CSSRule.
https://bugs.webkit.org/show_bug.cgi?id=70240

Reviewed by Darin Adler.

Move all the isFooRule() virtuals except isImportRule() to CSSRule
since they only make sense for its subclasses. isRule() remains in
StyleBase since we still need it for the parent chain traversal.
isImportRule() remains because XSLImportRule implements it.

Also moved insertedIntoParent() and removed its usage in
XSLStyleSheet since it is only reimplemented by CSSImportRule.

* css/CSSRule.h:
(WebCore::CSSRule::isCharsetRule):
(WebCore::CSSRule::isFontFaceRule):
(WebCore::CSSRule::isKeyframeRule):
(WebCore::CSSRule::isKeyframesRule):
(WebCore::CSSRule::isMediaRule):
(WebCore::CSSRule::isPageRule):
(WebCore::CSSRule::isStyleRule):
(WebCore::CSSRule::isRegionStyleRule):
(WebCore::CSSRule::insertedIntoParent):
* css/StyleBase.h:
(WebCore::StyleBase::isImportRule):
(WebCore::StyleBase::isCSSStyleSheet):
* xml/XSLStyleSheet.h:
(WebCore::XSLStyleSheet::append):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (97741 => 97742)


--- trunk/Source/WebCore/ChangeLog	2011-10-18 12:39:11 UTC (rev 97741)
+++ trunk/Source/WebCore/ChangeLog	2011-10-18 12:46:06 UTC (rev 97742)
@@ -1,3 +1,34 @@
+2011-10-18  Andreas Kling  <[email protected]>
+
+        Move CSSRule specific virtuals from StyleBase down into CSSRule.
+        https://bugs.webkit.org/show_bug.cgi?id=70240
+
+        Reviewed by Darin Adler.
+
+        Move all the isFooRule() virtuals except isImportRule() to CSSRule
+        since they only make sense for its subclasses. isRule() remains in
+        StyleBase since we still need it for the parent chain traversal.
+        isImportRule() remains because XSLImportRule implements it.
+
+        Also moved insertedIntoParent() and removed its usage in
+        XSLStyleSheet since it is only reimplemented by CSSImportRule.
+
+        * css/CSSRule.h:
+        (WebCore::CSSRule::isCharsetRule):
+        (WebCore::CSSRule::isFontFaceRule):
+        (WebCore::CSSRule::isKeyframeRule):
+        (WebCore::CSSRule::isKeyframesRule):
+        (WebCore::CSSRule::isMediaRule):
+        (WebCore::CSSRule::isPageRule):
+        (WebCore::CSSRule::isStyleRule):
+        (WebCore::CSSRule::isRegionStyleRule):
+        (WebCore::CSSRule::insertedIntoParent):
+        * css/StyleBase.h:
+        (WebCore::StyleBase::isImportRule):
+        (WebCore::StyleBase::isCSSStyleSheet):
+        * xml/XSLStyleSheet.h:
+        (WebCore::XSLStyleSheet::append):
+
 2011-10-18  Sachin Puranik  <[email protected]>
 
         Option.value should trim extra internal html spaces

Modified: trunk/Source/WebCore/css/CSSRule.h (97741 => 97742)


--- trunk/Source/WebCore/css/CSSRule.h	2011-10-18 12:39:11 UTC (rev 97741)
+++ trunk/Source/WebCore/css/CSSRule.h	2011-10-18 12:46:06 UTC (rev 97742)
@@ -49,6 +49,15 @@
 
     virtual CSSRuleType type() const = 0;
 
+    virtual bool isCharsetRule() const { return false; }
+    virtual bool isFontFaceRule() const { return false; }
+    virtual bool isKeyframeRule() const { return false; }
+    virtual bool isKeyframesRule() const { return false; }
+    virtual bool isMediaRule() const { return false; }
+    virtual bool isPageRule() const { return false; }
+    virtual bool isStyleRule() const { return false; }
+    virtual bool isRegionStyleRule() const { return false; }
+
     CSSStyleSheet* parentStyleSheet() const;
     CSSRule* parentRule() const;
 
@@ -57,6 +66,8 @@
 
     virtual void addSubresourceStyleURLs(ListHashSet<KURL>&) { }
 
+    virtual void insertedIntoParent() { }
+
 protected:
     CSSRule(CSSStyleSheet* parent)
         : StyleBase(parent)

Modified: trunk/Source/WebCore/css/StyleBase.h (97741 => 97742)


--- trunk/Source/WebCore/css/StyleBase.h	2011-10-18 12:39:11 UTC (rev 97741)
+++ trunk/Source/WebCore/css/StyleBase.h	2011-10-18 12:46:06 UTC (rev 97742)
@@ -47,20 +47,11 @@
         // returns the url of the style sheet this object belongs to
         KURL baseURL() const;
 
-        virtual bool isCSSStyleSheet() const { return false; }
-
-        virtual bool isCharsetRule() const { return false; }
-        virtual bool isFontFaceRule() const { return false; }
-        virtual bool isImportRule() const { return false; }
-        virtual bool isKeyframeRule() const { return false; }
-        virtual bool isKeyframesRule() const { return false; }
-        virtual bool isMediaRule() const { return false; }
-        virtual bool isPageRule() const { return false; }
         virtual bool isRule() const { return false; }
-        virtual bool isStyleRule() const { return false; }
-        virtual bool isRegionStyleRule() const { return false; }
+        virtual bool isImportRule() const { return false; }
 
         virtual bool isStyleSheet() const { return false; }
+        virtual bool isCSSStyleSheet() const { return false; }
         virtual bool isXSLStyleSheet() const { return false; }
 
         virtual bool isMutableStyleDeclaration() const { return false; }
@@ -71,8 +62,6 @@
 
         bool useStrictParsing() const { return !m_parent || m_parent->useStrictParsing(); }
 
-        virtual void insertedIntoParent() { }
-
         StyleSheet* stylesheet();
         Node* node();
 

Modified: trunk/Source/WebCore/xml/XSLStyleSheet.h (97741 => 97742)


--- trunk/Source/WebCore/xml/XSLStyleSheet.h	2011-10-18 12:39:11 UTC (rev 97741)
+++ trunk/Source/WebCore/xml/XSLStyleSheet.h	2011-10-18 12:46:06 UTC (rev 97742)
@@ -102,9 +102,7 @@
 private:
     void append(PassRefPtr<StyleBase> child)
     {
-        StyleBase* c = child.get();
         m_children.append(child);
-        c->insertedIntoParent();
     }
 
     XSLStyleSheet(Node* parentNode, const String& originalURL, const KURL& finalURL, bool embedded);
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to