Some problems with registering of event listeners during a treatment of event




14 years ago
14 years ago


(Reporter: bugzilla, Unassigned)




Firefox Tracking Flags

(Not tracked)



(1 attachment)



14 years ago
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."

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.

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."

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 :)

Comment 1

14 years ago

Comment 2

14 years ago
After re-reading of the note about DOM3 Events,
(, I'm
don't sure the triggering of the listener 'listener6' is a bug. See paragraph
1.2.1 and 1.2.2.

Comment 3

14 years ago
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.
Keywords: testcase

Comment 4

14 years ago
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.
Last Resolved: 14 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.