ttwf-js-cssomview-getclientrects-length.html (1281B)
1 <!DOCTYPE html> 2 <html> 3 <head> 4 <title>CSSOM View API Test: the length of getClientRects</title> 5 <link rel="author" title="simplezeroec" href="mailto:zhaolp0419@gmail.com"> 6 <link rel="help" href="https://www.w3.org/TR/cssom-view/#dom-element-getclientrects"> 7 <meta name="flags" content="dom"> 8 <meta name="assert" content="getClientRects will return rects of the correct number"> 9 <script src="/resources/testharness.js"></script> 10 <script src="/resources/testharnessreport.js"></script> 11 12 </head> 13 <body> 14 <div id="rectcontainer"> 15 <button id="testBtn" >Test</button> 16 <a id="testLink">Test Link</a> 17 </div> 18 <div id="log"></div> 19 <script> 20 21 test(function(){assert_equals(document.getElementById("rectcontainer").getClientRects().length,1,"1 ClientRects should be returned");},"assert_length_of_getClientRects_from_Parent"); 22 test(function(){assert_equals(document.getElementById("testBtn").getClientRects().length,1,"1 ClientRects should be returned");},"assert_length_of_getClientRects_from_Button"); 23 test(function(){assert_equals(document.getElementById("testLink").getClientRects().length,1,"1 ClientRects should be returned");},"assert_length_of_getClientRects_from_Link"); 24 25 26 </script> 27 </body> 28 </html>