[Refactoring] rename StyleRuleBlock -> StyleRuleGroup
authortasak@google.com <tasak@google.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 21 Jan 2013 10:33:19 +0000 (10:33 +0000)
committertasak@google.com <tasak@google.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 21 Jan 2013 10:33:19 +0000 (10:33 +0000)
https://bugs.webkit.org/show_bug.cgi?id=107415

Reviewed by Antti Koivisto.

StyleRuleBlock should be renamed StyleRuleGroup, because
CSSGroupingRule (not CSSBlockRule) is an interface for an at-rule that
contains other rules nested inside itself:
http://www.w3.org/TR/2012/WD-css3-conditional-20121213/#the-cssgroupingrule-interface
To match the name: CSSGroupingRule, StyleRuleGroup looks better.

No new tests, because just refactoring.

* css/CSSGroupingRule.cpp:
(WebCore::CSSGroupingRule::CSSGroupingRule):
(WebCore::CSSGroupingRule::reattach):
* css/CSSGroupingRule.h:
(CSSGroupingRule):
* css/StyleRule.cpp:
(WebCore::StyleRuleGroup::StyleRuleGroup):
(WebCore::StyleRuleGroup::wrapperInsertRule):
(WebCore::StyleRuleGroup::wrapperRemoveRule):
(WebCore::StyleRuleGroup::reportDescendantMemoryUsage):
(WebCore::StyleRuleMedia::StyleRuleMedia):
(WebCore::StyleRuleSupports::StyleRuleSupports):
(WebCore::StyleRuleRegion::StyleRuleRegion):
* css/StyleRule.h:
(StyleRuleGroup):
(WebCore::StyleRuleHost::StyleRuleHost):
(WebCore::toStyleRuleMedia):
(WebCore::toStyleRuleSupports):
(WebCore::toStyleRuleRegion):
Just replaced StyleRuleBlock with StyleRuleGroup.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@140316 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/css/CSSGroupingRule.cpp
Source/WebCore/css/CSSGroupingRule.h
Source/WebCore/css/StyleRule.cpp
Source/WebCore/css/StyleRule.h

index fbd8a6d..2c7a2fa 100644 (file)
@@ -1,3 +1,39 @@
+2013-01-21  Takashi Sakamoto  <tasak@google.com>
+
+        [Refactoring] rename StyleRuleBlock -> StyleRuleGroup
+        https://bugs.webkit.org/show_bug.cgi?id=107415
+
+        Reviewed by Antti Koivisto.
+
+        StyleRuleBlock should be renamed StyleRuleGroup, because
+        CSSGroupingRule (not CSSBlockRule) is an interface for an at-rule that
+        contains other rules nested inside itself:
+        http://www.w3.org/TR/2012/WD-css3-conditional-20121213/#the-cssgroupingrule-interface
+        To match the name: CSSGroupingRule, StyleRuleGroup looks better.
+
+        No new tests, because just refactoring.
+
+        * css/CSSGroupingRule.cpp:
+        (WebCore::CSSGroupingRule::CSSGroupingRule):
+        (WebCore::CSSGroupingRule::reattach):
+        * css/CSSGroupingRule.h:
+        (CSSGroupingRule):
+        * css/StyleRule.cpp:
+        (WebCore::StyleRuleGroup::StyleRuleGroup):
+        (WebCore::StyleRuleGroup::wrapperInsertRule):
+        (WebCore::StyleRuleGroup::wrapperRemoveRule):
+        (WebCore::StyleRuleGroup::reportDescendantMemoryUsage):
+        (WebCore::StyleRuleMedia::StyleRuleMedia):
+        (WebCore::StyleRuleSupports::StyleRuleSupports):
+        (WebCore::StyleRuleRegion::StyleRuleRegion):
+        * css/StyleRule.h:
+        (StyleRuleGroup):
+        (WebCore::StyleRuleHost::StyleRuleHost):
+        (WebCore::toStyleRuleMedia):
+        (WebCore::toStyleRuleSupports):
+        (WebCore::toStyleRuleRegion):
+        Just replaced StyleRuleBlock with StyleRuleGroup.
+
 2013-01-21  Andrey Lushnikov  <lushnikov@chromium.org>
 
         Web Inspector: refactoring to use string as argument for highlightRegex API
index 601a353..b39530d 100644 (file)
@@ -43,7 +43,7 @@
 
 namespace WebCore {
 
-CSSGroupingRule::CSSGroupingRule(StyleRuleBlock* groupRule, CSSStyleSheet* parent)
+CSSGroupingRule::CSSGroupingRule(StyleRuleGroup* groupRule, CSSStyleSheet* parent)
     : CSSRule(parent)
     , m_groupRule(groupRule)
     , m_childRuleCSSOMWrappers(groupRule->childRules().size())
@@ -153,7 +153,7 @@ CSSRuleList* CSSGroupingRule::cssRules() const
 void CSSGroupingRule::reattach(StyleRuleBase* rule)
 {
     ASSERT(rule);
-    m_groupRule = static_cast<StyleRuleBlock*>(rule);
+    m_groupRule = static_cast<StyleRuleGroup*>(rule);
     for (unsigned i = 0; i < m_childRuleCSSOMWrappers.size(); ++i) {
         if (m_childRuleCSSOMWrappers[i])
             m_childRuleCSSOMWrappers[i]->reattach(m_groupRule->childRules()[i].get());
index b2bcf3e..d2f66a2 100644 (file)
@@ -48,11 +48,11 @@ public:
     CSSRule* item(unsigned index) const;
 
 protected:
-    CSSGroupingRule(StyleRuleBlock* groupRule, CSSStyleSheet* parent);
+    CSSGroupingRule(StyleRuleGroup* groupRule, CSSStyleSheet* parent);
     
     void appendCssTextForItems(StringBuilder&) const;
 
-    RefPtr<StyleRuleBlock> m_groupRule;
+    RefPtr<StyleRuleGroup> m_groupRule;
     mutable Vector<RefPtr<CSSRule> > m_childRuleCSSOMWrappers;
     mutable OwnPtr<CSSRuleList> m_ruleListCSSOMWrapper;
 };
index d019ea6..4ebb3c5 100644 (file)
@@ -373,13 +373,13 @@ void StyleRuleFontFace::reportDescendantMemoryUsage(MemoryObjectInfo* memoryObje
 }
 
 
-StyleRuleBlock::StyleRuleBlock(Type type, Vector<RefPtr<StyleRuleBase> >& adoptRule)
+StyleRuleGroup::StyleRuleGroup(Type type, Vector<RefPtr<StyleRuleBase> >& adoptRule)
     : StyleRuleBase(type, 0)
 {
     m_childRules.swap(adoptRule);
 }
 
-StyleRuleBlock::StyleRuleBlock(const StyleRuleBlock& o)
+StyleRuleGroup::StyleRuleGroup(const StyleRuleGroup& o)
     : StyleRuleBase(o)
     , m_childRules(o.m_childRules.size())
 {
@@ -387,30 +387,30 @@ StyleRuleBlock::StyleRuleBlock(const StyleRuleBlock& o)
         m_childRules[i] = o.m_childRules[i]->copy();
 }
 
-void StyleRuleBlock::wrapperInsertRule(unsigned index, PassRefPtr<StyleRuleBase> rule)
+void StyleRuleGroup::wrapperInsertRule(unsigned index, PassRefPtr<StyleRuleBase> rule)
 {
     m_childRules.insert(index, rule);
 }
     
-void StyleRuleBlock::wrapperRemoveRule(unsigned index)
+void StyleRuleGroup::wrapperRemoveRule(unsigned index)
 {
     m_childRules.remove(index);
 }
 
-void StyleRuleBlock::reportDescendantMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const
+void StyleRuleGroup::reportDescendantMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const
 {
     MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::CSS);
     info.addMember(m_childRules);
 }
 
 StyleRuleMedia::StyleRuleMedia(PassRefPtr<MediaQuerySet> media, Vector<RefPtr<StyleRuleBase> >& adoptRules)
-    : StyleRuleBlock(Media, adoptRules)
+    : StyleRuleGroup(Media, adoptRules)
     , m_mediaQueries(media)
 {
 }
 
 StyleRuleMedia::StyleRuleMedia(const StyleRuleMedia& o)
-    : StyleRuleBlock(o)
+    : StyleRuleGroup(o)
 {
     if (o.m_mediaQueries)
         m_mediaQueries = o.m_mediaQueries->copy();
@@ -425,14 +425,14 @@ void StyleRuleMedia::reportDescendantMemoryUsage(MemoryObjectInfo* memoryObjectI
 
 #if ENABLE(CSS3_CONDITIONAL_RULES)
 StyleRuleSupports::StyleRuleSupports(const String& conditionText, bool conditionIsSupported, Vector<RefPtr<StyleRuleBase> >& adoptRules)
-    : StyleRuleBlock(Supports, adoptRules)
+    : StyleRuleGroup(Supports, adoptRules)
     , m_conditionText(conditionText)
     , m_conditionIsSupported(conditionIsSupported)
 {
 }
 
 StyleRuleSupports::StyleRuleSupports(const StyleRuleSupports& o)
-    : StyleRuleBlock(o)
+    : StyleRuleGroup(o)
     , m_conditionText(o.m_conditionText)
     , m_conditionIsSupported(o.m_conditionIsSupported)
 {
@@ -440,13 +440,13 @@ StyleRuleSupports::StyleRuleSupports(const StyleRuleSupports& o)
 #endif
 
 StyleRuleRegion::StyleRuleRegion(Vector<OwnPtr<CSSParserSelector> >* selectors, Vector<RefPtr<StyleRuleBase> >& adoptRules)
-    : StyleRuleBlock(Region, adoptRules)
+    : StyleRuleGroup(Region, adoptRules)
 {
     m_selectorList.adoptSelectorVector(*selectors);
 }
 
 StyleRuleRegion::StyleRuleRegion(const StyleRuleRegion& o)
-    : StyleRuleBlock(o)
+    : StyleRuleGroup(o)
     , m_selectorList(o.m_selectorList)
 {
 }
index 4bdacfc..fba5a74 100644 (file)
@@ -185,7 +185,7 @@ private:
     CSSSelectorList m_selectorList;
 };
 
-class StyleRuleBlock : public StyleRuleBase {
+class StyleRuleGroup : public StyleRuleBase {
 public:
     const Vector<RefPtr<StyleRuleBase> >& childRules() const { return m_childRules; }
     
@@ -195,14 +195,14 @@ public:
     void reportDescendantMemoryUsage(MemoryObjectInfo*) const;
     
 protected:
-    StyleRuleBlock(Type, Vector<RefPtr<StyleRuleBase> >& adoptRule);
-    StyleRuleBlock(const StyleRuleBlock&);
+    StyleRuleGroup(Type, Vector<RefPtr<StyleRuleBase> >& adoptRule);
+    StyleRuleGroup(const StyleRuleGroup&);
     
 private:
     Vector<RefPtr<StyleRuleBase> > m_childRules;
 };
 
-class StyleRuleMedia : public StyleRuleBlock {
+class StyleRuleMedia : public StyleRuleGroup {
 public:
     static PassRefPtr<StyleRuleMedia> create(PassRefPtr<MediaQuerySet> media, Vector<RefPtr<StyleRuleBase> >& adoptRules)
     {
@@ -223,7 +223,7 @@ private:
 };
 
 #if ENABLE(CSS3_CONDITIONAL_RULES)
-class StyleRuleSupports : public StyleRuleBlock {
+class StyleRuleSupports : public StyleRuleGroup {
 public:
     static PassRefPtr<StyleRuleSupports> create(const String& conditionText, bool conditionIsSupported, Vector<RefPtr<StyleRuleBase> >& adoptRules)
     {
@@ -243,7 +243,7 @@ private:
 };
 #endif
 
-class StyleRuleRegion : public StyleRuleBlock {
+class StyleRuleRegion : public StyleRuleGroup {
 public:
     static PassRefPtr<StyleRuleRegion> create(Vector<OwnPtr<CSSParserSelector> >* selectors, Vector<RefPtr<StyleRuleBase> >& adoptRules)
     {
@@ -264,7 +264,7 @@ private:
 };
 
 #if ENABLE(SHADOW_DOM)
-class StyleRuleHost : public StyleRuleBlock {
+class StyleRuleHost : public StyleRuleGroup {
 public:
     static PassRefPtr<StyleRuleHost> create(Vector<RefPtr<StyleRuleBase> >& adoptRules)
     {
@@ -274,8 +274,8 @@ public:
     PassRefPtr<StyleRuleHost> copy() const { return adoptRef(new StyleRuleHost(*this)); }
 
 private:
-    StyleRuleHost(Vector<RefPtr<StyleRuleBase> >& adoptRules) : StyleRuleBlock(HostInternal, adoptRules) { }
-    StyleRuleHost(const StyleRuleHost& o) : StyleRuleBlock(o) { }
+    StyleRuleHost(Vector<RefPtr<StyleRuleBase> >& adoptRules) : StyleRuleGroup(HostInternal, adoptRules) { }
+    StyleRuleHost(const StyleRuleHost& o) : StyleRuleGroup(o) { }
 };
 #endif
 
@@ -303,21 +303,21 @@ private:
 };
 #endif // ENABLE(CSS_DEVICE_ADAPTATION)
 
-inline const StyleRuleMedia* toStyleRuleMedia(const StyleRuleBlock* rule)
+inline const StyleRuleMedia* toStyleRuleMedia(const StyleRuleGroup* rule)
 {
     ASSERT(!rule || rule->isMediaRule());
     return static_cast<const StyleRuleMedia*>(rule);
 }
 
 #if ENABLE(CSS3_CONDITIONAL_RULES)
-inline const StyleRuleSupports* toStyleRuleSupports(const StyleRuleBlock* rule)
+inline const StyleRuleSupports* toStyleRuleSupports(const StyleRuleGroup* rule)
 {
     ASSERT(!rule || rule->isSupportsRule());
     return static_cast<const StyleRuleSupports*>(rule);
 }
 #endif
 
-inline const StyleRuleRegion* toStyleRuleRegion(const StyleRuleBlock* rule)
+inline const StyleRuleRegion* toStyleRuleRegion(const StyleRuleGroup* rule)
 {
     ASSERT(!rule || rule->isRegionRule());
     return static_cast<const StyleRuleRegion*>(rule);