Changeset 214507 in webkit
- Timestamp:
- Mar 28, 2017 4:53:28 PM (7 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r214506 r214507 1 2017-03-28 Myles C. Maxfield <mmaxfield@apple.com> 2 3 Ranges for variation font properties are not enforced 4 https://bugs.webkit.org/show_bug.cgi?id=169979 5 6 Reviewed by David Hyatt. 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-style-parse-expected.txt: 13 * fast/text/font-style-parse.html: 14 * fast/text/variations/font-loading-api-parse-ranges-expected.txt: 15 * fast/text/variations/font-loading-api-parse-ranges.html: 16 * fast/text/variations/out-of-bounds-selection-properties-expected.txt: Added. 17 * fast/text/variations/out-of-bounds-selection-properties.html: Added. 18 * platform/mac-elcapitan/fast/text/font-selection-font-face-parse-expected.txt: 19 1 20 2017-03-28 Andy Estes <aestes@apple.com> 2 21 -
trunk/LayoutTests/fast/text/font-selection-font-face-parse-expected.txt
r214419 r214507 26 26 PASS weightTestSheet.cssRules[25].style.fontWeight is "" 27 27 PASS weightTestSheet.cssRules[26].style.fontWeight is "1 2" 28 PASS weightTestSheet.cssRules[27].style.fontWeight is " -2 -1"28 PASS weightTestSheet.cssRules[27].style.fontWeight is "" 29 29 PASS weightTestSheet.cssRules[28].style.fontWeight is "" 30 30 PASS weightTestSheet.cssRules[29].style.fontWeight is "7 8" … … 64 64 PASS stretchTestSheet.cssRules[32].style.fontStretch is "" 65 65 PASS stretchTestSheet.cssRules[33].style.fontStretch is "1% 2%" 66 PASS stretchTestSheet.cssRules[34].style.fontStretch is " -2% -1%"66 PASS stretchTestSheet.cssRules[34].style.fontStretch is "" 67 67 PASS stretchTestSheet.cssRules[35].style.fontStretch is "" 68 68 PASS stretchTestSheet.cssRules[36].style.fontStretch is "" … … 73 73 PASS stretchTestSheet.cssRules[41].style.fontStretch is "2% calc(7%)" 74 74 PASS styleTestSheet.cssRules[0].style.fontStyle is "oblique 1deg" 75 PASS styleTestSheet.cssRules[1].style.fontStyle is "oblique 20 0grad"76 PASS styleTestSheet.cssRules[2].style.fontStyle is "oblique 6.28318rad"77 PASS styleTestSheet.cssRules[3].style.fontStyle is "oblique 4turn"75 PASS styleTestSheet.cssRules[1].style.fontStyle is "oblique 20grad" 76 PASS styleTestSheet.cssRules[2].style.fontStyle is "oblique 0.28318rad" 77 PASS styleTestSheet.cssRules[3].style.fontStyle is "oblique 0.04turn" 78 78 PASS styleTestSheet.cssRules[4].style.fontStyle is "" 79 79 PASS styleTestSheet.cssRules[5].style.fontStyle is "" … … 84 84 PASS styleTestSheet.cssRules[10].style.fontStyle is "" 85 85 PASS styleTestSheet.cssRules[11].style.fontStyle is "" 86 PASS styleTestSheet.cssRules[12].style.fontStyle is "oblique calc(1 441deg)"86 PASS styleTestSheet.cssRules[12].style.fontStyle is "oblique calc(15.4deg)" 87 87 PASS styleTestSheet.cssRules[13].style.fontStyle is "" 88 88 PASS styleTestSheet.cssRules[14].style.fontStyle is "" … … 96 96 PASS styleTestSheet.cssRules[22].style.fontStyle is "" 97 97 PASS styleTestSheet.cssRules[23].style.fontStyle is "" 98 PASS styleTestSheet.cssRules[24].style.fontStyle is "oblique 10 0deg 200deg"99 PASS styleTestSheet.cssRules[25].style.fontStyle is "oblique 10 0deg 200deg"98 PASS styleTestSheet.cssRules[24].style.fontStyle is "oblique 10deg 20deg" 99 PASS styleTestSheet.cssRules[25].style.fontStyle is "oblique 10deg 20deg" 100 100 PASS styleTestSheet.cssRules[26].style.fontStyle is "" 101 101 PASS styleTestSheet.cssRules[27].style.fontStyle is "" … … 109 109 PASS styleTestSheet.cssRules[35].style.fontStyle is "" 110 110 PASS styleTestSheet.cssRules[36].style.fontStyle is "" 111 PASS styleTestSheet.cssRules[37].style.fontStyle is "oblique 2deg 1turn"111 PASS styleTestSheet.cssRules[37].style.fontStyle is "oblique 2deg 4grad" 112 112 PASS styleTestSheet.cssRules[38].style.fontStyle is "" 113 113 PASS styleTestSheet.cssRules[39].style.fontStyle is "" -
trunk/LayoutTests/fast/text/font-selection-font-face-parse.html
r214419 r214507 232 232 } 233 233 @font-face { 234 font-style: oblique 20 0grad;235 } 236 @font-face { 237 font-style: oblique 6.28318rad;238 } 239 @font-face { 240 font-style: oblique 4turn;234 font-style: oblique 20grad; 235 } 236 @font-face { 237 font-style: oblique 0.28318rad; 238 } 239 @font-face { 240 font-style: oblique 0.04turn; 241 241 } 242 242 @font-face { … … 265 265 } 266 266 @font-face { 267 font-style: oblique calc( 4turn + 1deg);268 } 269 @font-face { 270 font-style: oblique 10 0 200;271 } 272 @font-face { 273 font-style: oblique 10 0 200;274 } 275 @font-face { 276 font-style: oblique a 10 0 200;277 } 278 @font-face { 279 font-style: oblique 10 0 200 a;280 } 281 @font-face { 282 font-style: oblique 10 0 a 200;283 } 284 @font-face { 285 font-style: oblique 10 0 a200;286 } 287 @font-face { 288 font-style: oblique 10 0a 200;289 } 290 @font-face { 291 font-style: oblique 10 0 a200;267 font-style: oblique calc(0.04turn + 1deg); 268 } 269 @font-face { 270 font-style: oblique 10 20; 271 } 272 @font-face { 273 font-style: oblique 10 20; 274 } 275 @font-face { 276 font-style: oblique a 10 20; 277 } 278 @font-face { 279 font-style: oblique 10 20 a; 280 } 281 @font-face { 282 font-style: oblique 10 a 20; 283 } 284 @font-face { 285 font-style: oblique 10 a20; 286 } 287 @font-face { 288 font-style: oblique 10a 20; 289 } 290 @font-face { 291 font-style: oblique 10 a20; 292 292 } 293 293 @font-face { … … 301 301 } 302 302 @font-face { 303 font-style: oblique 10 0deg 200deg;304 } 305 @font-face { 306 font-style: oblique 10 0deg 200deg;307 } 308 @font-face { 309 font-style: oblique a 10 0deg 200deg;310 } 311 @font-face { 312 font-style: oblique 10 0deg 200deg a;313 } 314 @font-face { 315 font-style: oblique 10 0deg a 200deg;316 } 317 @font-face { 318 font-style: oblique 10 0deg a200deg;319 } 320 @font-face { 321 font-style: oblique 10 0dega 200deg;322 } 323 @font-face { 324 font-style: oblique 10 0deg a200deg;303 font-style: oblique 10deg 20deg; 304 } 305 @font-face { 306 font-style: oblique 10deg 20deg; 307 } 308 @font-face { 309 font-style: oblique a 10deg 20deg; 310 } 311 @font-face { 312 font-style: oblique 10deg 20deg a; 313 } 314 @font-face { 315 font-style: oblique 10deg a 20deg; 316 } 317 @font-face { 318 font-style: oblique 10deg a20deg; 319 } 320 @font-face { 321 font-style: oblique 10dega 20deg; 322 } 323 @font-face { 324 font-style: oblique 10deg a20deg; 325 325 } 326 326 @font-face { … … 340 340 } 341 341 @font-face { 342 font-style: oblique 2deg 1turn;342 font-style: oblique 2deg 4grad; 343 343 } 344 344 @font-face { … … 386 386 shouldBeEqualToString("weightTestSheet.cssRules[25].style.fontWeight", ""); 387 387 shouldBeEqualToString("weightTestSheet.cssRules[26].style.fontWeight", "1 2"); 388 shouldBeEqualToString("weightTestSheet.cssRules[27].style.fontWeight", " -2 -1");388 shouldBeEqualToString("weightTestSheet.cssRules[27].style.fontWeight", ""); 389 389 shouldBeEqualToString("weightTestSheet.cssRules[28].style.fontWeight", ""); 390 390 shouldBeEqualToString("weightTestSheet.cssRules[29].style.fontWeight", "7 8"); … … 426 426 shouldBeEqualToString("stretchTestSheet.cssRules[32].style.fontStretch", ""); 427 427 shouldBeEqualToString("stretchTestSheet.cssRules[33].style.fontStretch", "1% 2%"); 428 shouldBeEqualToString("stretchTestSheet.cssRules[34].style.fontStretch", " -2% -1%");428 shouldBeEqualToString("stretchTestSheet.cssRules[34].style.fontStretch", ""); 429 429 shouldBeEqualToString("stretchTestSheet.cssRules[35].style.fontStretch", ""); 430 430 shouldBeEqualToString("stretchTestSheet.cssRules[36].style.fontStretch", ""); … … 437 437 var styleTestSheet = document.getElementById("styleTest").sheet; 438 438 shouldBeEqualToString("styleTestSheet.cssRules[0].style.fontStyle", "oblique 1deg"); 439 shouldBeEqualToString("styleTestSheet.cssRules[1].style.fontStyle", "oblique 20 0grad");440 shouldBeEqualToString("styleTestSheet.cssRules[2].style.fontStyle", "oblique 6.28318rad");441 shouldBeEqualToString("styleTestSheet.cssRules[3].style.fontStyle", "oblique 4turn");439 shouldBeEqualToString("styleTestSheet.cssRules[1].style.fontStyle", "oblique 20grad"); 440 shouldBeEqualToString("styleTestSheet.cssRules[2].style.fontStyle", "oblique 0.28318rad"); 441 shouldBeEqualToString("styleTestSheet.cssRules[3].style.fontStyle", "oblique 0.04turn"); 442 442 shouldBeEqualToString("styleTestSheet.cssRules[4].style.fontStyle", ""); 443 443 shouldBeEqualToString("styleTestSheet.cssRules[5].style.fontStyle", ""); … … 448 448 shouldBeEqualToString("styleTestSheet.cssRules[10].style.fontStyle", ""); 449 449 shouldBeEqualToString("styleTestSheet.cssRules[11].style.fontStyle", ""); 450 shouldBeEqualToString("styleTestSheet.cssRules[12].style.fontStyle", "oblique calc(1 441deg)");450 shouldBeEqualToString("styleTestSheet.cssRules[12].style.fontStyle", "oblique calc(15.4deg)"); 451 451 452 452 shouldBeEqualToString("styleTestSheet.cssRules[13].style.fontStyle", ""); … … 461 461 shouldBeEqualToString("styleTestSheet.cssRules[22].style.fontStyle", ""); 462 462 shouldBeEqualToString("styleTestSheet.cssRules[23].style.fontStyle", ""); 463 shouldBeEqualToString("styleTestSheet.cssRules[24].style.fontStyle", "oblique 10 0deg 200deg");464 shouldBeEqualToString("styleTestSheet.cssRules[25].style.fontStyle", "oblique 10 0deg 200deg");463 shouldBeEqualToString("styleTestSheet.cssRules[24].style.fontStyle", "oblique 10deg 20deg"); 464 shouldBeEqualToString("styleTestSheet.cssRules[25].style.fontStyle", "oblique 10deg 20deg"); 465 465 shouldBeEqualToString("styleTestSheet.cssRules[26].style.fontStyle", ""); 466 466 shouldBeEqualToString("styleTestSheet.cssRules[27].style.fontStyle", ""); … … 474 474 shouldBeEqualToString("styleTestSheet.cssRules[35].style.fontStyle", ""); 475 475 shouldBeEqualToString("styleTestSheet.cssRules[36].style.fontStyle", ""); 476 shouldBeEqualToString("styleTestSheet.cssRules[37].style.fontStyle", "oblique 2deg 1turn");476 shouldBeEqualToString("styleTestSheet.cssRules[37].style.fontStyle", "oblique 2deg 4grad"); 477 477 shouldBeEqualToString("styleTestSheet.cssRules[38].style.fontStyle", ""); 478 478 shouldBeEqualToString("styleTestSheet.cssRules[39].style.fontStyle", ""); -
trunk/LayoutTests/fast/text/font-selection-font-loading-api-parse-expected.txt
r214419 r214507 32 32 PASS setFontFaceStretch(fontFace, 'calc(3% + 4%)') is "7%" 33 33 PASS setFontFaceStyle(fontFace, 'oblique 1deg') is "oblique 1deg" 34 PASS setFontFaceStyle(fontFace, 'oblique 20 0grad') is "oblique 180deg"35 PASS setFontFaceStyle(fontFace, 'oblique 6.28318rad') is "oblique 359.75deg"36 PASS setFontFaceStyle(fontFace, 'oblique 4turn') is "oblique 1440deg"34 PASS setFontFaceStyle(fontFace, 'oblique 20grad') is "oblique 18deg" 35 PASS setFontFaceStyle(fontFace, 'oblique 0.28318rad') is "oblique 16deg" 36 PASS setFontFaceStyle(fontFace, 'oblique 0.04turn') is "oblique 14.25deg" 37 37 PASS setFontFaceStyle(fontFace, 'oblique 5') threw exception SyntaxError (DOM Exception 12): The string did not match the expected pattern.. 38 38 PASS setFontFaceStyle(fontFace, 'oblique 20') threw exception SyntaxError (DOM Exception 12): The string did not match the expected pattern.. … … 43 43 PASS setFontFaceStyle(fontFace, 'initial') threw exception SyntaxError (DOM Exception 12): The string did not match the expected pattern.. 44 44 PASS setFontFaceStyle(fontFace, 'oblique calc(3 + 4)') threw exception SyntaxError (DOM Exception 12): The string did not match the expected pattern.. 45 PASS setFontFaceStyle(fontFace, 'oblique calc( 4turn + 1deg)') is "oblique 1441deg"45 PASS setFontFaceStyle(fontFace, 'oblique calc(0.04turn + 1deg)') is "oblique 15.25deg" 46 46 PASS successfullyParsed is true 47 47 -
trunk/LayoutTests/fast/text/font-selection-font-loading-api-parse.html
r214419 r214507 57 57 58 58 shouldBeEqualToString("setFontFaceStyle(fontFace, 'oblique 1deg')", "oblique 1deg"); 59 shouldBeEqualToString("setFontFaceStyle(fontFace, 'oblique 20 0grad')", "oblique 180deg");60 shouldBeEqualToString("setFontFaceStyle(fontFace, 'oblique 6.28318rad')", "oblique 359.75deg");61 shouldBeEqualToString("setFontFaceStyle(fontFace, 'oblique 4turn')", "oblique 1440deg");59 shouldBeEqualToString("setFontFaceStyle(fontFace, 'oblique 20grad')", "oblique 18deg"); 60 shouldBeEqualToString("setFontFaceStyle(fontFace, 'oblique 0.28318rad')", "oblique 16deg"); 61 shouldBeEqualToString("setFontFaceStyle(fontFace, 'oblique 0.04turn')", "oblique 14.25deg"); 62 62 shouldThrow("setFontFaceStyle(fontFace, 'oblique 5')"); 63 63 shouldThrow("setFontFaceStyle(fontFace, 'oblique 20')"); … … 68 68 shouldThrow("setFontFaceStyle(fontFace, 'initial')"); 69 69 shouldThrow("setFontFaceStyle(fontFace, 'oblique calc(3 + 4)')"); 70 shouldBeEqualToString("setFontFaceStyle(fontFace, 'oblique calc( 4turn + 1deg)')", "oblique 1441deg");70 shouldBeEqualToString("setFontFaceStyle(fontFace, 'oblique calc(0.04turn + 1deg)')", "oblique 15.25deg"); 71 71 </script> 72 72 <script src="../../resources/js-test-post.js"></script> -
trunk/LayoutTests/fast/text/font-style-parse-expected.txt
r214419 r214507 1 1 PASS window.getComputedStyle(document.getElementById('test1')).fontStyle is "normal" 2 2 PASS window.getComputedStyle(document.getElementById('test2')).fontStyle is "oblique 1deg" 3 PASS window.getComputedStyle(document.getElementById('test3')).fontStyle is "oblique 18 0deg"4 PASS window.getComputedStyle(document.getElementById('test4')).fontStyle is "oblique 359.75deg"5 PASS window.getComputedStyle(document.getElementById('test5')).fontStyle is "oblique 14 40deg"3 PASS window.getComputedStyle(document.getElementById('test3')).fontStyle is "oblique 18deg" 4 PASS window.getComputedStyle(document.getElementById('test4')).fontStyle is "oblique 16deg" 5 PASS window.getComputedStyle(document.getElementById('test5')).fontStyle is "oblique 14.25deg" 6 6 PASS window.getComputedStyle(document.getElementById('test6')).fontStyle is "normal" 7 7 PASS window.getComputedStyle(document.getElementById('test7')).fontStyle is "normal" … … 12 12 PASS window.getComputedStyle(document.getElementById('test12')).fontStyle is "normal" 13 13 PASS window.getComputedStyle(document.getElementById('test13')).fontStyle is "normal" 14 PASS window.getComputedStyle(document.getElementById('test14')).fontStyle is "oblique 1 441deg"14 PASS window.getComputedStyle(document.getElementById('test14')).fontStyle is "oblique 15.25deg" 15 15 PASS window.getComputedStyle(document.getElementById('test15')).fontStyle is "italic" 16 16 PASS window.getComputedStyle(document.getElementById('test16')).fontStyle is "italic" -
trunk/LayoutTests/fast/text/font-style-parse.html
r214419 r214507 8 8 <div id="test1"></div> 9 9 <div id="test2" style="font-style: oblique 1deg;"></div> 10 <div id="test3" style="font-style: oblique 20 0grad;"></div>11 <div id="test4" style="font-style: oblique 6.28318rad;"></div>12 <div id="test5" style="font-style: oblique 4turn;"></div>10 <div id="test3" style="font-style: oblique 20grad;"></div> 11 <div id="test4" style="font-style: oblique 0.28318rad;"></div> 12 <div id="test5" style="font-style: oblique 0.04turn;"></div> 13 13 <div id="test6" style="font-style: oblique 5;"></div> 14 14 <div id="test7" style="font-style: oblique 20;"></div> … … 19 19 <div id="test12" style="font-style: initial;"></div> 20 20 <div id="test13" style="font-style: oblique calc(3 + 4);"></div> 21 <div id="test14" style="font-style: oblique calc( 4turn + 1deg);"></div>21 <div id="test14" style="font-style: oblique calc(0.04turn + 1deg);"></div> 22 22 <div id="test15" style="font: 100 italic 48px/49px 'Helvetica Neue';"></div> 23 23 <div id="test16" style="font: italic 100 48px/49px 'Helvetica Neue';"></div> … … 31 31 shouldBeEqualToString("window.getComputedStyle(document.getElementById('test1')).fontStyle", "normal"); 32 32 shouldBeEqualToString("window.getComputedStyle(document.getElementById('test2')).fontStyle", "oblique 1deg"); 33 shouldBeEqualToString("window.getComputedStyle(document.getElementById('test3')).fontStyle", "oblique 18 0deg");34 shouldBeEqualToString("window.getComputedStyle(document.getElementById('test4')).fontStyle", "oblique 359.75deg");35 shouldBeEqualToString("window.getComputedStyle(document.getElementById('test5')).fontStyle", "oblique 14 40deg");33 shouldBeEqualToString("window.getComputedStyle(document.getElementById('test3')).fontStyle", "oblique 18deg"); 34 shouldBeEqualToString("window.getComputedStyle(document.getElementById('test4')).fontStyle", "oblique 16deg"); 35 shouldBeEqualToString("window.getComputedStyle(document.getElementById('test5')).fontStyle", "oblique 14.25deg"); 36 36 shouldBeEqualToString("window.getComputedStyle(document.getElementById('test6')).fontStyle", "normal"); 37 37 shouldBeEqualToString("window.getComputedStyle(document.getElementById('test7')).fontStyle", "normal"); … … 42 42 shouldBeEqualToString("window.getComputedStyle(document.getElementById('test12')).fontStyle", "normal"); 43 43 shouldBeEqualToString("window.getComputedStyle(document.getElementById('test13')).fontStyle", "normal"); 44 shouldBeEqualToString("window.getComputedStyle(document.getElementById('test14')).fontStyle", "oblique 1 441deg");44 shouldBeEqualToString("window.getComputedStyle(document.getElementById('test14')).fontStyle", "oblique 15.25deg"); 45 45 shouldBeEqualToString("window.getComputedStyle(document.getElementById('test15')).fontStyle", "italic"); 46 46 shouldBeEqualToString("window.getComputedStyle(document.getElementById('test16')).fontStyle", "italic"); -
trunk/LayoutTests/fast/text/variations/font-loading-api-parse-ranges-expected.txt
r214433 r214507 8 8 PASS (new FontFace('asdf', 'url(notreal)', { weight: '50 150' })).weight is "50 150" 9 9 PASS (new FontFace('asdf', 'url(notreal)', { weight: '2 3' })).weight is "2 3" 10 PASS (new FontFace('asdf', 'url(notreal)', { weight: '-3 -2' })).weight is "-3 -2"10 PASS (new FontFace('asdf', 'url(notreal)', { weight: '-3 -2' })).weight threw exception SyntaxError (DOM Exception 12): The string did not match the expected pattern.. 11 11 PASS (new FontFace('asdf', 'url(notreal)', { weight: '5 4' })).weight threw exception SyntaxError (DOM Exception 12): The string did not match the expected pattern.. 12 12 PASS (new FontFace('asdf', 'url(notreal)', { weight: '100 200 3' })).weight threw exception SyntaxError (DOM Exception 12): The string did not match the expected pattern.. 13 13 PASS (new FontFace('asdf', 'url(notreal)', { weight: '100 200 a' })).weight threw exception SyntaxError (DOM Exception 12): The string did not match the expected pattern.. 14 PASS (new FontFace('asdf', 'url(notreal)', { weight: '-3' })).weight is "-3"14 PASS (new FontFace('asdf', 'url(notreal)', { weight: '-3' })).weight threw exception SyntaxError (DOM Exception 12): The string did not match the expected pattern.. 15 15 PASS (new FontFace('asdf', 'url(notreal)', { stretch: 'semi-expanded expanded' })).stretch threw exception SyntaxError (DOM Exception 12): The string did not match the expected pattern.. 16 16 PASS (new FontFace('asdf', 'url(notreal)', { stretch: '100% 200%' })).stretch is "100% 200%" … … 23 23 PASS (new FontFace('asdf', 'url(notreal)', { stretch: '50% 60%' })).stretch is "50% 60%" 24 24 PASS (new FontFace('asdf', 'url(notreal)', { stretch: '2% 3%' })).stretch is "2% 3%" 25 PASS (new FontFace('asdf', 'url(notreal)', { stretch: '-3% -2%' })).stretch is "-3% -2%"25 PASS (new FontFace('asdf', 'url(notreal)', { stretch: '-3% -2%' })).stretch threw exception SyntaxError (DOM Exception 12): The string did not match the expected pattern.. 26 26 PASS (new FontFace('asdf', 'url(notreal)', { stretch: '5% 4%' })).stretch threw exception SyntaxError (DOM Exception 12): The string did not match the expected pattern.. 27 27 PASS (new FontFace('asdf', 'url(notreal)', { stretch: '100% 200% 3%' })).stretch threw exception SyntaxError (DOM Exception 12): The string did not match the expected pattern.. 28 28 PASS (new FontFace('asdf', 'url(notreal)', { stretch: '100% 200% a' })).stretch threw exception SyntaxError (DOM Exception 12): The string did not match the expected pattern.. 29 PASS (new FontFace('asdf', 'url(notreal)', { stretch: '-3%' })).stretch is "-3%"29 PASS (new FontFace('asdf', 'url(notreal)', { stretch: '-3%' })).stretch threw exception SyntaxError (DOM Exception 12): The string did not match the expected pattern.. 30 30 PASS (new FontFace('asdf', 'url(notreal)', { style: 'oblique 10deg 20deg' })).style is "oblique 10deg 20deg" 31 31 PASS (new FontFace('asdf', 'url(notreal)', { style: 'oblique a10deg 20deg' })).style threw exception SyntaxError (DOM Exception 12): The string did not match the expected pattern.. -
trunk/LayoutTests/fast/text/variations/font-loading-api-parse-ranges.html
r214433 r214507 15 15 shouldBeEqualToString("(new FontFace('asdf', 'url(notreal)', { weight: '50 150' })).weight", "50 150"); 16 16 shouldBeEqualToString("(new FontFace('asdf', 'url(notreal)', { weight: '2 3' })).weight", "2 3"); 17 should BeEqualToString("(new FontFace('asdf', 'url(notreal)', { weight: '-3 -2' })).weight", "-3 -2");17 shouldThrow("(new FontFace('asdf', 'url(notreal)', { weight: '-3 -2' })).weight"); 18 18 shouldThrow("(new FontFace('asdf', 'url(notreal)', { weight: '5 4' })).weight"); 19 19 shouldThrow("(new FontFace('asdf', 'url(notreal)', { weight: '100 200 3' })).weight"); 20 20 shouldThrow("(new FontFace('asdf', 'url(notreal)', { weight: '100 200 a' })).weight"); 21 should BeEqualToString("(new FontFace('asdf', 'url(notreal)', { weight: '-3' })).weight", "-3");21 shouldThrow("(new FontFace('asdf', 'url(notreal)', { weight: '-3' })).weight"); 22 22 23 23 shouldThrow("(new FontFace('asdf', 'url(notreal)', { stretch: 'semi-expanded expanded' })).stretch"); … … 31 31 shouldBeEqualToString("(new FontFace('asdf', 'url(notreal)', { stretch: '50% 60%' })).stretch", "50% 60%"); 32 32 shouldBeEqualToString("(new FontFace('asdf', 'url(notreal)', { stretch: '2% 3%' })).stretch", "2% 3%"); 33 should BeEqualToString("(new FontFace('asdf', 'url(notreal)', { stretch: '-3% -2%' })).stretch", "-3% -2%");33 shouldThrow("(new FontFace('asdf', 'url(notreal)', { stretch: '-3% -2%' })).stretch"); 34 34 shouldThrow("(new FontFace('asdf', 'url(notreal)', { stretch: '5% 4%' })).stretch"); 35 35 shouldThrow("(new FontFace('asdf', 'url(notreal)', { stretch: '100% 200% 3%' })).stretch"); 36 36 shouldThrow("(new FontFace('asdf', 'url(notreal)', { stretch: '100% 200% a' })).stretch"); 37 should BeEqualToString("(new FontFace('asdf', 'url(notreal)', { stretch: '-3%' })).stretch", "-3%");37 shouldThrow("(new FontFace('asdf', 'url(notreal)', { stretch: '-3%' })).stretch"); 38 38 39 39 shouldBeEqualToString("(new FontFace('asdf', 'url(notreal)', { style: 'oblique 10deg 20deg' })).style", "oblique 10deg 20deg"); -
trunk/LayoutTests/platform/mac-elcapitan/fast/text/font-selection-font-face-parse-expected.txt
r214419 r214507 26 26 PASS weightTestSheet.cssRules[25].style.fontWeight is "" 27 27 FAIL weightTestSheet.cssRules[26].style.fontWeight should be 1 2. Was . 28 FAIL weightTestSheet.cssRules[27].style.fontWeight should be -2 -1. Was . 28 PASS weightTestSheet.cssRules[27].style.fontWeight is "" 29 29 PASS weightTestSheet.cssRules[28].style.fontWeight is "" 30 30 FAIL weightTestSheet.cssRules[29].style.fontWeight should be 7 8. Was . … … 64 64 PASS stretchTestSheet.cssRules[32].style.fontStretch is "" 65 65 FAIL stretchTestSheet.cssRules[33].style.fontStretch should be 1% 2%. Was . 66 FAIL stretchTestSheet.cssRules[34].style.fontStretch should be -2% -1%. Was . 66 PASS stretchTestSheet.cssRules[34].style.fontStretch is "" 67 67 PASS stretchTestSheet.cssRules[35].style.fontStretch is "" 68 68 PASS stretchTestSheet.cssRules[36].style.fontStretch is "" … … 73 73 FAIL stretchTestSheet.cssRules[41].style.fontStretch should be 2% calc(7%). Was . 74 74 PASS styleTestSheet.cssRules[0].style.fontStyle is "oblique 1deg" 75 PASS styleTestSheet.cssRules[1].style.fontStyle is "oblique 20 0grad"76 PASS styleTestSheet.cssRules[2].style.fontStyle is "oblique 6.28318rad"77 PASS styleTestSheet.cssRules[3].style.fontStyle is "oblique 4turn"75 PASS styleTestSheet.cssRules[1].style.fontStyle is "oblique 20grad" 76 PASS styleTestSheet.cssRules[2].style.fontStyle is "oblique 0.28318rad" 77 PASS styleTestSheet.cssRules[3].style.fontStyle is "oblique 0.04turn" 78 78 PASS styleTestSheet.cssRules[4].style.fontStyle is "" 79 79 PASS styleTestSheet.cssRules[5].style.fontStyle is "" … … 84 84 PASS styleTestSheet.cssRules[10].style.fontStyle is "" 85 85 PASS styleTestSheet.cssRules[11].style.fontStyle is "" 86 PASS styleTestSheet.cssRules[12].style.fontStyle is "oblique calc(1 441deg)"86 PASS styleTestSheet.cssRules[12].style.fontStyle is "oblique calc(15.4deg)" 87 87 PASS styleTestSheet.cssRules[13].style.fontStyle is "" 88 88 PASS styleTestSheet.cssRules[14].style.fontStyle is "" … … 96 96 PASS styleTestSheet.cssRules[22].style.fontStyle is "" 97 97 PASS styleTestSheet.cssRules[23].style.fontStyle is "" 98 FAIL styleTestSheet.cssRules[24].style.fontStyle should be oblique 10 0deg 200deg. Was .99 FAIL styleTestSheet.cssRules[25].style.fontStyle should be oblique 10 0deg 200deg. Was .98 FAIL styleTestSheet.cssRules[24].style.fontStyle should be oblique 10deg 20deg. Was . 99 FAIL styleTestSheet.cssRules[25].style.fontStyle should be oblique 10deg 20deg. Was . 100 100 PASS styleTestSheet.cssRules[26].style.fontStyle is "" 101 101 PASS styleTestSheet.cssRules[27].style.fontStyle is "" … … 109 109 PASS styleTestSheet.cssRules[35].style.fontStyle is "" 110 110 PASS styleTestSheet.cssRules[36].style.fontStyle is "" 111 FAIL styleTestSheet.cssRules[37].style.fontStyle should be oblique 2deg 1turn. Was .111 FAIL styleTestSheet.cssRules[37].style.fontStyle should be oblique 2deg 4grad. Was . 112 112 PASS styleTestSheet.cssRules[38].style.fontStyle is "" 113 113 PASS styleTestSheet.cssRules[39].style.fontStyle is "" -
trunk/Source/WebCore/ChangeLog
r214506 r214507 1 2017-03-28 Myles C. Maxfield <mmaxfield@apple.com> 2 3 Ranges for variation font properties are not enforced 4 https://bugs.webkit.org/show_bug.cgi?id=169979 5 6 Reviewed by David Hyatt. 7 8 The spec specifies that: 9 - Font weights less than or equal to 0, or greater than or equal to 1000 are parse errors 10 - Font stretch values less than or equal to 0% are parse errors 11 - Font style values less than or equal to -90deg or greater than or equal to 90deg are parse errors 12 13 Test: fast/text/variations/out-of-bounds-selection-properties.html 14 15 * css/parser/CSSPropertyParser.cpp: 16 (WebCore::consumeFontWeightRange): 17 (WebCore::fontStretchIsWithinRange): 18 (WebCore::consumeFontStretch): 19 (WebCore::consumeFontStretchRange): 20 (WebCore::fontStyleIsWithinRange): 21 (WebCore::consumeFontStyle): 22 (WebCore::consumeFontStyleRange): 23 1 24 2017-03-28 Andy Estes <aestes@apple.com> 2 25 -
trunk/Source/WebCore/css/parser/CSSPropertyParser.cpp
r214419 r214507 884 884 if (auto result = consumeFontWeightKeywordValue(range)) 885 885 return result; 886 auto firstNumber = consume Number(range, ValueRangeAll);886 auto firstNumber = consumeFontWeightNumber(range); 887 887 if (!firstNumber) 888 888 return nullptr; 889 889 if (range.atEnd()) 890 890 return firstNumber; 891 auto secondNumber = consumeNumber(range, ValueRangeAll); 892 if (!secondNumber) 893 return nullptr; 894 if (firstNumber->floatValue() > secondNumber->floatValue()) 891 auto secondNumber = consumeFontWeightNumber(range); 892 if (!secondNumber || firstNumber->floatValue() > secondNumber->floatValue()) 895 893 return nullptr; 896 894 auto result = CSSValueList::createSpaceSeparated(); … … 906 904 } 907 905 906 static bool fontStretchIsWithinRange(float stretch) 907 { 908 return stretch > 0; 909 } 910 908 911 static RefPtr<CSSPrimitiveValue> consumeFontStretch(CSSParserTokenRange& range) 909 912 { 910 913 if (auto result = consumeFontStretchKeywordValue(range)) 911 914 return result; 912 return consumePercent(range, ValueRangeAll); 915 if (auto percent = consumePercent(range, ValueRangeNonNegative)) 916 return fontStretchIsWithinRange(percent->value<float>()) ? percent : nullptr; 917 return nullptr; 913 918 } 914 919 … … 918 923 if (auto result = consumeFontStretchKeywordValue(range)) 919 924 return result; 920 auto firstPercent = consumePercent(range, ValueRange All);921 if (!firstPercent )925 auto firstPercent = consumePercent(range, ValueRangeNonNegative); 926 if (!firstPercent || !fontStretchIsWithinRange(firstPercent->value<float>())) 922 927 return nullptr; 923 928 if (range.atEnd()) 924 929 return firstPercent; 925 auto secondPercent = consumePercent(range, ValueRangeAll); 926 if (!secondPercent) 927 return nullptr; 928 if (firstPercent->floatValue() > secondPercent->floatValue()) 930 auto secondPercent = consumePercent(range, ValueRangeNonNegative); 931 if (!secondPercent || !fontStretchIsWithinRange(secondPercent->value<float>()) || firstPercent->floatValue() > secondPercent->floatValue()) 929 932 return nullptr; 930 933 auto result = CSSValueList::createSpaceSeparated(); … … 938 941 { 939 942 return consumeIdent<CSSValueNormal, CSSValueItalic, CSSValueOblique>(range); 943 } 944 945 static bool fontStyleIsWithinRange(float oblique) 946 { 947 return oblique > -90 && oblique < 90; 940 948 } 941 949 … … 953 961 if (range.atEnd()) 954 962 return CSSFontStyleValue::create(CSSValuePool::singleton().createIdentifierValue(CSSValueOblique)); 955 if (auto angle = consumeAngle(range, cssParserMode)) 956 return CSSFontStyleValue::create(CSSValuePool::singleton().createIdentifierValue(CSSValueOblique), WTFMove(angle)); 963 if (auto angle = consumeAngle(range, cssParserMode)) { 964 if (fontStyleIsWithinRange(angle->value<float>(CSSPrimitiveValue::CSS_DEG))) 965 return CSSFontStyleValue::create(CSSValuePool::singleton().createIdentifierValue(CSSValueOblique), WTFMove(angle)); 966 return nullptr; 967 } 957 968 return CSSFontStyleValue::create(CSSValuePool::singleton().createIdentifierValue(CSSValueOblique)); 958 969 } … … 969 980 970 981 if (auto firstAngle = consumeAngle(range, cssParserMode)) { 982 if (!fontStyleIsWithinRange(firstAngle->value<float>(CSSPrimitiveValue::CSS_DEG))) 983 return nullptr; 971 984 if (range.atEnd()) { 972 985 auto result = CSSValueList::createSpaceSeparated(); … … 975 988 } 976 989 auto secondAngle = consumeAngle(range, cssParserMode); 977 if (!secondAngle) 978 return nullptr; 979 if (firstAngle->floatValue(CSSPrimitiveValue::CSS_DEG) > secondAngle->floatValue(CSSPrimitiveValue::CSS_DEG)) 990 if (!secondAngle || !fontStyleIsWithinRange(secondAngle->value<float>(CSSPrimitiveValue::CSS_DEG)) || firstAngle->floatValue(CSSPrimitiveValue::CSS_DEG) > secondAngle->floatValue(CSSPrimitiveValue::CSS_DEG)) 980 991 return nullptr; 981 992 auto result = CSSValueList::createSpaceSeparated();
Note: See TracChangeset
for help on using the changeset viewer.