W3C home > Mailing lists > Public > www-dom@w3.org > April to June 2010

Re: addEventListener with useCapture = true triggered by target phase event?

From: ATSUSHI TAKAYAMA <taka.atsushi@googlemail.com>
Date: Wed, 14 Apr 2010 11:47:12 -0400
Message-ID: <t2j9cef076f1004140847mf23a6d7dr6ab8c09a97c7681c@mail.gmail.com>
To: Doug Schepers <schepers@w3.org>
Cc: www-dom@w3.org
Thank you Doug,

>
> If you have any tests for this, they would be appreciated.
>

Here it is. useCapture is true.

=== html ===
<input type="button" id="target" value="Click me" />
<script>
var target = document.getElementById('target');
target.addEventListener('click', function(e) {
  if (e.eventPhase === Event.AT_TARGET && e.target === target) {
    alert('Should be no alert')
  }
}, true);
</script>
=== /html ===

If eventPhase is the target phase, and event target is the element on
which the EventListener was set, then the event should not be fired.
Firefox, Opera, Safari, Chromium all fires.

A. TAKAYAMA
Received on Wednesday, 14 April 2010 15:47:40 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Friday, 22 June 2012 06:14:04 GMT