GetBoundingRect.html (774B)
1 <!doctype html> 2 <html> 3 <head> 4 <meta charset="utf-8"> 5 <title>getBoundingClientRect</title> 6 <link rel="help" href="https://drafts.csswg.org/cssom-view/#dom-element-getboundingclientrect"> 7 <script src="/resources/testharness.js"></script> 8 <script src="/resources/testharnessreport.js"></script> 9 10 <style> 11 #foo { 12 margin: 0px 0px 0px 5px; 13 transform: translate(10px, 200px); 14 position: fixed; 15 left: 5px; 16 background-color: red; 17 } 18 </style> 19 </head> 20 <body> 21 <div id="foo"> 22 FOO 23 </div> 24 <script> 25 test(function () { 26 var foo = document.getElementById("foo").getBoundingClientRect(); 27 assert_equals(foo.left, 20); 28 }); 29 </script> 30 </body> 31 </html>