flex-computed.html (1561B)
1 <!DOCTYPE html> 2 <html> 3 <head> 4 <meta charset="utf-8"> 5 <title>CSS Flexible Box Layout: getComputedStyle().flex</title> 6 <link rel="help" href="https://drafts.csswg.org/css-flexbox/#propdef-flex"> 7 <meta name="assert" content="flex computed value is specified keywords and/or computed <length-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 #target { 17 font-size: 40px; 18 } 19 </style> 20 </head> 21 <body> 22 <div id="container"> 23 <div id="target"></div> 24 </div> 25 <script> 26 test_computed_value("flex", "none", "0 0 auto"); 27 test_computed_value("flex", "1", "1 1 0%"); 28 test_computed_value("flex", "2 3", "2 3 0%"); 29 test_computed_value("flex", "4 5 6px"); 30 test_computed_value("flex", "7% 8", "8 1 7%"); 31 test_computed_value("flex", "8 auto", "8 1 auto"); 32 test_computed_value("flex", "calc(10px + 0.5em)", "1 1 30px"); 33 test_computed_value("flex", "calc(10px - 0.5em)", "1 1 0px"); 34 test_computed_value("flex", "1 1 calc(10em)", "1 1 400px"); 35 test_computed_value("flex", "1 1 calc(-10em)", "1 1 0px"); 36 test_computed_value("flex", "calc(10 + (sign(20cqw - 10px) * 5)) calc(10 + (sign(20cqw - 10px) * 5)) 1px", "5 5 1px"); 37 test_computed_value("flex", "1 1 calc(10px + (sign(20cqw - 10px) * 5px))", "1 1 5px"); 38 test_computed_value("flex", "calc(1) calc(2 + 1) calc(3px)", "1 3 3px"); 39 test_computed_value("flex", "calc(-1) calc(-1) 0", "0 0 0px"); 40 </script> 41 </body> 42 </html>