Open Bug 422057 Opened 17 years ago Updated 3 years ago

Javascript event target locked after changing underlying node

Categories

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

x86
Windows XP
defect

Tracking

()

UNCONFIRMED

People

(Reporter: michiel, Unassigned)

Details

Attachments

(1 file)

User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.12) Gecko/20080201 Firefox/2.0.0.12 Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.12) Gecko/20080201 Firefox/2.0.0.12 It appears that, after removing the target element of an event from the DOM tree, all subsequent mouse events are on the parent of that removed element until after the next mouse event. When you move the mouse, the onmousemove event displays the tagname of the target element in the log area at the bottom. It displays 'HTML' outside the box and 'DIV' inside the box. When you mouse-down on in the box, the content of the box is changed to a textarea element. You can edit the text and click in the textarea to update the cursor position. Focus is given to allow you to enter text immediately. When you click on the text-area while pressing the CTRL key, the text-area is replaced by its content. Then when you move the mouse outside the box, the event target tag-name remains 'DIV' instead of becoming 'HTML' as it was initially. You need to click somewhere for the proper situation to restore. Reproducible: Always Steps to Reproduce: 1. Move the mouse outside the box and see the text 'on mouse over: target HTML' 2. Click in the box (mouse up event should suffice) 3. press control and click in the box again (again, mouse up event should suffice) 4. move the mouse outside the box 5. See the text 'on mouse move: target DIV' in the log area instead of 'on mouse move: target HTML' 6. Click anywhere 7. Move the mouse outside the box 8. See the text 'on mouse move: target HTML' again Actual Results: After removing the TEXTAREA and replacing it with a text node, the target of the on-mouse-move event is always the DIV containing the original TEXTAREA instead of the actual target of the event. Expected Results: After removing the TEXTAREA and replacing it with a text node, the target of the on-mouse-move event should be the actual target of the event like before the TEXTAREA was replaced.
Assignee: general → nobody
Component: JavaScript Engine → DOM
QA Contact: general → general
Could you please test this on FF3 (beta or nightly). Event handling is quite different there.
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
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: