Bug 67824 - [meta] Events should have constructors
: [meta] Events should have constructors
Status: ASSIGNED
Product: WebKit
Classification: Unclassified
Component: HTML DOM
: 528+ (Nightly build)
: Unspecified Unspecified
: P2 Normal
Assigned To: Kentaro Hara
:
Depends on: 63878 66756 67248 67273 67527 67537 67800 67825 67922 67924 67926 67927 67969 67977 68048 68067 68148 68336 68793 68883 68896 69829 69893 69907 69911 69980 70017 70296 71345 71685 72856 107411 107430 107630 107919 108303 108320 109170
Blocks:
  Show dependency treegraph
 
Reported: 2011-09-08 18:01 PDT by Kentaro Hara
Modified: 2013-02-22 14:25 PST (History)
12 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Kentaro Hara 2011-09-08 18:01:12 PDT
The following Events have the specs for their constructors:
Event, CustomEvent, ProgressEvent

The following Events do not yet have the specs for their constructors, and we are now proposing the specs:
UIEvent, MouseEvent, KeyboardEvent, WheelEvent, TextEvent, CompositionEvent, HashChangeEvent, MessageEvent, ErrorEvent, PageTransitionEvent, PopStateEvent, CloseEvent

The following Events do not yet have the specs for their constructors and will not have the specs, since these Events are WebKit-specific. We need to implement these constructors based on the current IDL of initXXXXXXEvent():
BeforeLoadEvent, WebKitAnimationEvent, WebKitTransitionEvent, OverflowEvent

We will not implement constructors for the following Events, since these Events will be deprecated:
MutationEvent
Comment 2 Kentaro Hara 2011-10-13 17:17:12 PDT
Current progress:

Event, CustomEvent, ProgressEvent => Done. Specs are defined and constructors are implemented.

UIEvent, MouseEvent, KeyboardEvent, WheelEvent, TextEvent, CompositionEvent => On-going. Specs are under discussion. After the specs are defined, I will implement constructors for these Events.

HashChangeEvent, MessageEvent, ErrorEvent, PageTransitionEvent, PopStateEvent, CloseEvent => Done. Specs are defined and constructors are implemented.

BeforeLoadEvent, WebKitAnimationEvent, WebKitTransitionEvent, OverflowEvent => Done. No specs because they are WebKit-specific. Constructors are implemented.

MutationEvent => I will not implement this, since MutationEvent is going to be deprecated.


And I will fix the follow-up bugs:
https://bugs.webkit.org/show_bug.cgi?id=67926
https://bugs.webkit.org/show_bug.cgi?id=67927
https://bugs.webkit.org/show_bug.cgi?id=67980
Comment 3 Simon Fraser (smfr) 2012-01-09 18:01:58 PST
What about keyboard events?
Comment 4 Kentaro Hara 2012-01-09 18:06:41 PST
http://html5labs.interoperabilitybridges.com/dom4events/(In reply to comment #3)
> What about keyboard events?

I've been asking the spec author to define the spec (but it has been taking so loooooooong time...). After the spec is defined, I'd really want to implement them. I'll ping the spec author again.

Spec draft:
http://html5labs.interoperabilitybridges.com/dom4events/
Comment 5 Kentaro Hara 2012-03-02 05:45:25 PST
(In reply to comment #4)
> http://html5labs.interoperabilitybridges.com/dom4events/(In reply to comment #3)
> > What about keyboard events?
> 
> I've been asking the spec author to define the spec (but it has been taking so loooooooong time...). After the spec is defined, I'd really want to implement them. I'll ping the spec author again.
> 
> Spec draft:
> http://html5labs.interoperabilitybridges.com/dom4events/

I've triggered the www-dom@ discussion several times, but it seems to be stopped again...

http://lists.w3.org/Archives/Public/www-dom/2012JanMar/0132.html

As far as I understand, www-dom@ people have reached a consensus on Event constructors (i.e. new XXXEvent()). The spec writer is trying to move the spec draft to w3.org but nothing has happened for one month:)
Comment 6 Kentaro Hara 2012-03-21 16:41:29 PDT
Regarding the specs of Event constructors, the discussion was re-triggered in W3C bugzilla and another MSFT person took over the spec writing, but consequently the bug was marked as "LATER"...

https://www.w3.org/Bugs/Public/show_bug.cgi?id=14051
Comment 7 Daniel Freedman 2012-09-25 15:24:27 PDT
Has there been any additional movement on this? The PointerEvents submission (http://www.w3.org/Submission/pointer-events/) is written to use an Event Constructor, and I'd hate to see them have to make an initPointerEvent.
Comment 8 Adam Barth 2012-09-25 15:58:00 PDT
New events should use event constructors rather than initFooEvent.  We even have support for it in the code generator.
Comment 9 Kentaro Hara 2012-09-25 17:01:15 PDT
(In reply to comment #7)
> Has there been any additional movement on this? The PointerEvents submission (http://www.w3.org/Submission/pointer-events/) is written to use an Event Constructor, and I'd hate to see them have to make an initPointerEvent.

Events should have constructors, as Adam pointed out.

That being said, the tricky part is that PointerEvent inherit MouseEvent, which does not yet have a constructor. I've been asking MSFT guys to spec the MouseEvent constructor for a long time but the bug was marked as LATER (https://www.w3.org/Bugs/Public/show_bug.cgi?id=14051).

Either way, it's the time to restart the discussion:

- I'll ask Jacob Rossi and Travis Leithead about the timeline for DOM4 constructors. Given that the PointerEvent constructor is speced by Jacob, I hope they are now interested in working on the DOM4 constructors.

- If it will take more time to spec the DOM4 constructors, I will start discussion in webkit-dev@ about whether it is OK to implement the DOM4 constructors without waiting for the spec. If we could reach the consensus, I can start the implementation. (Nit: Implementing constructors for MouseEvent and KeyboardEvent is a bit trickier than other constructors.)
Comment 10 Daniel Freedman 2013-02-22 14:21:08 PST
Awesome work on all these event constructors!

Now that we have constructor syntax for MouseEvents, could we add the buttons property to MouseEvent that is specified in DOM Level 3 Events? Relevant WebKit bug: https://bugs.webkit.org/show_bug.cgi?id=81855.
Comment 11 Kentaro Hara 2013-02-22 14:25:47 PST
(In reply to comment #10)
> Now that we have constructor syntax for MouseEvents, could we add the buttons property to MouseEvent that is specified in DOM Level 3 Events? Relevant WebKit bug: https://bugs.webkit.org/show_bug.cgi?id=81855.

Sounds reasonable to me.