CSS: Move duplicate property elimination to parser.
authorkling@webkit.org <kling@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 21 May 2012 19:36:39 +0000 (19:36 +0000)
committerkling@webkit.org <kling@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 21 May 2012 19:36:39 +0000 (19:36 +0000)
commit3093a1065659fc48c9fcdfff8d5c3fa3170743e3
tree6a802d4937697d52b4d635c8cdcae4092e6a815f
parent46dcebb930150d13008ba05a9b878c15588b10fc
CSS: Move duplicate property elimination to parser.
<http://webkit.org/b/86948>

Reviewed by Antti Koivisto.

Source/WebCore:

Remove the StylePropertySet constructor that handled elimination of duplicate
properties and move that to a new parser method, CSSParser::filteredProperties().
Call sites are converted to using StylePropertySet(const Vector<CSSProperty>&).

Instead of building a hashmap of seen properties, use the new WTF::BitArray class
to track whether a given property ID has been seen, and whether we have an
!important entry for a given ID.

* css/CSSParser.cpp:
(WebCore::CSSParser::parseValue):
(WebCore::CSSParser::parseDeclaration):
(WebCore::CSSParser::filteredProperties):
(WebCore::CSSParser::createStyleRule):
(WebCore::CSSParser::createFontFaceRule):
(WebCore::CSSParser::createPageRule):
(WebCore::CSSParser::createKeyframe):
* css/CSSParser.h:
* css/StylePropertySet.cpp:
(WebCore::StylePropertySet::StylePropertySet):
(WebCore::StylePropertySet::addParsedProperties):
* css/StylePropertySet.h:
(WebCore::StylePropertySet::create):
(StylePropertySet):
* svg/SVGFontFaceElement.cpp:
(WebCore::SVGFontFaceElement::rebuildFontFace):

Source/WTF:

Add WTF::BitArray, a simple, malloc free, fixed-size bit array class.

* GNUmakefile.list.am:
* WTF.gypi:
* WTF.pro:
* WTF.vcproj/WTF.vcproj:
* WTF.xcodeproj/project.pbxproj:
* wtf/BitArray.h: Added.
(WTF):
(BitArray):
(WTF::BitArray::BitArray):
(WTF::BitArray::set):
(WTF::BitArray::get):
* wtf/CMakeLists.txt:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@117809 268f45cc-cd09-0410-ab3c-d52691b4dbfc
14 files changed:
Source/WTF/ChangeLog
Source/WTF/GNUmakefile.list.am
Source/WTF/WTF.gypi
Source/WTF/WTF.pro
Source/WTF/WTF.vcproj/WTF.vcproj
Source/WTF/WTF.xcodeproj/project.pbxproj
Source/WTF/wtf/BitArray.h [new file with mode: 0644]
Source/WTF/wtf/CMakeLists.txt
Source/WebCore/ChangeLog
Source/WebCore/css/CSSParser.cpp
Source/WebCore/css/CSSParser.h
Source/WebCore/css/StylePropertySet.cpp
Source/WebCore/css/StylePropertySet.h
Source/WebCore/svg/SVGFontFaceElement.cpp