inset-computed.html (1130B)
1 <!DOCTYPE html> 2 <html> 3 <head> 4 <meta charset="utf-8"> 5 <title>CSS Positioned Layout Module: getComputedStyle() for inset properties</title> 6 <link rel="help" href="https://drafts.csswg.org/css-position/#insets"> 7 <script src="/resources/testharness.js"></script> 8 <script src="/resources/testharnessreport.js"></script> 9 <script src="/css/support/computed-testcommon.js"></script> 10 </head> 11 <body> 12 <div id="target"></div> 13 <style> 14 #target { 15 font-size: 40px; 16 } 17 </style> 18 <script> 19 const values = [ 20 // [input, serialized(optional)] 21 ["auto"], 22 ["calc(10px + 0.5em)", "30px"], 23 ["calc(10px - 0.5em)", "-10px"], 24 ["-40%"], 25 ["calc(50% + 60px)"] 26 ]; 27 function test_inset_longhand(longhand_property) { 28 for (let value of values) { 29 if (value[1] === undefined) 30 test_computed_value(longhand_property, value[0]); 31 else 32 test_computed_value(longhand_property, value[0], value[1]); 33 } 34 } 35 36 test_inset_longhand("inset-block-start"); 37 test_inset_longhand("inset-block-end"); 38 test_inset_longhand("inset-inline-start"); 39 test_inset_longhand("inset-inline-end"); 40 </script> 41 </body> 42 </html>