Re: Conflicts between D3E and Web DOM Core

On 03/10/2011 10:01 AM, Anne van Kesteren wrote:
> On Thu, 10 Mar 2011 04:30:17 +0100, Jacob Rossi <jrossi@microsoft.com>
> wrote:
>>> Why should we have the artificial restriction? What exactly does
>>> initEvent() do that is required here?
>>
>> initEvent() populates the event object with the necessary properties
>> to make it useful. An event without a type is just a bad programming
>> practice that we shouldn't be encouraging. You use the term
>> "artificial" yet it's not artificial: *all* browsers have this
>> restriction today and it's what the spec says. Changing it to be
>> otherwise requires me to ask, "what's the use case?" Unless there's a
>> valid use case for events without a name, then there's no reason to
>> change.
>
> It is artificial because you can just invoke initEvent with the empty
> string, false, and false, and the event object will be identical. So you
> are essentially throwing for not invoking initEvent which is rather silly.

Why is that silly? Quite often when you have objects with
some kind of init method, you want to "prevent" object usage
before the init is called.

Received on Thursday, 10 March 2011 15:03:14 UTC