Skip to content
  • mitz@apple.com's avatar
    WebCore: · 5a140d99
    mitz@apple.com authored
            Reviewed by Alexey Proskuryakov.
    
            - fix a leak when using hex color values in CSS variables
    
            - fix CSSOM access to hex color values in variables declarations
    
            Test: fast/css/variables/color-hex-test.html
    
            Added a new unit/type, CSS_PARSER_HEXCOLOR, which serves as the unit for
            CSSParserValues coming from colors in hex notation. CSSParserValues can
            no longer have CSS_RGBCOLOR as their unit. CSS_PARSER_HEXCOLOR is also
            used as the type for CSSValues in CSS variables declarations where the
            parser value was a hex color. However the type of all other color
            CSSValues remains CSS_RGBCOLOR.
    
            * css/CSSGrammar.y: Changed to use the new CSS_PARSER_HEXCOLOR value
            for color values in hex notation.
            * css/CSSParser.cpp:
            (WebCore::CSSParser::parseColorFromValue): Updated for the new unit.
            * css/CSSParserValues.cpp:
            (WebCore::CSSParserValue::createCSSValue): Ditto.
            * css/CSSPrimitiveValue.cpp:
            (WebCore::CSSPrimitiveValue::cleanup): Fixed the leak by deref()ing the
            string containing the color.
            (WebCore::CSSPrimitiveValue::cssText): Added support for
            CSS_PARSER_HEXCOLOR for when serializing variable values.
            (WebCore::CSSPrimitiveValue::parserValue): Updated for the new unit.
            * css/CSSPrimitiveValue.h:
            (WebCore::CSSPrimitiveValue::): Added a new unti, CSS_PARSER_HEXCOLOR.
    
    LayoutTests:
    
            Reviewed by Alexey Proskuryakov.
    
            - updated test to cover serializing variable values which are colors in
              hex notation
    
            * fast/css/variables/color-hex-test.html:
    
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@35320 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    5a140d99