Ticket #9951 (closed bug: fixed)
Wrong order in .trigger() when DOM is modified in a handler
| Reported by: | dmethvin | Owned by: | dmethvin |
|---|---|---|---|
| Priority: | low | Milestone: | 1.7 |
| Component: | event | Version: | 1.6.2 |
| Keywords: | Cc: | ||
| Blocking: | Blocked by: |
Description
The W3C DOM Event Model spec ( http://www.w3.org/TR/DOM-Level-3-Events/#event-flow) says browsers are supposed to calculate the event propagation path in advance, so that modifications to the DOM in a handler does not affect the path. Although the liveHandler method attempts this for delegated events, .trigger() does not.
http://jsfiddle.net/dmethvin/rGyJ3/
There are still some situations where delegated events may yield a different path than directly attached ones; need to document that.
Change History
comment:1 Changed 22 months ago by dmethvin
- Owner set to dmethvin
- Priority changed from undecided to low
- Status changed from new to assigned
- Component changed from unfiled to event
- Milestone changed from None to 1.7
comment:2 Changed 20 months ago by Dave Methvin
- Status changed from assigned to closed
- Resolution set to fixed
Fix #9951. Precompute path for .trigger() to match up with W3C spec.
Changeset: ecd10464e8659b008e52161cc029f9d6863e33b3
Please follow the bug reporting guidlines and use jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.
