Bug 158883 - TouchEvent should have a constructor
Summary: TouchEvent should have a constructor
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Chris Dumez
URL:
Keywords: WebExposed
Depends on:
Blocks: 147740
  Show dependency treegraph
 
Reported: 2016-06-17 12:39 PDT by Chris Dumez
Modified: 2016-06-17 13:51 PDT (History)
8 users (show)

See Also:


Attachments
Patch (9.32 KB, patch)
2016-06-17 12:43 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff
Patch (11.22 KB, patch)
2016-06-17 13:50 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Dumez 2016-06-17 12:39:56 PDT
TouchEvent should have a constructor:
https://w3c.github.io/touch-events/#touchevent-interface
Comment 1 Chris Dumez 2016-06-17 12:43:44 PDT
Created attachment 281577 [details]
Patch
Comment 2 Benjamin Poulain 2016-06-17 13:39:42 PDT
Comment on attachment 281577 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=281577&action=review

> LayoutTests/fast/events/touch/touch-event-constructor.html:8
> +description("Tests the TouchEvent constructor");

Tests->Test

> LayoutTests/fast/events/touch/touch-event-constructor.html:30
> +shouldNotThrow("ev = new TouchEvent('touchmove', { touches: listA, targetTouches: listB, changedTouches: listC, bubbles: true })");
> +shouldBe("ev.__proto__", "TouchEvent.prototype");
> +shouldBeEqualToString("ev.type", "touchmove");
> +shouldBe("ev.touches.length", "1");
> +shouldBe("ev.targetTouches.length", "2");
> +shouldBe("ev.changedTouches.length", "3");
> +shouldBeTrue("ev.bubbles");

Ideally you should also cover each list separately.
Comment 3 Chris Dumez 2016-06-17 13:50:28 PDT
Created attachment 281585 [details]
Patch
Comment 4 Chris Dumez 2016-06-17 13:51:13 PDT
Comment on attachment 281585 [details]
Patch

Clearing flags on attachment: 281585

Committed r202178: <http://trac.webkit.org/changeset/202178>
Comment 5 Chris Dumez 2016-06-17 13:51:19 PDT
All reviewed patches have been landed.  Closing bug.