test_overflowing-body.html (922B)
1 <!DOCTYPE HTML> 2 <html> 3 <!-- 4 Test InspectorUtils.GetOverflowingChildrenOfElement applied to the body element 5 --> 6 <head> 7 <meta charset="utf-8"> 8 <title>Test InspectorUtils.GetOverflowingChildrenOfElement on the body element</title> 9 <script src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script> 10 <style> 11 body { 12 overflow: auto; 13 margin: 0; 14 } 15 .tallBox { 16 overflow: auto; 17 background: lavender; 18 width: 200px; 19 height: 110vh; 20 } 21 </style> 22 <script> 23 'use strict'; 24 25 SimpleTest.waitForExplicitFinish(); 26 const InspectorUtils = SpecialPowers.InspectorUtils; 27 28 function runTests() { 29 const body = document.documentElement; 30 const overflowing_children = InspectorUtils.getOverflowingChildrenOfElement(body); 31 32 is(overflowing_children.length, 1, `body has the expected number of children.`); 33 34 SimpleTest.finish(); 35 }; 36 window.onload = runTests; 37 </script> 38 </head> 39 <body> 40 <div class="tallBox"><div> 41 </body> 42 </html>