This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 14051 - Need a spec for MouseEvent constructor
Summary: Need a spec for MouseEvent constructor
Status: RESOLVED LATER
Alias: None
Product: WebAppsWG
Classification: Unclassified
Component: HISTORICAL - DOM3 Events (show other bugs)
Version: unspecified
Hardware: PC All
: P2 enhancement
Target Milestone: ---
Assignee: Travis Leithead [MSFT]
QA Contact: public-webapps-bugzilla
URL:
Whiteboard:
Keywords: needsReview
Depends on:
Blocks: 14050 14052 14053 14054 14055
  Show dependency treegraph
 
Reported: 2011-09-06 18:38 UTC by Kentaro Hara
Modified: 2012-04-07 05:18 UTC (History)
5 users (show)

See Also:


Attachments

Description Kentaro Hara 2011-09-06 18:38:38 UTC
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;
}
Comment 1 Ian 'Hixie' Hickson 2011-09-10 01:26:59 UTC
DragEventInit in the HTML spec now depends on this.
Comment 2 Kentaro Hara 2011-09-27 13:40:04 UTC
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;
}
Comment 3 Travis Leithead [MSFT] 2012-03-08 21:16:37 UTC
Assigning to myself to take action on these open bugs.
Comment 4 Kentaro Hara 2012-03-08 22:06:17 UTC
Really thank you for working on this!! WebKit implementation has been waiting for the spec. (https://bugs.webkit.org/show_bug.cgi?id=67824)
Comment 5 Travis Leithead [MSFT] 2012-03-09 00:50:55 UTC
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?
Comment 6 Kentaro Hara 2012-03-09 00:58:09 UTC
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
Comment 7 Travis Leithead [MSFT] 2012-03-09 01:16:19 UTC
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.
Comment 8 Travis Leithead [MSFT] 2012-03-09 01:26:33 UTC
(marked as enhancement)
Comment 9 Kentaro Hara 2012-03-09 02:23:36 UTC
(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.)
Comment 10 Travis Leithead [MSFT] 2012-03-19 19:30:52 UTC
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".
Comment 11 Kentaro Hara 2012-04-07 05:18:57 UTC
FYI, the meta-bug to track Event constructors in WebKit is this: https://bugs.webkit.org/show_bug.cgi?id=67824