WebCore:
authordarin@apple.com <darin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 19 Feb 2008 02:21:07 +0000 (02:21 +0000)
committerdarin@apple.com <darin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 19 Feb 2008 02:21:07 +0000 (02:21 +0000)
commitc1b393de903145a18b466b8e1f2d1e8d7bf849bf
tree91a3296852d8025f371c9484856278ce407eaee1
parent65c6635d8f698b7827d909ad9ff006e1376c305d
WebCore:

        Reviewed by Sam.

        - reduce use of DeprecatedString and memory allocations in processing of CSS
        - remove unnecessary double -> float -> double trip in the CSS parser
        - cleaned up names and structure in CSS grammar

        * css/CSSGrammar.y: Remove getPropertyID and getValueID. Both are now in CSSParser.cpp
        instead, and they now work on ParseString and String objects and don't require the caller
        to put the string into a char*. Gave members of the %union more sensible names, removed
        duplicates, and sorted into a logical order. Put the %expect back in, rather than leaving
        it commented out.
        * css/CSSParser.cpp:
        (WebCore::equalIgnoringCase): Added.
        (WebCore::hasPrefix): Added.
        (WebCore::CSSParser::parseTransitionProperty): Changed to call the new cssPropertyID,
        which obviates the need to call lower() and utf8() or to allocate memory at all. Also
        used equalIgnoringCase rather than putting the value into a String just to compare it.
        (WebCore::CSSParser::lex): Replaced convertASCIIToFloat with charactersToDouble. This change
        along with the CSSGrammar.y change, removes the double -> float -> double round trip, and
        affects the result of one layout test.
        (WebCore::cssPropertyID): Added. Gets the property ID from the gperf hash table, but
        without allocating any memory.
        (WebCore::cssValueKeywordID): Ditto.
        * css/CSSParser.h: Removed declaration for deprecatedString function (now used only in
        CSSParser.cpp; soon to be deleted). Added cssPropertyID and cssValueKeywordID functions.

        * css/CSSStyleDeclaration.cpp:
        (WebCore::CSSStyleDeclaration::getPropertyCSSValue): Call cssPropertyID instead of propertyID.
        (WebCore::CSSStyleDeclaration::getPropertyValue): Ditto.
        (WebCore::CSSStyleDeclaration::getPropertyPriority): Ditto.
        (WebCore::CSSStyleDeclaration::getPropertyShorthand): Ditto.
        (WebCore::CSSStyleDeclaration::isPropertyImplicit): Ditto.
        (WebCore::CSSStyleDeclaration::setProperty): Ditto.
        (WebCore::CSSStyleDeclaration::removeProperty): Ditto.
        (WebCore::CSSStyleDeclaration::isPropertyName): Ditto.
        * css/CSSStyleDeclaration.h: Removed unnecessary includes, unnecessary Noncopyable boilerplate,
        and the getPropertyID function declaration along with its associated apology comment.

        * css/makevalues.pl: Generate constants instead of macros for CSS value numbers (but not an
        enumeration, like properties, since you rarely have any reason to handle all values, but
        often have a reason to handle all properties). Renamed the constant for the number of CSS
        value keywords from CSS_VAL_TOTAL to numCSSValueKeywords, and added maxCSSValueKeywordLength.

        * platform/text/String.cpp:
        (WebCore::charactersToDouble): Made this function more efficient by using a stack buffer
        rather than a CString.

LayoutTests:

        Reviewed by Sam.

        - generate new results for the one test that was altered by the
          double -> float -> double trip taken by numeric values in the
          CSS parser

        This test appears under three different names in three different
        parts of our test suite.

        * platform/mac/css1/box_properties/acid_test-expected.checksum: Updated.
        * platform/mac/css1/box_properties/acid_test-expected.png: Ditto.
        * platform/mac/css1/box_properties/acid_test-expected.txt: Ditto.
        * platform/mac/css2.1/t09-c5526c-display-00-e-expected.checksum: Ditto.
        * platform/mac/css2.1/t09-c5526c-display-00-e-expected.png: Ditto.
        * platform/mac/css2.1/t09-c5526c-display-00-e-expected.txt: Ditto.
        * platform/mac/fast/block/basic/011-expected.checksum: Ditto.
        * platform/mac/fast/block/basic/011-expected.png: Ditto.
        * platform/mac/fast/block/basic/011-expected.txt: Ditto.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@30393 268f45cc-cd09-0410-ab3c-d52691b4dbfc
20 files changed:
LayoutTests/ChangeLog
LayoutTests/platform/mac/css1/box_properties/acid_test-expected.checksum
LayoutTests/platform/mac/css1/box_properties/acid_test-expected.png
LayoutTests/platform/mac/css1/box_properties/acid_test-expected.txt
LayoutTests/platform/mac/css2.1/t09-c5526c-display-00-e-expected.checksum
LayoutTests/platform/mac/css2.1/t09-c5526c-display-00-e-expected.png
LayoutTests/platform/mac/css2.1/t09-c5526c-display-00-e-expected.txt
LayoutTests/platform/mac/fast/block/basic/011-expected.checksum
LayoutTests/platform/mac/fast/block/basic/011-expected.png
LayoutTests/platform/mac/fast/block/basic/011-expected.txt
WebCore/ChangeLog
WebCore/css/CSSGrammar.y
WebCore/css/CSSParser.cpp
WebCore/css/CSSParser.h
WebCore/css/CSSStyleDeclaration.cpp
WebCore/css/CSSStyleDeclaration.h
WebCore/css/makevalues.pl
WebCore/platform/text/String.cpp
WebCore/svg/SVGFontFaceElement.cpp
WebCore/svg/SVGStyledElement.cpp