This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
Background: We are planning to make all Events constructible. For example, CustomEvent already has the spec for its constructor (http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#interface-customevent). We propose a spec for MouseEvent constructor as follows: [Constructor(DOMString type, optional MouseEventInit eventInitDict)] dictionary MouseEventInit : UIEventInit { long screenX; long screenY; long clientX; long clientY; boolean ctrlKey; boolean shiftKey; boolean altKey; boolean metaKey; unsigned short button; unsigned short buttons; EventTarget relatedTarget; }
DragEventInit in the HTML spec now depends on this.
Correction: [Constructor(DOMString type, optional MouseEventInit eventInitDict)] interface MouseEvent : UIEvent { ... } dictionary MouseEventInit : UIEventInit { long screenX; long screenY; long clientX; long clientY; boolean ctrlKey; boolean shiftKey; boolean altKey; boolean metaKey; unsigned short button; unsigned short buttons; EventTarget relatedTarget; }
Assigning to myself to take action on these open bugs.
Really thank you for working on this!! WebKit implementation has been waiting for the spec. (https://bugs.webkit.org/show_bug.cgi?id=67824)
I'd love to see these constructors defined as well. I did a quick check of DOM4, and didn't see definitions for the derived events that we have bugs on: 14050, 14051, 14052, 14053, 14054, 14055. This is an interesting situation. I like event constructors, don't get me wrong, but they are a "new" feature introduced by DOM4 (which has the algorithm that describes how they work for the Event interface as well as any derived interfaces, according to 4.4 Constructing events (http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#constructing-events). I'd prefer not to add them to DOM3 at this time. Anne, DOM4 seems to provide the right hook to allow any derived Event interface that has a constructor to be specified. Do you think we need any follow-up action to account for UIEvent, MouseEvent, KeyboardEvent, TextEvent, CompositionEvent constructors? For example, it might be nice to note which of the "common" events have constructors?
I would really appreciate your work! FYI: The spec draft by Jacob Rossi: http://html5labs.interoperabilitybridges.com/dom4events/ The discussion on www-dom@: http://lists.w3.org/Archives/Public/www-dom/2011OctDec/0081.html http://lists.w3.org/Archives/Public/www-dom/2012JanMar/0025.html
Based on Jacob's comments in that last email discussion, the presently called "DOM4 Events" could become a WebApps deliverable. It also appears that those events defined in that spec have constructors as requested by this bug and the others mentioned earlier. Kentaro, in light of another specification picking up these event constructors, do you object to resolving the current set of bugs on this component as LATER (i.e., will come in a later specification)? In the mean time, I'm going to link these various bugs together for tracking all blocked on the resolution of this bug.
(marked as enhancement)
(In reply to comment #7) > Kentaro, in light of another specification picking up these event constructors, > do you object to resolving the current set of bugs on this component as LATER > (i.e., will come in a later specification)? I do not object it. BTW, when will the "later" be? (I just want to know the plan.)
I spoke with Jacob about the status of "DOM4 Events". He's not quite sure on the timeline for getting that spec into WebApps--presumably we can put some more attention on that once this spec is locked down :-) Thanks for your understanding. I'm resolving the set of bugs for adding Event Constructors as "Later".
FYI, the meta-bug to track Event constructors in WebKit is this: https://bugs.webkit.org/show_bug.cgi?id=67824