Look the next testcase. The listener 'listener4' is triggered but it should not be. DOM spec. say: "If an EventListener is added to an EventTarget while it is processing an event, it will not be triggered by the current actions but may be triggered during a later stage of event flow, such as the bubbling phase." http://www.w3.org/TR/DOM-Level-2-Events/events.html#Events-EventTarget-addEventListener The listener 'listener3' added on BODY during the capturing phase is triggered during the bubbling phase, in conformance with the spec. The listener 'listener6' registered when the listener 'listener1' is triggered (thus after the dispatch of the event) should not be triggered. DOM spec. say: "The chain of EventTargets from the top of the tree to the event's target is determined before the initial dispatch of the event." for capturing phase. http://www.w3.org/TR/DOM-Level-2-Events/events.html#Events-flow-capture-h3 And for bubbling phase: "The chain of EventTargets from the event target to the top of the tree is determined before the initial dispatch of the event." http://www.w3.org/TR/DOM-Level-2-Events/events.html#Events-flow-bubbling-h3 Actual result: listener4 and listener6 are triggered during the same event flow during which they are registered. Expected result: listener4 and listener6 aren't triggered during the event flow during which they are registered. As usual, sorry for my bad english :)
After re-reading of the note about DOM3 Events, (http://www.w3.org/TR/2003/NOTE-DOM-Level-3-Events-20031107/events.html), I'm don't sure the triggering of the listener 'listener6' is a bug. See paragraph 1.2.1 and 1.2.2.
Could you re-test with a recent trunk build? Patch for bug 174320 has fixed a few of listeners issues, at least the first part of your report. By the way, please report seaprate issues in separate bugs.
I tested with "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8b2) Gecko/20050312 Firefox/1.0+". It works. The listener 'listener4' isn't triggered. Good job, guys :) For 'listener6', i think this is not a bug (See comment #2). I mark this bug as 'FIXED'. If the triggering of 'listener6' is finally a bug, i will open a new entry in bugzilla.
Status: UNCONFIRMED → RESOLVED
Last Resolved: 14 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.