Last Comment Bug 698929 - Implement event.stopImmediatePropagation
: Implement event.stopImmediatePropagation
Status: RESOLVED FIXED
: dev-doc-complete
Product: Core
Classification: Components
Component: DOM: Events (show other bugs)
: unspecified
: All All
: -- enhancement (vote)
: mozilla10
Assigned To: Olli Pettay [:smaug] (high review load, please consider other reviewers)
:
Mentors:
http://dvcs.w3.org/hg/domcore/raw-fil...
Depends on: 699925
Blocks:
  Show dependency treegraph
 
Reported: 2011-11-01 16:01 PDT by David Bruant
Modified: 2011-11-17 09:17 PST (History)
5 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
patch (41.59 KB, patch)
2011-11-02 14:56 PDT, Olli Pettay [:smaug] (high review load, please consider other reviewers)
no flags Details | Diff | Review
patch (40.97 KB, patch)
2011-11-03 08:16 PDT, Olli Pettay [:smaug] (high review load, please consider other reviewers)
jst: review+
Details | Diff | Review
up-to-date (41.00 KB, patch)
2011-11-04 10:17 PDT, Olli Pettay [:smaug] (high review load, please consider other reviewers)
no flags Details | Diff | Review

Description David Bruant 2011-11-01 16:01:31 PDT
This function (http://www.w3.org/TR/DOM-Level-3-Events/#events-event-type-stopImmediatePropagation ) is implemented in Chrome, Safari and IE9 (according to http://samples.msdn.microsoft.com/ietestcenter/#webapps ) but still lacks in Firefox. It can be useful to ensure security (make sure that only the event handler you decided run, for instance).
Comment 1 Olli Pettay [:smaug] (high review load, please consider other reviewers) 2011-11-01 16:09:43 PDT
(In reply to David Bruant from comment #0)
> (make sure that
> only the event handler you decided run, for instance).
It can't ensure that. There can be listeners in the list before your listener.
Comment 2 David Bruant 2011-11-01 16:14:22 PDT
(In reply to Olli Pettay [:smaug] from comment #1)
> (In reply to David Bruant from comment #0)
> > (make sure that
> > only the event handler you decided run, for instance).
> It can't ensure that. There can be listeners in the list before your
> listener.
True. I meant "under the condition that you run first".
Comment 3 Olli Pettay [:smaug] (high review load, please consider other reviewers) 2011-11-02 14:56:34 PDT
Created attachment 571467 [details] [diff] [review]
patch

the interesting part is in the beginning. Rest is mainly just (automatic) uuid changes.
Uploaded to tryserver.
Comment 4 Olli Pettay [:smaug] (high review load, please consider other reviewers) 2011-11-02 15:07:30 PDT
Note, the patch gives IE9/DOM4 behavior. Webkit does something a bit different with the flags,
and I haven't understood what Opera does.
Comment 5 Olli Pettay [:smaug] (high review load, please consider other reviewers) 2011-11-03 04:03:06 PDT
Or, hmm, does IE9 still do something else. I need to test.
Comment 6 Olli Pettay [:smaug] (high review load, please consider other reviewers) 2011-11-03 05:18:34 PDT
So, IE9 clears propagation flags after dispatching an event.
Gecko kinds of does that also atm (unless system group listener calls stopPropagation, but that is a bug.)
I think IE9's behavior is better than what DOM4 says (and no one implements that part of DOM4 correctly anyway).
Comment 7 Olli Pettay [:smaug] (high review load, please consider other reviewers) 2011-11-03 08:16:23 PDT
Created attachment 571648 [details] [diff] [review]
patch

Simpler, and keeps more of the old behavior, and IE9 seems to behave this way.
(I'll file spec bugs)
Comment 8 Olli Pettay [:smaug] (high review load, please consider other reviewers) 2011-11-04 10:17:40 PDT
Created attachment 572013 [details] [diff] [review]
up-to-date
Comment 9 Olli Pettay [:smaug] (high review load, please consider other reviewers) 2011-11-04 11:39:11 PDT
https://hg.mozilla.org/mozilla-central/rev/ae9e5bf847fc
Comment 10 David Bruant 2011-11-17 07:26:54 PST
(In reply to Olli Pettay [:smaug] from comment #7)
> (I'll file spec bugs)
Did you? Where can i follow progress on that?

Doc: https://developer.mozilla.org/en/DOM/event.stopImmediatePropagation
https://developer.mozilla.org/en/Firefox_10_for_developers#DOM
Comment 11 Olli Pettay [:smaug] (high review load, please consider other reviewers) 2011-11-17 09:17:39 PST
Sorry, I haven't filed them yet. I need to re-review DOM4's event handling fully, since it seems
to have some minor problems there and there. (D3E kind of don't have those problems, I think,
because it leaves some cases undefined.)

Note You need to log in before you can comment on or make changes to this bug.