document.elementFromPoint does not behave as expected

UNCONFIRMED
Unassigned

Status

()

P5
normal
UNCONFIRMED
5 years ago
4 months ago

People

(Reporter: carl.allain, Unassigned)

Tracking

21 Branch
x86_64
Windows 7
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Reporter)

Description

5 years ago
Created attachment 794069 [details]
test1.html

User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:21.0) Gecko/20100101 Firefox/21.0 (Beta/Release)
Build ID: 20130511120803

Steps to reproduce:

Use the sample html file provided by opening it in a browser tab.

Reduce the browser window and scroll so the only thing you see is the body text 'Allo'.

Click on the body text 'Allo'.



Actual results:

Two alert windows will be shown. The second one is the one that is interesting as it gives us the name of the Element which Mozilla thinks we clicked on. It shows HTMLHeadingElement instead of HTMLBodyElement.


Expected results:

The second alert should have shown HTMLBodyElement as with IE and Chrome.
(Reporter)

Comment 1

5 years ago
And for some reason Firefox scrolls to show the heading when we click on the body text while other browsers leave the document as it was shown.

Updated

5 years ago
Attachment #794069 - Attachment mime type: text/plain → text/html

Comment 2

5 years ago
I think it's because the browser window get resized when the first alert is displayed. So by the time document.elementFromPoint is called, the position of the click is actually over the h1 element.

Note that you get the expected result if you comment out the first alert.

Updated

5 years ago
Component: Untriaged → DOM
Product: Firefox → Core
Comment 2 sounds correct to me, and the bug is invalid as far as I can tell...
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
You need to log in before you can comment on or make changes to this bug.