Bug 147740
Summary: | TouchEvent and Touch should have constructors | ||
---|---|---|---|
Product: | WebKit | Reporter: | Rick Byers <rbyers> |
Component: | UI Events | Assignee: | Beth Dakin <bdakin> |
Status: | RESOLVED FIXED | ||
Severity: | Normal | CC: | bdakin, benjamin, cdumez, dino, graouts, philip, sam, webkit-bug-importer |
Priority: | P2 | Keywords: | InRadar |
Version: | 528+ (Nightly build) | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
Bug Depends on: | 158883, 162709, 162713, 162728, 162734, 162736, 162757, 162787, 162806 | ||
Bug Blocks: |
Rick Byers
Most UIEvents at this point have a DOM Event constructor. TouchEvent is a notable exception. It's not a big use case, but JS-generated events are sometimes useful and (IMHO) ideally all event types would be consistent in this regard. Is there any interest in adding constructors to WebKit? Should be trivial.
We (Touch Event Community Group) have recently added constructor definitions to the draft TouchEvents level 2 spec: http://w3c.github.io/touch-events/touchevents.html#touchevent-interface (bug: https://github.com/w3c/touch-events/issues/10). Any feedback on the design? I'm happy to make changes before pages start depending on the API.
http://crbug.com/508675 tracks shipping these in blink.
Attachments | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
Rick Byers
Beth, is this little tweak something you hope to do at some point?
Beth Dakin
(In reply to comment #1)
> Beth, is this little tweak something you hope to do at some point?
Thanks for cc'ing me! Could be interesting. :-)
Radar WebKit Bug Importer
<rdar://problem/26063585>
Rick Byers
/cc grouts who seems to be doing other TouchEvents works (yay!)
Chris Dumez
I am working on the TouchEvent constructor.
Chris Dumez
Added a TouchEvent constructor via Bug 158883. It looks like WebKit on iOS already has a constructor for Touch so closing.
Rick Byers
Chris, does the Touch constructor on iOS follow the spec (and normal DOM constructor pattern) in taking a dictionary? foolip@ says he can only get it working by passing a list of parameters similar to createTouch.
Rick Byers
Reference: https://codereview.chromium.org/2352333002/
Chris Dumez
(In reply to comment #7)
> Chris, does the Touch constructor on iOS follow the spec (and normal DOM
> constructor pattern) in taking a dictionary? foolip@ says he can only get
> it working by passing a list of parameters similar to createTouch.
It does not look like we support passing a Dictionary at the moment, it takes in a list of parameters :/
Rick Byers
> It does not look like we support passing a Dictionary at the moment, it takes in a list of parameters :/
Ugh, yeah that's not going to be interoperable (the whole point of the constructors is to avoid having to keep extending a long argument list).
Ok if we reopen this to track getting WebKit passing this test?
https://github.com/w3c/web-platform-tests/blob/master/touch-events/touch-touchevent-constructor.html
Rick Byers
Note that if issue 157269 isn't going to be fixed, than the Safari-specific TouchEvent constructor should probably also have a way to set these non-standard properties on TouchEvent.
I have now come across one script that is relying on these properties on Safari: http://s0.2mdn.net/instream/video/client.js, and as a result other libraries cannot move from initTouchEvent to the TouchEvent constructor without breaking this script.
Rick Byers
Darn sorry, used the wrong hotword. See "bug 15726" for the clientX/clientY issue above.
Rick Byers
Damn damn, not my day :-)
See "bug 157269" for the clientX/clientY issue above.
Chris Dumez
Resolved in sub-bugs.