Changeset 140316 in webkit
- Timestamp:
- Jan 21, 2013 2:33:19 AM (11 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r140314 r140316 1 2013-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 1 37 2013-01-21 Andrey Lushnikov <lushnikov@chromium.org> 2 38 -
trunk/Source/WebCore/css/CSSGroupingRule.cpp
r139590 r140316 44 44 namespace WebCore { 45 45 46 CSSGroupingRule::CSSGroupingRule(StyleRule Block* groupRule, CSSStyleSheet* parent)46 CSSGroupingRule::CSSGroupingRule(StyleRuleGroup* groupRule, CSSStyleSheet* parent) 47 47 : CSSRule(parent) 48 48 , m_groupRule(groupRule) … … 154 154 { 155 155 ASSERT(rule); 156 m_groupRule = static_cast<StyleRule Block*>(rule);156 m_groupRule = static_cast<StyleRuleGroup*>(rule); 157 157 for (unsigned i = 0; i < m_childRuleCSSOMWrappers.size(); ++i) { 158 158 if (m_childRuleCSSOMWrappers[i]) -
trunk/Source/WebCore/css/CSSGroupingRule.h
r139409 r140316 49 49 50 50 protected: 51 CSSGroupingRule(StyleRule Block* groupRule, CSSStyleSheet* parent);51 CSSGroupingRule(StyleRuleGroup* groupRule, CSSStyleSheet* parent); 52 52 53 53 void appendCssTextForItems(StringBuilder&) const; 54 54 55 RefPtr<StyleRule Block> m_groupRule;55 RefPtr<StyleRuleGroup> m_groupRule; 56 56 mutable Vector<RefPtr<CSSRule> > m_childRuleCSSOMWrappers; 57 57 mutable OwnPtr<CSSRuleList> m_ruleListCSSOMWrapper; -
trunk/Source/WebCore/css/StyleRule.cpp
r140115 r140316 374 374 375 375 376 StyleRule Block::StyleRuleBlock(Type type, Vector<RefPtr<StyleRuleBase> >& adoptRule)376 StyleRuleGroup::StyleRuleGroup(Type type, Vector<RefPtr<StyleRuleBase> >& adoptRule) 377 377 : StyleRuleBase(type, 0) 378 378 { … … 380 380 } 381 381 382 StyleRule Block::StyleRuleBlock(const StyleRuleBlock& o)382 StyleRuleGroup::StyleRuleGroup(const StyleRuleGroup& o) 383 383 : StyleRuleBase(o) 384 384 , m_childRules(o.m_childRules.size()) … … 388 388 } 389 389 390 void StyleRule Block::wrapperInsertRule(unsigned index, PassRefPtr<StyleRuleBase> rule)390 void StyleRuleGroup::wrapperInsertRule(unsigned index, PassRefPtr<StyleRuleBase> rule) 391 391 { 392 392 m_childRules.insert(index, rule); 393 393 } 394 394 395 void StyleRule Block::wrapperRemoveRule(unsigned index)395 void StyleRuleGroup::wrapperRemoveRule(unsigned index) 396 396 { 397 397 m_childRules.remove(index); 398 398 } 399 399 400 void StyleRule Block::reportDescendantMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const400 void StyleRuleGroup::reportDescendantMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const 401 401 { 402 402 MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::CSS); … … 405 405 406 406 StyleRuleMedia::StyleRuleMedia(PassRefPtr<MediaQuerySet> media, Vector<RefPtr<StyleRuleBase> >& adoptRules) 407 : StyleRule Block(Media, adoptRules)407 : StyleRuleGroup(Media, adoptRules) 408 408 , m_mediaQueries(media) 409 409 { … … 411 411 412 412 StyleRuleMedia::StyleRuleMedia(const StyleRuleMedia& o) 413 : StyleRule Block(o)413 : StyleRuleGroup(o) 414 414 { 415 415 if (o.m_mediaQueries) … … 426 426 #if ENABLE(CSS3_CONDITIONAL_RULES) 427 427 StyleRuleSupports::StyleRuleSupports(const String& conditionText, bool conditionIsSupported, Vector<RefPtr<StyleRuleBase> >& adoptRules) 428 : StyleRule Block(Supports, adoptRules)428 : StyleRuleGroup(Supports, adoptRules) 429 429 , m_conditionText(conditionText) 430 430 , m_conditionIsSupported(conditionIsSupported) … … 433 433 434 434 StyleRuleSupports::StyleRuleSupports(const StyleRuleSupports& o) 435 : StyleRule Block(o)435 : StyleRuleGroup(o) 436 436 , m_conditionText(o.m_conditionText) 437 437 , m_conditionIsSupported(o.m_conditionIsSupported) … … 441 441 442 442 StyleRuleRegion::StyleRuleRegion(Vector<OwnPtr<CSSParserSelector> >* selectors, Vector<RefPtr<StyleRuleBase> >& adoptRules) 443 : StyleRule Block(Region, adoptRules)443 : StyleRuleGroup(Region, adoptRules) 444 444 { 445 445 m_selectorList.adoptSelectorVector(*selectors); … … 447 447 448 448 StyleRuleRegion::StyleRuleRegion(const StyleRuleRegion& o) 449 : StyleRule Block(o)449 : StyleRuleGroup(o) 450 450 , m_selectorList(o.m_selectorList) 451 451 { -
trunk/Source/WebCore/css/StyleRule.h
r140115 r140316 186 186 }; 187 187 188 class StyleRule Block: public StyleRuleBase {188 class StyleRuleGroup : public StyleRuleBase { 189 189 public: 190 190 const Vector<RefPtr<StyleRuleBase> >& childRules() const { return m_childRules; } … … 196 196 197 197 protected: 198 StyleRule Block(Type, Vector<RefPtr<StyleRuleBase> >& adoptRule);199 StyleRule Block(const StyleRuleBlock&);198 StyleRuleGroup(Type, Vector<RefPtr<StyleRuleBase> >& adoptRule); 199 StyleRuleGroup(const StyleRuleGroup&); 200 200 201 201 private: … … 203 203 }; 204 204 205 class StyleRuleMedia : public StyleRule Block{205 class StyleRuleMedia : public StyleRuleGroup { 206 206 public: 207 207 static PassRefPtr<StyleRuleMedia> create(PassRefPtr<MediaQuerySet> media, Vector<RefPtr<StyleRuleBase> >& adoptRules) … … 224 224 225 225 #if ENABLE(CSS3_CONDITIONAL_RULES) 226 class StyleRuleSupports : public StyleRule Block{226 class StyleRuleSupports : public StyleRuleGroup { 227 227 public: 228 228 static PassRefPtr<StyleRuleSupports> create(const String& conditionText, bool conditionIsSupported, Vector<RefPtr<StyleRuleBase> >& adoptRules) … … 244 244 #endif 245 245 246 class StyleRuleRegion : public StyleRule Block{246 class StyleRuleRegion : public StyleRuleGroup { 247 247 public: 248 248 static PassRefPtr<StyleRuleRegion> create(Vector<OwnPtr<CSSParserSelector> >* selectors, Vector<RefPtr<StyleRuleBase> >& adoptRules) … … 265 265 266 266 #if ENABLE(SHADOW_DOM) 267 class StyleRuleHost : public StyleRule Block{267 class StyleRuleHost : public StyleRuleGroup { 268 268 public: 269 269 static PassRefPtr<StyleRuleHost> create(Vector<RefPtr<StyleRuleBase> >& adoptRules) … … 275 275 276 276 private: 277 StyleRuleHost(Vector<RefPtr<StyleRuleBase> >& adoptRules) : StyleRule Block(HostInternal, adoptRules) { }278 StyleRuleHost(const StyleRuleHost& o) : StyleRule Block(o) { }277 StyleRuleHost(Vector<RefPtr<StyleRuleBase> >& adoptRules) : StyleRuleGroup(HostInternal, adoptRules) { } 278 StyleRuleHost(const StyleRuleHost& o) : StyleRuleGroup(o) { } 279 279 }; 280 280 #endif … … 304 304 #endif // ENABLE(CSS_DEVICE_ADAPTATION) 305 305 306 inline const StyleRuleMedia* toStyleRuleMedia(const StyleRule Block* rule)306 inline const StyleRuleMedia* toStyleRuleMedia(const StyleRuleGroup* rule) 307 307 { 308 308 ASSERT(!rule || rule->isMediaRule()); … … 311 311 312 312 #if ENABLE(CSS3_CONDITIONAL_RULES) 313 inline const StyleRuleSupports* toStyleRuleSupports(const StyleRule Block* rule)313 inline const StyleRuleSupports* toStyleRuleSupports(const StyleRuleGroup* rule) 314 314 { 315 315 ASSERT(!rule || rule->isSupportsRule()); … … 318 318 #endif 319 319 320 inline const StyleRuleRegion* toStyleRuleRegion(const StyleRule Block* rule)320 inline const StyleRuleRegion* toStyleRuleRegion(const StyleRuleGroup* rule) 321 321 { 322 322 ASSERT(!rule || rule->isRegionRule());
Note: See TracChangeset
for help on using the changeset viewer.