offset-position-computed.html (1670B)
1 <!DOCTYPE html> 2 <html> 3 <head> 4 <meta charset="utf-8"> 5 <title>Motion Path Module Level 1: getComputedStyle().offsetPosition</title> 6 <link rel="help" href="https://drafts.fxtf.org/motion-1/#offset-position-property"> 7 <meta name="assert" content="offset-position is 'auto', 'normal', or a computed position."> 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 #target { 13 font-size: 40px; 14 } 15 </style> 16 </head> 17 <body> 18 <div id="target"></div> 19 <script> 20 test_computed_value("offset-position", "auto"); 21 test_computed_value("offset-position", "normal"); 22 23 test_computed_value("offset-position", "left bottom", "0% 100%"); 24 test_computed_value("offset-position", "center center", "50% 50%"); 25 test_computed_value("offset-position", "right center", "100% 50%"); 26 test_computed_value("offset-position", "center top", "50% 0%"); 27 test_computed_value("offset-position", "center bottom", "50% 100%"); 28 test_computed_value("offset-position", "calc(5em + 20%) center", "calc(20% + 200px) 50%"); 29 test_computed_value("offset-position", "right 3em", "100% 120px"); 30 test_computed_value("offset-position", "10px 20%"); 31 test_computed_value("offset-position", "left -10px top -20%", "-10px -20%"); 32 test_computed_value("offset-position", "right 10% bottom 5em", "90% calc(100% - 200px)"); 33 test_computed_value("offset-position", "top 10px right -20%", "120% 10px"); 34 test_computed_value("offset-position", "left 10% bottom 2em", "10% calc(100% - 80px)"); 35 test_computed_value('offset-position', 'calc(10px - 0.5em) calc(10px + 0.5em)', '-10px 30px'); 36 </script> 37 </body> 38 </html>