-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
elementFromPoint() is sometimes incorrect #41227
Copy link
Copy link
Open
Description
Use this simplified version of tests/wpt/tests/pointerevents/compat/pointerevent_mouse-pointer-on-scrollbar.html for testing:
<!DOCTYPE html>
<style>
#target {
height: 100px;
width: 100px;
overflow-y: scroll;
}
#spacer {
background: green;
height: 200px;
}
</style>
<div id="target">
<div id="spacer"></div>
</div>
<script>
var receivedEvents = [];
var targetDiv = document.getElementById("target");
var rect = targetDiv.getBoundingClientRect();
var x1 = rect.right - 5;
var y1 = rect.top + 20;
let hitNode = document.elementFromPoint(x1, y1);
console.log(`Testing ${x1}, ${y1}`);
console.log(`hitNode is ${hitNode.getAttribute("id")}`);
console.log(`targetDiv is ${targetDiv.getAttribute("id")}`);
</script>Servo's incorrect output is:
Testing 103, 28
hitNode is spacer
targetDiv is target
while Firefox's correct output is:
Testing 103, 28
hitNode is target
targetDiv is target
Reactions are currently unavailable