2 <script src=
"../../../resources/js-test.js"></script>
3 <script src=
"resources/elementsFromPoint.js"></script>
20 transform: translate(
50px,
50px);
27 <iframe id=
"iframe" src=
"data:text/html,<div id='div' style='width: 100px; height: 100px; background: red'></div>"></iframe>
28 <iframe id=
"iframeScrollbars" src=
"data:text/html,<div id='big' style='width: 500px; height: 500px; background: blue;'></div><div id='div' style='position: absolute; top: 0; left: 0; width: 100px; height: 100px; background: green;'>"></iframe>
29 <div id=
"console"></div>
31 window
.jsTestIsAsync
= true;
33 if (window
.testRunner
)
34 testRunner
.dumpAsText();
37 internals
.settings
.setMockScrollbarsEnabled(true);
40 checkElementsFromPointFourCorners('document', 'iframe');
41 checkElementsFromPointFourCorners('document.getElementById(\'iframe\').contentDocument', 'document.getElementById(\'iframe\').contentDocument.getElementById(\'div\')');
42 checkElementsFromPointFourCorners('document', 'iframeScrollbars');
43 checkElementsFromPointFourCorners('document.getElementById(\'iframeScrollbars\').contentDocument', 'document.getElementById(\'iframeScrollbars\').contentDocument.getElementById(\'div\')');
45 // Ensure that elements outside the inner document's viewport are not returned.
46 shouldBeEqualToNumber('document.getElementById(\'iframeScrollbars\').contentDocument.elementsFromPoint(-1, -1).length', 0);
47 shouldBeEqualToNumber('document.getElementById(\'iframeScrollbars\').contentDocument.elementsFromPoint(1, 1).length', 2);
48 shouldBeEqualToNumber('document.getElementById(\'iframeScrollbars\').contentDocument.elementsFromPoint(500, 500).length', 0);
49 shouldBeEqualToNumber('document.getElementById(\'iframeScrollbars\').contentDocument.elementsFromPoint(140, 140).length', 0);