Changeset 214419 in webkit


Ignore:
Timestamp:
Mar 27, 2017 10:50:33 AM (7 years ago)
Author:
mmaxfield@apple.com
Message:

font variation properties don't need to accept numbers
https://bugs.webkit.org/show_bug.cgi?id=169357

Reviewed by Antti Koivisto.

Source/WebCore:

The CSS Fonts level 4 spec stabilized the grammar accepted by font-weight,
font-style, and font-stretch. The changes are that font-style and
font-stretch no longer accept raw numbers, and the @font-face descriptor
ranges are now separated by spaces instead of slashes.

Tests: fast/text/font-selection-font-face-parse.html

fast/text/font-selection-font-loading-api-parse.html
fast/text/font-stretch-parse.html
fast/text/font-style-parse.html
fast/text/variations/font-selection-properties.html

  • css/CSSComputedStyleDeclaration.cpp:

(WebCore::ComputedStyleExtractor::fontWeightFromStyleValue):
(WebCore::fontWeightFromStyle):
(WebCore::ComputedStyleExtractor::fontStretchFromStyleValue):
(WebCore::fontStretchFromStyle):
(WebCore::ComputedStyleExtractor::fontStyleFromStyleValue):
(WebCore::fontStyleFromStyle):

  • css/CSSComputedStyleDeclaration.h:
  • css/FontFace.cpp:

(WebCore::FontFace::style):
(WebCore::FontFace::weight):
(WebCore::FontFace::stretch):
(WebCore::rangeIsSingleValue): Deleted.

  • css/StyleBuilderConverter.h:

(WebCore::StyleBuilderConverter::convertFontStretchFromValue):

  • css/parser/CSSPropertyParser.cpp:

(WebCore::consumeFontWeightRange):
(WebCore::consumeFontStretch):
(WebCore::consumeFontStretchRange):
(WebCore::consumeFontStyle):
(WebCore::consumeFontStyleRange):

LayoutTests:

  • fast/text/font-selection-font-face-parse-expected.txt:
  • fast/text/font-selection-font-face-parse.html:
  • fast/text/font-selection-font-loading-api-parse-expected.txt:
  • fast/text/font-selection-font-loading-api-parse.html:
  • fast/text/font-stretch-parse-expected.txt:
  • fast/text/font-stretch-parse.html:
  • fast/text/font-style-parse-expected.txt:
  • fast/text/font-style-parse.html:
  • fast/text/variations/font-selection-properties.html:
  • platform/mac-elcapitan/fast/text/font-selection-font-face-parse-expected.txt:
Location:
trunk
Files:
17 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r214415 r214419  
     12017-03-27  Myles C. Maxfield  <mmaxfield@apple.com>
     2
     3        font variation properties don't need to accept numbers
     4        https://bugs.webkit.org/show_bug.cgi?id=169357
     5
     6        Reviewed by Antti Koivisto.
     7
     8        * fast/text/font-selection-font-face-parse-expected.txt:
     9        * fast/text/font-selection-font-face-parse.html:
     10        * fast/text/font-selection-font-loading-api-parse-expected.txt:
     11        * fast/text/font-selection-font-loading-api-parse.html:
     12        * fast/text/font-stretch-parse-expected.txt:
     13        * fast/text/font-stretch-parse.html:
     14        * fast/text/font-style-parse-expected.txt:
     15        * fast/text/font-style-parse.html:
     16        * fast/text/variations/font-selection-properties.html:
     17        * platform/mac-elcapitan/fast/text/font-selection-font-face-parse-expected.txt:
     18
    1192017-03-27  Myles C. Maxfield  <mmaxfield@apple.com>
    220
  • trunk/LayoutTests/fast/text/font-selection-font-face-parse-expected.txt

    r214359 r214419  
    1717PASS weightTestSheet.cssRules[16].style.fontWeight is "300"
    1818PASS weightTestSheet.cssRules[17].style.fontWeight is "200"
    19 PASS weightTestSheet.cssRules[18].style.fontWeight is "100 / 200"
    20 PASS weightTestSheet.cssRules[19].style.fontWeight is "100 / 200"
     19PASS weightTestSheet.cssRules[18].style.fontWeight is "100 200"
     20PASS weightTestSheet.cssRules[19].style.fontWeight is "100 200"
    2121PASS weightTestSheet.cssRules[20].style.fontWeight is ""
    2222PASS weightTestSheet.cssRules[21].style.fontWeight is ""
     
    2525PASS weightTestSheet.cssRules[24].style.fontWeight is ""
    2626PASS weightTestSheet.cssRules[25].style.fontWeight is ""
    27 PASS weightTestSheet.cssRules[26].style.fontWeight is "1 / 2"
    28 PASS weightTestSheet.cssRules[27].style.fontWeight is "-2 / -1"
     27PASS weightTestSheet.cssRules[26].style.fontWeight is "1 2"
     28PASS weightTestSheet.cssRules[27].style.fontWeight is "-2 -1"
    2929PASS weightTestSheet.cssRules[28].style.fontWeight is ""
    30 PASS weightTestSheet.cssRules[29].style.fontWeight is "7 / 8"
    31 PASS weightTestSheet.cssRules[30].style.fontWeight is "2 / 7"
     30PASS weightTestSheet.cssRules[29].style.fontWeight is "7 8"
     31PASS weightTestSheet.cssRules[30].style.fontWeight is "2 7"
    3232PASS stretchTestSheet.cssRules[0].style.fontStretch is "1%"
    33 PASS stretchTestSheet.cssRules[1].style.fontStretch is "2"
     33PASS stretchTestSheet.cssRules[1].style.fontStretch is ""
    3434PASS stretchTestSheet.cssRules[2].style.fontStretch is "ultra-condensed"
    3535PASS stretchTestSheet.cssRules[3].style.fontStretch is "extra-condensed"
     
    4343PASS stretchTestSheet.cssRules[11].style.fontStretch is ""
    4444PASS stretchTestSheet.cssRules[12].style.fontStretch is ""
    45 PASS stretchTestSheet.cssRules[13].style.fontStretch is "7"
    46 PASS stretchTestSheet.cssRules[14].style.fontStretch is "100 / 200"
    47 PASS stretchTestSheet.cssRules[15].style.fontStretch is "100 / 200"
     45PASS stretchTestSheet.cssRules[13].style.fontStretch is ""
     46PASS stretchTestSheet.cssRules[14].style.fontStretch is ""
     47PASS stretchTestSheet.cssRules[15].style.fontStretch is ""
    4848PASS stretchTestSheet.cssRules[16].style.fontStretch is ""
    4949PASS stretchTestSheet.cssRules[17].style.fontStretch is ""
     
    5252PASS stretchTestSheet.cssRules[20].style.fontStretch is ""
    5353PASS stretchTestSheet.cssRules[21].style.fontStretch is ""
    54 PASS stretchTestSheet.cssRules[22].style.fontStretch is "1 / 2"
    55 PASS stretchTestSheet.cssRules[23].style.fontStretch is "-2 / -1"
     54PASS stretchTestSheet.cssRules[22].style.fontStretch is ""
     55PASS stretchTestSheet.cssRules[23].style.fontStretch is ""
    5656PASS stretchTestSheet.cssRules[24].style.fontStretch is ""
    57 PASS stretchTestSheet.cssRules[25].style.fontStretch is "100% / 200%"
    58 PASS stretchTestSheet.cssRules[26].style.fontStretch is "100% / 200%"
     57PASS stretchTestSheet.cssRules[25].style.fontStretch is "100% 200%"
     58PASS stretchTestSheet.cssRules[26].style.fontStretch is "100% 200%"
    5959PASS stretchTestSheet.cssRules[27].style.fontStretch is ""
    6060PASS stretchTestSheet.cssRules[28].style.fontStretch is ""
     
    6363PASS stretchTestSheet.cssRules[31].style.fontStretch is ""
    6464PASS stretchTestSheet.cssRules[32].style.fontStretch is ""
    65 PASS stretchTestSheet.cssRules[33].style.fontStretch is "1% / 2%"
    66 PASS stretchTestSheet.cssRules[34].style.fontStretch is "-2% / -1%"
     65PASS stretchTestSheet.cssRules[33].style.fontStretch is "1% 2%"
     66PASS stretchTestSheet.cssRules[34].style.fontStretch is "-2% -1%"
    6767PASS stretchTestSheet.cssRules[35].style.fontStretch is ""
    6868PASS stretchTestSheet.cssRules[36].style.fontStretch is ""
    6969PASS stretchTestSheet.cssRules[37].style.fontStretch is ""
    70 PASS stretchTestSheet.cssRules[38].style.fontStretch is "7 / 8"
    71 PASS stretchTestSheet.cssRules[39].style.fontStretch is "2 / 7"
     70PASS stretchTestSheet.cssRules[38].style.fontStretch is ""
     71PASS stretchTestSheet.cssRules[39].style.fontStretch is ""
     72PASS stretchTestSheet.cssRules[40].style.fontStretch is "calc(7%) 8%"
     73PASS stretchTestSheet.cssRules[41].style.fontStretch is "2% calc(7%)"
    7274PASS styleTestSheet.cssRules[0].style.fontStyle is "oblique 1deg"
    7375PASS styleTestSheet.cssRules[1].style.fontStyle is "oblique 200grad"
    7476PASS styleTestSheet.cssRules[2].style.fontStyle is "oblique 6.28318rad"
    7577PASS styleTestSheet.cssRules[3].style.fontStyle is "oblique 4turn"
    76 PASS styleTestSheet.cssRules[4].style.fontStyle is "oblique 5"
    77 PASS styleTestSheet.cssRules[5].style.fontStyle is "oblique 20"
     78PASS styleTestSheet.cssRules[4].style.fontStyle is ""
     79PASS styleTestSheet.cssRules[5].style.fontStyle is ""
    7880PASS styleTestSheet.cssRules[6].style.fontStyle is "italic"
    7981PASS styleTestSheet.cssRules[7].style.fontStyle is "oblique"
     
    8183PASS styleTestSheet.cssRules[9].style.fontStyle is ""
    8284PASS styleTestSheet.cssRules[10].style.fontStyle is ""
    83 PASS styleTestSheet.cssRules[11].style.fontStyle is "oblique 7"
     85PASS styleTestSheet.cssRules[11].style.fontStyle is ""
    8486PASS styleTestSheet.cssRules[12].style.fontStyle is "oblique calc(1441deg)"
    85 PASS styleTestSheet.cssRules[13].style.fontStyle is "oblique 100deg 200deg"
    86 PASS styleTestSheet.cssRules[14].style.fontStyle is "oblique 100deg 200deg"
     87PASS styleTestSheet.cssRules[13].style.fontStyle is ""
     88PASS styleTestSheet.cssRules[14].style.fontStyle is ""
    8789PASS styleTestSheet.cssRules[15].style.fontStyle is ""
    8890PASS styleTestSheet.cssRules[16].style.fontStyle is ""
     
    9193PASS styleTestSheet.cssRules[19].style.fontStyle is ""
    9294PASS styleTestSheet.cssRules[20].style.fontStyle is ""
    93 PASS styleTestSheet.cssRules[21].style.fontStyle is "oblique 1deg 2deg"
    94 PASS styleTestSheet.cssRules[22].style.fontStyle is "oblique -2deg -1deg"
     95PASS styleTestSheet.cssRules[21].style.fontStyle is ""
     96PASS styleTestSheet.cssRules[22].style.fontStyle is ""
    9597PASS styleTestSheet.cssRules[23].style.fontStyle is ""
    9698PASS styleTestSheet.cssRules[24].style.fontStyle is "oblique 100deg 200deg"
     
    108110PASS styleTestSheet.cssRules[36].style.fontStyle is ""
    109111PASS styleTestSheet.cssRules[37].style.fontStyle is "oblique 2deg 1turn"
    110 PASS styleTestSheet.cssRules[38].style.fontStyle is "oblique 7deg 8deg"
    111 PASS styleTestSheet.cssRules[39].style.fontStyle is "oblique 2deg 7deg"
     112PASS styleTestSheet.cssRules[38].style.fontStyle is ""
     113PASS styleTestSheet.cssRules[39].style.fontStyle is ""
     114PASS styleTestSheet.cssRules[40].style.fontStyle is "oblique calc(7deg) 8deg"
     115PASS styleTestSheet.cssRules[41].style.fontStyle is "oblique 2deg calc(7deg)"
    112116PASS successfullyParsed is true
    113117
  • trunk/LayoutTests/fast/text/font-selection-font-face-parse.html

    r214359 r214419  
    5858}
    5959@font-face {
    60     font-weight: 100/200;
    61 }
    62 @font-face {
    63     font-weight: 100 / 200;
    64 }
    65 @font-face {
    66     font-weight: a 100 / 200;
    67 }
    68 @font-face {
    69     font-weight: 100 / 200 a;
    70 }
    71 @font-face {
    72     font-weight: 100 a / 200;
    73 }
    74 @font-face {
    75     font-weight: 100 a/ 200;
    76 }
    77 @font-face {
    78     font-weight: 100 /a 200;
    79 }
    80 @font-face {
    81     font-weight: 100 / a200;
    82 }
    83 @font-face {
    84     font-weight: 1 / 2;
    85 }
    86 @font-face {
    87     font-weight: -2 / -1;
    88 }
    89 @font-face {
    90     font-weight: 2 / 1;
    91 }
    92 @font-face {
    93     font-weight: calc(3 + 4) / 8;
    94 }
    95 @font-face {
    96     font-weight: 2 / calc(3 + 4);
     60    font-weight: 100 200;
     61}
     62@font-face {
     63    font-weight: 100 200;
     64}
     65@font-face {
     66    font-weight: a 100 200;
     67}
     68@font-face {
     69    font-weight: 100 200 a;
     70}
     71@font-face {
     72    font-weight: 100 a 200;
     73}
     74@font-face {
     75    font-weight: 100a 200;
     76}
     77@font-face {
     78    font-weight: 100 a200;
     79}
     80@font-face {
     81    font-weight: 100 a200;
     82}
     83@font-face {
     84    font-weight: 1 2;
     85}
     86@font-face {
     87    font-weight: -2 -1;
     88}
     89@font-face {
     90    font-weight: 2 1;
     91}
     92@font-face {
     93    font-weight: calc(3 + 4) 8;
     94}
     95@font-face {
     96    font-weight: 2 calc(3 + 4);
    9797}
    9898</style>
     
    142142}
    143143@font-face {
    144     font-stretch: 100/200;
    145 }
    146 @font-face {
    147     font-stretch: 100 / 200;
    148 }
    149 @font-face {
    150     font-stretch: a 100 / 200;
    151 }
    152 @font-face {
    153     font-stretch: 100 / 200 a;
    154 }
    155 @font-face {
    156     font-stretch: 100 a / 200;
    157 }
    158 @font-face {
    159     font-stretch: 100 a/ 200;
    160 }
    161 @font-face {
    162     font-stretch: 100 /a 200;
    163 }
    164 @font-face {
    165     font-stretch: 100 / a200;
    166 }
    167 @font-face {
    168     font-stretch: 1 / 2;
    169 }
    170 @font-face {
    171     font-stretch: -2 / -1;
    172 }
    173 @font-face {
    174     font-stretch: 2 / 1;
    175 }
    176 @font-face {
    177     font-stretch: 100%/200%;
    178 }
    179 @font-face {
    180     font-stretch: 100% / 200%;
    181 }
    182 @font-face {
    183     font-stretch: a 100% / 200%;
    184 }
    185 @font-face {
    186     font-stretch: 100% / 200% a;
    187 }
    188 @font-face {
    189     font-stretch: 100% a / 200%;
    190 }
    191 @font-face {
    192     font-stretch: 100% a/ 200%;
    193 }
    194 @font-face {
    195     font-stretch: 100% /a 200%;
    196 }
    197 @font-face {
    198     font-stretch: 100% / a200%;
    199 }
    200 @font-face {
    201     font-stretch: 1% / 2%;
    202 }
    203 @font-face {
    204     font-stretch: -2% / -1%;
    205 }
    206 @font-face {
    207     font-stretch: 2% / 1%;
    208 }
    209 @font-face {
    210     font-stretch: 1 / 2%;
    211 }
    212 @font-face {
    213     font-stretch: 1% / 2;
    214 }
    215 @font-face {
    216     font-stretch: calc(3 + 4) / 8;
    217 }
    218 @font-face {
    219     font-stretch: 2 / calc(3 + 4);
     144    font-stretch: 100 200;
     145}
     146@font-face {
     147    font-stretch: 100  200;
     148}
     149@font-face {
     150    font-stretch: a 100 200;
     151}
     152@font-face {
     153    font-stretch: 100 200 a;
     154}
     155@font-face {
     156    font-stretch: 100 a 200;
     157}
     158@font-face {
     159    font-stretch: 100a 200;
     160}
     161@font-face {
     162    font-stretch: 100 a200;
     163}
     164@font-face {
     165    font-stretch: 100 a200;
     166}
     167@font-face {
     168    font-stretch: 1 2;
     169}
     170@font-face {
     171    font-stretch: -2 -1;
     172}
     173@font-face {
     174    font-stretch: 2 1;
     175}
     176@font-face {
     177    font-stretch: 100% 200%;
     178}
     179@font-face {
     180    font-stretch: 100%   200%;
     181}
     182@font-face {
     183    font-stretch: a 100% 200%;
     184}
     185@font-face {
     186    font-stretch: 100% 200% a;
     187}
     188@font-face {
     189    font-stretch: 100% a 200%;
     190}
     191@font-face {
     192    font-stretch: 100%a 200%;
     193}
     194@font-face {
     195    font-stretch: 100% a200%;
     196}
     197@font-face {
     198    font-stretch: 100% a200%;
     199}
     200@font-face {
     201    font-stretch: 1% 2%;
     202}
     203@font-face {
     204    font-stretch: -2% -1%;
     205}
     206@font-face {
     207    font-stretch: 2% 1%;
     208}
     209@font-face {
     210    font-stretch: 1 2%;
     211}
     212@font-face {
     213    font-stretch: 1% 2;
     214}
     215@font-face {
     216    font-stretch: calc(3 + 4) 8;
     217}
     218@font-face {
     219    font-stretch: 2 calc(3 + 4);
     220}
     221@font-face {
     222    font-stretch: calc(3% + 4%) 8%;
     223}
     224@font-face {
     225    font-stretch: 2% calc(3% + 4%);
    220226}
    221227</style>
     
    341347@font-face {
    342348    font-style: oblique 2 calc(3 + 4);
     349}
     350@font-face {
     351    font-style: oblique calc(3deg + 4deg) 8deg;
     352}
     353@font-face {
     354    font-style: oblique 2deg calc(3deg + 4deg);
    343355}
    344356</style>
     
    365377shouldBeEqualToString("weightTestSheet.cssRules[16].style.fontWeight", "300");
    366378shouldBeEqualToString("weightTestSheet.cssRules[17].style.fontWeight", "200");
    367 shouldBeEqualToString("weightTestSheet.cssRules[18].style.fontWeight", "100 / 200");
    368 shouldBeEqualToString("weightTestSheet.cssRules[19].style.fontWeight", "100 / 200");
     379shouldBeEqualToString("weightTestSheet.cssRules[18].style.fontWeight", "100 200");
     380shouldBeEqualToString("weightTestSheet.cssRules[19].style.fontWeight", "100 200");
    369381shouldBeEqualToString("weightTestSheet.cssRules[20].style.fontWeight", "");
    370382shouldBeEqualToString("weightTestSheet.cssRules[21].style.fontWeight", "");
     
    373385shouldBeEqualToString("weightTestSheet.cssRules[24].style.fontWeight", "");
    374386shouldBeEqualToString("weightTestSheet.cssRules[25].style.fontWeight", "");
    375 shouldBeEqualToString("weightTestSheet.cssRules[26].style.fontWeight", "1 / 2");
    376 shouldBeEqualToString("weightTestSheet.cssRules[27].style.fontWeight", "-2 / -1");
     387shouldBeEqualToString("weightTestSheet.cssRules[26].style.fontWeight", "1 2");
     388shouldBeEqualToString("weightTestSheet.cssRules[27].style.fontWeight", "-2 -1");
    377389shouldBeEqualToString("weightTestSheet.cssRules[28].style.fontWeight", "");
    378 shouldBeEqualToString("weightTestSheet.cssRules[29].style.fontWeight", "7 / 8");
    379 shouldBeEqualToString("weightTestSheet.cssRules[30].style.fontWeight", "2 / 7");
     390shouldBeEqualToString("weightTestSheet.cssRules[29].style.fontWeight", "7 8");
     391shouldBeEqualToString("weightTestSheet.cssRules[30].style.fontWeight", "2 7");
    380392
    381393var stretchTestSheet = document.getElementById("stretchTest").sheet;
    382394shouldBeEqualToString("stretchTestSheet.cssRules[0].style.fontStretch", "1%");
    383 shouldBeEqualToString("stretchTestSheet.cssRules[1].style.fontStretch", "2");
     395shouldBeEqualToString("stretchTestSheet.cssRules[1].style.fontStretch", "");
    384396shouldBeEqualToString("stretchTestSheet.cssRules[2].style.fontStretch", "ultra-condensed");
    385397shouldBeEqualToString("stretchTestSheet.cssRules[3].style.fontStretch", "extra-condensed");
     
    393405shouldBeEqualToString("stretchTestSheet.cssRules[11].style.fontStretch", "");
    394406shouldBeEqualToString("stretchTestSheet.cssRules[12].style.fontStretch", "");
    395 shouldBeEqualToString("stretchTestSheet.cssRules[13].style.fontStretch", "7");
    396 shouldBeEqualToString("stretchTestSheet.cssRules[14].style.fontStretch", "100 / 200");
    397 shouldBeEqualToString("stretchTestSheet.cssRules[15].style.fontStretch", "100 / 200");
     407shouldBeEqualToString("stretchTestSheet.cssRules[13].style.fontStretch", "");
     408shouldBeEqualToString("stretchTestSheet.cssRules[14].style.fontStretch", "");
     409shouldBeEqualToString("stretchTestSheet.cssRules[15].style.fontStretch", "");
    398410shouldBeEqualToString("stretchTestSheet.cssRules[16].style.fontStretch", "");
    399411shouldBeEqualToString("stretchTestSheet.cssRules[17].style.fontStretch", "");
     
    402414shouldBeEqualToString("stretchTestSheet.cssRules[20].style.fontStretch", "");
    403415shouldBeEqualToString("stretchTestSheet.cssRules[21].style.fontStretch", "");
    404 shouldBeEqualToString("stretchTestSheet.cssRules[22].style.fontStretch", "1 / 2");
    405 shouldBeEqualToString("stretchTestSheet.cssRules[23].style.fontStretch", "-2 / -1");
     416shouldBeEqualToString("stretchTestSheet.cssRules[22].style.fontStretch", "");
     417shouldBeEqualToString("stretchTestSheet.cssRules[23].style.fontStretch", "");
    406418shouldBeEqualToString("stretchTestSheet.cssRules[24].style.fontStretch", "");
    407 shouldBeEqualToString("stretchTestSheet.cssRules[25].style.fontStretch", "100% / 200%");
    408 shouldBeEqualToString("stretchTestSheet.cssRules[26].style.fontStretch", "100% / 200%");
     419shouldBeEqualToString("stretchTestSheet.cssRules[25].style.fontStretch", "100% 200%");
     420shouldBeEqualToString("stretchTestSheet.cssRules[26].style.fontStretch", "100% 200%");
    409421shouldBeEqualToString("stretchTestSheet.cssRules[27].style.fontStretch", "");
    410422shouldBeEqualToString("stretchTestSheet.cssRules[28].style.fontStretch", "");
     
    413425shouldBeEqualToString("stretchTestSheet.cssRules[31].style.fontStretch", "");
    414426shouldBeEqualToString("stretchTestSheet.cssRules[32].style.fontStretch", "");
    415 shouldBeEqualToString("stretchTestSheet.cssRules[33].style.fontStretch", "1% / 2%");
    416 shouldBeEqualToString("stretchTestSheet.cssRules[34].style.fontStretch", "-2% / -1%");
     427shouldBeEqualToString("stretchTestSheet.cssRules[33].style.fontStretch", "1% 2%");
     428shouldBeEqualToString("stretchTestSheet.cssRules[34].style.fontStretch", "-2% -1%");
    417429shouldBeEqualToString("stretchTestSheet.cssRules[35].style.fontStretch", "");
    418430shouldBeEqualToString("stretchTestSheet.cssRules[36].style.fontStretch", "");
    419431shouldBeEqualToString("stretchTestSheet.cssRules[37].style.fontStretch", "");
    420 shouldBeEqualToString("stretchTestSheet.cssRules[38].style.fontStretch", "7 / 8");
    421 shouldBeEqualToString("stretchTestSheet.cssRules[39].style.fontStretch", "2 / 7");
     432shouldBeEqualToString("stretchTestSheet.cssRules[38].style.fontStretch", "");
     433shouldBeEqualToString("stretchTestSheet.cssRules[39].style.fontStretch", "");
     434shouldBeEqualToString("stretchTestSheet.cssRules[40].style.fontStretch", "calc(7%) 8%");
     435shouldBeEqualToString("stretchTestSheet.cssRules[41].style.fontStretch", "2% calc(7%)");
    422436
    423437var styleTestSheet = document.getElementById("styleTest").sheet;
     
    426440shouldBeEqualToString("styleTestSheet.cssRules[2].style.fontStyle", "oblique 6.28318rad");
    427441shouldBeEqualToString("styleTestSheet.cssRules[3].style.fontStyle", "oblique 4turn");
    428 shouldBeEqualToString("styleTestSheet.cssRules[4].style.fontStyle", "oblique 5");
    429 shouldBeEqualToString("styleTestSheet.cssRules[5].style.fontStyle", "oblique 20");
     442shouldBeEqualToString("styleTestSheet.cssRules[4].style.fontStyle", "");
     443shouldBeEqualToString("styleTestSheet.cssRules[5].style.fontStyle", "");
    430444shouldBeEqualToString("styleTestSheet.cssRules[6].style.fontStyle", "italic");
    431445shouldBeEqualToString("styleTestSheet.cssRules[7].style.fontStyle", "oblique");
     
    433447shouldBeEqualToString("styleTestSheet.cssRules[9].style.fontStyle", "");
    434448shouldBeEqualToString("styleTestSheet.cssRules[10].style.fontStyle", "");
    435 shouldBeEqualToString("styleTestSheet.cssRules[11].style.fontStyle", "oblique 7");
     449shouldBeEqualToString("styleTestSheet.cssRules[11].style.fontStyle", "");
    436450shouldBeEqualToString("styleTestSheet.cssRules[12].style.fontStyle", "oblique calc(1441deg)");
    437451
    438 shouldBeEqualToString("styleTestSheet.cssRules[13].style.fontStyle", "oblique 100deg 200deg");
    439 shouldBeEqualToString("styleTestSheet.cssRules[14].style.fontStyle", "oblique 100deg 200deg");
     452shouldBeEqualToString("styleTestSheet.cssRules[13].style.fontStyle", "");
     453shouldBeEqualToString("styleTestSheet.cssRules[14].style.fontStyle", "");
    440454shouldBeEqualToString("styleTestSheet.cssRules[15].style.fontStyle", "");
    441455shouldBeEqualToString("styleTestSheet.cssRules[16].style.fontStyle", "");
     
    444458shouldBeEqualToString("styleTestSheet.cssRules[19].style.fontStyle", "");
    445459shouldBeEqualToString("styleTestSheet.cssRules[20].style.fontStyle", "");
    446 shouldBeEqualToString("styleTestSheet.cssRules[21].style.fontStyle", "oblique 1deg 2deg");
    447 shouldBeEqualToString("styleTestSheet.cssRules[22].style.fontStyle", "oblique -2deg -1deg");
     460shouldBeEqualToString("styleTestSheet.cssRules[21].style.fontStyle", "");
     461shouldBeEqualToString("styleTestSheet.cssRules[22].style.fontStyle", "");
    448462shouldBeEqualToString("styleTestSheet.cssRules[23].style.fontStyle", "");
    449463shouldBeEqualToString("styleTestSheet.cssRules[24].style.fontStyle", "oblique 100deg 200deg");
     
    461475shouldBeEqualToString("styleTestSheet.cssRules[36].style.fontStyle", "");
    462476shouldBeEqualToString("styleTestSheet.cssRules[37].style.fontStyle", "oblique 2deg 1turn");
    463 shouldBeEqualToString("styleTestSheet.cssRules[38].style.fontStyle", "oblique 7deg 8deg");
    464 shouldBeEqualToString("styleTestSheet.cssRules[39].style.fontStyle", "oblique 2deg 7deg");
     477shouldBeEqualToString("styleTestSheet.cssRules[38].style.fontStyle", "");
     478shouldBeEqualToString("styleTestSheet.cssRules[39].style.fontStyle", "");
     479shouldBeEqualToString("styleTestSheet.cssRules[40].style.fontStyle", "oblique calc(7deg) 8deg");
     480shouldBeEqualToString("styleTestSheet.cssRules[41].style.fontStyle", "oblique 2deg calc(7deg)");
    465481</script>
    466482<script src="../../resources/js-test-post.js"></script>
  • trunk/LayoutTests/fast/text/font-selection-font-loading-api-parse-expected.txt

    r213464 r214419  
    1717PASS setFontFaceWeight(fontFace, 'calc(150 + 50)') is "200"
    1818PASS setFontFaceStretch(fontFace, '1%') is "1%"
    19 PASS setFontFaceStretch(fontFace, '2') is "2%"
     19PASS setFontFaceStretch(fontFace, '2') threw exception SyntaxError (DOM Exception 12): The string did not match the expected pattern..
    2020PASS setFontFaceStretch(fontFace, 'ultra-condensed') is "ultra-condensed"
    2121PASS setFontFaceStretch(fontFace, 'extra-condensed') is "extra-condensed"
     
    2929PASS setFontFaceStretch(fontFace, 'garbage') threw exception SyntaxError (DOM Exception 12): The string did not match the expected pattern..
    3030PASS setFontFaceStretch(fontFace, 'initial') threw exception SyntaxError (DOM Exception 12): The string did not match the expected pattern..
    31 PASS setFontFaceStretch(fontFace, 'calc(3 + 4)') is "7%"
     31PASS setFontFaceStretch(fontFace, 'calc(3 + 4)') threw exception SyntaxError (DOM Exception 12): The string did not match the expected pattern..
     32PASS setFontFaceStretch(fontFace, 'calc(3% + 4%)') is "7%"
    3233PASS setFontFaceStyle(fontFace, 'oblique 1deg') is "oblique 1deg"
    3334PASS setFontFaceStyle(fontFace, 'oblique 200grad') is "oblique 180deg"
    34 PASS setFontFaceStyle(fontFace, 'oblique 6.28318rad') is "oblique 359.750000deg"
     35PASS setFontFaceStyle(fontFace, 'oblique 6.28318rad') is "oblique 359.75deg"
    3536PASS setFontFaceStyle(fontFace, 'oblique 4turn') is "oblique 1440deg"
    36 PASS setFontFaceStyle(fontFace, 'oblique 5') is "oblique 5deg"
    37 PASS setFontFaceStyle(fontFace, 'oblique 20') is "italic"
     37PASS setFontFaceStyle(fontFace, 'oblique 5') threw exception SyntaxError (DOM Exception 12): The string did not match the expected pattern..
     38PASS setFontFaceStyle(fontFace, 'oblique 20') threw exception SyntaxError (DOM Exception 12): The string did not match the expected pattern..
    3839PASS setFontFaceStyle(fontFace, 'italic') is "italic"
    3940PASS setFontFaceStyle(fontFace, 'oblique') is "italic"
     
    4142PASS setFontFaceStyle(fontFace, 'garbage') threw exception SyntaxError (DOM Exception 12): The string did not match the expected pattern..
    4243PASS setFontFaceStyle(fontFace, 'initial') threw exception SyntaxError (DOM Exception 12): The string did not match the expected pattern..
    43 PASS setFontFaceStyle(fontFace, 'oblique calc(3 + 4)') is "oblique 7deg"
     44PASS setFontFaceStyle(fontFace, 'oblique calc(3 + 4)') threw exception SyntaxError (DOM Exception 12): The string did not match the expected pattern..
    4445PASS setFontFaceStyle(fontFace, 'oblique calc(4turn + 1deg)') is "oblique 1441deg"
    4546PASS successfullyParsed is true
  • trunk/LayoutTests/fast/text/font-selection-font-loading-api-parse.html

    r213464 r214419  
    4141
    4242shouldBeEqualToString("setFontFaceStretch(fontFace, '1%')", "1%");
    43 shouldBeEqualToString("setFontFaceStretch(fontFace, '2')", "2%");
     43shouldThrow("setFontFaceStretch(fontFace, '2')");
    4444shouldBeEqualToString("setFontFaceStretch(fontFace, 'ultra-condensed')", "ultra-condensed");
    4545shouldBeEqualToString("setFontFaceStretch(fontFace, 'extra-condensed')", "extra-condensed");
     
    5353shouldThrow("setFontFaceStretch(fontFace, 'garbage')");
    5454shouldThrow("setFontFaceStretch(fontFace, 'initial')");
    55 shouldBeEqualToString("setFontFaceStretch(fontFace, 'calc(3 + 4)')", "7%");
     55shouldThrow("setFontFaceStretch(fontFace, 'calc(3 + 4)')");
     56shouldBeEqualToString("setFontFaceStretch(fontFace, 'calc(3% + 4%)')", "7%");
    5657
    5758shouldBeEqualToString("setFontFaceStyle(fontFace, 'oblique 1deg')", "oblique 1deg");
    5859shouldBeEqualToString("setFontFaceStyle(fontFace, 'oblique 200grad')", "oblique 180deg");
    59 shouldBeEqualToString("setFontFaceStyle(fontFace, 'oblique 6.28318rad')", "oblique 359.750000deg");
     60shouldBeEqualToString("setFontFaceStyle(fontFace, 'oblique 6.28318rad')", "oblique 359.75deg");
    6061shouldBeEqualToString("setFontFaceStyle(fontFace, 'oblique 4turn')", "oblique 1440deg");
    61 shouldBeEqualToString("setFontFaceStyle(fontFace, 'oblique 5')", "oblique 5deg");
    62 shouldBeEqualToString("setFontFaceStyle(fontFace, 'oblique 20')", "italic");
     62shouldThrow("setFontFaceStyle(fontFace, 'oblique 5')");
     63shouldThrow("setFontFaceStyle(fontFace, 'oblique 20')");
    6364shouldBeEqualToString("setFontFaceStyle(fontFace, 'italic')", "italic");
    6465shouldBeEqualToString("setFontFaceStyle(fontFace, 'oblique')", "italic");
     
    6667shouldThrow("setFontFaceStyle(fontFace, 'garbage')");
    6768shouldThrow("setFontFaceStyle(fontFace, 'initial')");
    68 shouldBeEqualToString("setFontFaceStyle(fontFace, 'oblique calc(3 + 4)')", "oblique 7deg");
     69shouldThrow("setFontFaceStyle(fontFace, 'oblique calc(3 + 4)')");
    6970shouldBeEqualToString("setFontFaceStyle(fontFace, 'oblique calc(4turn + 1deg)')", "oblique 1441deg");
    7071</script>
  • trunk/LayoutTests/fast/text/font-stretch-parse-expected.txt

    r213464 r214419  
    11PASS window.getComputedStyle(document.getElementById('test1')).fontStretch is "normal"
    22PASS window.getComputedStyle(document.getElementById('test2')).fontStretch is "1%"
    3 PASS window.getComputedStyle(document.getElementById('test3')).fontStretch is "2%"
     3PASS window.getComputedStyle(document.getElementById('test3')).fontStretch is "normal"
    44PASS window.getComputedStyle(document.getElementById('test4')).fontStretch is "ultra-condensed"
    55PASS window.getComputedStyle(document.getElementById('test5')).fontStretch is "extra-condensed"
     
    1313PASS window.getComputedStyle(document.getElementById('test13')).fontStretch is "normal"
    1414PASS window.getComputedStyle(document.getElementById('test14')).fontStretch is "normal"
    15 PASS window.getComputedStyle(document.getElementById('test15')).fontStretch is "7%"
     15PASS window.getComputedStyle(document.getElementById('test15')).fontStretch is "normal"
    1616PASS window.getComputedStyle(document.getElementById('test16')).fontStretch is "extra-condensed"
    1717PASS window.getComputedStyle(document.getElementById('test17')).fontStretch is "extra-condensed"
     
    1919PASS window.getComputedStyle(document.getElementById('test19')).fontStretch is "normal"
    2020PASS window.getComputedStyle(document.getElementById('test20')).fontStretch is "extra-expanded"
     21PASS window.getComputedStyle(document.getElementById('test21')).fontStretch is "7%"
    2122PASS window.getComputedStyle(document.getElementById('test1')).font is "normal normal normal normal 16px/18px Times"
    2223PASS window.getComputedStyle(document.getElementById('test2')).font is "16px/18px Times"
    23 PASS window.getComputedStyle(document.getElementById('test3')).font is "16px/18px Times"
     24PASS window.getComputedStyle(document.getElementById('test3')).font is "normal normal normal normal 16px/18px Times"
    2425PASS window.getComputedStyle(document.getElementById('test4')).font is "normal normal normal ultra-condensed 16px/18px Times"
    2526PASS window.getComputedStyle(document.getElementById('test5')).font is "normal normal normal extra-condensed 16px/18px Times"
     
    3334PASS window.getComputedStyle(document.getElementById('test13')).font is "normal normal normal normal 16px/18px Times"
    3435PASS window.getComputedStyle(document.getElementById('test14')).font is "normal normal normal normal 16px/18px Times"
    35 PASS window.getComputedStyle(document.getElementById('test15')).font is "16px/18px Times"
     36PASS window.getComputedStyle(document.getElementById('test15')).font is "normal normal normal normal 16px/18px Times"
    3637PASS window.getComputedStyle(document.getElementById('test16')).font is "normal normal 100 extra-condensed 48px/49px 'Helvetica Neue'"
    3738PASS window.getComputedStyle(document.getElementById('test17')).font is "normal normal 100 extra-condensed 48px/49px 'Helvetica Neue'"
     
    3940PASS window.getComputedStyle(document.getElementById('test19')).font is "normal normal 100 normal 48px/49px 'Helvetica Neue'"
    4041PASS window.getComputedStyle(document.getElementById('test20')).font is "italic small-caps 100 extra-expanded 48px/49px 'Helvetica Neue'"
     42PASS window.getComputedStyle(document.getElementById('test21')).font is "16px/18px Times"
    4143PASS document.getElementById('test1').style.font is ""
    4244PASS document.getElementById('test16').style.font is "100 extra-condensed 48px/49px 'Helvetica Neue'"
  • trunk/LayoutTests/fast/text/font-stretch-parse.html

    r213464 r214419  
    2626<div style="font-stretch: extra-expanded;"><div id="test19" style="font: 100 48px/49px 'Helvetica Neue';"></div></div>
    2727<div id="test20" style="font: italic small-caps 100 extra-expanded 48px/49px 'Helvetica Neue';"></div>
     28<div id="test21" style="font-stretch: calc(3% + 4%);"></div>
    2829</div>
    2930<script>
    3031shouldBeEqualToString("window.getComputedStyle(document.getElementById('test1')).fontStretch", "normal");
    3132shouldBeEqualToString("window.getComputedStyle(document.getElementById('test2')).fontStretch", "1%");
    32 shouldBeEqualToString("window.getComputedStyle(document.getElementById('test3')).fontStretch", "2%");
     33shouldBeEqualToString("window.getComputedStyle(document.getElementById('test3')).fontStretch", "normal");
    3334shouldBeEqualToString("window.getComputedStyle(document.getElementById('test4')).fontStretch", "ultra-condensed");
    3435shouldBeEqualToString("window.getComputedStyle(document.getElementById('test5')).fontStretch", "extra-condensed");
     
    4243shouldBeEqualToString("window.getComputedStyle(document.getElementById('test13')).fontStretch", "normal");
    4344shouldBeEqualToString("window.getComputedStyle(document.getElementById('test14')).fontStretch", "normal");
    44 shouldBeEqualToString("window.getComputedStyle(document.getElementById('test15')).fontStretch", "7%");
     45shouldBeEqualToString("window.getComputedStyle(document.getElementById('test15')).fontStretch", "normal");
    4546shouldBeEqualToString("window.getComputedStyle(document.getElementById('test16')).fontStretch", "extra-condensed");
    4647shouldBeEqualToString("window.getComputedStyle(document.getElementById('test17')).fontStretch", "extra-condensed");
     
    4849shouldBeEqualToString("window.getComputedStyle(document.getElementById('test19')).fontStretch", "normal");
    4950shouldBeEqualToString("window.getComputedStyle(document.getElementById('test20')).fontStretch", "extra-expanded");
     51shouldBeEqualToString("window.getComputedStyle(document.getElementById('test21')).fontStretch", "7%");
    5052
    5153shouldBeEqualToString("window.getComputedStyle(document.getElementById('test1')).font", "normal normal normal normal 16px/18px Times");
    5254shouldBeEqualToString("window.getComputedStyle(document.getElementById('test2')).font", "16px/18px Times");
    53 shouldBeEqualToString("window.getComputedStyle(document.getElementById('test3')).font", "16px/18px Times");
     55shouldBeEqualToString("window.getComputedStyle(document.getElementById('test3')).font", "normal normal normal normal 16px/18px Times");
    5456shouldBeEqualToString("window.getComputedStyle(document.getElementById('test4')).font", "normal normal normal ultra-condensed 16px/18px Times");
    5557shouldBeEqualToString("window.getComputedStyle(document.getElementById('test5')).font", "normal normal normal extra-condensed 16px/18px Times");
     
    6365shouldBeEqualToString("window.getComputedStyle(document.getElementById('test13')).font", "normal normal normal normal 16px/18px Times");
    6466shouldBeEqualToString("window.getComputedStyle(document.getElementById('test14')).font", "normal normal normal normal 16px/18px Times");
    65 shouldBeEqualToString("window.getComputedStyle(document.getElementById('test15')).font", "16px/18px Times");
     67shouldBeEqualToString("window.getComputedStyle(document.getElementById('test15')).font", "normal normal normal normal 16px/18px Times");
    6668shouldBeEqualToString("window.getComputedStyle(document.getElementById('test16')).font", "normal normal 100 extra-condensed 48px/49px 'Helvetica Neue'");
    6769shouldBeEqualToString("window.getComputedStyle(document.getElementById('test17')).font", "normal normal 100 extra-condensed 48px/49px 'Helvetica Neue'");
     
    6971shouldBeEqualToString("window.getComputedStyle(document.getElementById('test19')).font", "normal normal 100 normal 48px/49px 'Helvetica Neue'");
    7072shouldBeEqualToString("window.getComputedStyle(document.getElementById('test20')).font", "italic small-caps 100 extra-expanded 48px/49px 'Helvetica Neue'");
     73shouldBeEqualToString("window.getComputedStyle(document.getElementById('test21')).font", "16px/18px Times");
    7174
    7275shouldBeEqualToString("document.getElementById('test1').style.font", "");
  • trunk/LayoutTests/fast/text/font-style-parse-expected.txt

    r214359 r214419  
    44PASS window.getComputedStyle(document.getElementById('test4')).fontStyle is "oblique 359.75deg"
    55PASS window.getComputedStyle(document.getElementById('test5')).fontStyle is "oblique 1440deg"
    6 PASS window.getComputedStyle(document.getElementById('test6')).fontStyle is "oblique 5deg"
    7 PASS window.getComputedStyle(document.getElementById('test7')).fontStyle is "italic"
     6PASS window.getComputedStyle(document.getElementById('test6')).fontStyle is "normal"
     7PASS window.getComputedStyle(document.getElementById('test7')).fontStyle is "normal"
    88PASS window.getComputedStyle(document.getElementById('test8')).fontStyle is "italic"
    99PASS window.getComputedStyle(document.getElementById('test9')).fontStyle is "italic"
     
    1111PASS window.getComputedStyle(document.getElementById('test11')).fontStyle is "normal"
    1212PASS window.getComputedStyle(document.getElementById('test12')).fontStyle is "normal"
    13 PASS window.getComputedStyle(document.getElementById('test13')).fontStyle is "oblique 7deg"
     13PASS window.getComputedStyle(document.getElementById('test13')).fontStyle is "normal"
    1414PASS window.getComputedStyle(document.getElementById('test14')).fontStyle is "oblique 1441deg"
    1515PASS window.getComputedStyle(document.getElementById('test15')).fontStyle is "italic"
     
    2525PASS window.getComputedStyle(document.getElementById('test4')).font is "16px/18px Times"
    2626PASS window.getComputedStyle(document.getElementById('test5')).font is "16px/18px Times"
    27 PASS window.getComputedStyle(document.getElementById('test6')).font is "16px/18px Times"
    28 PASS window.getComputedStyle(document.getElementById('test7')).font is "italic normal normal normal 16px/18px Times"
     27PASS window.getComputedStyle(document.getElementById('test6')).font is "normal normal normal normal 16px/18px Times"
     28PASS window.getComputedStyle(document.getElementById('test7')).font is "normal normal normal normal 16px/18px Times"
    2929PASS window.getComputedStyle(document.getElementById('test8')).font is "italic normal normal normal 16px/18px Times"
    3030PASS window.getComputedStyle(document.getElementById('test9')).font is "italic normal normal normal 16px/18px Times"
     
    3232PASS window.getComputedStyle(document.getElementById('test11')).font is "normal normal normal normal 16px/18px Times"
    3333PASS window.getComputedStyle(document.getElementById('test12')).font is "normal normal normal normal 16px/18px Times"
    34 PASS window.getComputedStyle(document.getElementById('test13')).font is "16px/18px Times"
     34PASS window.getComputedStyle(document.getElementById('test13')).font is "normal normal normal normal 16px/18px Times"
    3535PASS window.getComputedStyle(document.getElementById('test14')).font is "16px/18px Times"
    3636PASS window.getComputedStyle(document.getElementById('test15')).font is "italic normal 100 normal 48px/49px 'Helvetica Neue'"
  • trunk/LayoutTests/fast/text/font-style-parse.html

    r214359 r214419  
    3434shouldBeEqualToString("window.getComputedStyle(document.getElementById('test4')).fontStyle", "oblique 359.75deg");
    3535shouldBeEqualToString("window.getComputedStyle(document.getElementById('test5')).fontStyle", "oblique 1440deg");
    36 shouldBeEqualToString("window.getComputedStyle(document.getElementById('test6')).fontStyle", "oblique 5deg");
    37 shouldBeEqualToString("window.getComputedStyle(document.getElementById('test7')).fontStyle", "italic");
     36shouldBeEqualToString("window.getComputedStyle(document.getElementById('test6')).fontStyle", "normal");
     37shouldBeEqualToString("window.getComputedStyle(document.getElementById('test7')).fontStyle", "normal");
    3838shouldBeEqualToString("window.getComputedStyle(document.getElementById('test8')).fontStyle", "italic");
    3939shouldBeEqualToString("window.getComputedStyle(document.getElementById('test9')).fontStyle", "italic");
     
    4141shouldBeEqualToString("window.getComputedStyle(document.getElementById('test11')).fontStyle", "normal");
    4242shouldBeEqualToString("window.getComputedStyle(document.getElementById('test12')).fontStyle", "normal");
    43 shouldBeEqualToString("window.getComputedStyle(document.getElementById('test13')).fontStyle", "oblique 7deg");
     43shouldBeEqualToString("window.getComputedStyle(document.getElementById('test13')).fontStyle", "normal");
    4444shouldBeEqualToString("window.getComputedStyle(document.getElementById('test14')).fontStyle", "oblique 1441deg");
    4545shouldBeEqualToString("window.getComputedStyle(document.getElementById('test15')).fontStyle", "italic");
     
    5656shouldBeEqualToString("window.getComputedStyle(document.getElementById('test4')).font", "16px/18px Times");
    5757shouldBeEqualToString("window.getComputedStyle(document.getElementById('test5')).font", "16px/18px Times");
    58 shouldBeEqualToString("window.getComputedStyle(document.getElementById('test6')).font", "16px/18px Times");
    59 shouldBeEqualToString("window.getComputedStyle(document.getElementById('test7')).font", "italic normal normal normal 16px/18px Times");
     58shouldBeEqualToString("window.getComputedStyle(document.getElementById('test6')).font", "normal normal normal normal 16px/18px Times");
     59shouldBeEqualToString("window.getComputedStyle(document.getElementById('test7')).font", "normal normal normal normal 16px/18px Times");
    6060shouldBeEqualToString("window.getComputedStyle(document.getElementById('test8')).font", "italic normal normal normal 16px/18px Times");
    6161shouldBeEqualToString("window.getComputedStyle(document.getElementById('test9')).font", "italic normal normal normal 16px/18px Times");
     
    6363shouldBeEqualToString("window.getComputedStyle(document.getElementById('test11')).font", "normal normal normal normal 16px/18px Times");
    6464shouldBeEqualToString("window.getComputedStyle(document.getElementById('test12')).font", "normal normal normal normal 16px/18px Times");
    65 shouldBeEqualToString("window.getComputedStyle(document.getElementById('test13')).font", "16px/18px Times");
     65shouldBeEqualToString("window.getComputedStyle(document.getElementById('test13')).font", "normal normal normal normal 16px/18px Times");
    6666shouldBeEqualToString("window.getComputedStyle(document.getElementById('test14')).font", "16px/18px Times");
    6767shouldBeEqualToString("window.getComputedStyle(document.getElementById('test15')).font", "italic normal 100 normal 48px/49px 'Helvetica Neue'");
  • trunk/LayoutTests/fast/text/variations/font-selection-properties.html

    r213505 r214419  
    1111<body>
    1212This test makes sure that the font selection properties affect font variations.
    13 <div style="font-family: Boxis; font-stretch: 900;">Hello</div>
    14 <div style="font-family: Boxis; font-stretch: 900; font-variation-settings: 'wdth' 100;">Hello</div>
     13<div style="font-family: Boxis; font-stretch: 900%;">Hello</div>
     14<div style="font-family: Boxis; font-stretch: 900%; font-variation-settings: 'wdth' 100;">Hello</div>
    1515</body>
    1616</html>
  • trunk/LayoutTests/platform/mac-elcapitan/fast/text/font-selection-font-face-parse-expected.txt

    r214359 r214419  
    1717PASS weightTestSheet.cssRules[16].style.fontWeight is "300"
    1818PASS weightTestSheet.cssRules[17].style.fontWeight is "200"
    19 FAIL weightTestSheet.cssRules[18].style.fontWeight should be 100 / 200. Was .
    20 FAIL weightTestSheet.cssRules[19].style.fontWeight should be 100 / 200. Was .
     19FAIL weightTestSheet.cssRules[18].style.fontWeight should be 100 200. Was .
     20FAIL weightTestSheet.cssRules[19].style.fontWeight should be 100 200. Was .
    2121PASS weightTestSheet.cssRules[20].style.fontWeight is ""
    2222PASS weightTestSheet.cssRules[21].style.fontWeight is ""
     
    2525PASS weightTestSheet.cssRules[24].style.fontWeight is ""
    2626PASS weightTestSheet.cssRules[25].style.fontWeight is ""
    27 FAIL weightTestSheet.cssRules[26].style.fontWeight should be 1 / 2. Was .
    28 FAIL weightTestSheet.cssRules[27].style.fontWeight should be -2 / -1. Was .
     27FAIL weightTestSheet.cssRules[26].style.fontWeight should be 1 2. Was .
     28FAIL weightTestSheet.cssRules[27].style.fontWeight should be -2 -1. Was .
    2929PASS weightTestSheet.cssRules[28].style.fontWeight is ""
    30 FAIL weightTestSheet.cssRules[29].style.fontWeight should be 7 / 8. Was .
    31 FAIL weightTestSheet.cssRules[30].style.fontWeight should be 2 / 7. Was .
     30FAIL weightTestSheet.cssRules[29].style.fontWeight should be 7 8. Was .
     31FAIL weightTestSheet.cssRules[30].style.fontWeight should be 2 7. Was .
    3232PASS stretchTestSheet.cssRules[0].style.fontStretch is "1%"
    33 PASS stretchTestSheet.cssRules[1].style.fontStretch is "2"
     33PASS stretchTestSheet.cssRules[1].style.fontStretch is ""
    3434PASS stretchTestSheet.cssRules[2].style.fontStretch is "ultra-condensed"
    3535PASS stretchTestSheet.cssRules[3].style.fontStretch is "extra-condensed"
     
    4343PASS stretchTestSheet.cssRules[11].style.fontStretch is ""
    4444PASS stretchTestSheet.cssRules[12].style.fontStretch is ""
    45 PASS stretchTestSheet.cssRules[13].style.fontStretch is "7"
    46 FAIL stretchTestSheet.cssRules[14].style.fontStretch should be 100 / 200. Was .
    47 FAIL stretchTestSheet.cssRules[15].style.fontStretch should be 100 / 200. Was .
     45PASS stretchTestSheet.cssRules[13].style.fontStretch is ""
     46PASS stretchTestSheet.cssRules[14].style.fontStretch is ""
     47PASS stretchTestSheet.cssRules[15].style.fontStretch is ""
    4848PASS stretchTestSheet.cssRules[16].style.fontStretch is ""
    4949PASS stretchTestSheet.cssRules[17].style.fontStretch is ""
     
    5252PASS stretchTestSheet.cssRules[20].style.fontStretch is ""
    5353PASS stretchTestSheet.cssRules[21].style.fontStretch is ""
    54 FAIL stretchTestSheet.cssRules[22].style.fontStretch should be 1 / 2. Was .
    55 FAIL stretchTestSheet.cssRules[23].style.fontStretch should be -2 / -1. Was .
     54PASS stretchTestSheet.cssRules[22].style.fontStretch is ""
     55PASS stretchTestSheet.cssRules[23].style.fontStretch is ""
    5656PASS stretchTestSheet.cssRules[24].style.fontStretch is ""
    57 FAIL stretchTestSheet.cssRules[25].style.fontStretch should be 100% / 200%. Was .
    58 FAIL stretchTestSheet.cssRules[26].style.fontStretch should be 100% / 200%. Was .
     57FAIL stretchTestSheet.cssRules[25].style.fontStretch should be 100% 200%. Was .
     58FAIL stretchTestSheet.cssRules[26].style.fontStretch should be 100% 200%. Was .
    5959PASS stretchTestSheet.cssRules[27].style.fontStretch is ""
    6060PASS stretchTestSheet.cssRules[28].style.fontStretch is ""
     
    6363PASS stretchTestSheet.cssRules[31].style.fontStretch is ""
    6464PASS stretchTestSheet.cssRules[32].style.fontStretch is ""
    65 FAIL stretchTestSheet.cssRules[33].style.fontStretch should be 1% / 2%. Was .
    66 FAIL stretchTestSheet.cssRules[34].style.fontStretch should be -2% / -1%. Was .
     65FAIL stretchTestSheet.cssRules[33].style.fontStretch should be 1% 2%. Was .
     66FAIL stretchTestSheet.cssRules[34].style.fontStretch should be -2% -1%. Was .
    6767PASS stretchTestSheet.cssRules[35].style.fontStretch is ""
    6868PASS stretchTestSheet.cssRules[36].style.fontStretch is ""
    6969PASS stretchTestSheet.cssRules[37].style.fontStretch is ""
    70 FAIL stretchTestSheet.cssRules[38].style.fontStretch should be 7 / 8. Was .
    71 FAIL stretchTestSheet.cssRules[39].style.fontStretch should be 2 / 7. Was .
     70PASS stretchTestSheet.cssRules[38].style.fontStretch is ""
     71PASS stretchTestSheet.cssRules[39].style.fontStretch is ""
     72FAIL stretchTestSheet.cssRules[40].style.fontStretch should be calc(7%) 8%. Was .
     73FAIL stretchTestSheet.cssRules[41].style.fontStretch should be 2% calc(7%). Was .
    7274PASS styleTestSheet.cssRules[0].style.fontStyle is "oblique 1deg"
    7375PASS styleTestSheet.cssRules[1].style.fontStyle is "oblique 200grad"
    7476PASS styleTestSheet.cssRules[2].style.fontStyle is "oblique 6.28318rad"
    7577PASS styleTestSheet.cssRules[3].style.fontStyle is "oblique 4turn"
    76 FAIL styleTestSheet.cssRules[4].style.fontStyle should be oblique 5. Was oblique 5deg.
    77 FAIL styleTestSheet.cssRules[5].style.fontStyle should be oblique 20. Was oblique 20deg.
     78PASS styleTestSheet.cssRules[4].style.fontStyle is ""
     79PASS styleTestSheet.cssRules[5].style.fontStyle is ""
    7880PASS styleTestSheet.cssRules[6].style.fontStyle is "italic"
    7981PASS styleTestSheet.cssRules[7].style.fontStyle is "oblique"
     
    8183PASS styleTestSheet.cssRules[9].style.fontStyle is ""
    8284PASS styleTestSheet.cssRules[10].style.fontStyle is ""
    83 FAIL styleTestSheet.cssRules[11].style.fontStyle should be oblique 7. Was oblique 7deg.
     85PASS styleTestSheet.cssRules[11].style.fontStyle is ""
    8486PASS styleTestSheet.cssRules[12].style.fontStyle is "oblique calc(1441deg)"
    85 FAIL styleTestSheet.cssRules[13].style.fontStyle should be oblique 100deg 200deg. Was .
    86 FAIL styleTestSheet.cssRules[14].style.fontStyle should be oblique 100deg 200deg. Was .
     87PASS styleTestSheet.cssRules[13].style.fontStyle is ""
     88PASS styleTestSheet.cssRules[14].style.fontStyle is ""
    8789PASS styleTestSheet.cssRules[15].style.fontStyle is ""
    8890PASS styleTestSheet.cssRules[16].style.fontStyle is ""
     
    9193PASS styleTestSheet.cssRules[19].style.fontStyle is ""
    9294PASS styleTestSheet.cssRules[20].style.fontStyle is ""
    93 FAIL styleTestSheet.cssRules[21].style.fontStyle should be oblique 1deg 2deg. Was .
    94 FAIL styleTestSheet.cssRules[22].style.fontStyle should be oblique -2deg -1deg. Was .
     95PASS styleTestSheet.cssRules[21].style.fontStyle is ""
     96PASS styleTestSheet.cssRules[22].style.fontStyle is ""
    9597PASS styleTestSheet.cssRules[23].style.fontStyle is ""
    9698FAIL styleTestSheet.cssRules[24].style.fontStyle should be oblique 100deg 200deg. Was .
     
    108110PASS styleTestSheet.cssRules[36].style.fontStyle is ""
    109111FAIL styleTestSheet.cssRules[37].style.fontStyle should be oblique 2deg 1turn. Was .
    110 FAIL styleTestSheet.cssRules[38].style.fontStyle should be oblique 7deg 8deg. Was .
    111 FAIL styleTestSheet.cssRules[39].style.fontStyle should be oblique 2deg 7deg. Was .
     112PASS styleTestSheet.cssRules[38].style.fontStyle is ""
     113PASS styleTestSheet.cssRules[39].style.fontStyle is ""
     114FAIL styleTestSheet.cssRules[40].style.fontStyle should be oblique calc(7deg) 8deg. Was .
     115FAIL styleTestSheet.cssRules[41].style.fontStyle should be oblique 2deg calc(7deg). Was .
    112116PASS successfullyParsed is true
    113117
  • trunk/Source/WebCore/ChangeLog

    r214418 r214419  
     12017-03-27  Myles C. Maxfield  <mmaxfield@apple.com>
     2
     3        font variation properties don't need to accept numbers
     4        https://bugs.webkit.org/show_bug.cgi?id=169357
     5
     6        Reviewed by Antti Koivisto.
     7
     8        The CSS Fonts level 4 spec stabilized the grammar accepted by font-weight,
     9        font-style, and font-stretch. The changes are that font-style and
     10        font-stretch no longer accept raw numbers, and the @font-face descriptor
     11        ranges are now separated by spaces instead of slashes.
     12
     13        Tests: fast/text/font-selection-font-face-parse.html
     14               fast/text/font-selection-font-loading-api-parse.html
     15               fast/text/font-stretch-parse.html
     16               fast/text/font-style-parse.html
     17               fast/text/variations/font-selection-properties.html
     18
     19        * css/CSSComputedStyleDeclaration.cpp:
     20        (WebCore::ComputedStyleExtractor::fontWeightFromStyleValue):
     21        (WebCore::fontWeightFromStyle):
     22        (WebCore::ComputedStyleExtractor::fontStretchFromStyleValue):
     23        (WebCore::fontStretchFromStyle):
     24        (WebCore::ComputedStyleExtractor::fontStyleFromStyleValue):
     25        (WebCore::fontStyleFromStyle):
     26        * css/CSSComputedStyleDeclaration.h:
     27        * css/FontFace.cpp:
     28        (WebCore::FontFace::style):
     29        (WebCore::FontFace::weight):
     30        (WebCore::FontFace::stretch):
     31        (WebCore::rangeIsSingleValue): Deleted.
     32        * css/StyleBuilderConverter.h:
     33        (WebCore::StyleBuilderConverter::convertFontStretchFromValue):
     34        * css/parser/CSSPropertyParser.cpp:
     35        (WebCore::consumeFontWeightRange):
     36        (WebCore::consumeFontStretch):
     37        (WebCore::consumeFontStretchRange):
     38        (WebCore::consumeFontStyle):
     39        (WebCore::consumeFontStyleRange):
     40
    1412017-03-27  Youenn Fablet  <youenn@apple.com>
    242
  • trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp

    r214394 r214419  
    19181918}
    19191919
    1920 static Ref<CSSPrimitiveValue> fontWeightFromStyle(const RenderStyle& style)
    1921 {
    1922     auto weight = style.fontDescription().weight();
     1920Ref<CSSPrimitiveValue> ComputedStyleExtractor::fontWeightFromStyleValue(FontSelectionValue weight)
     1921{
    19231922    if (auto value = fontWeightKeyword(weight))
    19241923        return CSSValuePool::singleton().createIdentifierValue(value.value());
     
    19261925}
    19271926
    1928 static Ref<CSSPrimitiveValue> fontStretchFromStyle(const RenderStyle& style)
    1929 {
    1930     auto stretch = style.fontDescription().stretch();
     1927static Ref<CSSPrimitiveValue> fontWeightFromStyle(const RenderStyle& style)
     1928{
     1929    return ComputedStyleExtractor::fontWeightFromStyleValue(style.fontDescription().weight());
     1930}
     1931
     1932Ref<CSSPrimitiveValue> ComputedStyleExtractor::fontStretchFromStyleValue(FontSelectionValue stretch)
     1933{
    19311934    if (auto keyword = fontStretchKeyword(stretch))
    19321935        return CSSValuePool::singleton().createIdentifierValue(keyword.value());
     
    19341937}
    19351938
     1939static Ref<CSSPrimitiveValue> fontStretchFromStyle(const RenderStyle& style)
     1940{
     1941    return ComputedStyleExtractor::fontStretchFromStyleValue(style.fontDescription().stretch());
     1942}
     1943
     1944Ref<CSSFontStyleValue> ComputedStyleExtractor::fontStyleFromStyleValue(FontSelectionValue italic)
     1945{
     1946    if (auto keyword = fontStyleKeyword(italic))
     1947        return CSSFontStyleValue::create(CSSValuePool::singleton().createIdentifierValue(keyword.value()));
     1948    return CSSFontStyleValue::create(CSSValuePool::singleton().createIdentifierValue(CSSValueOblique), CSSValuePool::singleton().createValue(static_cast<float>(italic), CSSPrimitiveValue::CSS_DEG));
     1949}
     1950
    19361951static Ref<CSSFontStyleValue> fontStyleFromStyle(const RenderStyle& style)
    19371952{
    1938     FontSelectionValue italic = style.fontDescription().italic();
    1939     if (italic == normalItalicValue())
    1940         return CSSFontStyleValue::create(CSSValuePool::singleton().createIdentifierValue(CSSValueNormal));
    1941     if (italic == italicValue())
    1942         return CSSFontStyleValue::create(CSSValuePool::singleton().createIdentifierValue(CSSValueItalic));
    1943     return CSSFontStyleValue::create(CSSValuePool::singleton().createIdentifierValue(CSSValueOblique), CSSValuePool::singleton().createValue(static_cast<float>(italic), CSSPrimitiveValue::CSS_DEG));
     1953    return ComputedStyleExtractor::fontStyleFromStyleValue(style.fontDescription().italic());
    19441954}
    19451955
  • trunk/Source/WebCore/css/CSSComputedStyleDeclaration.h

    r209969 r214419  
    2929namespace WebCore {
    3030
     31class CSSFontStyleValue;
    3132class CSSPrimitiveValue;
    3233class CSSValueList;
     
    3435class Element;
    3536class FilterOperations;
     37class FontSelectionValue;
    3638class MutableStyleProperties;
    3739class Node;
     
    6466
    6567    static Ref<CSSValue> valueForFilter(const RenderStyle&, const FilterOperations&, AdjustPixelValuesForComputedStyle = AdjustPixelValues);
     68
     69    static Ref<CSSPrimitiveValue> fontWeightFromStyleValue(FontSelectionValue);
     70    static Ref<CSSPrimitiveValue> fontStretchFromStyleValue(FontSelectionValue);
     71    static Ref<CSSFontStyleValue> fontStyleFromStyleValue(FontSelectionValue);
    6672
    6773private:
  • trunk/Source/WebCore/css/FontFace.cpp

    r214359 r214419  
    2727#include "FontFace.h"
    2828
     29#include "CSSComputedStyleDeclaration.h"
    2930#include "CSSFontFaceSource.h"
    3031#include "CSSFontFeatureValue.h"
     32#include "CSSFontStyleValue.h"
    3133#include "CSSParser.h"
    3234#include "CSSUnicodeRangeValue.h"
     
    4042#include <runtime/ArrayBufferView.h>
    4143#include <runtime/JSCInlines.h>
     44#include <wtf/text/StringBuilder.h>
    4245
    4346namespace WebCore {
     
    281284}
    282285
    283 static inline bool rangeIsSingleValue(FontSelectionRange range, FontSelectionValue value)
    284 {
    285     return range.minimum == value && range.maximum == value;
    286 };
    287 
    288286String FontFace::style() const
    289287{
     
    291289    auto style = m_backing->italic();
    292290
    293     if (rangeIsSingleValue(style, italicValue()))
    294         return ASCIILiteral("italic");
    295     if (rangeIsSingleValue(style, normalItalicValue()))
    296         return ASCIILiteral("normal");
    297 
    298     if (style.minimum == style.maximum) {
    299         auto value = static_cast<float>(style.minimum);
    300         if (value >= 0) {
    301             auto floored = std::floor(value);
    302             if (floored == value)
    303                 return String::format("oblique %ddeg", static_cast<int>(floored));
    304         }
    305         return String::format("oblique %fdeg", static_cast<float>(style.minimum));
    306     }
    307 
    308     return String::format("oblique %fdeg %fdeg", static_cast<float>(style.minimum), static_cast<float>(style.maximum));
     291    auto minimum = ComputedStyleExtractor::fontStyleFromStyleValue(style.minimum);
     292    auto maximum = ComputedStyleExtractor::fontStyleFromStyleValue(style.maximum);
     293
     294    if (minimum.get().equals(maximum.get()))
     295        return minimum->cssText();
     296
     297    ASSERT(minimum->fontStyleValue->valueID() == CSSValueOblique);
     298    ASSERT(maximum->fontStyleValue->valueID() == CSSValueOblique);
     299
     300    StringBuilder builder;
     301    builder.append(minimum->fontStyleValue->cssText());
     302    builder.append(' ');
     303    if (minimum->obliqueValue.get() == maximum->obliqueValue.get())
     304        builder.append(minimum->obliqueValue->cssText());
     305    else {
     306        builder.append(minimum->obliqueValue->cssText());
     307        builder.append(maximum->obliqueValue->cssText());
     308    }
     309    return builder.toString();
    309310}
    310311
     
    314315    auto weight = m_backing->weight();
    315316
    316     if (rangeIsSingleValue(weight, normalWeightValue()))
    317         return ASCIILiteral("normal");
    318     if (rangeIsSingleValue(weight, boldWeightValue()))
    319         return ASCIILiteral("bold");
    320 
    321     if (weight.minimum == weight.maximum) {
    322         auto value = static_cast<float>(weight.minimum);
    323         if (value >= 0) {
    324             auto floored = std::floor(value);
    325             if (floored == value)
    326                 return String::format("%d", static_cast<int>(floored));
    327         }
    328         return String::format("%f", static_cast<float>(weight.minimum));
    329     }
    330 
    331     return String::format("%f %f", static_cast<float>(weight.minimum), static_cast<float>(weight.maximum));
     317    auto minimum = ComputedStyleExtractor::fontWeightFromStyleValue(weight.minimum);
     318    auto maximum = ComputedStyleExtractor::fontWeightFromStyleValue(weight.maximum);
     319
     320    if (minimum.get().equals(maximum.get()))
     321        return minimum->cssText();
     322
     323    StringBuilder builder;
     324    builder.append(minimum->cssText());
     325    builder.append(' ');
     326    builder.append(maximum->cssText());
     327    return builder.toString();
    332328}
    333329
     
    337333    auto stretch = m_backing->stretch();
    338334
    339     if (rangeIsSingleValue(stretch, ultraCondensedStretchValue()))
    340         return ASCIILiteral("ultra-condensed");
    341     if (rangeIsSingleValue(stretch, extraCondensedStretchValue()))
    342         return ASCIILiteral("extra-condensed");
    343     if (rangeIsSingleValue(stretch, condensedStretchValue()))
    344         return ASCIILiteral("condensed");
    345     if (rangeIsSingleValue(stretch, semiCondensedStretchValue()))
    346         return ASCIILiteral("semi-condensed");
    347     if (rangeIsSingleValue(stretch, normalStretchValue()))
    348         return ASCIILiteral("normal");
    349     if (rangeIsSingleValue(stretch, semiExpandedStretchValue()))
    350         return ASCIILiteral("semi-expanded");
    351     if (rangeIsSingleValue(stretch, expandedStretchValue()))
    352         return ASCIILiteral("expanded");
    353     if (rangeIsSingleValue(stretch, extraExpandedStretchValue()))
    354         return ASCIILiteral("extra-expanded");
    355     if (rangeIsSingleValue(stretch, ultraExpandedStretchValue()))
    356         return ASCIILiteral("ultra-expanded");
    357 
    358     if (stretch.minimum == stretch.maximum) {
    359         auto value = static_cast<float>(stretch.minimum);
    360         if (value >= 0) {
    361             auto floored = std::floor(value);
    362             if (floored == value)
    363                 return String::format("%d%%", static_cast<int>(floored));
    364         }
    365         return String::format("%f%%", static_cast<float>(stretch.minimum));
    366     }
    367 
    368     return String::format("%f%% %f%%", static_cast<float>(stretch.minimum), static_cast<float>(stretch.maximum));
     335    auto minimum = ComputedStyleExtractor::fontStretchFromStyleValue(stretch.minimum);
     336    auto maximum = ComputedStyleExtractor::fontStretchFromStyleValue(stretch.maximum);
     337
     338    if (minimum.get().equals(maximum.get()))
     339        return minimum->cssText();
     340
     341    StringBuilder builder;
     342    builder.append(minimum->cssText());
     343    builder.append(' ');
     344    builder.append(maximum->cssText());
     345    return builder.toString();
    369346}
    370347
  • trunk/Source/WebCore/css/StyleBuilderConverter.h

    r214359 r214419  
    11941194    const auto& primitiveValue = downcast<CSSPrimitiveValue>(value);
    11951195
    1196     if (primitiveValue.isPercentage() || primitiveValue.isNumber())
     1196    if (primitiveValue.isPercentage())
    11971197        return FontSelectionValue::clampFloat(primitiveValue.floatValue());
    11981198
  • trunk/Source/WebCore/css/parser/CSSPropertyParser.cpp

    r214359 r214419  
    889889    if (range.atEnd())
    890890        return firstNumber;
    891     if (!consumeSlashIncludingWhitespace(range))
    892         return nullptr;
    893891    auto secondNumber = consumeNumber(range, ValueRangeAll);
    894892    if (!secondNumber)
     
    896894    if (firstNumber->floatValue() > secondNumber->floatValue())
    897895        return nullptr;
    898     auto result = CSSValueList::createSlashSeparated();
     896    auto result = CSSValueList::createSpaceSeparated();
    899897    result->append(firstNumber.releaseNonNull());
    900898    result->append(secondNumber.releaseNonNull());
     
    912910    if (auto result = consumeFontStretchKeywordValue(range))
    913911        return result;
    914     if (auto percent = consumePercent(range, ValueRangeAll))
    915         return percent;
    916     return consumeNumber(range, ValueRangeAll);
     912    return consumePercent(range, ValueRangeAll);
    917913}
    918914
     
    922918    if (auto result = consumeFontStretchKeywordValue(range))
    923919        return result;
    924     if (auto firstPercent = consumePercent(range, ValueRangeAll)) {
    925         if (range.atEnd())
    926             return firstPercent;
    927         if (!consumeSlashIncludingWhitespace(range))
    928             return nullptr;
    929         auto secondPercent = consumePercent(range, ValueRangeAll);
    930         if (!secondPercent)
    931             return nullptr;
    932         if (firstPercent->floatValue() > secondPercent->floatValue())
    933             return nullptr;
    934         auto result = CSSValueList::createSlashSeparated();
    935         result->append(firstPercent.releaseNonNull());
    936         result->append(secondPercent.releaseNonNull());
    937         return RefPtr<CSSValue>(WTFMove(result));
    938     }
    939 
    940     if (auto firstNumber = consumeNumber(range, ValueRangeAll)) {
    941         if (range.atEnd())
    942             return firstNumber;
    943         if (!consumeSlashIncludingWhitespace(range))
    944             return nullptr;
    945         auto secondNumber = consumeNumber(range, ValueRangeAll);
    946         if (!secondNumber)
    947             return nullptr;
    948         if (firstNumber->floatValue() > secondNumber->floatValue())
    949             return nullptr;
    950         auto result = CSSValueList::createSlashSeparated();
    951         result->append(firstNumber.releaseNonNull());
    952         result->append(secondNumber.releaseNonNull());
    953         return RefPtr<CSSValue>(WTFMove(result));
    954     }
    955 
    956     return nullptr;
     920    auto firstPercent = consumePercent(range, ValueRangeAll);
     921    if (!firstPercent)
     922        return nullptr;
     923    if (range.atEnd())
     924        return firstPercent;
     925    auto secondPercent = consumePercent(range, ValueRangeAll);
     926    if (!secondPercent)
     927        return nullptr;
     928    if (firstPercent->floatValue() > secondPercent->floatValue())
     929        return nullptr;
     930    auto result = CSSValueList::createSpaceSeparated();
     931    result->append(firstPercent.releaseNonNull());
     932    result->append(secondPercent.releaseNonNull());
     933    return RefPtr<CSSValue>(WTFMove(result));
    957934}
    958935#endif
     
    978955    if (auto angle = consumeAngle(range, cssParserMode))
    979956        return CSSFontStyleValue::create(CSSValuePool::singleton().createIdentifierValue(CSSValueOblique), WTFMove(angle));
    980     if (auto number = consumeNumber(range, ValueRangeAll))
    981         return CSSFontStyleValue::create(CSSValuePool::singleton().createIdentifierValue(CSSValueOblique), CSSValuePool::singleton().createValue(number->value<double>(), CSSPrimitiveValue::CSS_DEG));
    982957    return CSSFontStyleValue::create(CSSValuePool::singleton().createIdentifierValue(CSSValueOblique));
    983958}
     
    1007982        result->append(firstAngle.releaseNonNull());
    1008983        result->append(secondAngle.releaseNonNull());
    1009         return CSSFontStyleRangeValue::create(keyword.releaseNonNull(), WTFMove(result));
    1010     }
    1011 
    1012     if (auto firstNumber = consumeNumber(range, ValueRangeAll)) {
    1013         if (range.atEnd()) {
    1014             auto result = CSSValueList::createSpaceSeparated();
    1015             result->append(firstNumber.releaseNonNull());
    1016             return CSSFontStyleRangeValue::create(keyword.releaseNonNull(), WTFMove(result));
    1017         }
    1018         auto secondNumber = consumeNumber(range, ValueRangeAll);
    1019         if (!secondNumber)
    1020             return nullptr;
    1021         if (firstNumber->floatValue() > secondNumber->floatValue())
    1022             return nullptr;
    1023         auto result = CSSValueList::createSpaceSeparated();
    1024         result->append(CSSValuePool::singleton().createValue(firstNumber->value<double>(), CSSPrimitiveValue::CSS_DEG));
    1025         result->append(CSSValuePool::singleton().createValue(secondNumber->value<double>(), CSSPrimitiveValue::CSS_DEG));
    1026984        return CSSFontStyleRangeValue::create(keyword.releaseNonNull(), WTFMove(result));
    1027985    }
Note: See TracChangeset for help on using the changeset viewer.