Use Vector instead of a linked list for rules in CSSStyleSelector
authorantti@apple.com <antti@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 2 Feb 2011 15:00:55 +0000 (15:00 +0000)
committerantti@apple.com <antti@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 2 Feb 2011 15:00:55 +0000 (15:00 +0000)
commit4b97bd1fe03f970c7dfa32f00f6ccce1cd69eb53
treefcb3fd4926473cee75f3730757a109825551e485
parent8e39c9b23cb4a3464bd8e61a878d8040aea13905
Use Vector instead of a linked list for rules in CSSStyleSelector
https://bugs.webkit.org/show_bug.cgi?id=53581

Reviewed by Maciej Stachowiak.

- eliminate CSSRuleDataList, replace with Vector<RuleData>
- rename CSSRuleData -> RuleData and CSSRuleSet -> RuleSet
  (these are selector internal classes, CSS prefix is better reserved for public ones).
- constify a bit
- shrink the vectors to fit after collecting the rules

* css/CSSStyleSelector.cpp:
(WebCore::RuleData::RuleData):
(WebCore::RuleData::position):
(WebCore::RuleData::rule):
(WebCore::RuleData::selector):
(WebCore::RuleSet::disableAutoShrinkToFit):
(WebCore::RuleSet::getIDRules):
(WebCore::RuleSet::getClassRules):
(WebCore::RuleSet::getTagRules):
(WebCore::RuleSet::getPseudoRules):
(WebCore::RuleSet::getUniversalRules):
(WebCore::RuleSet::getPageRules):
(WebCore::collectSiblingRulesInDefaultStyle):
(WebCore::CSSStyleSelector::CSSStyleSelector):
(WebCore::loadFullDefaultStyle):
(WebCore::loadSimpleDefaultStyle):
(WebCore::loadViewSourceStyle):
(WebCore::CSSStyleSelector::matchRules):
(WebCore::CSSStyleSelector::matchRulesForList):
(WebCore::operator >):
(WebCore::operator <=):
(WebCore::CSSStyleSelector::sortMatchedRules):
(WebCore::CSSStyleSelector::matchUARules):
(WebCore::RuleSet::RuleSet):
(WebCore::RuleSet::~RuleSet):
(WebCore::RuleSet::addToRuleSet):
(WebCore::RuleSet::addRule):
(WebCore::RuleSet::addPageRule):
(WebCore::RuleSet::addRulesFromSheet):
(WebCore::RuleSet::addStyleRule):
(WebCore::collectIdsAndSiblingRulesFromList):
(WebCore::RuleSet::collectIdsAndSiblingRules):
(WebCore::shrinkMapVectorsToFit):
(WebCore::RuleSet::shrinkToFit):
(WebCore::CSSStyleSelector::matchPageRules):
(WebCore::CSSStyleSelector::matchPageRulesForList):
* css/CSSStyleSelector.h:
(WebCore::CSSStyleSelector::addMatchedRule):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@77376 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/css/CSSStyleSelector.cpp
Source/WebCore/css/CSSStyleSelector.h