Changeset 150776 in webkit


Ignore:
Timestamp:
May 27, 2013 1:58:52 PM (11 years ago)
Author:
Claudio Saavedra
Message:

[CSS] -webkit-var prefix is case-sensitive
https://bugs.webkit.org/show_bug.cgi?id=116829

Reviewed by Darin Adler.

Source/WebCore:

Tests: Added case to fast/css/variables/case-sensitive.html

  • css/CSSParser.cpp:

(WebCore::isEqualToCSSCaseSensitiveIdentifier): Add variant to
IsEqualToCSSIdentifier that respects case-sensitivity.
(WebCore::CSSParser::realLex): Use the above method for CSS
variable declarations.

LayoutTests:

  • fast/css/variables/case-sensitive.html: Add a

check for case-sensitiveness of the prefix of
variable declarations.

  • fast/css/variables/case-sensitive-expected.html: Update.
Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r150755 r150776  
     12013-05-27  Claudio Saavedra  <csaavedra@igalia.com>
     2
     3        [CSS] -webkit-var prefix is case-sensitive
     4        https://bugs.webkit.org/show_bug.cgi?id=116829
     5
     6        Reviewed by Darin Adler.
     7
     8        * fast/css/variables/case-sensitive.html: Add a
     9        check for case-sensitiveness of the prefix of
     10        variable declarations.
     11        * fast/css/variables/case-sensitive-expected.html: Update.
     12
    1132013-05-27  Radu Stavila  <stavila@adobe.com>
    214
  • trunk/LayoutTests/fast/css/variables/case-sensitive-expected.html

    r150207 r150776  
    11<!DOCTYPE html>
    22<html>
    3 <div>This text should have a transparent background.</div>
     3<div>This text should have a transparent background and no left padding.</div>
    44</html>
  • trunk/LayoutTests/fast/css/variables/case-sensitive.html

    r150207 r150776  
    88  background-color: -webkit-var(NaMe);
    99  -webkit-var-nAmE: green;
     10  padding-left: -webkit-var(padding);
     11  -WEBKIT-VAR-padding: 200px;
    1012}
    1113</style>
    12 <div>This text should have a transparent background.</div>
     14<div>This text should have a transparent background and no left padding.</div>
    1315</html>
  • trunk/Source/WebCore/ChangeLog

    r150775 r150776  
     12013-05-27  Claudio Saavedra  <csaavedra@igalia.com>
     2
     3        [CSS] -webkit-var prefix is case-sensitive
     4        https://bugs.webkit.org/show_bug.cgi?id=116829
     5
     6        Reviewed by Darin Adler.
     7
     8        Tests: Added case to fast/css/variables/case-sensitive.html
     9
     10        * css/CSSParser.cpp:
     11        (WebCore::isEqualToCSSCaseSensitiveIdentifier): Add variant to
     12        IsEqualToCSSIdentifier that respects case-sensitivity.
     13        (WebCore::CSSParser::realLex): Use the above method for CSS
     14        variable declarations.
     15
    1162013-05-27  Zalan Bujtas  <zalan@apple.com>
    217
  • trunk/Source/WebCore/css/CSSParser.cpp

    r150734 r150776  
    98629862
    98639863template <typename CharacterType>
     9864static inline bool isEqualToCSSCaseSensitiveIdentifier(CharacterType* string, const char* constantString)
     9865{
     9866    do {
     9867        if (*string++ != *constantString++)
     9868            return false;
     9869    } while (*constantString);
     9870    return true;
     9871}
     9872
     9873template <typename CharacterType>
    98649874static CharacterType* checkAndSkipEscape(CharacterType* currentCharacter)
    98659875{
     
    1097710987
    1097810988#if ENABLE(CSS_VARIABLES)
    10979             if (cssVariablesEnabled() && isEqualToCSSIdentifier(tokenStart<SrcCharacterType>() + 1, "webkit-var") && tokenStart<SrcCharacterType>()[11] == '-' && isIdentifierStartAfterDash(tokenStart<SrcCharacterType>() + 12))
     10989            if (cssVariablesEnabled() && isEqualToCSSCaseSensitiveIdentifier(tokenStart<SrcCharacterType>() + 1, "webkit-var") && tokenStart<SrcCharacterType>()[11] == '-' && isIdentifierStartAfterDash(tokenStart<SrcCharacterType>() + 12))
    1098010990                m_token = VAR_DEFINITION;
    1098110991            else
Note: See TracChangeset for help on using the changeset viewer.