Event propagation quirky with changed EventTarget nodes

RESOLVED FIXED

Status

()

Core
DOM: Events
RESOLVED FIXED
15 years ago
11 years ago

People

(Reporter: WeirdAl, Unassigned)

Tracking

({testcase})

Trunk
x86
Windows 98
testcase
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(3 attachments)

(Reporter)

Description

15 years ago
I've noticed a rather interesting behavior in Mozilla, one which the DOM 2
Events Recommendation and the DOM 3 Events Last Call Working Draft from W3C do
not cover.

Basically, when I replace the actual event target (or likely any ancestor node
of the actual target) with another node, the DOM specs are not clear on correct
behavior.

I'm attaching two testcases, an XUL testcase and an XHTML testcase.  The XUL
testcase is more descriptive, but the XHTML testcase will render in non-Gecko
based browsers as well.

I believe there is at least one bug in the behaviors of the browser here; I'm
just not sure what exactly is "wrong" and what is "correct".
(Reporter)

Comment 1

15 years ago
Created attachment 113068 [details]
XUL testcase
(Reporter)

Comment 2

15 years ago
Created attachment 113069 [details]
XHTML testcase
(Reporter)

Updated

15 years ago
Keywords: testcase
(Reporter)

Comment 3

15 years ago
jst:  thought you'd like to see this, as a member of the DOM WG.
(Reporter)

Comment 4

15 years ago
Running the XUL testcase, the third step, it shows the event propagating through
foo_menu, not bar_menu.  This is clearly a bug.
Alex, could you send a request to the DOM WG (www-dom@w3.org) to clarify the
intended behavior in the DOM Events specification?
(Reporter)

Comment 6

15 years ago
http://lists.w3.org/Archives/Public/www-dom/2003JanMar/0019.html
(Reporter)

Comment 7

15 years ago
http://lists.w3.org/Archives/Public/www-dom/2003JanMar/0022.html

The DOM WG's response.

I think Mr. Hegaret is telling us that for the XUL testcase's second part, the
Event object should still go to the target node.

Comment 8

12 years ago
This is how KHTML handles event propagation:
http://lxr.kde.org/source/kdelibs/khtml/xml/dom_nodeimpl.cpp#L416
But is that a bit slow way to do it, creating a node chain for each event...
Assignee: saari → events
QA Contact: vladimire → ian

Comment 9

12 years ago
Created attachment 179456 [details]
Create event target chain in stack

Any comments on this one?
The idea is to create an event target chain in stack before starting to handle
the event.
This would be quite big change to event handling, but I think something like
this is needed. And hopefully it wouldn't slow down the event handling.
Yes, something like this is absolutely needed; there is no other way to
implement the spec.  Yes, this would be a major change to event handling (and
need changes to all the HandleDOMEvent mathods, if nothing else).  See bug
234455.  Any such code should go there, probably.
Depends on: 234455

Comment 11

11 years ago
fixed in bug 234455
Status: NEW → RESOLVED
Last Resolved: 11 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.