Changeset 140316 in webkit


Ignore:
Timestamp:
Jan 21, 2013 2:33:19 AM (11 years ago)
Author:
tasak@google.com
Message:

[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.

Location:
trunk/Source/WebCore
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r140314 r140316  
     12013-01-21  Takashi Sakamoto  <tasak@google.com>
     2
     3        [Refactoring] rename StyleRuleBlock -> StyleRuleGroup
     4        https://bugs.webkit.org/show_bug.cgi?id=107415
     5
     6        Reviewed by Antti Koivisto.
     7
     8        StyleRuleBlock should be renamed StyleRuleGroup, because
     9        CSSGroupingRule (not CSSBlockRule) is an interface for an at-rule that
     10        contains other rules nested inside itself:
     11        http://www.w3.org/TR/2012/WD-css3-conditional-20121213/#the-cssgroupingrule-interface
     12        To match the name: CSSGroupingRule, StyleRuleGroup looks better.
     13
     14        No new tests, because just refactoring.
     15
     16        * css/CSSGroupingRule.cpp:
     17        (WebCore::CSSGroupingRule::CSSGroupingRule):
     18        (WebCore::CSSGroupingRule::reattach):
     19        * css/CSSGroupingRule.h:
     20        (CSSGroupingRule):
     21        * css/StyleRule.cpp:
     22        (WebCore::StyleRuleGroup::StyleRuleGroup):
     23        (WebCore::StyleRuleGroup::wrapperInsertRule):
     24        (WebCore::StyleRuleGroup::wrapperRemoveRule):
     25        (WebCore::StyleRuleGroup::reportDescendantMemoryUsage):
     26        (WebCore::StyleRuleMedia::StyleRuleMedia):
     27        (WebCore::StyleRuleSupports::StyleRuleSupports):
     28        (WebCore::StyleRuleRegion::StyleRuleRegion):
     29        * css/StyleRule.h:
     30        (StyleRuleGroup):
     31        (WebCore::StyleRuleHost::StyleRuleHost):
     32        (WebCore::toStyleRuleMedia):
     33        (WebCore::toStyleRuleSupports):
     34        (WebCore::toStyleRuleRegion):
     35        Just replaced StyleRuleBlock with StyleRuleGroup.
     36
    1372013-01-21  Andrey Lushnikov  <lushnikov@chromium.org>
    238
  • trunk/Source/WebCore/css/CSSGroupingRule.cpp

    r139590 r140316  
    4444namespace WebCore {
    4545
    46 CSSGroupingRule::CSSGroupingRule(StyleRuleBlock* groupRule, CSSStyleSheet* parent)
     46CSSGroupingRule::CSSGroupingRule(StyleRuleGroup* groupRule, CSSStyleSheet* parent)
    4747    : CSSRule(parent)
    4848    , m_groupRule(groupRule)
     
    154154{
    155155    ASSERT(rule);
    156     m_groupRule = static_cast<StyleRuleBlock*>(rule);
     156    m_groupRule = static_cast<StyleRuleGroup*>(rule);
    157157    for (unsigned i = 0; i < m_childRuleCSSOMWrappers.size(); ++i) {
    158158        if (m_childRuleCSSOMWrappers[i])
  • trunk/Source/WebCore/css/CSSGroupingRule.h

    r139409 r140316  
    4949
    5050protected:
    51     CSSGroupingRule(StyleRuleBlock* groupRule, CSSStyleSheet* parent);
     51    CSSGroupingRule(StyleRuleGroup* groupRule, CSSStyleSheet* parent);
    5252   
    5353    void appendCssTextForItems(StringBuilder&) const;
    5454
    55     RefPtr<StyleRuleBlock> m_groupRule;
     55    RefPtr<StyleRuleGroup> m_groupRule;
    5656    mutable Vector<RefPtr<CSSRule> > m_childRuleCSSOMWrappers;
    5757    mutable OwnPtr<CSSRuleList> m_ruleListCSSOMWrapper;
  • trunk/Source/WebCore/css/StyleRule.cpp

    r140115 r140316  
    374374
    375375
    376 StyleRuleBlock::StyleRuleBlock(Type type, Vector<RefPtr<StyleRuleBase> >& adoptRule)
     376StyleRuleGroup::StyleRuleGroup(Type type, Vector<RefPtr<StyleRuleBase> >& adoptRule)
    377377    : StyleRuleBase(type, 0)
    378378{
     
    380380}
    381381
    382 StyleRuleBlock::StyleRuleBlock(const StyleRuleBlock& o)
     382StyleRuleGroup::StyleRuleGroup(const StyleRuleGroup& o)
    383383    : StyleRuleBase(o)
    384384    , m_childRules(o.m_childRules.size())
     
    388388}
    389389
    390 void StyleRuleBlock::wrapperInsertRule(unsigned index, PassRefPtr<StyleRuleBase> rule)
     390void StyleRuleGroup::wrapperInsertRule(unsigned index, PassRefPtr<StyleRuleBase> rule)
    391391{
    392392    m_childRules.insert(index, rule);
    393393}
    394394   
    395 void StyleRuleBlock::wrapperRemoveRule(unsigned index)
     395void StyleRuleGroup::wrapperRemoveRule(unsigned index)
    396396{
    397397    m_childRules.remove(index);
    398398}
    399399
    400 void StyleRuleBlock::reportDescendantMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const
     400void StyleRuleGroup::reportDescendantMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const
    401401{
    402402    MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::CSS);
     
    405405
    406406StyleRuleMedia::StyleRuleMedia(PassRefPtr<MediaQuerySet> media, Vector<RefPtr<StyleRuleBase> >& adoptRules)
    407     : StyleRuleBlock(Media, adoptRules)
     407    : StyleRuleGroup(Media, adoptRules)
    408408    , m_mediaQueries(media)
    409409{
     
    411411
    412412StyleRuleMedia::StyleRuleMedia(const StyleRuleMedia& o)
    413     : StyleRuleBlock(o)
     413    : StyleRuleGroup(o)
    414414{
    415415    if (o.m_mediaQueries)
     
    426426#if ENABLE(CSS3_CONDITIONAL_RULES)
    427427StyleRuleSupports::StyleRuleSupports(const String& conditionText, bool conditionIsSupported, Vector<RefPtr<StyleRuleBase> >& adoptRules)
    428     : StyleRuleBlock(Supports, adoptRules)
     428    : StyleRuleGroup(Supports, adoptRules)
    429429    , m_conditionText(conditionText)
    430430    , m_conditionIsSupported(conditionIsSupported)
     
    433433
    434434StyleRuleSupports::StyleRuleSupports(const StyleRuleSupports& o)
    435     : StyleRuleBlock(o)
     435    : StyleRuleGroup(o)
    436436    , m_conditionText(o.m_conditionText)
    437437    , m_conditionIsSupported(o.m_conditionIsSupported)
     
    441441
    442442StyleRuleRegion::StyleRuleRegion(Vector<OwnPtr<CSSParserSelector> >* selectors, Vector<RefPtr<StyleRuleBase> >& adoptRules)
    443     : StyleRuleBlock(Region, adoptRules)
     443    : StyleRuleGroup(Region, adoptRules)
    444444{
    445445    m_selectorList.adoptSelectorVector(*selectors);
     
    447447
    448448StyleRuleRegion::StyleRuleRegion(const StyleRuleRegion& o)
    449     : StyleRuleBlock(o)
     449    : StyleRuleGroup(o)
    450450    , m_selectorList(o.m_selectorList)
    451451{
  • trunk/Source/WebCore/css/StyleRule.h

    r140115 r140316  
    186186};
    187187
    188 class StyleRuleBlock : public StyleRuleBase {
     188class StyleRuleGroup : public StyleRuleBase {
    189189public:
    190190    const Vector<RefPtr<StyleRuleBase> >& childRules() const { return m_childRules; }
     
    196196   
    197197protected:
    198     StyleRuleBlock(Type, Vector<RefPtr<StyleRuleBase> >& adoptRule);
    199     StyleRuleBlock(const StyleRuleBlock&);
     198    StyleRuleGroup(Type, Vector<RefPtr<StyleRuleBase> >& adoptRule);
     199    StyleRuleGroup(const StyleRuleGroup&);
    200200   
    201201private:
     
    203203};
    204204
    205 class StyleRuleMedia : public StyleRuleBlock {
     205class StyleRuleMedia : public StyleRuleGroup {
    206206public:
    207207    static PassRefPtr<StyleRuleMedia> create(PassRefPtr<MediaQuerySet> media, Vector<RefPtr<StyleRuleBase> >& adoptRules)
     
    224224
    225225#if ENABLE(CSS3_CONDITIONAL_RULES)
    226 class StyleRuleSupports : public StyleRuleBlock {
     226class StyleRuleSupports : public StyleRuleGroup {
    227227public:
    228228    static PassRefPtr<StyleRuleSupports> create(const String& conditionText, bool conditionIsSupported, Vector<RefPtr<StyleRuleBase> >& adoptRules)
     
    244244#endif
    245245
    246 class StyleRuleRegion : public StyleRuleBlock {
     246class StyleRuleRegion : public StyleRuleGroup {
    247247public:
    248248    static PassRefPtr<StyleRuleRegion> create(Vector<OwnPtr<CSSParserSelector> >* selectors, Vector<RefPtr<StyleRuleBase> >& adoptRules)
     
    265265
    266266#if ENABLE(SHADOW_DOM)
    267 class StyleRuleHost : public StyleRuleBlock {
     267class StyleRuleHost : public StyleRuleGroup {
    268268public:
    269269    static PassRefPtr<StyleRuleHost> create(Vector<RefPtr<StyleRuleBase> >& adoptRules)
     
    275275
    276276private:
    277     StyleRuleHost(Vector<RefPtr<StyleRuleBase> >& adoptRules) : StyleRuleBlock(HostInternal, adoptRules) { }
    278     StyleRuleHost(const StyleRuleHost& o) : StyleRuleBlock(o) { }
     277    StyleRuleHost(Vector<RefPtr<StyleRuleBase> >& adoptRules) : StyleRuleGroup(HostInternal, adoptRules) { }
     278    StyleRuleHost(const StyleRuleHost& o) : StyleRuleGroup(o) { }
    279279};
    280280#endif
     
    304304#endif // ENABLE(CSS_DEVICE_ADAPTATION)
    305305
    306 inline const StyleRuleMedia* toStyleRuleMedia(const StyleRuleBlock* rule)
     306inline const StyleRuleMedia* toStyleRuleMedia(const StyleRuleGroup* rule)
    307307{
    308308    ASSERT(!rule || rule->isMediaRule());
     
    311311
    312312#if ENABLE(CSS3_CONDITIONAL_RULES)
    313 inline const StyleRuleSupports* toStyleRuleSupports(const StyleRuleBlock* rule)
     313inline const StyleRuleSupports* toStyleRuleSupports(const StyleRuleGroup* rule)
    314314{
    315315    ASSERT(!rule || rule->isSupportsRule());
     
    318318#endif
    319319
    320 inline const StyleRuleRegion* toStyleRuleRegion(const StyleRuleBlock* rule)
     320inline const StyleRuleRegion* toStyleRuleRegion(const StyleRuleGroup* rule)
    321321{
    322322    ASSERT(!rule || rule->isRegionRule());
Note: See TracChangeset for help on using the changeset viewer.