New issue
Advanced search Search tips

Issue 782188 link

Starred by 1 user

Issue metadata

Status: Assigned
Owner:
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

Interoperability issues with document.elementFromPoint() function

Project Member Reported by sriram...@samsung.com, Nov 7 2017

Issue description

What steps will reproduce the problem?
(1) Load the below test case
(2) Observe the behaviour in chrome, firefox and other browsers (Edge, safari)
(3) The output is different in each of the browsers.

******************** TEST CASE *********************
<style>
body { margin: 0; }
</style>
<div style="width: 100.5px;">abc</div>
<script>
	console.log(document.elementFromPoint(100.5, 12));
	console.log(document.elementFromPoint(100.9, 12));
	console.log(document.elementFromPoint(101, 12));
</script>
******************************************************

********************* Output *******************************
Firefox (same irrespective of manual zoom level)
Div
Body
Body

Chrome
Normal zoom:
Div
Div
Body

With manual zoom: 125%
Div
Body
Body

with manual zoom: 200%
Body
Body
Body 


This has come up during the review of https://chromium-review.googlesource.com/c/chromium/src/+/716096
 
Owner: schenney@chromium.org
Status: Assigned (was: Untriaged)
I think we should report the rendered pixels under the point, in which case we are right to round. But the zoom results suggest that Firefox is not doing that, and is working in sub-pixel coordinates.

I can verify the difficulty of fixing this. But right now it seems low priority.

Sign in to add a comment