Re: [DOM Level 3 Events] optionality of the capture argument in addEventListener/removeEventListener

On 9/25/10, Anne van Kesteren <annevk@opera.com> wrote:
> On Fri, 24 Sep 2010 23:00:37 +0200, Charles Pritchard <chuck@jumis.com>
> wrote:
>> There are many cases where leaving out that required 3rd argument
>> just fails miserably.
>>
>> Wish it weren't so. Afaik, it'll definitely break things.
>
> In the short term, sure. In the long term all browsers will support it. We
> should definitely make this change.
>

In the short term, new tutorials may be written saying that it is
optional and authors will follow those guides, causing
interoperability problems for older browsers.

That's the bad. The good is the long term scenario of having a
slightly cleaner API and resultant code (that doesn't need the extra
param).

I'd like to see a little warning in the spec, something along the lines of:

useCapture -
 [description]
 If omitted, the behavior is the same as if `false` had been supplied.

Note that `useCapture` was required in previous versions of the
specification and omitting it will result in an error in older
implementations. Authors should therefore continue to supply a value
for `useCapture` until implementations support its omission.

[...]
Old thread:
<http://lists.w3.org/Archives/Public/www-dom/2006AprJun/0022.html>
-- 
Garrett

Received on Friday, 1 October 2010 20:05:25 UTC