Changeset 116263 in webkit


Ignore:
Timestamp:
May 6, 2012 8:13:12 PM (12 years ago)
Author:
bashi@chromium.org
Message:

Disallow unquoted -webkit-font-feature-settings tags
https://bugs.webkit.org/show_bug.cgi?id=85362

Reviewed by Kent Tamura.

Source/WebCore:

Disallow unquoted tags to follow the current draft.
http://dev.w3.org/csswg/css3-fonts/#font-feature-settings-prop

No new tests. css3/font-feature-settings-parsing.html was updated.

  • css/CSSParser.cpp:

(WebCore::CSSParser::parseFontFeatureTag): Accepts only 4-characters string.

LayoutTests:

  • css3/font-feature-settings-parsing-expected.txt: Updated to follow the current draft specification.
  • css3/font-feature-settings-parsing.html: Ditto.
Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r116261 r116263  
     12012-05-06  Kenichi Ishibashi  <bashi@chromium.org>
     2
     3        Disallow unquoted -webkit-font-feature-settings tags
     4        https://bugs.webkit.org/show_bug.cgi?id=85362
     5
     6        Reviewed by Kent Tamura.
     7
     8        * css3/font-feature-settings-parsing-expected.txt: Updated to follow the current draft specification.
     9        * css3/font-feature-settings-parsing.html: Ditto.
     10
    1112012-05-06  Raphael Kubo da Costa  <rakuco@webkit.org>
    212
  • trunk/LayoutTests/css3/font-feature-settings-parsing-expected.txt

    r92457 r116263  
    1313PASS parseResultOf("valid_valuelist") is "'tnum' 1, 'hist' 1"
    1414PASS parseResultOf("valid_singlequote") is "'PKRN' 1"
    15 PASS parseResultOf("valid_ident") is "'dlig' 1"
    1615PASS parseResultOf("valid_unusual_tag") is "'!@#$' 1"
    1716PASS parseResultOf("valid_tag_space") is "'a bc' 1"
    18 PASS parseResultOf("valid_cases") is "'dlig' 1, 'DLIG' 1, 'DLig' 1"
    19 PASS parseResultOf("valid_composite") is "'dlig' 1, 'smcp' 1, 'liga' 0"
     17PASS parseResultOf("valid_composite") is "'dlig' 1, 'smcp' 1, 'lig ' 0"
    2018- Tests invalid inputs.  Results should be "normal".
     19PASS parseResultOf("invalid_ident") is "normal"
     20PASS parseResultOf("invalid_cases") is "normal"
    2121PASS parseResultOf("invalid_1") is "normal"
    2222PASS parseResultOf("invalid_off") is "normal"
  • trunk/LayoutTests/css3/font-feature-settings-parsing.html

    r100369 r116263  
    3434}
    3535
    36 #valid_ident {
    37     -webkit-font-feature-settings: dlig;
    38 }
    39 
    4036#valid_unusual_tag {
    4137    -webkit-font-feature-settings: "!@#$";
    4238}
    4339
    44 #valid_cases {
    45     -webkit-font-feature-settings: dlig, DLIG, DLig;
    46 }
    47 
    4840#valid_tag_space {
    4941    -webkit-font-feature-settings: "a bc";
     
    5143
    5244#valid_composite {
    53     -webkit-font-feature-settings: "dlig" 1, 'smcp' on, liga off;
     45    -webkit-font-feature-settings: "dlig" 1, 'smcp' on, 'lig ' off;
     46}
     47
     48#invalid_ident {
     49    -webkit-font-feature-settings: dlig;
     50}
     51
     52#invalid_cases {
     53    -webkit-font-feature-settings: dlig, DLIG, DLig;
    5454}
    5555
     
    138138<div id="valid_valuelist"></div>
    139139<div id="valid_singlequote"></div>
    140 <div id="valid_ident"></div>
    141140<div id="valid_unusual_tag"></div>
    142141<div id="valid_tag_space"></div>
    143 <div id="valid_cases"></div>
    144142<div id="valid_composite"></div>
    145143
     144<div id="invalid_ident"></div>
     145<div id="invalid_cases"></div>
    146146<div id="invalid_1"></div>
    147147<div id="invalid_off"></div>
     
    160160<div id="invalid_0"></div>
    161161
    162 <div id="outer" style="-webkit-font-feature-settings: dlig;">
     162<div id="outer" style="-webkit-font-feature-settings: 'dlig';">
    163163  <div id="inner"></div>
    164164</div>
     
    183183shouldBeEqualToString('parseResultOf("valid_valuelist")', "'tnum' 1, 'hist' 1");
    184184shouldBeEqualToString('parseResultOf("valid_singlequote")', "'PKRN' 1");
    185 shouldBeEqualToString('parseResultOf("valid_ident")', "'dlig' 1");
    186185shouldBeEqualToString('parseResultOf("valid_unusual_tag")', "'!@#$' 1");
    187186shouldBeEqualToString('parseResultOf("valid_tag_space")', "'a bc' 1");
    188 shouldBeEqualToString('parseResultOf("valid_cases")', "'dlig' 1, 'DLIG' 1, 'DLig' 1");
    189 shouldBeEqualToString('parseResultOf("valid_composite")', "'dlig' 1, 'smcp' 1, 'liga' 0");
     187shouldBeEqualToString('parseResultOf("valid_composite")', "'dlig' 1, 'smcp' 1, 'lig ' 0");
    190188
    191189debug('- Tests invalid inputs.  Results should be "normal".');
     190shouldBe('parseResultOf("invalid_ident")', '"normal"');
     191shouldBe('parseResultOf("invalid_cases")', '"normal"');
    192192shouldBe('parseResultOf("invalid_1")', '"normal"');
    193193shouldBe('parseResultOf("invalid_off")', '"normal"');
  • trunk/Source/WebCore/ChangeLog

    r116262 r116263  
     12012-05-06  Kenichi Ishibashi  <bashi@chromium.org>
     2
     3        Disallow unquoted -webkit-font-feature-settings tags
     4        https://bugs.webkit.org/show_bug.cgi?id=85362
     5
     6        Reviewed by Kent Tamura.
     7
     8        Disallow unquoted tags to follow the current draft.
     9        http://dev.w3.org/csswg/css3-fonts/#font-feature-settings-prop
     10
     11        No new tests. css3/font-feature-settings-parsing.html was updated.
     12
     13        * css/CSSParser.cpp:
     14        (WebCore::CSSParser::parseFontFeatureTag): Accepts only 4-characters string.
     15
    1162012-05-06  Raphael Kubo da Costa  <rakuco@webkit.org>
    217
  • trunk/Source/WebCore/css/CSSParser.cpp

    r115972 r116263  
    75207520    CSSParserValue* value = m_valueList->current();
    75217521    // Feature tag name comes first
    7522     if (value->unit != CSSPrimitiveValue::CSS_STRING && value->unit != CSSPrimitiveValue::CSS_IDENT)
     7522    if (value->unit != CSSPrimitiveValue::CSS_STRING)
    75237523        return false;
    75247524    if (value->string.length != tagNameLength)
Note: See TracChangeset for help on using the changeset viewer.