| <!DOCTYPE html> | |
| <title>Test that document.elementFromPoint supports "double" arguments.</title> | |
| <style> | |
| body { margin: 0; } | |
| </style> | |
| <script src="../resources/testharness.js"></script> | |
| <script src="../resources/testharnessreport.js"></script> | |
| <div style="width: 100.25px;">abc</div> | |
| <script> | |
| test(function() { | |
| var divElement = document.querySelector("div"); | |
| var rect = divElement.getBoundingClientRect(); | |
| // Test that elementFromPoint hits div element. | |
| assert_equals(document.elementFromPoint(100.25, 12), divElement); | |
| // Page zoom factor of 3.0 should still hit div element. | |
| eventSender.setPageZoomFactor(3.0); | |
| assert_equals(document.elementFromPoint(100.25, 12), divElement); | |
| // Page zoom factor of 4.0 should hit body element as the fraction will not be snapped. | |
| eventSender.setPageZoomFactor(4.0); | |
| assert_equals(document.elementFromPoint(100.25, 12), document.body); | |
| }); | |
| </script> |