Open Bug 908233 Opened 8 years ago Updated 3 years ago

document.elementFromPoint does not behave as expected


(Core :: DOM: Core & HTML, defect, P5)

21 Branch
Windows 7





(Reporter: carl.allain, Unassigned)



(1 file)

Attached file 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.
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.
Attachment #794069 - Attachment mime type: text/plain → text/html
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.
Component: Untriaged → DOM
Product: Firefox → Core
Comment 2 sounds correct to me, and the bug is invalid as far as I can tell...

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
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.