font-width-computed.html (1550B)
1 <!DOCTYPE html> 2 <html> 3 <head> 4 <meta charset="utf-8"> 5 <title>CSS Fonts Module Level 4: getComputedStyle().fontWidth</title> 6 <link rel="help" href="https://www.w3.org/TR/css-fonts-4/#font-width-prop"> 7 <meta name="assert" content="font-width computed value is a percentage."> 8 <script src="/resources/testharness.js"></script> 9 <script src="/resources/testharnessreport.js"></script> 10 <script src="/css/support/computed-testcommon.js"></script> 11 <style> 12 #container { 13 container-type: inline-size; 14 width: 10px; 15 } 16 </style> 17 </head> 18 <body> 19 <div id="container"> 20 <div id="target"></div> 21 </div> 22 <script> 23 for (const property of ['font-width','font-stretch']) { 24 test_computed_value(property, 'ultra-condensed', '50%'); 25 test_computed_value(property, 'extra-condensed', '62.5%'); 26 test_computed_value(property, 'condensed', '75%'); 27 test_computed_value(property, 'semi-condensed', '87.5%'); 28 test_computed_value(property, 'normal', '100%'); 29 test_computed_value(property, 'semi-expanded', '112.5%'); 30 test_computed_value(property, 'expanded', '125%'); 31 test_computed_value(property, 'extra-expanded', '150%'); 32 test_computed_value(property, 'ultra-expanded', '200%'); 33 34 test_computed_value(property, '234.5%'); 35 test_computed_value(property, 'calc(100%)', '100%'); 36 test_computed_value(property, 'calc(0%)', '0%'); 37 test_computed_value(property, 'calc(-100%)', '0%'); 38 test_computed_value(property, 'calc(100% + 100%)', '200%'); 39 test_computed_value(property, 'calc(100% + (sign(20cqw - 10px) * 5%))', '95%'); 40 } 41 </script> 42 </body> 43 </html>