perspective-origin-computed.html (2199B)
1 <!DOCTYPE html> 2 <html> 3 <head> 4 <meta charset="utf-8"> 5 <title>CSS Transform Module Level 2: getComputedStyle().perspectiveOrigin</title> 6 <link rel="help" href="https://drafts.csswg.org/css-transforms-2/#perspective-origin-property"> 7 <meta name="assert" content="perspective-origin computed value is a pair of absolute lengths"> 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 width: 200px; 14 height: 300px; 15 font-size: 40px; 16 } 17 </style> 18 </head> 19 <body> 20 <div id="target"></div> 21 <script> 22 test_computed_value("perspective-origin", "10%", "20px 150px"); 23 test_computed_value("perspective-origin", "10% center", "20px 150px"); 24 test_computed_value("perspective-origin", "20% 30px", "40px 30px"); 25 test_computed_value("perspective-origin", "30px center", "30px 150px"); 26 test_computed_value("perspective-origin", "40px top", "40px 0px"); 27 test_computed_value("perspective-origin", "bottom 10% right 20%", "160px 270px"); 28 test_computed_value("perspective-origin", "bottom right", "200px 300px"); 29 test_computed_value("perspective-origin", "center", "100px 150px"); 30 test_computed_value("perspective-origin", "center 50px", "100px 50px"); 31 test_computed_value("perspective-origin", "center bottom", "100px 300px"); 32 test_computed_value("perspective-origin", "center center", "100px 150px"); 33 test_computed_value("perspective-origin", "center left", "0px 150px"); 34 test_computed_value("perspective-origin", "left", "0px 150px"); 35 test_computed_value("perspective-origin", "left 10px", "0px 10px"); 36 test_computed_value("perspective-origin", "left bottom", "0px 300px"); 37 test_computed_value("perspective-origin", "left center", "0px 150px"); 38 test_computed_value("perspective-origin", "right 40%", "200px 120px"); 39 test_computed_value("perspective-origin", "right 30% top -60px", "140px -60px"); 40 test_computed_value("perspective-origin", "top", "100px 0px"); 41 test_computed_value("perspective-origin", "right 20px bottom 30px", "180px 270px"); 42 43 test_computed_value("perspective-origin", "right calc(10px - 0.5em) top calc(10px - 0.5em)", "210px -10px"); 44 </script> 45 </body> 46 </html>