Changeset 214359 in webkit
- Timestamp:
- Mar 24, 2017 11:23:48 AM (7 years ago)
- Location:
- trunk
- Files:
-
- 4 added
- 25 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r214357 r214359 1 2017-03-24 Myles C. Maxfield <mmaxfield@apple.com> 2 3 font-style needs a new CSSValue to make CSSRule.cssText work correctly 4 https://bugs.webkit.org/show_bug.cgi?id=169258 5 6 Reviewed by David Hyatt. 7 8 Update tests' expected results. 9 10 * fast/text/font-selection-font-face-parse-expected.txt: 11 * fast/text/font-selection-font-face-parse.html: 12 * fast/text/font-style-parse-expected.txt: 13 * fast/text/font-style-parse.html: 14 * platform/mac-elcapitan/fast/text/font-selection-font-face-parse-expected.txt: 15 * svg/css/getComputedStyle-basic-expected.txt: 16 1 17 2017-03-24 Youenn Fablet <youenn@apple.com> 2 18 -
trunk/LayoutTests/fast/text/font-selection-font-face-parse-expected.txt
r213528 r214359 70 70 PASS stretchTestSheet.cssRules[38].style.fontStretch is "7 / 8" 71 71 PASS stretchTestSheet.cssRules[39].style.fontStretch is "2 / 7" 72 PASS styleTestSheet.cssRules[0].style.fontStyle is " 1deg"73 PASS styleTestSheet.cssRules[1].style.fontStyle is " 200grad"74 PASS styleTestSheet.cssRules[2].style.fontStyle is " 6.28318rad"75 PASS styleTestSheet.cssRules[3].style.fontStyle is " 4turn"76 PASS styleTestSheet.cssRules[4].style.fontStyle is " 5"77 PASS styleTestSheet.cssRules[5].style.fontStyle is " 20"72 PASS styleTestSheet.cssRules[0].style.fontStyle is "oblique 1deg" 73 PASS styleTestSheet.cssRules[1].style.fontStyle is "oblique 200grad" 74 PASS styleTestSheet.cssRules[2].style.fontStyle is "oblique 6.28318rad" 75 PASS 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" 78 78 PASS styleTestSheet.cssRules[6].style.fontStyle is "italic" 79 79 PASS styleTestSheet.cssRules[7].style.fontStyle is "oblique" … … 81 81 PASS styleTestSheet.cssRules[9].style.fontStyle is "" 82 82 PASS styleTestSheet.cssRules[10].style.fontStyle is "" 83 PASS styleTestSheet.cssRules[11].style.fontStyle is " 7"84 PASS styleTestSheet.cssRules[12].style.fontStyle is " calc(1441deg)"85 PASS styleTestSheet.cssRules[13].style.fontStyle is " 100 / 200"86 PASS styleTestSheet.cssRules[14].style.fontStyle is " 100 / 200"83 PASS styleTestSheet.cssRules[11].style.fontStyle is "oblique 7" 84 PASS 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" 87 87 PASS styleTestSheet.cssRules[15].style.fontStyle is "" 88 88 PASS styleTestSheet.cssRules[16].style.fontStyle is "" … … 91 91 PASS styleTestSheet.cssRules[19].style.fontStyle is "" 92 92 PASS styleTestSheet.cssRules[20].style.fontStyle is "" 93 PASS styleTestSheet.cssRules[21].style.fontStyle is " 1 / 2"94 PASS styleTestSheet.cssRules[22].style.fontStyle is " -2 / -1"93 PASS styleTestSheet.cssRules[21].style.fontStyle is "oblique 1deg 2deg" 94 PASS styleTestSheet.cssRules[22].style.fontStyle is "oblique -2deg -1deg" 95 95 PASS styleTestSheet.cssRules[23].style.fontStyle is "" 96 PASS styleTestSheet.cssRules[24].style.fontStyle is " 100deg /200deg"97 PASS styleTestSheet.cssRules[25].style.fontStyle is " 100deg /200deg"96 PASS styleTestSheet.cssRules[24].style.fontStyle is "oblique 100deg 200deg" 97 PASS styleTestSheet.cssRules[25].style.fontStyle is "oblique 100deg 200deg" 98 98 PASS styleTestSheet.cssRules[26].style.fontStyle is "" 99 99 PASS styleTestSheet.cssRules[27].style.fontStyle is "" … … 102 102 PASS styleTestSheet.cssRules[30].style.fontStyle is "" 103 103 PASS styleTestSheet.cssRules[31].style.fontStyle is "" 104 PASS styleTestSheet.cssRules[32].style.fontStyle is " 1deg /2deg"105 PASS styleTestSheet.cssRules[33].style.fontStyle is " -2deg /-1deg"104 PASS styleTestSheet.cssRules[32].style.fontStyle is "oblique 1deg 2deg" 105 PASS styleTestSheet.cssRules[33].style.fontStyle is "oblique -2deg -1deg" 106 106 PASS styleTestSheet.cssRules[34].style.fontStyle is "" 107 107 PASS styleTestSheet.cssRules[35].style.fontStyle is "" 108 108 PASS styleTestSheet.cssRules[36].style.fontStyle is "" 109 PASS styleTestSheet.cssRules[37].style.fontStyle is " 2deg /1turn"110 PASS styleTestSheet.cssRules[38].style.fontStyle is " 7 / 8"111 PASS styleTestSheet.cssRules[39].style.fontStyle is " 2 / 7"109 PASS 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" 112 112 PASS successfullyParsed is true 113 113 -
trunk/LayoutTests/fast/text/font-selection-font-face-parse.html
r213528 r214359 262 262 } 263 263 @font-face { 264 font-style: oblique 100 /200;265 } 266 @font-face { 267 font-style: oblique 100 /200;268 } 269 @font-face { 270 font-style: oblique a 100 /200;271 } 272 @font-face { 273 font-style: oblique 100 /200 a;274 } 275 @font-face { 276 font-style: oblique 100 a /200;277 } 278 @font-face { 279 font-style: oblique 100 a /200;280 } 281 @font-face { 282 font-style: oblique 100 /a 200;283 } 284 @font-face { 285 font-style: oblique 100 /a200;286 } 287 @font-face { 288 font-style: oblique 1 /2;289 } 290 @font-face { 291 font-style: oblique -2 /-1;292 } 293 @font-face { 294 font-style: oblique 2 /1;295 } 296 @font-face { 297 font-style: oblique 100deg /200deg;298 } 299 @font-face { 300 font-style: oblique 100deg /200deg;301 } 302 @font-face { 303 font-style: oblique a 100deg /200deg;304 } 305 @font-face { 306 font-style: oblique 100deg /200deg a;307 } 308 @font-face { 309 font-style: oblique 100deg a /200deg;310 } 311 @font-face { 312 font-style: oblique 100deg a /200deg;313 } 314 @font-face { 315 font-style: oblique 100deg /a 200deg;316 } 317 @font-face { 318 font-style: oblique 100deg /a200deg;319 } 320 @font-face { 321 font-style: oblique 1deg /2deg;322 } 323 @font-face { 324 font-style: oblique -2deg /-1deg;325 } 326 @font-face { 327 font-style: oblique 2deg /1deg;328 } 329 @font-face { 330 font-style: oblique 1 /2deg;331 } 332 @font-face { 333 font-style: oblique 1deg /2;334 } 335 @font-face { 336 font-style: oblique 2deg /1turn;337 } 338 @font-face { 339 font-style: oblique calc(3 + 4) /8;340 } 341 @font-face { 342 font-style: oblique 2 /calc(3 + 4);264 font-style: oblique 100 200; 265 } 266 @font-face { 267 font-style: oblique 100 200; 268 } 269 @font-face { 270 font-style: oblique a 100 200; 271 } 272 @font-face { 273 font-style: oblique 100 200 a; 274 } 275 @font-face { 276 font-style: oblique 100 a 200; 277 } 278 @font-face { 279 font-style: oblique 100 a200; 280 } 281 @font-face { 282 font-style: oblique 100a 200; 283 } 284 @font-face { 285 font-style: oblique 100 a200; 286 } 287 @font-face { 288 font-style: oblique 1 2; 289 } 290 @font-face { 291 font-style: oblique -2 -1; 292 } 293 @font-face { 294 font-style: oblique 2 1; 295 } 296 @font-face { 297 font-style: oblique 100deg 200deg; 298 } 299 @font-face { 300 font-style: oblique 100deg 200deg; 301 } 302 @font-face { 303 font-style: oblique a 100deg 200deg; 304 } 305 @font-face { 306 font-style: oblique 100deg 200deg a; 307 } 308 @font-face { 309 font-style: oblique 100deg a 200deg; 310 } 311 @font-face { 312 font-style: oblique 100deg a200deg; 313 } 314 @font-face { 315 font-style: oblique 100dega 200deg; 316 } 317 @font-face { 318 font-style: oblique 100deg a200deg; 319 } 320 @font-face { 321 font-style: oblique 1deg 2deg; 322 } 323 @font-face { 324 font-style: oblique -2deg -1deg; 325 } 326 @font-face { 327 font-style: oblique 2deg 1deg; 328 } 329 @font-face { 330 font-style: oblique 1 2deg; 331 } 332 @font-face { 333 font-style: oblique 1deg 2; 334 } 335 @font-face { 336 font-style: oblique 2deg 1turn; 337 } 338 @font-face { 339 font-style: oblique calc(3 + 4) 8; 340 } 341 @font-face { 342 font-style: oblique 2 calc(3 + 4); 343 343 } 344 344 </style> … … 422 422 423 423 var styleTestSheet = document.getElementById("styleTest").sheet; 424 shouldBeEqualToString("styleTestSheet.cssRules[0].style.fontStyle", " 1deg");425 shouldBeEqualToString("styleTestSheet.cssRules[1].style.fontStyle", " 200grad");426 shouldBeEqualToString("styleTestSheet.cssRules[2].style.fontStyle", " 6.28318rad");427 shouldBeEqualToString("styleTestSheet.cssRules[3].style.fontStyle", " 4turn");428 shouldBeEqualToString("styleTestSheet.cssRules[4].style.fontStyle", " 5");429 shouldBeEqualToString("styleTestSheet.cssRules[5].style.fontStyle", " 20");424 shouldBeEqualToString("styleTestSheet.cssRules[0].style.fontStyle", "oblique 1deg"); 425 shouldBeEqualToString("styleTestSheet.cssRules[1].style.fontStyle", "oblique 200grad"); 426 shouldBeEqualToString("styleTestSheet.cssRules[2].style.fontStyle", "oblique 6.28318rad"); 427 shouldBeEqualToString("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"); 430 430 shouldBeEqualToString("styleTestSheet.cssRules[6].style.fontStyle", "italic"); 431 431 shouldBeEqualToString("styleTestSheet.cssRules[7].style.fontStyle", "oblique"); … … 433 433 shouldBeEqualToString("styleTestSheet.cssRules[9].style.fontStyle", ""); 434 434 shouldBeEqualToString("styleTestSheet.cssRules[10].style.fontStyle", ""); 435 shouldBeEqualToString("styleTestSheet.cssRules[11].style.fontStyle", " 7");436 shouldBeEqualToString("styleTestSheet.cssRules[12].style.fontStyle", " calc(1441deg)");435 shouldBeEqualToString("styleTestSheet.cssRules[11].style.fontStyle", "oblique 7"); 436 shouldBeEqualToString("styleTestSheet.cssRules[12].style.fontStyle", "oblique calc(1441deg)"); 437 437 438 shouldBeEqualToString("styleTestSheet.cssRules[13].style.fontStyle", " 100 / 200");439 shouldBeEqualToString("styleTestSheet.cssRules[14].style.fontStyle", " 100 / 200");438 shouldBeEqualToString("styleTestSheet.cssRules[13].style.fontStyle", "oblique 100deg 200deg"); 439 shouldBeEqualToString("styleTestSheet.cssRules[14].style.fontStyle", "oblique 100deg 200deg"); 440 440 shouldBeEqualToString("styleTestSheet.cssRules[15].style.fontStyle", ""); 441 441 shouldBeEqualToString("styleTestSheet.cssRules[16].style.fontStyle", ""); … … 444 444 shouldBeEqualToString("styleTestSheet.cssRules[19].style.fontStyle", ""); 445 445 shouldBeEqualToString("styleTestSheet.cssRules[20].style.fontStyle", ""); 446 shouldBeEqualToString("styleTestSheet.cssRules[21].style.fontStyle", " 1 / 2");447 shouldBeEqualToString("styleTestSheet.cssRules[22].style.fontStyle", " -2 / -1");446 shouldBeEqualToString("styleTestSheet.cssRules[21].style.fontStyle", "oblique 1deg 2deg"); 447 shouldBeEqualToString("styleTestSheet.cssRules[22].style.fontStyle", "oblique -2deg -1deg"); 448 448 shouldBeEqualToString("styleTestSheet.cssRules[23].style.fontStyle", ""); 449 shouldBeEqualToString("styleTestSheet.cssRules[24].style.fontStyle", " 100deg /200deg");450 shouldBeEqualToString("styleTestSheet.cssRules[25].style.fontStyle", " 100deg /200deg");449 shouldBeEqualToString("styleTestSheet.cssRules[24].style.fontStyle", "oblique 100deg 200deg"); 450 shouldBeEqualToString("styleTestSheet.cssRules[25].style.fontStyle", "oblique 100deg 200deg"); 451 451 shouldBeEqualToString("styleTestSheet.cssRules[26].style.fontStyle", ""); 452 452 shouldBeEqualToString("styleTestSheet.cssRules[27].style.fontStyle", ""); … … 455 455 shouldBeEqualToString("styleTestSheet.cssRules[30].style.fontStyle", ""); 456 456 shouldBeEqualToString("styleTestSheet.cssRules[31].style.fontStyle", ""); 457 shouldBeEqualToString("styleTestSheet.cssRules[32].style.fontStyle", " 1deg /2deg");458 shouldBeEqualToString("styleTestSheet.cssRules[33].style.fontStyle", " -2deg /-1deg");457 shouldBeEqualToString("styleTestSheet.cssRules[32].style.fontStyle", "oblique 1deg 2deg"); 458 shouldBeEqualToString("styleTestSheet.cssRules[33].style.fontStyle", "oblique -2deg -1deg"); 459 459 shouldBeEqualToString("styleTestSheet.cssRules[34].style.fontStyle", ""); 460 460 shouldBeEqualToString("styleTestSheet.cssRules[35].style.fontStyle", ""); 461 461 shouldBeEqualToString("styleTestSheet.cssRules[36].style.fontStyle", ""); 462 shouldBeEqualToString("styleTestSheet.cssRules[37].style.fontStyle", " 2deg /1turn");463 shouldBeEqualToString("styleTestSheet.cssRules[38].style.fontStyle", " 7 / 8");464 shouldBeEqualToString("styleTestSheet.cssRules[39].style.fontStyle", " 2 / 7");462 shouldBeEqualToString("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"); 465 465 </script> 466 466 <script src="../../resources/js-test-post.js"></script> -
trunk/LayoutTests/fast/text/font-style-parse-expected.txt
r214324 r214359 1 1 PASS window.getComputedStyle(document.getElementById('test1')).fontStyle is "normal" 2 PASS window.getComputedStyle(document.getElementById('test2')).fontStyle is " 1deg"3 PASS window.getComputedStyle(document.getElementById('test3')).fontStyle is " 180deg"4 PASS window.getComputedStyle(document.getElementById('test4')).fontStyle is " 359.75deg"5 PASS window.getComputedStyle(document.getElementById('test5')).fontStyle is " 1440deg"6 PASS window.getComputedStyle(document.getElementById('test6')).fontStyle is " 5deg"2 PASS window.getComputedStyle(document.getElementById('test2')).fontStyle is "oblique 1deg" 3 PASS window.getComputedStyle(document.getElementById('test3')).fontStyle is "oblique 180deg" 4 PASS window.getComputedStyle(document.getElementById('test4')).fontStyle is "oblique 359.75deg" 5 PASS window.getComputedStyle(document.getElementById('test5')).fontStyle is "oblique 1440deg" 6 PASS window.getComputedStyle(document.getElementById('test6')).fontStyle is "oblique 5deg" 7 7 PASS window.getComputedStyle(document.getElementById('test7')).fontStyle is "italic" 8 8 PASS window.getComputedStyle(document.getElementById('test8')).fontStyle is "italic" … … 11 11 PASS window.getComputedStyle(document.getElementById('test11')).fontStyle is "normal" 12 12 PASS window.getComputedStyle(document.getElementById('test12')).fontStyle is "normal" 13 PASS window.getComputedStyle(document.getElementById('test13')).fontStyle is " 7deg"14 PASS window.getComputedStyle(document.getElementById('test14')).fontStyle is " 1441deg"13 PASS window.getComputedStyle(document.getElementById('test13')).fontStyle is "oblique 7deg" 14 PASS window.getComputedStyle(document.getElementById('test14')).fontStyle is "oblique 1441deg" 15 15 PASS window.getComputedStyle(document.getElementById('test15')).fontStyle is "italic" 16 16 PASS window.getComputedStyle(document.getElementById('test16')).fontStyle is "italic" … … 19 19 PASS window.getComputedStyle(document.getElementById('test19')).fontStyle is "italic" 20 20 PASS window.getComputedStyle(document.getElementById('test20')).fontStyle is "normal" 21 PASS window.getComputedStyle(document.getElementById('test21')).fontStyle is " 14deg"21 PASS window.getComputedStyle(document.getElementById('test21')).fontStyle is "oblique 14deg" 22 22 PASS window.getComputedStyle(document.getElementById('test1')).font is "normal normal normal normal 16px/18px Times" 23 23 PASS window.getComputedStyle(document.getElementById('test2')).font is "16px/18px Times" … … 48 48 PASS document.getElementById('test19').style.font is "italic small-caps 100 extra-expanded 48px/49px 'Helvetica Neue'" 49 49 PASS document.getElementById('test20').style.font is "" 50 PASS document.getElementById('test21').style.font is " 14deg small-caps 123 extra-expanded 48px/49px 'Helvetica Neue'"50 PASS document.getElementById('test21').style.font is "oblique 14deg small-caps 123 extra-expanded 48px/49px 'Helvetica Neue'" 51 51 PASS successfullyParsed is true 52 52 -
trunk/LayoutTests/fast/text/font-style-parse.html
r214324 r214359 30 30 <script> 31 31 shouldBeEqualToString("window.getComputedStyle(document.getElementById('test1')).fontStyle", "normal"); 32 shouldBeEqualToString("window.getComputedStyle(document.getElementById('test2')).fontStyle", " 1deg");33 shouldBeEqualToString("window.getComputedStyle(document.getElementById('test3')).fontStyle", " 180deg");34 shouldBeEqualToString("window.getComputedStyle(document.getElementById('test4')).fontStyle", " 359.75deg");35 shouldBeEqualToString("window.getComputedStyle(document.getElementById('test5')).fontStyle", " 1440deg");36 shouldBeEqualToString("window.getComputedStyle(document.getElementById('test6')).fontStyle", " 5deg");32 shouldBeEqualToString("window.getComputedStyle(document.getElementById('test2')).fontStyle", "oblique 1deg"); 33 shouldBeEqualToString("window.getComputedStyle(document.getElementById('test3')).fontStyle", "oblique 180deg"); 34 shouldBeEqualToString("window.getComputedStyle(document.getElementById('test4')).fontStyle", "oblique 359.75deg"); 35 shouldBeEqualToString("window.getComputedStyle(document.getElementById('test5')).fontStyle", "oblique 1440deg"); 36 shouldBeEqualToString("window.getComputedStyle(document.getElementById('test6')).fontStyle", "oblique 5deg"); 37 37 shouldBeEqualToString("window.getComputedStyle(document.getElementById('test7')).fontStyle", "italic"); 38 38 shouldBeEqualToString("window.getComputedStyle(document.getElementById('test8')).fontStyle", "italic"); … … 41 41 shouldBeEqualToString("window.getComputedStyle(document.getElementById('test11')).fontStyle", "normal"); 42 42 shouldBeEqualToString("window.getComputedStyle(document.getElementById('test12')).fontStyle", "normal"); 43 shouldBeEqualToString("window.getComputedStyle(document.getElementById('test13')).fontStyle", " 7deg");44 shouldBeEqualToString("window.getComputedStyle(document.getElementById('test14')).fontStyle", " 1441deg");43 shouldBeEqualToString("window.getComputedStyle(document.getElementById('test13')).fontStyle", "oblique 7deg"); 44 shouldBeEqualToString("window.getComputedStyle(document.getElementById('test14')).fontStyle", "oblique 1441deg"); 45 45 shouldBeEqualToString("window.getComputedStyle(document.getElementById('test15')).fontStyle", "italic"); 46 46 shouldBeEqualToString("window.getComputedStyle(document.getElementById('test16')).fontStyle", "italic"); … … 49 49 shouldBeEqualToString("window.getComputedStyle(document.getElementById('test19')).fontStyle", "italic"); 50 50 shouldBeEqualToString("window.getComputedStyle(document.getElementById('test20')).fontStyle", "normal"); 51 shouldBeEqualToString("window.getComputedStyle(document.getElementById('test21')).fontStyle", " 14deg");51 shouldBeEqualToString("window.getComputedStyle(document.getElementById('test21')).fontStyle", "oblique 14deg"); 52 52 53 53 shouldBeEqualToString("window.getComputedStyle(document.getElementById('test1')).font", "normal normal normal normal 16px/18px Times"); … … 80 80 shouldBeEqualToString("document.getElementById('test19').style.font", "italic small-caps 100 extra-expanded 48px/49px 'Helvetica Neue'"); 81 81 shouldBeEqualToString("document.getElementById('test20').style.font", ""); 82 shouldBeEqualToString("document.getElementById('test21').style.font", " 14deg small-caps 123 extra-expanded 48px/49px 'Helvetica Neue'");82 shouldBeEqualToString("document.getElementById('test21').style.font", "oblique 14deg small-caps 123 extra-expanded 48px/49px 'Helvetica Neue'"); 83 83 </script> 84 84 <script src="../../resources/js-test-post.js"></script> -
trunk/LayoutTests/platform/mac-elcapitan/fast/text/font-selection-font-face-parse-expected.txt
r213528 r214359 70 70 FAIL stretchTestSheet.cssRules[38].style.fontStretch should be 7 / 8. Was . 71 71 FAIL stretchTestSheet.cssRules[39].style.fontStretch should be 2 / 7. Was . 72 PASS styleTestSheet.cssRules[0].style.fontStyle is " 1deg"73 PASS styleTestSheet.cssRules[1].style.fontStyle is " 200grad"74 PASS styleTestSheet.cssRules[2].style.fontStyle is " 6.28318rad"75 PASS styleTestSheet.cssRules[3].style.fontStyle is " 4turn"76 PASS styleTestSheet.cssRules[4].style.fontStyle is "5" 77 PASS styleTestSheet.cssRules[5].style.fontStyle is "20" 72 PASS styleTestSheet.cssRules[0].style.fontStyle is "oblique 1deg" 73 PASS styleTestSheet.cssRules[1].style.fontStyle is "oblique 200grad" 74 PASS styleTestSheet.cssRules[2].style.fontStyle is "oblique 6.28318rad" 75 PASS 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. 78 78 PASS styleTestSheet.cssRules[6].style.fontStyle is "italic" 79 79 PASS styleTestSheet.cssRules[7].style.fontStyle is "oblique" … … 81 81 PASS styleTestSheet.cssRules[9].style.fontStyle is "" 82 82 PASS styleTestSheet.cssRules[10].style.fontStyle is "" 83 PASS styleTestSheet.cssRules[11].style.fontStyle is "7" 84 PASS styleTestSheet.cssRules[12].style.fontStyle is " calc(1441deg)"85 FAIL styleTestSheet.cssRules[13].style.fontStyle should be 100 / 200. Was .86 FAIL styleTestSheet.cssRules[14].style.fontStyle should be 100 / 200. Was .83 FAIL styleTestSheet.cssRules[11].style.fontStyle should be oblique 7. Was oblique 7deg. 84 PASS 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 . 87 87 PASS styleTestSheet.cssRules[15].style.fontStyle is "" 88 88 PASS styleTestSheet.cssRules[16].style.fontStyle is "" … … 91 91 PASS styleTestSheet.cssRules[19].style.fontStyle is "" 92 92 PASS styleTestSheet.cssRules[20].style.fontStyle is "" 93 FAIL styleTestSheet.cssRules[21].style.fontStyle should be 1 / 2. Was .94 FAIL styleTestSheet.cssRules[22].style.fontStyle should be -2 / -1. Was .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 . 95 95 PASS styleTestSheet.cssRules[23].style.fontStyle is "" 96 FAIL styleTestSheet.cssRules[24].style.fontStyle should be 100deg /200deg. Was .97 FAIL styleTestSheet.cssRules[25].style.fontStyle should be 100deg /200deg. Was .96 FAIL styleTestSheet.cssRules[24].style.fontStyle should be oblique 100deg 200deg. Was . 97 FAIL styleTestSheet.cssRules[25].style.fontStyle should be oblique 100deg 200deg. Was . 98 98 PASS styleTestSheet.cssRules[26].style.fontStyle is "" 99 99 PASS styleTestSheet.cssRules[27].style.fontStyle is "" … … 102 102 PASS styleTestSheet.cssRules[30].style.fontStyle is "" 103 103 PASS styleTestSheet.cssRules[31].style.fontStyle is "" 104 FAIL styleTestSheet.cssRules[32].style.fontStyle should be 1deg /2deg. Was .105 FAIL styleTestSheet.cssRules[33].style.fontStyle should be -2deg /-1deg. Was .104 FAIL styleTestSheet.cssRules[32].style.fontStyle should be oblique 1deg 2deg. Was . 105 FAIL styleTestSheet.cssRules[33].style.fontStyle should be oblique -2deg -1deg. Was . 106 106 PASS styleTestSheet.cssRules[34].style.fontStyle is "" 107 107 PASS styleTestSheet.cssRules[35].style.fontStyle is "" 108 108 PASS styleTestSheet.cssRules[36].style.fontStyle is "" 109 FAIL styleTestSheet.cssRules[37].style.fontStyle should be 2deg /1turn. Was .110 FAIL styleTestSheet.cssRules[38].style.fontStyle should be 7 / 8. Was .111 FAIL styleTestSheet.cssRules[39].style.fontStyle should be 2 / 7. Was .109 FAIL 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 . 112 112 PASS successfullyParsed is true 113 113 -
trunk/LayoutTests/svg/css/getComputedStyle-basic-expected.txt
r213094 r214359 92 92 rect: style.getPropertyCSSValue(font-size) : [object CSSPrimitiveValue] 93 93 rect: style.getPropertyValue(font-style) : normal 94 rect: style.getPropertyCSSValue(font-style) : [object CSS PrimitiveValue]94 rect: style.getPropertyCSSValue(font-style) : [object CSSValue] 95 95 rect: style.getPropertyValue(font-synthesis) : style weight small-caps 96 96 rect: style.getPropertyCSSValue(font-synthesis) : [object CSSValueList] … … 644 644 g: style.getPropertyCSSValue(font-size) : [object CSSPrimitiveValue] 645 645 g: style.getPropertyValue(font-style) : normal 646 g: style.getPropertyCSSValue(font-style) : [object CSS PrimitiveValue]646 g: style.getPropertyCSSValue(font-style) : [object CSSValue] 647 647 g: style.getPropertyValue(font-synthesis) : style weight small-caps 648 648 g: style.getPropertyCSSValue(font-synthesis) : [object CSSValueList] -
trunk/Source/WebCore/CMakeLists.txt
r214338 r214359 1315 1315 css/CSSFontFeatureValue.cpp 1316 1316 css/CSSFontSelector.cpp 1317 css/CSSFontStyleRangeValue.cpp 1318 css/CSSFontStyleValue.cpp 1317 1319 css/CSSFontValue.cpp 1318 1320 css/CSSFontVariationValue.cpp -
trunk/Source/WebCore/ChangeLog
r214358 r214359 1 2017-03-24 Myles C. Maxfield <mmaxfield@apple.com> 2 3 font-style needs a new CSSValue to make CSSRule.cssText work correctly 4 https://bugs.webkit.org/show_bug.cgi?id=169258 5 6 Reviewed by David Hyatt. 7 8 With variation fonts, font-style's value can't be captured in a CSSPrimitiveValue (nor any other subclass 9 off CSSValue) any more. Instead, we need to create two new CSSValues which represent the grammar that font- 10 style and it's associated @font-face descriptor accept. 11 12 The grammar of the font-style property is "normal | italic | oblique [ <<angle>> ]?" 13 The grammar of the font-style descriptor is "normal | italic | oblique [ <<angle>> | <<angle>> <<angle>> ]?" 14 15 We currently still support numbers in place of the <<angle>> value (contrary to the spec). We will remove 16 this support in https://bugs.webkit.org/show_bug.cgi?id=169357. 17 18 Tests: fast/text/font-selection-font-face-parse.html: 19 fast/text/font-style-parse.html: 20 21 * CMakeLists.txt: 22 * WebCore.xcodeproj/project.pbxproj: 23 * css/CSSAllInOne.cpp: 24 * css/CSSComputedStyleDeclaration.cpp: 25 (WebCore::fontStyleFromStyle): 26 (WebCore::fontShorthandValueForSelectionProperties): 27 * css/CSSFontFace.cpp: 28 (WebCore::calculateWeightRange): 29 (WebCore::calculateStretchRange): 30 (WebCore::calculateItalicRange): 31 * css/CSSFontFaceSet.cpp: 32 (WebCore::computeFontSelectionRequest): 33 (WebCore::CSSFontFaceSet::matchingFaces): 34 (WebCore::calculateWeightValue): Deleted. 35 (WebCore::calculateStretchValue): Deleted. 36 (WebCore::calculateStyleValue): Deleted. 37 * css/CSSFontFaceSet.h: 38 * css/CSSFontSelector.cpp: 39 (WebCore::CSSFontSelector::addFontFaceRule): 40 * css/CSSFontStyleRangeValue.cpp: Added. 41 (WebCore::CSSFontStyleRangeValue::customCSSText): 42 (WebCore::CSSFontStyleRangeValue::equals): 43 * css/CSSFontStyleRangeValue.h: Added. 44 * css/CSSFontStyleValue.cpp: Added. 45 (WebCore::CSSFontStyleValue::customCSSText): 46 (WebCore::CSSFontStyleValue::equals): 47 * css/CSSFontStyleValue.h: Added. 48 * css/CSSFontValue.cpp: 49 (WebCore::CSSFontValue::customCSSText): 50 * css/CSSFontValue.h: 51 * css/CSSValue.cpp: 52 (WebCore::CSSValue::equals): 53 (WebCore::CSSValue::cssText): 54 (WebCore::CSSValue::destroy): 55 * css/CSSValue.h: 56 (WebCore::CSSValue::isFontStyleValue): 57 (WebCore::CSSValue::isFontStyleRangeValue): 58 * css/FontFace.cpp: 59 (WebCore::FontFace::style): 60 (WebCore::FontFace::weight): 61 (WebCore::FontFace::stretch): 62 * css/StyleBuilderConverter.h: 63 (WebCore::StyleBuilderConverter::convertFontWeightFromValue): 64 (WebCore::StyleBuilderConverter::convertFontStretchFromValue): 65 (WebCore::StyleBuilderConverter::convertFontStyleFromValue): 66 (WebCore::StyleBuilderConverter::convertFontWeight): 67 (WebCore::StyleBuilderConverter::convertFontStretch): 68 (WebCore::StyleBuilderConverter::convertFontStyle): 69 * css/parser/CSSPropertyParser.cpp: 70 (WebCore::consumeFontStyle): 71 (WebCore::consumeFontStyleRange): 72 (WebCore::CSSPropertyParser::consumeSystemFont): 73 (WebCore::CSSPropertyParser::consumeFont): 74 * svg/SVGFontFaceElement.cpp: 75 (WebCore::SVGFontFaceElement::parseAttribute): 76 1 77 2017-03-24 Alex Christensen <achristensen@webkit.org> 2 78 -
trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj
r214330 r214359 5931 5931 C2AB0AF71E6B3C6C001348C5 /* FontSelectionAlgorithm.h in Headers */ = {isa = PBXBuildFile; fileRef = C2AB0AF51E6B3C6C001348C5 /* FontSelectionAlgorithm.h */; settings = {ATTRIBUTES = (Private, ); }; }; 5932 5932 C2E1F43F1D6254E10094625C /* BreakLines.h in Headers */ = {isa = PBXBuildFile; fileRef = BCEA4816097D93020094C9E4 /* BreakLines.h */; settings = {ATTRIBUTES = (Private, ); }; }; 5933 C2E38EFD1E8396FD00CA3ADF /* CSSFontStyleValue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C2E38EFB1E8396FD00CA3ADF /* CSSFontStyleValue.cpp */; }; 5934 C2E38EFE1E8396FD00CA3ADF /* CSSFontStyleValue.h in Headers */ = {isa = PBXBuildFile; fileRef = C2E38EFC1E8396FD00CA3ADF /* CSSFontStyleValue.h */; }; 5935 C2E38F011E84573500CA3ADF /* CSSFontStyleRangeValue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C2E38EFF1E84573500CA3ADF /* CSSFontStyleRangeValue.cpp */; }; 5936 C2E38F021E84573500CA3ADF /* CSSFontStyleRangeValue.h in Headers */ = {isa = PBXBuildFile; fileRef = C2E38F001E84573500CA3ADF /* CSSFontStyleRangeValue.h */; }; 5933 5937 C2F4E78A1E45BEA1006D7105 /* ComplexTextController.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C2F4E7881E45AEDF006D7105 /* ComplexTextController.cpp */; }; 5934 5938 C2F4E78C1E45C3EF006D7105 /* ComplexTextController.h in Headers */ = {isa = PBXBuildFile; fileRef = C2F4E7891E45AEDF006D7105 /* ComplexTextController.h */; settings = {ATTRIBUTES = (Private, ); }; }; … … 14319 14323 C2AB0B021E6DE32B001348C5 /* FontSelectionKeywordValues.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = FontSelectionKeywordValues.h; sourceTree = "<group>"; }; 14320 14324 C2AB0B031E6DE92C001348C5 /* FontSelectionValueInlines.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = FontSelectionValueInlines.h; sourceTree = "<group>"; }; 14325 C2E38EFB1E8396FD00CA3ADF /* CSSFontStyleValue.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CSSFontStyleValue.cpp; sourceTree = "<group>"; }; 14326 C2E38EFC1E8396FD00CA3ADF /* CSSFontStyleValue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CSSFontStyleValue.h; sourceTree = "<group>"; }; 14327 C2E38EFF1E84573500CA3ADF /* CSSFontStyleRangeValue.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CSSFontStyleRangeValue.cpp; sourceTree = "<group>"; }; 14328 C2E38F001E84573500CA3ADF /* CSSFontStyleRangeValue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CSSFontStyleRangeValue.h; sourceTree = "<group>"; }; 14321 14329 C2F4E7881E45AEDF006D7105 /* ComplexTextController.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ComplexTextController.cpp; sourceTree = "<group>"; }; 14322 14330 C2F4E7891E45AEDF006D7105 /* ComplexTextController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ComplexTextController.h; sourceTree = "<group>"; }; … … 24924 24932 3F2B33E3165ABD3500E3987C /* WebKitCSSViewportRule.idl */, 24925 24933 31055BB81E4FE18900EB604E /* WebKitFontFamilyNames.in */, 24934 C2E38EFB1E8396FD00CA3ADF /* CSSFontStyleValue.cpp */, 24935 C2E38EFC1E8396FD00CA3ADF /* CSSFontStyleValue.h */, 24936 C2E38EFF1E84573500CA3ADF /* CSSFontStyleRangeValue.cpp */, 24937 C2E38F001E84573500CA3ADF /* CSSFontStyleRangeValue.h */, 24926 24938 ); 24927 24939 path = css; … … 27264 27276 51E269371DD3BD9B006B6A58 /* IDBIterateCursorData.h in Headers */, 27265 27277 5185FC951BB4C4E80012898F /* IDBKey.h in Headers */, 27278 C2E38F021E84573500CA3ADF /* CSSFontStyleRangeValue.h in Headers */, 27266 27279 5185FC971BB4C4E80012898F /* IDBKeyData.h in Headers */, 27267 27280 5185FC991BB4C4E80012898F /* IDBKeyPath.h in Headers */, … … 29408 29421 081093DC1255F0E700ED9D29 /* SVGTextLayoutAttributesBuilder.h in Headers */, 29409 29422 081668DA125603D5006F25DE /* SVGTextLayoutEngine.h in Headers */, 29423 C2E38EFE1E8396FD00CA3ADF /* CSSFontStyleValue.h in Headers */, 29410 29424 080E49261255F3BD00EFCA27 /* SVGTextLayoutEngineBaseline.h in Headers */, 29411 29425 080E49281255F3BD00EFCA27 /* SVGTextLayoutEngineSpacing.h in Headers */, … … 30586 30600 94D4AC621DC24C8E0080F02D /* CSSCustomPropertyValue.cpp in Sources */, 30587 30601 4A9CC81716BB9AC600EC645A /* CSSDefaultStyleSheets.cpp in Sources */, 30602 C2E38F011E84573500CA3ADF /* CSSFontStyleRangeValue.cpp in Sources */, 30588 30603 94476BDA1DFCAC0300690E23 /* CSSDeferredParser.cpp in Sources */, 30589 30604 FBB0C5B717BBD626003D3677 /* CSSFilterImageValue.cpp in Sources */, … … 33110 33125 BC22747A0E8366E200E7F975 /* SVGRenderStyleDefs.cpp in Sources */, 33111 33126 B2227AA20D00BF220071B782 /* SVGScriptElement.cpp in Sources */, 33127 C2E38EFD1E8396FD00CA3ADF /* CSSFontStyleValue.cpp in Sources */, 33112 33128 B2227AA50D00BF220071B782 /* SVGSetElement.cpp in Sources */, 33113 33129 E4AFD00F0DAF335500F5F55C /* SVGSMILElement.cpp in Sources */, -
trunk/Source/WebCore/css/CSSAllInOne.cpp
r212252 r214359 47 47 #include "CSSFontFeatureValue.cpp" 48 48 #include "CSSFontSelector.cpp" 49 #include "CSSFontStyleValue.cpp" 49 50 #include "CSSFontValue.cpp" 50 51 #include "CSSFontVariationValue.cpp" -
trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp
r213567 r214359 36 36 #include "CSSCustomPropertyValue.h" 37 37 #include "CSSFontFeatureValue.h" 38 #include "CSSFontStyleValue.h" 38 39 #include "CSSFontValue.h" 39 40 #include "CSSFontVariationValue.h" … … 1930 1931 } 1931 1932 1932 static Ref<CSSPrimitiveValue> fontStyleFromStyle(const RenderStyle& style) 1933 { 1934 auto italic = style.fontDescription().italic(); 1935 if (auto italicValue = fontStyleKeyword(italic)) 1936 return CSSValuePool::singleton().createIdentifierValue(italicValue.value()); 1937 return CSSValuePool::singleton().createValue(static_cast<float>(italic), CSSPrimitiveValue::CSS_DEG); 1933 static Ref<CSSFontStyleValue> fontStyleFromStyle(const RenderStyle& style) 1934 { 1935 FontSelectionValue italic = style.fontDescription().italic(); 1936 if (italic == normalItalicValue()) 1937 return CSSFontStyleValue::create(CSSValuePool::singleton().createIdentifierValue(CSSValueNormal)); 1938 if (italic == italicValue()) 1939 return CSSFontStyleValue::create(CSSValuePool::singleton().createIdentifierValue(CSSValueItalic)); 1940 return CSSFontStyleValue::create(CSSValuePool::singleton().createIdentifierValue(CSSValueOblique), CSSValuePool::singleton().createValue(static_cast<float>(italic), CSSPrimitiveValue::CSS_DEG)); 1938 1941 } 1939 1942 … … 2551 2554 2552 2555 if (auto italic = fontStyleKeyword(fontDescription.italic())) 2553 computedFont->style = CSS ValuePool::singleton().createIdentifierValue(italic.value());2556 computedFont->style = CSSFontStyleValue::create(CSSValuePool::singleton().createIdentifierValue(italic.value())); 2554 2557 else 2555 2558 return CSSFontValue::create(); -
trunk/Source/WebCore/css/CSSFontFace.cpp
r213528 r214359 32 32 #include "CSSFontFeatureValue.h" 33 33 #include "CSSFontSelector.h" 34 #include "CSSFontStyleRangeValue.h" 35 #include "CSSFontStyleValue.h" 34 36 #include "CSSPrimitiveValueMappings.h" 35 37 #include "CSSSegmentedFontFace.h" … … 44 46 #include "RuntimeEnabledFeatures.h" 45 47 #include "Settings.h" 48 #include "StyleBuilderConverter.h" 46 49 #include "StyleProperties.h" 47 50 #include "StyleRule.h" … … 136 139 auto& value0 = downcast<CSSPrimitiveValue>(*valueList.item(0)); 137 140 auto& value1 = downcast<CSSPrimitiveValue>(*valueList.item(1)); 138 ASSERT(value0.isNumber());139 ASSERT(value1.isNumber());140 return { FontSelectionValue::clampFloat(value0.floatValue()), FontSelectionValue::clampFloat(value1.floatValue())};141 auto result0 = StyleBuilderConverter::convertFontWeightFromValue(value0); 142 auto result1 = StyleBuilderConverter::convertFontWeightFromValue(value1); 143 return { result0, result1 }; 141 144 } 142 145 143 146 ASSERT(is<CSSPrimitiveValue>(value)); 144 147 auto& primitiveValue = downcast<CSSPrimitiveValue>(value); 145 146 FontSelectionValue result; 147 if (primitiveValue.isNumber()) { 148 result = FontSelectionValue::clampFloat(primitiveValue.floatValue()); 149 return { result, result }; 150 } 151 152 ASSERT(primitiveValue.isValueID()); 153 if (auto value = fontWeightValue(primitiveValue.valueID())) 154 result = value.value(); 155 else { 156 ASSERT_NOT_REACHED(); 157 result = normalWeightValue(); 158 } 159 148 FontSelectionValue result = StyleBuilderConverter::convertFontWeightFromValue(primitiveValue); 160 149 return { result, result }; 161 150 } … … 185 174 auto& value0 = downcast<CSSPrimitiveValue>(*valueList.item(0)); 186 175 auto& value1 = downcast<CSSPrimitiveValue>(*valueList.item(1)); 187 ASSERT(value0.isPercentage() || value0.isNumber());188 ASSERT(value1.isPercentage() || value1.isNumber());189 return { FontSelectionValue::clampFloat(value0.floatValue()), FontSelectionValue::clampFloat(value1.floatValue())};176 auto result0 = StyleBuilderConverter::convertFontStretchFromValue(value0); 177 auto result1 = StyleBuilderConverter::convertFontStretchFromValue(value1); 178 return { result0, result1 }; 190 179 } 191 180 192 181 ASSERT(is<CSSPrimitiveValue>(value)); 193 182 const auto& primitiveValue = downcast<CSSPrimitiveValue>(value); 194 195 FontSelectionValue result; 196 if (primitiveValue.isPercentage() || primitiveValue.isNumber()) { 197 result = FontSelectionValue::clampFloat(primitiveValue.floatValue()); 198 return { result, result }; 199 } 200 201 ASSERT(primitiveValue.isValueID()); 202 if (auto value = fontStretchValue(primitiveValue.valueID())) 203 result = value.value(); 204 else { 205 ASSERT_NOT_REACHED(); 206 result = normalStretchValue(); 207 } 208 183 FontSelectionValue result = StyleBuilderConverter::convertFontStretchFromValue(primitiveValue); 209 184 return { result, result }; 210 185 } … … 225 200 static FontSelectionRange calculateItalicRange(CSSValue& value) 226 201 { 227 if (value.isValueList()) { 228 auto& valueList = downcast<CSSValueList>(value); 229 ASSERT(valueList.length() == 2); 230 if (valueList.length() != 2) 202 if (value.isFontStyleValue()) { 203 auto result = StyleBuilderConverter::convertFontStyleFromValue(value); 204 return { result, result }; 205 } 206 207 ASSERT(value.isFontStyleRangeValue()); 208 auto& rangeValue = downcast<CSSFontStyleRangeValue>(value); 209 ASSERT(rangeValue.fontStyleValue->isValueID()); 210 auto valueID = rangeValue.fontStyleValue->valueID(); 211 if (!rangeValue.obliqueValues) { 212 if (valueID == CSSValueNormal) 231 213 return { normalItalicValue(), normalItalicValue() }; 232 ASSERT(valueList.item(0)->isPrimitiveValue()); 233 ASSERT(valueList.item(1)->isPrimitiveValue()); 234 auto& value0 = downcast<CSSPrimitiveValue>(*valueList.item(0)); 235 auto& value1 = downcast<CSSPrimitiveValue>(*valueList.item(1)); 236 ASSERT(value0.isAngle() || value0.isNumber() || value0.isCalculated()); 237 ASSERT(value1.isAngle() || value1.isNumber() || value1.isCalculated()); 238 return { FontSelectionValue::clampFloat(value0.floatValue(CSSPrimitiveValue::CSS_DEG)), FontSelectionValue::clampFloat(value1.floatValue(CSSPrimitiveValue::CSS_DEG)) }; 239 } 240 241 ASSERT(is<CSSPrimitiveValue>(value)); 242 const auto& primitiveValue = downcast<CSSPrimitiveValue>(value); 243 244 FontSelectionValue result; 245 if (primitiveValue.isAngle() || primitiveValue.isNumber() || primitiveValue.isCalculated()) { 246 result = FontSelectionValue::clampFloat(primitiveValue.floatValue(CSSPrimitiveValue::CSS_DEG)); 214 ASSERT(valueID == CSSValueItalic || valueID == CSSValueOblique); 215 return { italicValue(), italicValue() }; 216 } 217 ASSERT(valueID == CSSValueOblique); 218 auto length = rangeValue.obliqueValues->length(); 219 if (length == 1) { 220 auto& primitiveValue = downcast<CSSPrimitiveValue>(*rangeValue.obliqueValues->item(0)); 221 FontSelectionValue result(primitiveValue.value<float>(CSSPrimitiveValue::CSS_DEG)); 247 222 return { result, result }; 248 223 } 249 250 ASSERT(primitiveValue.isValueID()); 251 if (auto value = fontStyleValue(primitiveValue.valueID())) 252 result = value.value(); 253 else { 254 ASSERT_NOT_REACHED(); 255 result = normalItalicValue(); 256 } 257 return { result, result }; 224 ASSERT(length == 2); 225 auto& primitiveValue1 = downcast<CSSPrimitiveValue>(*rangeValue.obliqueValues->item(0)); 226 auto& primitiveValue2 = downcast<CSSPrimitiveValue>(*rangeValue.obliqueValues->item(1)); 227 FontSelectionValue result1(primitiveValue1.value<float>(CSSPrimitiveValue::CSS_DEG)); 228 FontSelectionValue result2(primitiveValue2.value<float>(CSSPrimitiveValue::CSS_DEG)); 229 return { result1, result2 }; 258 230 } 259 231 -
trunk/Source/WebCore/css/CSSFontFaceSet.cpp
r213464 r214359 30 30 #include "CSSFontFamily.h" 31 31 #include "CSSFontSelector.h" 32 #include "CSSFontStyleValue.h" 32 33 #include "CSSParser.h" 33 34 #include "CSSPrimitiveValue.h" … … 37 38 #include "ExceptionCode.h" 38 39 #include "FontCache.h" 40 #include "StyleBuilderConverter.h" 39 41 #include "StyleProperties.h" 40 42 … … 287 289 } 288 290 289 static std::optional<FontSelectionValue> calculateWeightValue(CSSValue& weight) 290 { 291 if (!is<CSSPrimitiveValue>(weight)) 292 return std::nullopt; 293 294 auto& primitiveWeight = downcast<CSSPrimitiveValue>(weight); 295 if (primitiveWeight.isNumber()) 296 return FontSelectionValue::clampFloat(primitiveWeight.floatValue()); 297 298 if (!primitiveWeight.isValueID()) 299 return std::nullopt; 300 301 if (auto value = fontWeightValue(primitiveWeight.valueID())) 302 return value.value(); 303 ASSERT_NOT_REACHED(); 304 return normalWeightValue(); 305 } 306 307 static std::optional<FontSelectionValue> calculateStretchValue(CSSValue& style) 308 { 309 if (!is<CSSPrimitiveValue>(style)) 310 return std::nullopt; 311 312 auto& primitiveStretch = downcast<CSSPrimitiveValue>(style); 313 if (primitiveStretch.isNumber() || primitiveStretch.isPercentage()) 314 return FontSelectionValue::clampFloat(primitiveStretch.floatValue()); 315 316 if (!primitiveStretch.isValueID()) 317 return std::nullopt; 318 319 if (auto value = fontStretchValue(primitiveStretch.valueID())) 320 return value.value(); 321 return normalStretchValue(); 322 } 323 324 static std::optional<FontSelectionValue> calculateStyleValue(CSSValue& style) 325 { 326 if (!is<CSSPrimitiveValue>(style)) 327 return std::nullopt; 328 329 auto& primitiveSlant = downcast<CSSPrimitiveValue>(style); 330 if (primitiveSlant.isNumber() || primitiveSlant.isAngle()) 331 return FontSelectionValue::clampFloat(primitiveSlant.floatValue()); 332 333 if (!primitiveSlant.isValueID()) 334 return std::nullopt; 335 336 if (auto value = fontStyleValue(downcast<CSSPrimitiveValue>(style).valueID())) 337 return value.value(); 338 return normalItalicValue(); 339 } 340 341 static std::optional<FontSelectionRequest> computeFontSelectionRequest(MutableStyleProperties& style) 291 static FontSelectionRequest computeFontSelectionRequest(MutableStyleProperties& style) 342 292 { 343 293 RefPtr<CSSValue> weightValue = style.getPropertyCSSValue(CSSPropertyFontWeight).get(); … … 345 295 weightValue = CSSValuePool::singleton().createIdentifierValue(CSSValueNormal).ptr(); 346 296 347 FontSelectionValue weightSelectionValue;348 if (auto weightOptional = calculateWeightValue(*weightValue))349 weightSelectionValue = weightOptional.value();350 else351 return std::nullopt;352 353 297 RefPtr<CSSValue> stretchValue = style.getPropertyCSSValue(CSSPropertyFontStretch).get(); 354 298 if (!stretchValue) 355 299 stretchValue = CSSValuePool::singleton().createIdentifierValue(CSSValueNormal).ptr(); 356 300 357 FontSelectionValue stretchSelectionValue;358 if (auto stretchOptional = calculateStretchValue(*weightValue))359 stretchSelectionValue = stretchOptional.value();360 else361 return std::nullopt;362 363 301 RefPtr<CSSValue> styleValue = style.getPropertyCSSValue(CSSPropertyFontStyle).get(); 364 302 if (!styleValue) 365 styleValue = CSSValuePool::singleton().createIdentifierValue(CSSValueNormal).ptr(); 366 367 FontSelectionValue styleSelectionValue; 368 if (auto styleOptional = calculateStyleValue(*styleValue)) 369 styleSelectionValue = styleOptional.value(); 370 else 371 return std::nullopt; 372 373 return {{ weightSelectionValue, stretchSelectionValue, styleSelectionValue }}; 303 styleValue = CSSFontStyleValue::create(CSSValuePool::singleton().createIdentifierValue(CSSValueNormal)); 304 305 FontSelectionValue weightSelectionValue = StyleBuilderConverter::convertFontWeightFromValue(*weightValue); 306 FontSelectionValue stretchSelectionValue = StyleBuilderConverter::convertFontStretchFromValue(*stretchValue); 307 FontSelectionValue styleSelectionValue = StyleBuilderConverter::convertFontStyleFromValue(*styleValue); 308 309 return { weightSelectionValue, stretchSelectionValue, styleSelectionValue }; 374 310 } 375 311 … … 397 333 return Exception { SYNTAX_ERR }; 398 334 399 FontSelectionRequest request; 400 if (auto fontSelectionRequestOptional = computeFontSelectionRequest(style.get())) 401 request = fontSelectionRequestOptional.value(); 402 else 403 return Exception { SYNTAX_ERR }; 335 FontSelectionRequest request = computeFontSelectionRequest(style.get()); 404 336 405 337 auto family = style->getPropertyCSSValue(CSSPropertyFontFamily); -
trunk/Source/WebCore/css/CSSFontFaceSet.h
r213464 r214359 52 52 } 53 53 ~CSSFontFaceSet(); 54 55 static FontSelectionValue convertFontWeightFromValue(const CSSValue&); 56 static FontSelectionValue convertFontStretchFromValue(const CSSValue&); 57 static FontSelectionValue convertFontStyleFromValue(const CSSValue&); 54 58 55 59 void addClient(CSSFontFaceSetClient&); -
trunk/Source/WebCore/css/CSSFontSelector.cpp
r213464 r214359 34 34 #include "CSSFontFamily.h" 35 35 #include "CSSFontFeatureValue.h" 36 #include "CSSFontStyleRangeValue.h" 37 #include "CSSFontStyleValue.h" 36 38 #include "CSSPrimitiveValue.h" 37 39 #include "CSSPrimitiveValueMappings.h" … … 164 166 165 167 if (!fontStyle) 166 fontStyle = CSS ValuePool::singleton().createIdentifierValue(CSSValueNormal).ptr();168 fontStyle = CSSFontStyleRangeValue::create(CSSValuePool::singleton().createIdentifierValue(CSSValueNormal)); 167 169 168 170 if (!fontWeight) -
trunk/Source/WebCore/css/CSSFontValue.cpp
r213267 r214359 21 21 #include "CSSFontValue.h" 22 22 23 #include "CSSFontStyleValue.h" 23 24 #include "CSSPrimitiveValue.h" 24 25 #include "CSSValueList.h" … … 45 46 result.append(weight->cssText()); 46 47 } 47 if ( weight) {48 if (stretch) { 48 49 if (!result.isEmpty()) 49 50 result.append(' '); -
trunk/Source/WebCore/css/CSSFontValue.h
r213267 r214359 21 21 #pragma once 22 22 23 #include "CSSFontStyleValue.h" 23 24 #include "CSSValue.h" 24 25 #include <wtf/RefPtr.h> … … 40 41 bool equals(const CSSFontValue&) const; 41 42 42 RefPtr<CSS PrimitiveValue> style;43 RefPtr<CSSFontStyleValue> style; 43 44 RefPtr<CSSPrimitiveValue> variant; 44 45 RefPtr<CSSPrimitiveValue> weight; -
trunk/Source/WebCore/css/CSSValue.cpp
r212629 r214359 42 42 #include "CSSFontFaceSrcValue.h" 43 43 #include "CSSFontFeatureValue.h" 44 #include "CSSFontStyleRangeValue.h" 45 #include "CSSFontStyleValue.h" 44 46 #include "CSSFontValue.h" 45 47 #include "CSSFontVariationValue.h" … … 207 209 case PendingSubstitutionValueClass: 208 210 return compareCSSValues<CSSPendingSubstitutionValue>(*this, other); 211 case FontStyleClass: 212 return compareCSSValues<CSSFontStyleValue>(*this, other); 213 case FontStyleRangeClass: 214 return compareCSSValues<CSSFontStyleRangeValue>(*this, other); 209 215 default: 210 216 ASSERT_NOT_REACHED(); … … 303 309 case PendingSubstitutionValueClass: 304 310 return downcast<CSSPendingSubstitutionValue>(*this).customCSSText(); 311 case FontStyleClass: 312 return downcast<CSSFontStyleValue>(*this).customCSSText(); 313 case FontStyleRangeClass: 314 return downcast<CSSFontStyleRangeValue>(*this).customCSSText(); 305 315 } 306 316 … … 432 442 case PendingSubstitutionValueClass: 433 443 delete downcast<CSSPendingSubstitutionValue>(this); 444 return; 445 case FontStyleClass: 446 delete downcast<CSSFontStyleValue>(this); 447 return; 448 case FontStyleRangeClass: 449 delete downcast<CSSFontStyleRangeValue>(this); 434 450 return; 435 451 } -
trunk/Source/WebCore/css/CSSValue.h
r212629 r214359 80 80 bool isFontFaceSrcValue() const { return m_classType == FontFaceSrcClass; } 81 81 bool isFontValue() const { return m_classType == FontClass; } 82 bool isFontStyleValue() const { return m_classType == FontStyleClass; } 83 bool isFontStyleRangeValue() const { return m_classType == FontStyleRangeClass; } 82 84 bool isImageGeneratorValue() const { return m_classType >= CanvasClass && m_classType <= RadialGradientClass; } 83 85 bool isGradientValue() const { return m_classType >= LinearGradientClass && m_classType <= RadialGradientClass; } … … 156 158 #endif 157 159 FontClass, 160 FontStyleClass, 161 FontStyleRangeClass, 158 162 FontFaceSrcClass, 159 163 FunctionClass, -
trunk/Source/WebCore/css/FontFace.cpp
r213464 r214359 306 306 } 307 307 308 return String::format("oblique %fdeg -%fdeg", static_cast<float>(style.minimum), static_cast<float>(style.maximum));308 return String::format("oblique %fdeg %fdeg", static_cast<float>(style.minimum), static_cast<float>(style.maximum)); 309 309 } 310 310 … … 329 329 } 330 330 331 return String::format("%f -%f", static_cast<float>(weight.minimum), static_cast<float>(weight.maximum));331 return String::format("%f %f", static_cast<float>(weight.minimum), static_cast<float>(weight.maximum)); 332 332 } 333 333 … … 366 366 } 367 367 368 return String::format("%f%% -%f%%", static_cast<float>(stretch.minimum), static_cast<float>(stretch.maximum));368 return String::format("%f%% %f%%", static_cast<float>(stretch.minimum), static_cast<float>(stretch.maximum)); 369 369 } 370 370 -
trunk/Source/WebCore/css/StyleBuilderConverter.h
r213831 r214359 31 31 #include "CSSContentDistributionValue.h" 32 32 #include "CSSFontFeatureValue.h" 33 #include "CSSFontStyleValue.h" 33 34 #include "CSSFontVariationValue.h" 34 35 #include "CSSFunctionValue.h" … … 40 41 #include "CSSImageValue.h" 41 42 #include "CSSPrimitiveValue.h" 43 #include "CSSPrimitiveValueMappings.h" 42 44 #include "CSSReflectValue.h" 43 45 #include "FontSelectionValueInlines.h" … … 116 118 #endif 117 119 static FontFeatureSettings convertFontFeatureSettings(StyleResolver&, const CSSValue&); 120 static FontSelectionValue convertFontWeightFromValue(const CSSValue&); 121 static FontSelectionValue convertFontStretchFromValue(const CSSValue&); 122 static FontSelectionValue convertFontStyleFromValue(const CSSValue&); 118 123 static FontSelectionValue convertFontWeight(StyleResolver&, const CSSValue&); 119 124 static FontSelectionValue convertFontStretch(StyleResolver&, const CSSValue&); … … 1161 1166 } 1162 1167 1163 inline FontSelectionValue StyleBuilderConverter::convertFontWeight (StyleResolver& styleResolver,const CSSValue& value)1168 inline FontSelectionValue StyleBuilderConverter::convertFontWeightFromValue(const CSSValue& value) 1164 1169 { 1165 1170 ASSERT(is<CSSPrimitiveValue>(value)); … … 1174 1179 return normalWeightValue(); 1175 1180 case CSSValueBold: 1181 case CSSValueBolder: 1176 1182 return boldWeightValue(); 1177 case CSSValueBolder:1178 return FontCascadeDescription::bolderWeight(styleResolver.parentStyle()->fontDescription().weight());1179 1183 case CSSValueLighter: 1180 return FontCascadeDescription::lighterWeight(styleResolver.parentStyle()->fontDescription().weight());1184 return lightWeightValue(); 1181 1185 default: 1182 1186 ASSERT_NOT_REACHED(); … … 1185 1189 } 1186 1190 1187 inline FontSelectionValue StyleBuilderConverter::convertFontStretch (StyleResolver&,const CSSValue& value)1191 inline FontSelectionValue StyleBuilderConverter::convertFontStretchFromValue(const CSSValue& value) 1188 1192 { 1189 1193 ASSERT(is<CSSPrimitiveValue>(value)); … … 1200 1204 } 1201 1205 1206 inline FontSelectionValue StyleBuilderConverter::convertFontStyleFromValue(const CSSValue& value) 1207 { 1208 ASSERT(is<CSSFontStyleValue>(value)); 1209 const auto& fontStyleValue = downcast<CSSFontStyleValue>(value); 1210 1211 auto valueID = fontStyleValue.fontStyleValue->valueID(); 1212 if (valueID == CSSValueNormal) 1213 return normalItalicValue(); 1214 if (valueID == CSSValueItalic) 1215 return italicValue(); 1216 ASSERT(valueID == CSSValueOblique); 1217 if (auto* obliqueValue = fontStyleValue.obliqueValue.get()) 1218 return FontSelectionValue(obliqueValue->value<float>(CSSPrimitiveValue::CSS_DEG)); 1219 return italicValue(); 1220 } 1221 1222 inline FontSelectionValue StyleBuilderConverter::convertFontWeight(StyleResolver& styleResolver, const CSSValue& value) 1223 { 1224 ASSERT(is<CSSPrimitiveValue>(value)); 1225 auto& primitiveValue = downcast<CSSPrimitiveValue>(value); 1226 if (primitiveValue.isValueID()) { 1227 auto valueID = primitiveValue.valueID(); 1228 if (valueID == CSSValueBolder) 1229 return FontCascadeDescription::bolderWeight(styleResolver.parentStyle()->fontDescription().weight()); 1230 if (valueID == CSSValueLighter) 1231 return FontCascadeDescription::lighterWeight(styleResolver.parentStyle()->fontDescription().weight()); 1232 } 1233 return convertFontWeightFromValue(value); 1234 } 1235 1236 inline FontSelectionValue StyleBuilderConverter::convertFontStretch(StyleResolver&, const CSSValue& value) 1237 { 1238 return convertFontStretchFromValue(value); 1239 } 1240 1202 1241 inline FontSelectionValue StyleBuilderConverter::convertFontStyle(StyleResolver&, const CSSValue& value) 1203 1242 { 1204 ASSERT(is<CSSPrimitiveValue>(value)); 1205 const auto& primitiveValue = downcast<CSSPrimitiveValue>(value); 1206 1207 if (primitiveValue.isAngle() || primitiveValue.isNumber() || primitiveValue.isCalculated()) 1208 return FontSelectionValue::clampFloat(primitiveValue.floatValue(CSSPrimitiveValue::CSS_DEG)); 1209 1210 ASSERT(primitiveValue.isValueID()); 1211 if (auto value = fontStyleValue(primitiveValue.valueID())) 1212 return value.value(); 1213 ASSERT_NOT_REACHED(); 1214 return normalItalicValue(); 1243 return convertFontStyleFromValue(value); 1215 1244 } 1216 1245 -
trunk/Source/WebCore/css/parser/CSSPropertyParser.cpp
r214324 r214359 46 46 #include "CSSFontVariationValue.h" 47 47 #endif 48 #include "CSSFontStyleRangeValue.h" 49 #include "CSSFontStyleValue.h" 48 50 #include "CSSFunctionValue.h" 49 51 #include "CSSGridAutoRepeatValue.h" … … 961 963 } 962 964 963 static RefPtr<CSSPrimitiveValue> consumeFontStyle(CSSParserTokenRange& range, CSSParserMode cssParserMode) 964 { 965 if (auto result = consumeFontStyleKeywordValue(range)) { 966 if (result->valueID() == CSSValueOblique) { 967 if (range.atEnd()) 968 return result; 969 if (auto angle = consumeAngle(range, cssParserMode)) 970 return angle; 971 if (auto number = consumeNumber(range, ValueRangeAll)) 972 return number; 973 } 974 return result; 975 } 976 return nullptr; 965 static RefPtr<CSSFontStyleValue> consumeFontStyle(CSSParserTokenRange& range, CSSParserMode cssParserMode) 966 { 967 auto result = consumeFontStyleKeywordValue(range); 968 if (!result) 969 return nullptr; 970 971 if (result->valueID() == CSSValueNormal) 972 return CSSFontStyleValue::create(CSSValuePool::singleton().createIdentifierValue(CSSValueNormal)); 973 if (result->valueID() == CSSValueItalic) 974 return CSSFontStyleValue::create(CSSValuePool::singleton().createIdentifierValue(CSSValueItalic)); 975 ASSERT(result->valueID() == CSSValueOblique); 976 if (range.atEnd()) 977 return CSSFontStyleValue::create(CSSValuePool::singleton().createIdentifierValue(CSSValueOblique)); 978 if (auto angle = consumeAngle(range, cssParserMode)) 979 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)); 982 return CSSFontStyleValue::create(CSSValuePool::singleton().createIdentifierValue(CSSValueOblique)); 977 983 } 978 984 979 985 #if ENABLE(VARIATION_FONTS) 980 static RefPtr<CSS Value> consumeFontStyleRange(CSSParserTokenRange& range, CSSParserMode cssParserMode)981 { 982 if (auto result = consumeFontStyleKeywordValue(range)) {983 if (result->valueID() == CSSValueOblique) {984 if (range.atEnd())985 return result; 986 987 if (auto firstAngle = consumeAngle(range, cssParserMode)) {988 if (range.atEnd()) 989 return firstAngle;990 if (!consumeSlashIncludingWhitespace(range))991 return nullptr;992 auto secondAngle = consumeAngle(range, cssParserMode);993 if (!secondAngle)994 return nullptr;995 if (firstAngle->floatValue(CSSPrimitiveValue::CSS_DEG) > secondAngle->floatValue(CSSPrimitiveValue::CSS_DEG))996 return nullptr;997 auto result = CSSValueList::createSlashSeparated();998 result->append(firstAngle.releaseNonNull());999 result->append(secondAngle.releaseNonNull());1000 return RefPtr<CSSValue>(WTFMove(result));1001 }1002 1003 if (auto firstNumber = consumeNumber(range, ValueRangeAll)) {1004 if (range.atEnd())1005 return firstNumber; 1006 if (!consumeSlashIncludingWhitespace(range))1007 return nullptr;1008 auto secondNumber = consumeNumber(range, ValueRangeAll);1009 if (!secondNumber)1010 return nullptr;1011 if (firstNumber->floatValue() > secondNumber->floatValue())1012 return nullptr;1013 auto result = CSSValueList::createSlashSeparated();1014 result->append(firstNumber.releaseNonNull());1015 result->append(secondNumber.releaseNonNull());1016 return RefPtr<CSSValue>(WTFMove(result));1017 }1018 1019 return nullptr;1020 }1021 return result;1022 } 986 static RefPtr<CSSFontStyleRangeValue> consumeFontStyleRange(CSSParserTokenRange& range, CSSParserMode cssParserMode) 987 { 988 auto keyword = consumeFontStyleKeywordValue(range); 989 if (!keyword) 990 return nullptr; 991 992 if (keyword->valueID() != CSSValueOblique || range.atEnd()) 993 return CSSFontStyleRangeValue::create(keyword.releaseNonNull()); 994 995 if (auto firstAngle = consumeAngle(range, cssParserMode)) { 996 if (range.atEnd()) { 997 auto result = CSSValueList::createSpaceSeparated(); 998 result->append(firstAngle.releaseNonNull()); 999 return CSSFontStyleRangeValue::create(keyword.releaseNonNull(), WTFMove(result)); 1000 } 1001 auto secondAngle = consumeAngle(range, cssParserMode); 1002 if (!secondAngle) 1003 return nullptr; 1004 if (firstAngle->floatValue(CSSPrimitiveValue::CSS_DEG) > secondAngle->floatValue(CSSPrimitiveValue::CSS_DEG)) 1005 return nullptr; 1006 auto result = CSSValueList::createSpaceSeparated(); 1007 result->append(firstAngle.releaseNonNull()); 1008 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)); 1026 return CSSFontStyleRangeValue::create(keyword.releaseNonNull(), WTFMove(result)); 1027 } 1028 1023 1029 return nullptr; 1024 1030 } … … 4386 4392 return false; 4387 4393 4388 addProperty(CSSPropertyFontStyle, CSSPropertyFont, CSS ValuePool::singleton().createIdentifierValue(isItalic(fontDescription.italic()) ? CSSValueItalic : CSSValueNormal), important);4394 addProperty(CSSPropertyFontStyle, CSSPropertyFont, CSSFontStyleValue::create(CSSValuePool::singleton().createIdentifierValue(isItalic(fontDescription.italic()) ? CSSValueItalic : CSSValueNormal)), important); 4389 4395 addProperty(CSSPropertyFontWeight, CSSPropertyFont, CSSValuePool::singleton().createValue(static_cast<float>(fontDescription.weight())), important); 4390 4396 addProperty(CSSPropertyFontSize, CSSPropertyFont, CSSValuePool::singleton().createValue(fontDescription.specifiedSize(), CSSPrimitiveValue::CSS_PX), important); … … 4410 4416 } 4411 4417 // Optional font-style, font-variant, font-stretch and font-weight. 4412 RefPtr<CSS PrimitiveValue> fontStyle;4418 RefPtr<CSSFontStyleValue> fontStyle; 4413 4419 RefPtr<CSSPrimitiveValue> fontVariantCaps; 4414 4420 RefPtr<CSSPrimitiveValue> fontWeight; … … 4449 4455 bool hasWeight = fontWeight; 4450 4456 bool hasStretch = fontStretch; 4451 4452 addProperty(CSSPropertyFontStyle, CSSPropertyFont, fontStyle ? fontStyle.releaseNonNull() : CSSValuePool::singleton().createIdentifierValue(CSSValueNormal), important, !hasStyle); 4457 4458 if (!fontStyle) 4459 fontStyle = CSSFontStyleValue::create(CSSValuePool::singleton().createIdentifierValue(CSSValueNormal)); 4460 4461 addProperty(CSSPropertyFontStyle, CSSPropertyFont, fontStyle.releaseNonNull(), important, !hasStyle); 4453 4462 addProperty(CSSPropertyFontVariantCaps, CSSPropertyFont, fontVariantCaps ? fontVariantCaps.releaseNonNull() : CSSValuePool::singleton().createIdentifierValue(CSSValueNormal), important, !hasVariant); 4454 4463 /* … … 4473 4482 return false; 4474 4483 addProperty(CSSPropertyLineHeight, CSSPropertyFont, lineHeight.releaseNonNull(), important); 4475 } else {4484 } else 4476 4485 addProperty(CSSPropertyLineHeight, CSSPropertyFont, CSSValuePool::singleton().createIdentifierValue(CSSValueNormal), important, true); 4477 }4478 4486 4479 4487 // Font family must come now. -
trunk/Source/WebCore/editing/EditingStyle.cpp
r213464 r214359 30 30 #include "ApplyStyleCommand.h" 31 31 #include "CSSComputedStyleDeclaration.h" 32 #include "CSSFontStyleValue.h" 32 33 #include "CSSParser.h" 33 34 #include "CSSRuleList.h" … … 143 144 { 144 145 RefPtr<CSSValue> value = extractPropertyValue(style, propertyID); 146 if (propertyID == CSSPropertyFontStyle && is<CSSFontStyleValue>(value.get()) && downcast<CSSFontStyleValue>(value.get())->isItalic()) 147 return CSSValueItalic; 145 148 if (!is<CSSPrimitiveValue>(value.get())) 146 149 return 0; -
trunk/Source/WebCore/svg/SVGFontFaceElement.cpp
r211591 r214359 66 66 CSSPropertyID propId = cssPropertyIdForSVGAttributeName(name); 67 67 if (propId > 0) { 68 // FIXME: Parse using the @font-face descriptor grammars, not the property grammars. 68 69 m_fontFaceRule->mutableProperties().setProperty(propId, value, false); 69 70 rebuildFontFace();
Note: See TracChangeset
for help on using the changeset viewer.