Open Bug 908233 Opened 8 years ago Updated 3 years ago
.element From Point does not behave as expected
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.
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.
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
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.