font-face-style-normal.html (1690B)
1 <!DOCTYPE html> 2 <html> 3 <head> 4 <meta charset="utf-8"> 5 <title>CSS Fonts: parsing 'normal' in the font-style descriptor</title> 6 <link rel="author" title="Jonathan Kew" href="mailto:jkew@mozilla.org"/> 7 <link rel="help" href="https://drafts.csswg.org/css-fonts/#descdef-font-face-font-style"> 8 <meta name="assert" content="Ensure that although 'normal' equates to 'oblique 0deg', a following <angle> is not allowed."> 9 <script src="/resources/testharness.js"></script> 10 <script src="/resources/testharnessreport.js"></script> 11 </head> 12 <body> 13 <style> 14 @font-face { 15 font-family: test1; 16 font-style: normal; 17 src: url(/fonts/Ahem.ttf); 18 } 19 @font-face { 20 font-family: test2; 21 font-style: oblique 0deg; 22 src: url(/fonts/Ahem.ttf); 23 } 24 @font-face { 25 font-family: test3; 26 font-style: oblique 0deg 10deg; 27 src: url(/fonts/Ahem.ttf); 28 } 29 @font-face { 30 font-family: test4; 31 font-style: normal 10deg; 32 src: url(/fonts/Ahem.ttf); 33 } 34 </style> 35 <script> 36 promise_test(async (t) => { 37 const fonts = await document.fonts.load("12px test1"); 38 assert_equals(fonts[0].style, "normal", "'normal' serializes as specified"); 39 }); 40 promise_test(async (t) => { 41 const fonts = await document.fonts.load("12px test2"); 42 assert_equals(fonts[0].style, "normal", "'oblique 0deg' serializes as 'normal'"); 43 }); 44 promise_test(async (t) => { 45 const fonts = await document.fonts.load("12px test3"); 46 assert_equals(fonts[0].style, "oblique 0deg 10deg", "oblique range serializes as specified"); 47 }); 48 promise_test(async (t) => { 49 const fonts = await document.fonts.load("12px test4"); 50 assert_equals(fonts[0].style, "normal", "'normal 10deg' is not a valid range"); 51 }); 52 </script> 53 </body> 54 </html>