Skip to content
  • macpherson@chromium.org's avatar
    Make CSS variable names case-insensitive. · 4a8b3d82
    macpherson@chromium.org authored
    https://bugs.webkit.org/show_bug.cgi?id=98712
    
    Reviewed by Tony Chang.
    
    Source/WebCore:
    
    This patch modifies the parser to normalize all variable names to lower case,
    making variable definitions consistent with other property names, which are also case insensitive.
    Spec: http://dev.w3.org/csswg/css-variables/#defining-variables
    
    Test: fast/css/variables/case-insensitive.html
    
    * css/CSSParser.cpp:
    (WebCore::CSSParser::createPrimitiveNumericValue):
    (WebCore):
    (WebCore::CSSParser::createPrimitiveVariableNameValue):
    (WebCore::CSSParser::parseValidPrimitive):
    (WebCore::CSSParser::parseValue):
    (WebCore::CSSParser::storeVariableDeclaration):
    (WebCore::CSSParserString::lowerSubstring):
    Added function to compute a lower case substring as an AtomicString from a CSSParserString.
    * css/CSSParser.h:
    (CSSParser):
    * css/CSSParserValues.h:
    (CSSParserString):
    (WebCore::CSSParserString::lowerSubstring):
    
    LayoutTests:
    
    Add test that variable names are match correctly when different case is used.
    
    * fast/css/variables/case-insensitive-expected.html: Added.
    * fast/css/variables/case-insensitive.html: Added.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@131313 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    4a8b3d82