Closed Bug 489197 Opened 15 years ago Closed 3 years ago

elementFromPoint returning HTML instead of BODY element

Categories

(Core :: DOM: CSS Object Model, defect)

x86
Windows XP
defect

Tracking

()

RESOLVED DUPLICATE of bug 1259924

People

(Reporter: jarbon, Unassigned)

References

()

Details

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/525.19 (KHTML, like Gecko) Chrome/1.0.154.55 Safari/525.19
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.8) Gecko/2009032609 Firefox/3.0.8

elementFromPoint is returning the HTML element, when it should be returning the BODY element for points on the page where there is no other element.

Loading the repro html in IE, Chrome, Safari, all show 'BODY'.  FF shows 'HTML'.  Logically, 'BODY' is expected as it is lower in the DOM tree as well.

A fix would be much appreciated for browser compatibility.

The src for the repro url is:
<html>
<title>Should show 'BODY', not 'HTML'.</title>
<body onload="alert(document.elementFromPoint(10,10).tagName);" width="100" height="100">
</body>
</html>

cheers

Reproducible: Always

Steps to Reproduce:
1. http://jarbonpub.appspot.com/repro/chrome/elementFromPoint.html

Actual Results:  
HTML element is found

Expected Results:  
BODY element is found
Component: General → DOM: Core & HTML
Product: Firefox → Core
QA Contact: general → general
https://bugzilla.mozilla.org/show_bug.cgi?id=1472046

Move all DOM bugs that haven’t been updated in more than 3 years and has no one currently assigned to P5.

If you have questions, please contact :mdaly.
Priority: -- → P5
Severity: normal → --
Component: DOM: Core & HTML → DOM: CSS Object Model
Priority: P5 → --

This is a WebKit quirk, not a bug with getElementFromPoint.

Status: UNCONFIRMED → RESOLVED
Closed: 3 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.