- From: Garrett Smith <dhtmlkitchen@gmail.com>
- Date: Thu, 3 Mar 2011 14:41:35 -0800
- To: Jacob Rossi <jrossi@microsoft.com>
- Cc: "www-dom@w3.org" <www-dom@w3.org>
On 3/3/11, Jacob Rossi <jrossi@microsoft.com> wrote:
> I've identified some potential conflicts between Web DOM Core and DOM L3
> Events:
>
> 1. WDC allows the dispatch of an event without having initialized its event
> object (e=document.creatEvent("Event"); window.dispatchEvent(e);). No major
> browser supports this today and there are not any valid use cases for this
> behavior (that I can think of), so why make implementations change?
>
Maybe the authors' want to make event properties writable and have
defaults? Incompatible, sure.
> 2. cancels and bubbles are now optional arguments for initEvent() in WDC.
> How does this merge with the other init___Event( ) methods which are have
> cancels and bubbles in the middle of their methods? I think there's some
> support for improving how the init methods behave, but this doesn't really
> solve that problem. I'd rather see D3E keep these are required and then Web
> DOM Core consider taking the task of event object constructors. [1]
>
I agree in theory but don't like that proposal that's linked. Doesn't
resolve the major pain of long argument lists. Optional middle params
should not be an option, either. I like value object pattern much
more. I know I've said it but for those who haven't read, and example
of Value Object:
MouseEvent.fireEvent(target, "click"[, optionsObject]);
[...]
--
Garrett
Received on Thursday, 3 March 2011 22:42:07 UTC