Re: Conflicts between D3E and Web DOM Core

On 03/11/2011 10:39 PM, Glenn Maynard wrote:
> On Fri, Mar 11, 2011 at 12:54 PM, Jacob Rossi<jrossi@microsoft.com>  wrote:
>> Actually, null string has nothing to do with it. Anne has spec'd the default to be empty string, not null.
>
> The null string and the empty string mean the same thing: "", not null.
>
>> But spending time defining behavior that conflicts all current implementations and has no use case just stalls the progression of DOM L3 Events and yields no real value add.
>
> Not all.  WebKit doesn't check whether initEvent was called; it just
> checks whether event.type != "".  If it's to allow e.type == "", it
> would need a new flag indicating whether initEvent was called.
>
> Firefox seems buggy here.
>  It neither dispatches the event nor throws
> an exception when dispatchEvent is called without initEvent.
>  It seems
> to silently do nothing, which I think is wrong in any case.  (I havn't
> checked the source to see precisely what's happening.)
>

In Gecko the event is dispatched just normally in that case.
But because the event isn't initialized to "", or null, or anything 
else, no listener for it can be called.
That sounds pretty reasonable to me, although based on
D3E UNSPECIFIED_EVENT_TYPE_ERR should be thrown.

I'll fix this soon so that Gecko will throw that exception, and
still allow "" in the initEvent as it does now.

-Olli

Received on Saturday, 12 March 2011 22:24:14 UTC