Add PointerEvent, plus feature flag, plus Web Platform Tests
authordino@apple.com <dino@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 22 Sep 2018 00:51:47 +0000 (00:51 +0000)
committerdino@apple.com <dino@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 22 Sep 2018 00:51:47 +0000 (00:51 +0000)
https://bugs.webkit.org/show_bug.cgi?id=189867
<rdar://problem/44697384>

Reviewed by Simon Fraser.

LayoutTests/imported/w3c:

Import the Web Platform Tests for Pointer Events.

* resources/import-expectations.json:
* web-platform-tests/pointerevents/META.yml: Added.
* web-platform-tests/pointerevents/README.md: Added.
* web-platform-tests/pointerevents/extension/idlharness.window-expected.txt: Added.
* web-platform-tests/pointerevents/extension/idlharness.window.html: Added.
* web-platform-tests/pointerevents/extension/idlharness.window.js: Added.
* web-platform-tests/pointerevents/extension/pointerevent_constructor-expected.txt: Added.
* web-platform-tests/pointerevents/extension/pointerevent_constructor.html: Added.
* web-platform-tests/pointerevents/extension/pointerevent_touch-action-verification-expected.txt: Added.
* web-platform-tests/pointerevents/extension/pointerevent_touch-action-verification.html: Added.
* web-platform-tests/pointerevents/extension/w3c-import.log: Added.
* web-platform-tests/pointerevents/idlharness.window-expected.txt: Added.
* web-platform-tests/pointerevents/idlharness.window.html: Added.
* web-platform-tests/pointerevents/idlharness.window.js: Added.
* web-platform-tests/pointerevents/pointerevent_constructor-expected.txt: Added.
* web-platform-tests/pointerevents/pointerevent_constructor.html: Added.
* web-platform-tests/pointerevents/pointerevent_on_event_handlers-expected.txt: Added.
* web-platform-tests/pointerevents/pointerevent_on_event_handlers.html: Added.
* web-platform-tests/pointerevents/pointerevent_styles.css: Added.
* web-platform-tests/pointerevents/pointerevent_support.js: Added.
* web-platform-tests/pointerevents/pointerevent_touch-action-illegal-expected.txt: Added.
* web-platform-tests/pointerevents/pointerevent_touch-action-illegal.html: Added.
* web-platform-tests/pointerevents/pointerevent_touch-action-verification-expected.txt: Added.
* web-platform-tests/pointerevents/pointerevent_touch-action-verification.html: Added.
* web-platform-tests/pointerevents/pointerlock/resources/pointerevent_movementxy-iframe.html: Added.
* web-platform-tests/pointerevents/pointerlock/resources/w3c-import.log: Added.
* web-platform-tests/pointerevents/resources/pointerevent_attributes_hoverable_pointers-iframe.html: Added.
* web-platform-tests/pointerevents/resources/pointerevent_fractional_coordinates-iframe.html: Added.
* web-platform-tests/pointerevents/resources/pointerevent_pointerId_scope-iframe.html: Added.
* web-platform-tests/pointerevents/resources/w3c-import.log: Added.
* web-platform-tests/pointerevents/w3c-import.log: Added.

Source/WebCore:

Add the PointerEvent interface.

Tests: imported/w3c/web-platform-tests/pointerevents/extension/idlharness.window.html
       imported/w3c/web-platform-tests/pointerevents/extension/pointerevent_constructor.html
       imported/w3c/web-platform-tests/pointerevents/extension/pointerevent_touch-action-verification.html
       imported/w3c/web-platform-tests/pointerevents/idlharness.window.html
       imported/w3c/web-platform-tests/pointerevents/pointerevent_constructor.html
       imported/w3c/web-platform-tests/pointerevents/pointerevent_on_event_handlers.html
       imported/w3c/web-platform-tests/pointerevents/pointerevent_touch-action-illegal.html
       imported/w3c/web-platform-tests/pointerevents/pointerevent_touch-action-verification.html

* DerivedSources.make:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
        Add the new files.

* dom/Event.h:
(WebCore::Event::isPointerEvent const): New virtual identification method.

* dom/EventNames.in: Add PointerEvent so the InterfaceType code is generated.

* dom/PointerEvent.cpp: The PointerEvent interface, as specified by W3C.
(WebCore::PointerEvent::PointerEvent):
(WebCore::PointerEvent::eventInterface const):
* dom/PointerEvent.h: Added.
* dom/PointerEvent.idl: Added.

* page/RuntimeEnabledFeatures.h: Clean up the ordering of the features, so there aren't
confusing blank lines interspersed with #if USE macros.
(WebCore::RuntimeEnabledFeatures::setPointerEventsEnabled): Add a new flag for Pointer Events.
(WebCore::RuntimeEnabledFeatures::pointerEventsEnabled const):

Source/WebKit:

Add PointerEvents as an experimental feature.

* Shared/WebPreferences.yaml:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@236378 268f45cc-cd09-0410-ab3c-d52691b4dbfc

46 files changed:
LayoutTests/imported/w3c/ChangeLog
LayoutTests/imported/w3c/resources/import-expectations.json
LayoutTests/imported/w3c/web-platform-tests/pointerevents/META.yml [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/pointerevents/README.md [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/pointerevents/extension/idlharness.window-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/pointerevents/extension/idlharness.window.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/pointerevents/extension/idlharness.window.js [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/pointerevents/extension/pointerevent_constructor-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/pointerevents/extension/pointerevent_constructor.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/pointerevents/extension/pointerevent_touch-action-verification-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/pointerevents/extension/pointerevent_touch-action-verification.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/pointerevents/extension/w3c-import.log [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/pointerevents/idlharness.window-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/pointerevents/idlharness.window.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/pointerevents/idlharness.window.js [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_constructor-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_constructor.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_on_event_handlers-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_on_event_handlers.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_styles.css [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_support.js [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_touch-action-illegal-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_touch-action-illegal.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_touch-action-verification-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_touch-action-verification.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerlock/resources/pointerevent_movementxy-iframe.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerlock/resources/w3c-import.log [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/pointerevents/resources/pointerevent_attributes_hoverable_pointers-iframe.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/pointerevents/resources/pointerevent_fractional_coordinates-iframe.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/pointerevents/resources/pointerevent_pointerId_scope-iframe.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/pointerevents/resources/w3c-import.log [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/pointerevents/w3c-import.log [new file with mode: 0644]
Source/WebCore/CMakeLists.txt
Source/WebCore/ChangeLog
Source/WebCore/DerivedSources.make
Source/WebCore/Sources.txt
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/dom/Event.h
Source/WebCore/dom/EventNames.in
Source/WebCore/dom/PointerEvent.cpp [new file with mode: 0644]
Source/WebCore/dom/PointerEvent.h [new file with mode: 0644]
Source/WebCore/dom/PointerEvent.idl [new file with mode: 0644]
Source/WebCore/features.json
Source/WebCore/page/RuntimeEnabledFeatures.h
Source/WebKit/ChangeLog
Source/WebKit/Shared/WebPreferences.yaml

index f87963e..0ebdb22 100644 (file)
@@ -1,3 +1,45 @@
+2018-09-21  Dean Jackson  <dino@apple.com>
+
+        Add PointerEvent, plus feature flag, plus Web Platform Tests
+        https://bugs.webkit.org/show_bug.cgi?id=189867
+        <rdar://problem/44697384>
+
+        Reviewed by Simon Fraser.
+
+        Import the Web Platform Tests for Pointer Events.
+
+        * resources/import-expectations.json:
+        * web-platform-tests/pointerevents/META.yml: Added.
+        * web-platform-tests/pointerevents/README.md: Added.
+        * web-platform-tests/pointerevents/extension/idlharness.window-expected.txt: Added.
+        * web-platform-tests/pointerevents/extension/idlharness.window.html: Added.
+        * web-platform-tests/pointerevents/extension/idlharness.window.js: Added.
+        * web-platform-tests/pointerevents/extension/pointerevent_constructor-expected.txt: Added.
+        * web-platform-tests/pointerevents/extension/pointerevent_constructor.html: Added.
+        * web-platform-tests/pointerevents/extension/pointerevent_touch-action-verification-expected.txt: Added.
+        * web-platform-tests/pointerevents/extension/pointerevent_touch-action-verification.html: Added.
+        * web-platform-tests/pointerevents/extension/w3c-import.log: Added.
+        * web-platform-tests/pointerevents/idlharness.window-expected.txt: Added.
+        * web-platform-tests/pointerevents/idlharness.window.html: Added.
+        * web-platform-tests/pointerevents/idlharness.window.js: Added.
+        * web-platform-tests/pointerevents/pointerevent_constructor-expected.txt: Added.
+        * web-platform-tests/pointerevents/pointerevent_constructor.html: Added.
+        * web-platform-tests/pointerevents/pointerevent_on_event_handlers-expected.txt: Added.
+        * web-platform-tests/pointerevents/pointerevent_on_event_handlers.html: Added.
+        * web-platform-tests/pointerevents/pointerevent_styles.css: Added.
+        * web-platform-tests/pointerevents/pointerevent_support.js: Added.
+        * web-platform-tests/pointerevents/pointerevent_touch-action-illegal-expected.txt: Added.
+        * web-platform-tests/pointerevents/pointerevent_touch-action-illegal.html: Added.
+        * web-platform-tests/pointerevents/pointerevent_touch-action-verification-expected.txt: Added.
+        * web-platform-tests/pointerevents/pointerevent_touch-action-verification.html: Added.
+        * web-platform-tests/pointerevents/pointerlock/resources/pointerevent_movementxy-iframe.html: Added.
+        * web-platform-tests/pointerevents/pointerlock/resources/w3c-import.log: Added.
+        * web-platform-tests/pointerevents/resources/pointerevent_attributes_hoverable_pointers-iframe.html: Added.
+        * web-platform-tests/pointerevents/resources/pointerevent_fractional_coordinates-iframe.html: Added.
+        * web-platform-tests/pointerevents/resources/pointerevent_pointerId_scope-iframe.html: Added.
+        * web-platform-tests/pointerevents/resources/w3c-import.log: Added.
+        * web-platform-tests/pointerevents/w3c-import.log: Added.
+
 2018-09-21  YUHAN WU  <yuhan_wu@apple.com>
 
         Import WPT content hint tests
index 9e362fb..69faacf 100644 (file)
     "web-platform-tests/payment-method-id": "skip", 
     "web-platform-tests/payment-request": "import", 
     "web-platform-tests/performance-timeline": "skip", 
-    "web-platform-tests/pointerevents": "skip", 
+    "web-platform-tests/pointerevents": "import", 
     "web-platform-tests/pointerlock": "skip", 
     "web-platform-tests/preload": "skip", 
     "web-platform-tests/presentation-api": "skip", 
diff --git a/LayoutTests/imported/w3c/web-platform-tests/pointerevents/META.yml b/LayoutTests/imported/w3c/web-platform-tests/pointerevents/META.yml
new file mode 100644 (file)
index 0000000..ef94157
--- /dev/null
@@ -0,0 +1,9 @@
+spec: https://w3c.github.io/pointerevents/
+suggested_reviewers:
+  - Steditor
+  - jacobrossi
+  - plehegar
+  - scottgonzalez
+  - staktrace
+  - RByers
+  - NavidZ
diff --git a/LayoutTests/imported/w3c/web-platform-tests/pointerevents/README.md b/LayoutTests/imported/w3c/web-platform-tests/pointerevents/README.md
new file mode 100644 (file)
index 0000000..0cc0190
--- /dev/null
@@ -0,0 +1,9 @@
+Directory for Pointer Events Tests
+
+Latest Editor's Draft: https://w3c.github.io/pointerevents/
+
+Latest W3C Technical Report: http://www.w3.org/TR/pointerevents/
+
+Discussion forum for tests: http://lists.w3.org/Archives/Public/public-test-infra/
+
+Test Assertion table: https://www.w3.org/wiki/PointerEvents/TestAssertions
diff --git a/LayoutTests/imported/w3c/web-platform-tests/pointerevents/extension/idlharness.window-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/pointerevents/extension/idlharness.window-expected.txt
new file mode 100644 (file)
index 0000000..a7ea327
--- /dev/null
@@ -0,0 +1,30 @@
+
+FAIL idl_test setup promise_test: Unhandled rejection with value: object "Got an error before parsing any named definition: Unrecognised tokens, line 1 (tokens: "{\"error\": {\"message\"")
+[
+    {
+        "type": "{",
+        "value": "{",
+        "trivia": ""
+    },
+    {
+        "type": "string",
+        "value": "\"error\"",
+        "trivia": ""
+    },
+    {
+        "type": ":",
+        "value": ":",
+        "trivia": ""
+    },
+    {
+        "type": "{",
+        "value": "{",
+        "trivia": " "
+    },
+    {
+        "type": "string",
+        "value": "\"message\"",
+        "trivia": ""
+    }
+]"
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/pointerevents/extension/idlharness.window.html b/LayoutTests/imported/w3c/web-platform-tests/pointerevents/extension/idlharness.window.html
new file mode 100644 (file)
index 0000000..2382913
--- /dev/null
@@ -0,0 +1 @@
+<!-- This file is required for WebKit test infrastructure to run the templated test -->
\ No newline at end of file
diff --git a/LayoutTests/imported/w3c/web-platform-tests/pointerevents/extension/idlharness.window.js b/LayoutTests/imported/w3c/web-platform-tests/pointerevents/extension/idlharness.window.js
new file mode 100644 (file)
index 0000000..895a891
--- /dev/null
@@ -0,0 +1,14 @@
+// META: script=/resources/WebIDLParser.js
+// META: script=/resources/idlharness.js
+
+// https://w3c.github.io/pointerevents/extension.html
+
+idl_test(
+  ['pointerevents-extension'],
+  ['pointerevents', 'uievents', 'dom'],
+  idl_array => {
+    idl_array.add_objects({
+      PointerEvent: ['new PointerEvent("pointer")'],
+    })
+  }
+);
diff --git a/LayoutTests/imported/w3c/web-platform-tests/pointerevents/extension/pointerevent_constructor-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/pointerevents/extension/pointerevent_constructor-expected.txt
new file mode 100644 (file)
index 0000000..6d66d83
--- /dev/null
@@ -0,0 +1,9 @@
+PointerEvent: Dispatch custom event with coalesced events
+
+Test Description: This test checks if PointerEvent constructor works properly with respect to the coalesced events.
+
+The following pointer types were detected: .
+
+
+FAIL PointerEvent: Constructor test event.getCoalescedEvents is not a function. (In 'event.getCoalescedEvents()', 'event.getCoalescedEvents' is undefined)
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/pointerevents/extension/pointerevent_constructor.html b/LayoutTests/imported/w3c/web-platform-tests/pointerevents/extension/pointerevent_constructor.html
new file mode 100644 (file)
index 0000000..43d0aa5
--- /dev/null
@@ -0,0 +1,80 @@
+<!doctype html>
+<html>
+    <head>
+        <title>PointerEvent: Constructor test</title>
+        <meta name="viewport" content="width=device-width">
+        <link rel="stylesheet" type="text/css" href="pointerevent_styles.css">
+        <script src="/resources/testharness.js"></script>
+        <script src="/resources/testharnessreport.js"></script>
+        <!-- Additional helper script for common checks across event types -->
+    </head>
+    <body>
+    <h1>PointerEvent: Dispatch custom event with coalesced events</h1>
+    <h4>Test Description: This test checks if PointerEvent constructor works properly with respect to the coalesced events.</h4>
+    <div id="target0"></div>
+    <script>
+        async_test(function() {
+            var target0 = document.getElementById("target0");
+            // set values for non-default constructor
+            on_event(target0, "pointermove", this.step_func(function(event) {
+                generate_tests(assert_equals, [
+                    ["getCoalescedEvents().length", event.getCoalescedEvents().length, 2],
+                    ["event.target", event.target, target0],
+                    ["event.currentTarget", event.currentTarget, target0],
+                    ["event.eventPhase", event.eventPhase, Event.AT_TARGET],
+                    ["event.clientX", event.clientX, 310],
+                    ["getCoalescedEvents()[0].clientX", event.getCoalescedEvents()[0].clientX, 300],
+                    ["getCoalescedEvents()[1].clientX", event.getCoalescedEvents()[1].clientX, 310],
+                ]);
+                for (var i=0; i<event.getCoalescedEvents().length; i++) {
+                    var coalescedEvent = event.getCoalescedEvents()[i];
+                    generate_tests(assert_equals, [
+                        ["getCoalescedEvents()[" + i + "].pointerId", coalescedEvent.pointerId, event.pointerId],
+                        ["getCoalescedEvents()[" + i + "].pointerType", coalescedEvent.pointerType, event.pointerType],
+                        ["getCoalescedEvents()[" + i + "].isPrimary", coalescedEvent.isPrimary, event.isPrimary],
+                        ["getCoalescedEvents()[" + i + "].getCoalescedEvents().length", coalescedEvent.getCoalescedEvents().length, 0],
+                        ["getCoalescedEvents()[" + i + "].target", coalescedEvent.target, target0],
+                        ["getCoalescedEvents()[" + i + "].currentTarget", coalescedEvent.currentTarget, null],
+                        ["getCoalescedEvents()[" + i + "].eventPhase", coalescedEvent.eventPhase, Event.NONE],
+                        ["getCoalescedEvents()[" + i + "].cancelable", coalescedEvent.cancelable, false],
+                        ["getCoalescedEvents()[" + i + "].bubbles", coalescedEvent.bubbles, false],
+                        ["getCoalescedEvents()[" + i + "].offsetX", coalescedEvent.offsetX, event.offsetX + (i==0?-10:0)],
+                        ["getCoalescedEvents()[" + i + "].offsetY", coalescedEvent.offsetY, event.offsetY],
+                    ]);
+                }
+            }));
+            on_event(target0, "pointerout", this.step_func(function(event) {
+                generate_tests(assert_equals, [
+                    ["default getCoalescedEvents().length", event.getCoalescedEvents().length, 0],
+                ]);
+            }));
+
+            on_event(window, "load", this.step_func_done(function() {
+                assert_not_equals(window.PointerEvent, undefined);
+
+                var pointerEventInitDict =
+                {
+                  pointerId: 42,
+                  pointerType: "pen",
+                  isPrimary: true,
+                  clientX: 300,
+                };
+                
+                var p1 = new PointerEvent("pointermove", pointerEventInitDict);
+                pointerEventInitDict.clientX += 10;
+                var p2 = new PointerEvent("pointermove", pointerEventInitDict);
+                pointerEventInitDict.coalescedEvents = [p1, p2];
+                var event = new PointerEvent("pointermove", pointerEventInitDict);
+                target0.dispatchEvent(event);
+
+                var pointerEventDefault = new PointerEvent("pointerout");
+                target0.dispatchEvent(pointerEventDefault);
+            }, "PointerEvent constructor"));
+        })
+    </script>
+    <div id="complete-notice">
+    <p>The following pointer types were detected: <span id="pointertype-log"></span>.</p>
+    </div>
+    <div id="log"></div>
+    </body>
+</html>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/pointerevents/extension/pointerevent_touch-action-verification-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/pointerevents/extension/pointerevent_touch-action-verification-expected.txt
new file mode 100644 (file)
index 0000000..c5b110d
--- /dev/null
@@ -0,0 +1,51 @@
+Pointer Events touch-action attribute support
+
+Test Description: Test will automatically check parsing behaviour of various touch-action combinations.
+
+touch-action: basic verification
+
+The following pointer types were detected: .
+
+
+FAIL default assert_equals: expected (undefined) undefined but got (string) "auto"
+FAIL stylesheet-none assert_equals: expected (undefined) undefined but got (string) "none"
+FAIL explicit-auto assert_equals: expected (undefined) undefined but got (string) "auto"
+FAIL explicit-pan-x assert_equals: expected (undefined) undefined but got (string) "pan-x"
+FAIL explicit-pan-left assert_equals: expected (undefined) undefined but got (string) "pan-left"
+FAIL explicit-pan-right assert_equals: expected (undefined) undefined but got (string) "pan-right"
+FAIL explicit-pan-y assert_equals: expected (undefined) undefined but got (string) "pan-y"
+FAIL explicit-pan-up assert_equals: expected (undefined) undefined but got (string) "pan-up"
+FAIL explicit-pan-down assert_equals: expected (undefined) undefined but got (string) "pan-down"
+FAIL explicit-pinch-zoom assert_equals: expected (undefined) undefined but got (string) "pinch-zoom"
+FAIL explicit-pan-x-pan-y assert_equals: expected (undefined) undefined but got (string) "pan-x pan-y"
+FAIL explicit-pan-y-pan-x assert_equals: expected (undefined) undefined but got (string) "pan-x pan-y"
+FAIL explicit-pan-left-pan-up assert_equals: expected (undefined) undefined but got (string) "pan-left pan-up"
+FAIL explicit-pan-left-pan-down assert_equals: expected (undefined) undefined but got (string) "pan-left pan-down"
+FAIL explicit-pan-right-pan-up assert_equals: expected (undefined) undefined but got (string) "pan-right pan-up"
+FAIL explicit-pan-right-pan-down assert_equals: expected (undefined) undefined but got (string) "pan-right pan-down"
+FAIL explicit-pan-up-pan-left assert_equals: expected (undefined) undefined but got (string) "pan-left pan-up"
+FAIL explicit-pan-up-pan-right assert_equals: expected (undefined) undefined but got (string) "pan-right pan-up"
+FAIL explicit-pan-down-pan-left assert_equals: expected (undefined) undefined but got (string) "pan-left pan-down"
+FAIL explicit-pan-down-pan-right assert_equals: expected (undefined) undefined but got (string) "pan-right pan-down"
+FAIL explicit-pinch-zoom-pan-x-pan-up assert_equals: expected (undefined) undefined but got (string) "pan-x pan-up pinch-zoom"
+FAIL explicit-pinch-zoom-pan-x-pan-y assert_equals: expected (undefined) undefined but got (string) "manipulation"
+FAIL explicit-manipulation assert_equals: expected (undefined) undefined but got (string) "manipulation"
+FAIL explicit-none assert_equals: expected (undefined) undefined but got (string) "none"
+FAIL explicit-invalid-1 assert_equals: expected (undefined) undefined but got (string) "auto"
+FAIL explicit-invalid-2 assert_equals: expected (undefined) undefined but got (string) "none"
+FAIL explicit-invalid-3 assert_equals: expected (undefined) undefined but got (string) "auto"
+FAIL explicit-invalid-4 assert_equals: expected (undefined) undefined but got (string) "auto"
+FAIL explicit-invalid-5 assert_equals: expected (undefined) undefined but got (string) "auto"
+FAIL explicit-invalid-6 assert_equals: expected (undefined) undefined but got (string) "auto"
+FAIL explicit-invalid-7 assert_equals: expected (undefined) undefined but got (string) "auto"
+FAIL explicit-invalid-8 assert_equals: expected (undefined) undefined but got (string) "auto"
+FAIL explicit-invalid-9 assert_equals: expected (undefined) undefined but got (string) "auto"
+FAIL explicit-invalid-10 assert_equals: expected (undefined) undefined but got (string) "auto"
+FAIL explicit-invalid-11 assert_equals: expected (undefined) undefined but got (string) "auto"
+FAIL explicit-invalid-12 assert_equals: expected (undefined) undefined but got (string) "auto"
+FAIL explicit-invalid-13 assert_equals: expected (undefined) undefined but got (string) "auto"
+FAIL explicit-invalid-14 assert_equals: expected (undefined) undefined but got (string) "auto"
+FAIL not-inherited assert_equals: expected (undefined) undefined but got (string) "auto"
+FAIL inherit assert_equals: expected (undefined) undefined but got (string) "none"
+FAIL initial assert_equals: expected (undefined) undefined but got (string) "auto"
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/pointerevents/extension/pointerevent_touch-action-verification.html b/LayoutTests/imported/w3c/web-platform-tests/pointerevents/extension/pointerevent_touch-action-verification.html
new file mode 100644 (file)
index 0000000..178f7a6
--- /dev/null
@@ -0,0 +1,97 @@
+<!doctype html>
+<html>
+    <head>
+<!-- This is a fork of the main to support new additions to touch-action.
+     It should be integrated into web-platform-test when they are accepted into the
+     specification. -->
+        <title>touch-action: basic verification</title>
+        <meta name="assert" content="TA15.20 - The touch-action CSS property determines whether touch input MAY trigger default behavior supplied by the user agent.
+        auto: The user agent MAY determine any permitted touch behaviors, such as panning and zooming manipulations of the viewport, for touches that begin on the element.
+        none: Touches that begin on the element MUST NOT trigger default touch behaviors.
+        pan-x: The user agent MAY consider touches that begin on the element only for the purposes of horizontally scrolling the element's nearest ancestor with horizontally scrollable content.
+        pan-y: The user agent MAY consider touches that begin on the element only for the purposes of vertically scrolling the element's nearest ancestor with vertically scrollable content.
+        manipulation: The user agent MAY consider touches that begin on the element only for the purposes of scrolling and continuous zooming. Any additional behaviors supported by auto are out of scope for this specification.">
+        <meta name="viewport" content="width=device-width">
+        <link rel="stylesheet" type="text/css" href="pointerevent_styles.css">
+        <script src="/resources/testharness.js"></script>
+        <script src="/resources/testharnessreport.js"></script>
+        <style>
+          /*
+          Give some rules below something to override in order to test
+          that they really are being parsed
+          */
+          .defnone {
+          touch-action: none;
+          }
+        </style>
+    </head>
+    <body onload="run()">
+        <h2>Pointer Events touch-action attribute support</h2>
+        <h4 id="desc">Test Description: Test will automatically check parsing behaviour of various touch-action combinations.</h4>
+        <script type='text/javascript'>
+            var detected_pointertypes = {};
+
+            setup({ explicit_done: true });
+
+            function run() {
+                var tests = document.querySelectorAll('.test');
+                //TA 15.20
+                for (var i = 0; i < tests.length; i++) {
+                    test(function() {
+                      var style = window.getComputedStyle(tests[i]);
+                      assert_equals(tests[i].attributes.expected.value, style.touchAction);
+                    }, tests[i].id);
+                }
+                done();
+            }
+        </script>
+        <h1>touch-action: basic verification</h1>
+        <div id="complete-notice">
+            <p>The following pointer types were detected: <span id="pointertype-log"></span>.</p>
+        </div>
+        <div id="log"></div>
+        <div class="test" id="default" expected="auto"></div>
+        <div class="test defnone" id="stylesheet-none" expected="none"></div>
+        <div class="test defnone" id="explicit-auto" style="touch-action: auto;" expected="auto"></div>
+        <div class="test" id="explicit-pan-x" style="touch-action: pan-x;" expected="pan-x"></div>
+        <div class="test" id="explicit-pan-left" style="touch-action: pan-left;" expected="pan-left"></div>
+        <div class="test" id="explicit-pan-right" style="touch-action: pan-right;" expected="pan-right"></div>
+        <div class="test" id="explicit-pan-y" style="touch-action: pan-y;" expected="pan-y"></div>
+        <div class="test" id="explicit-pan-up" style="touch-action: pan-up;" expected="pan-up"></div>
+        <div class="test" id="explicit-pan-down" style="touch-action: pan-down;" expected="pan-down"></div>
+        <div class="test" id="explicit-pinch-zoom" style="touch-action: pinch-zoom;" expected="pinch-zoom"></div>
+        <div class="test" id="explicit-pan-x-pan-y" style="touch-action: pan-x pan-y;" expected="pan-x pan-y"></div>
+        <div class="test" id="explicit-pan-y-pan-x" style="touch-action: pan-y pan-x;" expected="pan-x pan-y"></div>
+        <div class="test" id="explicit-pan-left-pan-up" style="touch-action: pan-left pan-up;" expected="pan-left pan-up"></div>
+        <div class="test" id="explicit-pan-left-pan-down" style="touch-action: pan-left pan-down;" expected="pan-left pan-down"></div>
+        <div class="test" id="explicit-pan-right-pan-up" style="touch-action: pan-right pan-up;" expected="pan-right pan-up"></div>
+        <div class="test" id="explicit-pan-right-pan-down" style="touch-action: pan-right pan-down;" expected="pan-right pan-down"></div>
+        <div class="test" id="explicit-pan-up-pan-left" style="touch-action: pan-up pan-left;" expected="pan-left pan-up"></div>
+        <div class="test" id="explicit-pan-up-pan-right" style="touch-action: pan-up pan-right;" expected="pan-right pan-up"></div>
+        <div class="test" id="explicit-pan-down-pan-left" style="touch-action: pan-down pan-left;" expected="pan-left pan-down"></div>
+        <div class="test" id="explicit-pan-down-pan-right" style="touch-action: pan-down pan-right;" expected="pan-right pan-down"></div>
+        <div class="test" id="explicit-pinch-zoom-pan-x-pan-up" style="touch-action: pinch-zoom pan-x pan-up;" expected="pan-x pan-up pinch-zoom"></div>
+        <div class="test" id="explicit-pinch-zoom-pan-x-pan-y" style="touch-action: pinch-zoom pan-x pan-y;" expected="manipulation"></div>
+        <div class="test" id="explicit-manipulation" style="touch-action: manipulation;" expected="manipulation"></div>
+        <div class="test" id="explicit-none" style="touch-action: none;" expected="none"></div>
+        <div class="test" id="explicit-invalid-1" style="touch-action: bogus;" expected="auto"></div>
+        <div class="test defnone" id="explicit-invalid-2" style="touch-action: auto pan-x;" expected="none"></div>
+        <div class="test" id="explicit-invalid-3" style="touch-action: pan-y none;" expected="auto"></div>
+        <div class="test" id="explicit-invalid-4" style="touch-action: pan-x pan-x;" expected="auto"></div>
+        <div class="test" id="explicit-invalid-5" style="touch-action: manipulation pan-x;" expected="auto"></div>
+        <div class="test" id="explicit-invalid-6" style="touch-action: pan-x pan-left;" expected="auto"></div>
+        <div class="test" id="explicit-invalid-7" style="touch-action: auto pan-left;" expected="auto"></div>
+        <div class="test" id="explicit-invalid-8" style="touch-action: none pan-left;" expected="auto"></div>
+        <div class="test" id="explicit-invalid-9" style="touch-action: pan-x pan-right;" expected="auto"></div>
+        <div class="test" id="explicit-invalid-10" style="touch-action: pan-y pan-up;" expected="auto"></div>
+        <div class="test" id="explicit-invalid-11" style="touch-action: pan-y pan-down;" expected="auto"></div>
+        <div class="test" id="explicit-invalid-12" style="touch-action: pan-left pan-right;" expected="auto"></div>
+        <div class="test" id="explicit-invalid-13" style="touch-action: pan-up pan-down;" expected="auto"></div>
+        <div class="test" id="explicit-invalid-14" style="touch-action: pinch-zoom none;" expected="auto"></div>
+        <div style="touch-action: none;">
+          <div class="test" id="not-inherited" expected="auto"></div>
+          <div class="test" id="inherit" style="touch-action: inherit;" expected="none"></div>
+        </div>
+        <div class="test defnone" id="initial" style="touch-action: initial;" expected="auto"></div>
+    </body>
+</html>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/pointerevents/extension/w3c-import.log b/LayoutTests/imported/w3c/web-platform-tests/pointerevents/extension/w3c-import.log
new file mode 100644 (file)
index 0000000..278b616
--- /dev/null
@@ -0,0 +1,19 @@
+The tests in this directory were imported from the W3C repository.
+Do NOT modify these tests directly in WebKit.
+Instead, create a pull request on the WPT github:
+       https://github.com/web-platform-tests/wpt
+
+Then run the Tools/Scripts/import-w3c-tests in WebKit to reimport
+
+Do NOT modify or remove this file.
+
+------------------------------------------------------------------------
+Properties requiring vendor prefixes:
+None
+Property values requiring vendor prefixes:
+None
+------------------------------------------------------------------------
+List of files:
+/LayoutTests/imported/w3c/web-platform-tests/pointerevents/extension/idlharness.window.js
+/LayoutTests/imported/w3c/web-platform-tests/pointerevents/extension/pointerevent_constructor.html
+/LayoutTests/imported/w3c/web-platform-tests/pointerevents/extension/pointerevent_touch-action-verification.html
diff --git a/LayoutTests/imported/w3c/web-platform-tests/pointerevents/idlharness.window-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/pointerevents/idlharness.window-expected.txt
new file mode 100644 (file)
index 0000000..a7ea327
--- /dev/null
@@ -0,0 +1,30 @@
+
+FAIL idl_test setup promise_test: Unhandled rejection with value: object "Got an error before parsing any named definition: Unrecognised tokens, line 1 (tokens: "{\"error\": {\"message\"")
+[
+    {
+        "type": "{",
+        "value": "{",
+        "trivia": ""
+    },
+    {
+        "type": "string",
+        "value": "\"error\"",
+        "trivia": ""
+    },
+    {
+        "type": ":",
+        "value": ":",
+        "trivia": ""
+    },
+    {
+        "type": "{",
+        "value": "{",
+        "trivia": " "
+    },
+    {
+        "type": "string",
+        "value": "\"message\"",
+        "trivia": ""
+    }
+]"
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/pointerevents/idlharness.window.html b/LayoutTests/imported/w3c/web-platform-tests/pointerevents/idlharness.window.html
new file mode 100644 (file)
index 0000000..2382913
--- /dev/null
@@ -0,0 +1 @@
+<!-- This file is required for WebKit test infrastructure to run the templated test -->
\ No newline at end of file
diff --git a/LayoutTests/imported/w3c/web-platform-tests/pointerevents/idlharness.window.js b/LayoutTests/imported/w3c/web-platform-tests/pointerevents/idlharness.window.js
new file mode 100644 (file)
index 0000000..89a994a
--- /dev/null
@@ -0,0 +1,19 @@
+// META: script=/resources/WebIDLParser.js
+// META: script=/resources/idlharness.js
+
+'use strict';
+
+// https://w3c.github.io/pointerevents/
+
+idl_test(
+  ['pointerevents'],
+  ['uievents', 'dom', 'html'],
+  idl_array => {
+    idl_array.add_objects({
+      Element: ['document'],
+      Window: ['window'],
+      Navigator: ['navigator'],
+      PointerEvent: ['new PointerEvent("type")']
+    });
+  }
+);
diff --git a/LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_constructor-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_constructor-expected.txt
new file mode 100644 (file)
index 0000000..ffb81a3
--- /dev/null
@@ -0,0 +1,34 @@
+PointerEvent: Dispatch custom event
+
+Test Description: This test checks if PointerEvent constructor works properly using synthetic pointerover and pointerout events. For valid results, this test must be run without generating real (trusted) pointerover or pointerout events on the black rectangle below.
+
+The following pointer types were detected: pen.
+
+
+PASS PointerEvent: Constructor test 
+PASS custom bubbles 
+PASS custom cancelable 
+PASS custom pointerId 
+PASS custom pointerType 
+PASS custom button 
+PASS custom buttons 
+PASS custom width 
+PASS custom height 
+PASS custom clientX 
+PASS custom clientY 
+PASS custom tiltX 
+PASS custom tiltY 
+PASS custom twist 
+PASS custom isPrimary 
+PASS custom pressure:  
+PASS default pointerId 
+PASS default pointerType 
+PASS default width 
+PASS default height 
+PASS default tiltX 
+PASS default tiltY 
+PASS default pressure 
+PASS default tangentialPressure 
+PASS default twist 
+PASS default isPrimary 
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_constructor.html b/LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_constructor.html
new file mode 100644 (file)
index 0000000..b8a97d1
--- /dev/null
@@ -0,0 +1,114 @@
+<!doctype html>
+<html>
+    <head>
+        <title>PointerEvent: Constructor test</title>
+        <meta name="viewport" content="width=device-width">
+        <link rel="stylesheet" type="text/css" href="pointerevent_styles.css">
+        <script src="/resources/testharness.js"></script>
+        <script src="/resources/testharnessreport.js"></script>
+        <!-- Additional helper script for common checks across event types -->
+        <script type="text/javascript" src="pointerevent_support.js"></script>
+    </head>
+    <body>
+    <h1>PointerEvent: Dispatch custom event</h1>
+    <h4>Test Description: This test checks if PointerEvent constructor works properly using synthetic pointerover and pointerout events. For valid results, this test must be run without generating real (trusted) pointerover or pointerout events on the black rectangle below.</h4>
+    <div id="target0"></div>
+    <script>
+        var detected_pointertypes = {};
+        add_completion_callback(showPointerTypes);
+
+        async_test(function() {
+            var target0 = document.getElementById("target0");
+            // set values for non-default constructor
+            var testBubbles = true;
+            var testCancelable = true;
+            var testPointerId = 42;
+            var testPointerType = 'pen';
+            var testClientX = 300;
+            var testClientY = 500;
+            var testWidth = 3;
+            var testHeight = 5;
+            var testTiltX = -45;
+            var testTiltY = 30;
+            var testButton = 0;
+            var testButtons = 1;
+            var testPressure = 0.4;
+            var testTangentialPressure = 0.5;
+            var testTwist = 286;
+            var testIsPrimary = true;
+
+            on_event(target0, "pointerover", this.step_func(function(event) {
+                detected_pointertypes[ event.pointerType ] = true;
+                generate_tests(assert_equals, [
+                    ["custom bubbles", event.bubbles, testBubbles],
+                    ["custom cancelable", event.cancelable, testCancelable],
+                    ["custom pointerId", event.pointerId, testPointerId],
+                    ["custom pointerType", event.pointerType, testPointerType],
+                    ["custom button", event.button, testButton],
+                    ["custom buttons", event.buttons, testButtons],
+                    ["custom width", event.width, testWidth],
+                    ["custom height", event.height, testHeight],
+                    ["custom clientX", event.clientX, testClientX],
+                    ["custom clientY", event.clientY, testClientY],
+                    ["custom tiltX", event.tiltX, testTiltX],
+                    ["custom tiltY", event.tiltY, testTiltY],
+                    ["custom twist", event.twist, testTwist],
+                    ["custom isPrimary", event.isPrimary, testIsPrimary]
+                ]);
+                test(function() {
+                    assert_approx_equals(event.pressure, testPressure, 0.00000001, "custom pressure: ");
+                    assert_approx_equals(event.tangentialPressure, testTangentialPressure, 0.00000001, "custom tangential pressure: ");
+                }, "custom pressure: ");
+            }));
+
+            on_event(target0, "pointerout", this.step_func(function(event) {
+                generate_tests(assert_equals, [
+                    ["default pointerId", event.pointerId, 0],
+                    ["default pointerType", event.pointerType, ""],
+                    ["default width", event.width, 1],
+                    ["default height", event.height, 1],
+                    ["default tiltX", event.tiltX, 0],
+                    ["default tiltY", event.tiltY, 0],
+                    ["default pressure", event.pressure, 0],
+                    ["default tangentialPressure", event.tangentialPressure, 0],
+                    ["default twist", event.twist, 0],
+                    ["default isPrimary", event.isPrimary, false]
+                ]);
+            }));
+
+            on_event(window, "load", this.step_func_done(function() {
+                assert_not_equals(window.PointerEvent, undefined);
+
+                var pointerEventCustom = new PointerEvent("pointerover",
+                {bubbles: testBubbles,
+                cancelable: testCancelable,
+                pointerId: testPointerId,
+                pointerType: testPointerType,
+                width: testWidth,
+                height: testHeight,
+                clientX: testClientX,
+                clientY: testClientY,
+                tiltX: testTiltX,
+                tiltY: testTiltY,
+                button: testButton,
+                buttons: testButtons,
+                pressure: testPressure,
+                tangentialPressure: testTangentialPressure,
+                twist: testTwist,
+                isPrimary: testIsPrimary
+                });
+                // A PointerEvent created with a PointerEvent constructor must have all its attributes set to the corresponding values provided to the constructor.
+                // For attributes where values are not provided to the constructor, the corresponding default values must be used.
+                // TA: 12.1
+                target0.dispatchEvent(pointerEventCustom);
+                var pointerEventDefault = new PointerEvent("pointerout");
+                target0.dispatchEvent(pointerEventDefault);
+            }, "PointerEvent constructor"));
+        })
+    </script>
+    <div id="complete-notice">
+    <p>The following pointer types were detected: <span id="pointertype-log"></span>.</p>
+    </div>
+    <div id="log"></div>
+    </body>
+</html>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_on_event_handlers-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_on_event_handlers-expected.txt
new file mode 100644 (file)
index 0000000..339316a
--- /dev/null
@@ -0,0 +1,38 @@
+PointerEvent: Dispatch custom event
+
+Test Description: This test checks if on pointer event handlers through attributes works properly using synthetic pointerevents. For valid results, this test must be run without generating real (trusted) events on the black rectangle below.
+
+
+Harness Error (TIMEOUT), message = null
+
+FAIL The default value of onpointerdown is always null assert_equals: The default value of the property is null for a Window instance expected (object) null but got (undefined) undefined
+FAIL The onpointerdown content attribute must be compiled into the onpointerdown property assert_equals: The onpointerdown property must be a function expected "function" but got "undefined"
+NOTRUN dispatching a pointerdown event must trigger element.onpointerdown 
+FAIL The default value of onpointerup is always null assert_equals: The default value of the property is null for a Window instance expected (object) null but got (undefined) undefined
+FAIL The onpointerup content attribute must be compiled into the onpointerup property assert_equals: The onpointerup property must be a function expected "function" but got "undefined"
+NOTRUN dispatching a pointerup event must trigger element.onpointerup 
+FAIL The default value of onpointercancel is always null assert_equals: The default value of the property is null for a Window instance expected (object) null but got (undefined) undefined
+FAIL The onpointercancel content attribute must be compiled into the onpointercancel property assert_equals: The onpointercancel property must be a function expected "function" but got "undefined"
+NOTRUN dispatching a pointercancel event must trigger element.onpointercancel 
+FAIL The default value of onpointermove is always null assert_equals: The default value of the property is null for a Window instance expected (object) null but got (undefined) undefined
+FAIL The onpointermove content attribute must be compiled into the onpointermove property assert_equals: The onpointermove property must be a function expected "function" but got "undefined"
+NOTRUN dispatching a pointermove event must trigger element.onpointermove 
+FAIL The default value of onpointerover is always null assert_equals: The default value of the property is null for a Window instance expected (object) null but got (undefined) undefined
+FAIL The onpointerover content attribute must be compiled into the onpointerover property assert_equals: The onpointerover property must be a function expected "function" but got "undefined"
+NOTRUN dispatching a pointerover event must trigger element.onpointerover 
+FAIL The default value of onpointerout is always null assert_equals: The default value of the property is null for a Window instance expected (object) null but got (undefined) undefined
+FAIL The onpointerout content attribute must be compiled into the onpointerout property assert_equals: The onpointerout property must be a function expected "function" but got "undefined"
+NOTRUN dispatching a pointerout event must trigger element.onpointerout 
+FAIL The default value of onpointerenter is always null assert_equals: The default value of the property is null for a Window instance expected (object) null but got (undefined) undefined
+FAIL The onpointerenter content attribute must be compiled into the onpointerenter property assert_equals: The onpointerenter property must be a function expected "function" but got "undefined"
+NOTRUN dispatching a pointerenter event must trigger element.onpointerenter 
+FAIL The default value of onpointerleave is always null assert_equals: The default value of the property is null for a Window instance expected (object) null but got (undefined) undefined
+FAIL The onpointerleave content attribute must be compiled into the onpointerleave property assert_equals: The onpointerleave property must be a function expected "function" but got "undefined"
+NOTRUN dispatching a pointerleave event must trigger element.onpointerleave 
+FAIL The default value of ongotpointercapture is always null assert_equals: The default value of the property is null for a Window instance expected (object) null but got (undefined) undefined
+FAIL The ongotpointercapture content attribute must be compiled into the ongotpointercapture property assert_equals: The ongotpointercapture property must be a function expected "function" but got "undefined"
+NOTRUN dispatching a gotpointercapture event must trigger element.ongotpointercapture 
+FAIL The default value of onlostpointercapture is always null assert_equals: The default value of the property is null for a Window instance expected (object) null but got (undefined) undefined
+FAIL The onlostpointercapture content attribute must be compiled into the onlostpointercapture property assert_equals: The onlostpointercapture property must be a function expected "function" but got "undefined"
+NOTRUN dispatching a lostpointercapture event must trigger element.onlostpointercapture 
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_on_event_handlers.html b/LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_on_event_handlers.html
new file mode 100644 (file)
index 0000000..d8cfa7a
--- /dev/null
@@ -0,0 +1,67 @@
+<!doctype html>
+<html>
+    <head>
+        <title>PointerEvent: Constructor test</title>
+        <meta name="viewport" content="width=device-width">
+        <link rel="stylesheet" type="text/css" href="pointerevent_styles.css">
+        <script src="/resources/testharness.js"></script>
+        <script src="/resources/testharnessreport.js"></script>
+        <!-- Additional helper script for common checks across event types -->
+        <script type="text/javascript" src="pointerevent_support.js"></script>
+    </head>
+    <body>
+    <h1>PointerEvent: Dispatch custom event</h1>
+    <h4>Test Description: This test checks if on pointer event handlers through attributes works properly using synthetic pointerevents. For valid results, this test must be run without generating real (trusted) events on the black rectangle below.</h4>
+    <div id="target0"
+         onpointercancel="window.eventHappened = 'pointercancel';"
+         onpointerdown="window.eventHappened = 'pointerdown';"
+         onpointerup="window.eventHappened = 'pointerup';"
+         onpointermove="window.eventHappened = 'pointermove';"
+         onpointerout="window.eventHappened = 'pointerout';"
+         onpointerover="window.eventHappened = 'pointerover';"
+         onpointerleave="window.eventHappened = 'pointerleave';"
+         onpointerenter="window.eventHappened = 'pointerenter';"
+         ongotpointercapture="window.eventHappened = 'gotpointercapture';"
+         onlostpointercapture="window.eventHappened = 'lostpointercapture';"
+    ></div>
+    <script>
+        window.eventHappened = '';
+
+        All_Pointer_Events.forEach(function(event) {
+            var on_event = "on" + event;
+
+            test(function() {
+              const htmlElement = document.createElement("span");
+              const svgElement = document.createElementNS("http://www.w3.org/2000/svg", "g");
+              for (var location of [window, htmlElement, svgElement, document]) {
+                assert_equals(location[on_event], null,
+                  `The default value of the property is null for a ${location.constructor.name} instance`);
+              }
+            }, "The default value of " + on_event + " is always null");
+
+            test(function() {
+              window.eventHappened = '';
+              const element = document.querySelector("#target0");
+              const compiledHandler = element[on_event];
+              assert_equals(typeof compiledHandler, "function", "The " + on_event + " property must be a function");
+              compiledHandler();
+              assert_equals(window.eventHappened, event, "Calling the handler must run the code");
+            }, "The " + on_event + " content attribute must be compiled into the " + on_event + " property");
+
+            var handlerTest = async_test("dispatching a " + event + " event must trigger element." + on_event);
+            const element = document.createElement("meta");
+            element[on_event] = function(e) {
+              handlerTest.step(function() {
+                assert_equals(e.currentTarget, element, "The event must be fired at the <meta> element");
+              });
+              handlerTest.done();
+            };
+            element.dispatchEvent(new Event(event));
+        });
+    </script>
+    <div id="complete-notice">
+    <p>The following pointer types were detected: <span id="pointertype-log"></span>.</p>
+    </div>
+    <div id="log"></div>
+    </body>
+</html>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_styles.css b/LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_styles.css
new file mode 100644 (file)
index 0000000..1ee3b0b
--- /dev/null
@@ -0,0 +1,112 @@
+#innerFrame {
+position: absolute;
+top: 300px;
+left: 200px;
+height: 100px;
+width: 100px;
+}
+
+.spacer {
+height: 100px;
+}
+
+#square1 {
+top: 330px;
+left: 150px;
+background: black;
+}
+
+#square2 {
+top: 50px;
+left: 30px;
+visibility: hidden;
+background: red;
+}
+
+.square {
+height: 20px;
+width: 20px;
+position: absolute;
+padding: 0px;
+}
+
+#target0 {
+background: black;
+color: white;
+white-space: nowrap;
+overflow-y: auto;
+overflow-x: auto;
+}
+
+#target1 {
+background: purple;
+color: white;
+white-space: nowrap;
+overflow-y: auto;
+overflow-x: auto;
+}
+
+#scrollTarget {
+  background: darkblue;
+}
+
+.touchActionNone {
+touch-action: none;
+}
+
+#innerframe {
+width: 90%;
+margin: 10px;
+margin-left: 10%;
+height: 200px;
+}
+
+.scroller {
+width: 700px;
+height: 430px;
+margin: 20px;
+overflow: auto;
+background: black;
+}
+
+.scroller > div {
+height: 1000px;
+width: 1000px;
+color: white;
+}
+
+.scroller > div div {
+height: 100%;
+width: 100%;
+color: white;
+}
+
+div {
+margin: 0em;
+padding: 2em;
+}
+
+#complete-notice {
+background: #afa;
+border: 1px solid #0a0;
+display: none;
+}
+
+#pointertype-log {
+font-weight: bold;
+}
+
+#event-log {
+font-weight: bold;
+}
+
+#listener {
+background: orange;
+border: 1px solid orange;
+position: absolute;
+top: -100px;
+}
+
+body.scrollable {
+min-height: 5000px;
+}
diff --git a/LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_support.js b/LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_support.js
new file mode 100644 (file)
index 0000000..bf68f85
--- /dev/null
@@ -0,0 +1,262 @@
+var All_Pointer_Events = [
+        "pointerdown",
+        "pointerup",
+        "pointercancel",
+        "pointermove",
+        "pointerover",
+        "pointerout",
+        "pointerenter",
+        "pointerleave",
+        "gotpointercapture",
+        "lostpointercapture"];
+
+// Check for conformance to PointerEvent interface
+// TA: 1.1, 1.2, 1.6, 1.7, 1.8, 1.9, 1.10, 1.11, 1.12, 1.13
+function check_PointerEvent(event, testNamePrefix) {
+    if (testNamePrefix === undefined)
+        testNamePrefix = "";
+
+    // Use expectedPointerType if set otherwise just use the incoming event pointerType in the test name.
+    var pointerTestName = testNamePrefix + ' ' + (expectedPointerType == null ? event.pointerType : expectedPointerType) + ' ' + event.type;
+
+    if (expectedPointerType != null) {
+        test(function () {
+            assert_equals(event.pointerType, expectedPointerType, "pointerType should be the one specified in the test page.");
+        }, pointerTestName + " event pointerType is correct.");
+    }
+
+    test(function () {
+        assert_true(event instanceof event.target.ownerDocument.defaultView.PointerEvent, "event is a PointerEvent event");
+    }, pointerTestName + " event is a PointerEvent event");
+
+
+    // Check attributes for conformance to WebIDL:
+    // * attribute exists
+    // * has proper type
+    // * if the attribute is "readonly", it cannot be changed
+    // TA: 1.1, 1.2
+    var idl_type_check = {
+        "long": function (v) { return typeof v === "number" && Math.round(v) === v; },
+        "float": function (v) { return typeof v === "number"; },
+        "string": function (v) { return typeof v === "string"; },
+        "boolean": function (v) { return typeof v === "boolean" },
+        "object": function (v) { return typeof v === "object" }
+    };
+    [
+        ["readonly", "long", "pointerId"],
+        ["readonly", "float", "width"],
+        ["readonly", "float", "height"],
+        ["readonly", "float", "pressure"],
+        ["readonly", "long", "tiltX"],
+        ["readonly", "long", "tiltY"],
+        ["readonly", "string", "pointerType"],
+        ["readonly", "boolean", "isPrimary"],
+        ["readonly", "long", "detail", 0],
+        ["readonly", "object", "fromElement", null],
+        ["readonly", "object", "toElement", null]
+    ].forEach(function (attr) {
+        var readonly = attr[0];
+        var type = attr[1];
+        var name = attr[2];
+        var value = attr[3];
+
+        // existence check
+        test(function () {
+            assert_true(name in event, name + " attribute in " + event.type + " event");
+        }, pointerTestName + "." + name + " attribute exists");
+
+        // readonly check
+        if (readonly === "readonly") {
+            test(function () {
+                assert_readonly(event.type, name, event.type + "." + name + " cannot be changed");
+            }, pointerTestName + "." + name + " is readonly");
+        }
+
+        // type check
+        test(function () {
+            assert_true(idl_type_check[type](event[name]), name + " attribute of type " + type);
+        }, pointerTestName + "." + name + " IDL type " + type + " (JS type was " + typeof event[name] + ")");
+
+        // value check if defined
+        if (value !== undefined) {
+            test(function () {
+                assert_equals(event[name], value, name + " attribute value");
+            }, pointerTestName + "." + name + " value is " + value + ".");
+        }
+    });
+
+
+    // Check the pressure value
+    // TA: 1.6, 1.7, 1.8
+    test(function () {
+        // TA: 1.6
+        assert_greater_than_equal(event.pressure, 0, "pressure is greater than or equal to 0");
+        assert_less_than_equal(event.pressure, 1, "pressure is less than or equal to 1");
+
+        if (event.buttons === 0) {
+            assert_equals(event.pressure, 0, "pressure is 0 for mouse with no buttons pressed");
+        }
+
+        // TA: 1.7, 1.8
+        if (event.pointerType === "mouse") {
+            if (event.buttons !== 0) {
+                assert_equals(event.pressure, 0.5, "pressure is 0.5 for mouse with a button pressed");
+            }
+        }
+    }, pointerTestName + ".pressure value is valid");
+
+    // Check mouse-specific properties
+    if (event.pointerType === "mouse") {
+        // TA: 1.9, 1.10, 1.13
+        test(function () {
+            assert_equals(event.width, 1, "width of mouse should be 1");
+            assert_equals(event.height, 1, "height of mouse should be 1");
+            assert_equals(event.tiltX, 0, event.type + ".tiltX is 0 for mouse");
+            assert_equals(event.tiltY, 0, event.type + ".tiltY is 0 for mouse");
+            assert_true(event.isPrimary, event.type + ".isPrimary is true for mouse");
+        }, pointerTestName + " properties for pointerType = mouse");
+        // Check properties for pointers other than mouse
+    }
+}
+
+function showPointerTypes() {
+    var complete_notice = document.getElementById("complete-notice");
+    var pointertype_log = document.getElementById("pointertype-log");
+    var pointertypes = Object.keys(detected_pointertypes);
+    pointertype_log.innerHTML = pointertypes.length ?
+        pointertypes.join(",") : "(none)";
+    complete_notice.style.display = "block";
+}
+
+function showLoggedEvents() {
+    var event_log_elem = document.getElementById("event-log");
+    event_log_elem.innerHTML = event_log.length ? event_log.join(", ") : "(none)";
+
+    var complete_notice = document.getElementById("complete-notice");
+    complete_notice.style.display = "block";
+}
+
+function log(msg, el) {
+    if (++count > 10){
+      count = 0;
+      el.innerHTML = ' ';
+    }
+    el.innerHTML = msg + '; ' + el.innerHTML;
+}
+
+ function failOnScroll() {
+    assert_true(false,
+    "scroll received while shouldn't");
+}
+
+function updateDescriptionNextStep() {
+    document.getElementById('desc').innerHTML = "Test Description: Try to scroll text RIGHT.";
+}
+
+function updateDescriptionComplete() {
+    document.getElementById('desc').innerHTML = "Test Description: Test complete";
+}
+
+function updateDescriptionSecondStepTouchActionElement(target, scrollReturnInterval) {
+    window.step_timeout(function() {
+    objectScroller(target, 'up', 0);}
+    , scrollReturnInterval);
+    document.getElementById('desc').innerHTML = "Test Description: Try to scroll element RIGHT moving your outside of the red border";
+}
+
+function updateDescriptionThirdStepTouchActionElement(target, scrollReturnInterval, callback = null) {
+    window.step_timeout(function() {
+        objectScroller(target, 'left', 0);
+        if (callback) {
+            callback();
+        }
+    }, scrollReturnInterval);
+    document.getElementById('desc').innerHTML = "Test Description: Try to scroll element DOWN then RIGHT starting your touch inside of the element. Then tap complete button";
+}
+
+function updateDescriptionFourthStepTouchActionElement(target, scrollReturnInterval) {
+    document.getElementById('desc').innerHTML = "Test Description: Try to scroll element RIGHT starting your touch inside of the element";
+}
+
+function objectScroller(target, direction, value) {
+    if (direction == 'up') {
+        target.scrollTop = 0;
+    } else if (direction == 'left') {
+        target.scrollLeft = 0;
+    }
+}
+
+function sPointerCapture(e) {
+    try {
+        target0.setPointerCapture(e.pointerId);
+    }
+    catch(e) {
+    }
+}
+
+function rPointerCapture(e) {
+    try {
+        captureButton.value = 'Set Capture';
+        target0.releasePointerCapture(e.pointerId);
+    }
+    catch(e) {
+    }
+}
+
+var globalPointerEventTest = null;
+var expectedPointerType = null;
+const ALL_POINTERS = ['mouse', 'touch', 'pen'];
+const HOVERABLE_POINTERS = ['mouse', 'pen'];
+const NOHOVER_POINTERS = ['touch'];
+
+function MultiPointerTypeTest(testName, types) {
+    this.testName = testName;
+    this.types = types;
+    this.currentTypeIndex = 0;
+    this.currentTest = null;
+    this.createNextTest();
+}
+
+MultiPointerTypeTest.prototype.step = function(op) {
+    this.currentTest.step(op);
+}
+
+MultiPointerTypeTest.prototype.skip = function() {
+    var prevTest = this.currentTest;
+    this.createNextTest();
+    prevTest.timeout();
+}
+
+MultiPointerTypeTest.prototype.done = function() {
+    if (this.currentTest.status != 1) {
+        var prevTest = this.currentTest;
+        this.createNextTest();
+        if (prevTest != null)
+            prevTest.done();
+    }
+}
+
+MultiPointerTypeTest.prototype.step = function(stepFunction) {
+    this.currentTest.step(stepFunction);
+}
+
+MultiPointerTypeTest.prototype.createNextTest = function() {
+    if (this.currentTypeIndex < this.types.length) {
+        var pointerTypeDescription = document.getElementById('pointerTypeDescription');
+        document.getElementById('pointerTypeDescription').innerHTML = "Follow the test instructions with <span style='color: red'>" + this.types[this.currentTypeIndex] + "</span>. If you don't have the device <a href='javascript:;' onclick='globalPointerEventTest.skip()'>skip it</a>.";
+        this.currentTest = async_test(this.types[this.currentTypeIndex] + ' ' + this.testName);
+        expectedPointerType = this.types[this.currentTypeIndex];
+        this.currentTypeIndex++;
+    } else {
+        document.getElementById('pointerTypeDescription').innerHTML = "";
+    }
+    resetTestState();
+}
+
+function setup_pointerevent_test(testName, supportedPointerTypes) {
+    return globalPointerEventTest = new MultiPointerTypeTest(testName, supportedPointerTypes);
+}
+
+function checkPointerEventType(event) {
+    assert_equals(event.pointerType, expectedPointerType, "pointerType should be the same as the requested device.");
+}
diff --git a/LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_touch-action-illegal-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_touch-action-illegal-expected.txt
new file mode 100644 (file)
index 0000000..563bd20
--- /dev/null
@@ -0,0 +1,13 @@
+Pointer Events touch-action attribute support
+
+Test Description: Test will automatically check behaviour of following combinations: 'pan-x none', 'pan-y none', 'auto none'
+
+touch-action: none
+
+The following pointer types were detected: (none).
+
+
+FAIL 'pan-x none' is corrected properly assert_true: 'pan-x none' is corrected properly expected true got false
+FAIL 'pan-y none' is corrected properly assert_true: 'pan-y none' is corrected properly expected true got false
+FAIL 'auto none' is corrected properly assert_true: 'auto none' is corrected properly expected true got false
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_touch-action-illegal.html b/LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_touch-action-illegal.html
new file mode 100644 (file)
index 0000000..5fe6179
--- /dev/null
@@ -0,0 +1,67 @@
+<!doctype html>
+<html>
+    <head>
+        <title>touch-action: illegal</title>
+        <meta name="viewport" content="width=device-width">
+        <link rel="stylesheet" type="text/css" href="pointerevent_styles.css">
+        <script src="/resources/testharness.js"></script>
+        <script src="/resources/testharnessreport.js"></script>
+        <script src="pointerevent_support.js"></script>
+        <style>
+            #target0 {
+            width: 700px;
+            height: 50px;
+            touch-action: pan-x none;
+            }
+            #target1 {
+            width: 700px;
+            height: 50px;
+            background: black;
+            margin-top: 5px;
+            touch-action: pan-y none;
+            }
+            #target2 {
+            width: 700px;
+            height: 50px;
+            background: black;
+            margin-top: 5px;
+            touch-action: auto none;
+            }
+        </style>
+    </head>
+    <body onload="run()">
+        <h1>Pointer Events touch-action attribute support</h1>
+        <h4 id="desc">Test Description: Test will automatically check behaviour of following combinations: 'pan-x none', 'pan-y none', 'auto none'</h4>
+        <div id="target0"></div>
+        <div id="target1"></div>
+        <div id="target2"></div>
+        <script type='text/javascript'>
+            var detected_pointertypes = {};
+
+            setup({ explicit_done: true });
+            add_completion_callback(showPointerTypes);
+
+            function run() {
+                var target0 = document.getElementById('target0');
+                var target1 = document.getElementById('target1');
+                var target2 = document.getElementById('target2');
+
+                test(function() {
+                    assert_true(getComputedStyle(target0).touchAction == 'auto', "'pan-x none' is corrected properly");
+                }, "'pan-x none' is corrected properly");
+                test(function() {
+                    assert_true(getComputedStyle(target1).touchAction == 'auto', "'pan-y none' is corrected properly");
+                }, "'pan-y none' is corrected properly");
+                test(function() {
+                    assert_true(getComputedStyle(target2).touchAction == 'auto', "'auto none' is corrected properly");
+                }, "'auto none' is corrected properly");
+                done();
+            }
+        </script>
+        <h1>touch-action: none</h1>
+        <div id="complete-notice">
+            <p>The following pointer types were detected: <span id="pointertype-log"></span>.</p>
+        </div>
+        <div id="log"></div>
+    </body>
+</html>
\ No newline at end of file
diff --git a/LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_touch-action-verification-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_touch-action-verification-expected.txt
new file mode 100644 (file)
index 0000000..771bba1
--- /dev/null
@@ -0,0 +1,33 @@
+Pointer Events touch-action attribute support
+
+Test Description: Test will automatically check parsing behaviour of various touch-action combinations.
+
+touch-action: basic verification
+
+
+FAIL default assert_equals: expected (undefined) undefined but got (string) "auto"
+FAIL stylesheet-none assert_equals: expected (undefined) undefined but got (string) "none"
+FAIL explicit-auto assert_equals: expected (undefined) undefined but got (string) "auto"
+FAIL explicit-pan-x assert_equals: expected (undefined) undefined but got (string) "pan-x"
+FAIL explicit-pan-y assert_equals: expected (undefined) undefined but got (string) "pan-y"
+FAIL explicit-pan-x-pan-y assert_equals: expected (undefined) undefined but got (string) "pan-x pan-y"
+FAIL explicit-pan-y-pan-x assert_equals: expected (undefined) undefined but got (string) "pan-x pan-y"
+FAIL explicit-manipulation assert_equals: expected (undefined) undefined but got (string) "manipulation"
+FAIL explicit-none assert_equals: expected (undefined) undefined but got (string) "none"
+FAIL explicit-invalid-1 assert_equals: expected (undefined) undefined but got (string) "auto"
+FAIL explicit-invalid-2 assert_equals: expected (undefined) undefined but got (string) "none"
+FAIL explicit-invalid-3 assert_equals: expected (undefined) undefined but got (string) "auto"
+FAIL explicit-invalid-4 assert_equals: expected (undefined) undefined but got (string) "auto"
+FAIL explicit-invalid-5 assert_equals: expected (undefined) undefined but got (string) "auto"
+FAIL explicit-invalid-6 assert_equals: expected (undefined) undefined but got (string) "auto"
+FAIL explicit-invalid-7 assert_equals: expected (undefined) undefined but got (string) "auto"
+FAIL explicit-invalid-8 assert_equals: expected (undefined) undefined but got (string) "auto"
+FAIL explicit-invalid-9 assert_equals: expected (undefined) undefined but got (string) "auto"
+FAIL explicit-invalid-10 assert_equals: expected (undefined) undefined but got (string) "auto"
+FAIL explicit-invalid-11 assert_equals: expected (undefined) undefined but got (string) "auto"
+FAIL explicit-invalid-12 assert_equals: expected (undefined) undefined but got (string) "auto"
+FAIL explicit-invalid-13 assert_equals: expected (undefined) undefined but got (string) "auto"
+FAIL not-inherited assert_equals: expected (undefined) undefined but got (string) "auto"
+FAIL inherit assert_equals: expected (undefined) undefined but got (string) "none"
+FAIL initial assert_equals: expected (undefined) undefined but got (string) "auto"
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_touch-action-verification.html b/LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_touch-action-verification.html
new file mode 100644 (file)
index 0000000..f42d9f6
--- /dev/null
@@ -0,0 +1,78 @@
+<!doctype html>
+<html>
+    <head>
+        <title>touch-action: basic verification</title>
+        <meta name="assert" content="TA15.20 - The touch-action CSS property determines whether touch input MAY trigger default behavior supplied by the user agent.
+        auto: The user agent MAY determine any permitted touch behaviors, such as panning and zooming manipulations of the viewport, for touches that begin on the element. 
+        none: Touches that begin on the element MUST NOT trigger default touch behaviors.
+        pan-x: The user agent MAY consider touches that begin on the element only for the purposes of horizontally scrolling the element's nearest ancestor with horizontally scrollable content.
+        pan-y: The user agent MAY consider touches that begin on the element only for the purposes of vertically scrolling the element's nearest ancestor with vertically scrollable content.
+        manipulation: The user agent MAY consider touches that begin on the element only for the purposes of scrolling and continuous zooming. Any additional behaviors supported by auto are out of scope for this specification.">
+        <meta name="viewport" content="width=device-width">
+        <link rel="stylesheet" type="text/css" href="pointerevent_styles.css">
+        <script src="/resources/testharness.js"></script>
+        <script src="/resources/testharnessreport.js"></script>
+        <style>
+          /*
+          Give some rules below something to override in order to test
+          that they really are being parsed
+          */
+          .defnone {
+          touch-action: none;
+          }
+        </style>
+    </head>
+    <body onload="run()">
+        <h2>Pointer Events touch-action attribute support</h2>
+        <h4 id="desc">Test Description: Test will automatically check parsing behaviour of various touch-action combinations.</h4>
+        <script type='text/javascript'>
+            var detected_pointertypes = {};
+
+            setup({ explicit_done: true });
+
+            function run() {
+                var tests = document.querySelectorAll('.test');
+                //TA 15.20
+                for (var i = 0; i < tests.length; i++) {
+                    test(function() {
+                      var style = window.getComputedStyle(tests[i]);
+                      assert_equals(tests[i].attributes.expected.value, style.touchAction);
+                    }, tests[i].id);
+                }
+                done();
+            }
+        </script>
+        <h1>touch-action: basic verification</h1>
+        <div id="complete-notice">
+            <p>The following pointer types were detected: <span id="pointertype-log"></span>.</p>
+        </div>
+        <div id="log"></div>
+        <div class="test" id="default" expected="auto"></div>
+        <div class="test defnone" id="stylesheet-none" expected="none"></div>
+        <div class="test defnone" id="explicit-auto" style="touch-action: auto;" expected="auto"></div>
+        <div class="test" id="explicit-pan-x" style="touch-action: pan-x;" expected="pan-x"></div>
+        <div class="test" id="explicit-pan-y" style="touch-action: pan-y;" expected="pan-y"></div>
+        <div class="test" id="explicit-pan-x-pan-y" style="touch-action: pan-x pan-y;" expected="pan-x pan-y"></div>
+        <div class="test" id="explicit-pan-y-pan-x" style="touch-action: pan-y pan-x;" expected="pan-x pan-y"></div>
+        <div class="test" id="explicit-manipulation" style="touch-action: manipulation;" expected="manipulation"></div>
+        <div class="test" id="explicit-none" style="touch-action: none;" expected="none"></div>
+        <div class="test" id="explicit-invalid-1" style="touch-action: bogus;" expected="auto"></div>
+        <div class="test defnone" id="explicit-invalid-2" style="touch-action: auto pan-x;" expected="none"></div>
+        <div class="test" id="explicit-invalid-3" style="touch-action: pan-y none;" expected="auto"></div>
+        <div class="test" id="explicit-invalid-4" style="touch-action: pan-x pan-x;" expected="auto"></div>
+        <div class="test" id="explicit-invalid-5" style="touch-action: manipulation pan-x;" expected="auto"></div>
+        <div class="test" id="explicit-invalid-6" style="touch-action: pan-x pan-left;" expected="auto"></div>
+        <div class="test" id="explicit-invalid-7" style="touch-action: auto pan-left;" expected="auto"></div>
+        <div class="test" id="explicit-invalid-8" style="touch-action: none pan-left;" expected="auto"></div>
+        <div class="test" id="explicit-invalid-9" style="touch-action: pan-x pan-right;" expected="auto"></div>
+        <div class="test" id="explicit-invalid-10" style="touch-action: pan-y pan-up;" expected="auto"></div>
+        <div class="test" id="explicit-invalid-11" style="touch-action: pan-y pan-down;" expected="auto"></div>
+        <div class="test" id="explicit-invalid-12" style="touch-action: pan-left pan-right;" expected="auto"></div>
+        <div class="test" id="explicit-invalid-13" style="touch-action: pan-up pan-down;" expected="auto"></div>
+        <div style="touch-action: none;">
+          <div class="test" id="not-inherited" expected="auto"></div>
+          <div class="test" id="inherit" style="touch-action: inherit;" expected="none"></div>
+        </div>
+        <div class="test defnone" id="initial" style="touch-action: initial;" expected="auto"></div>
+    </body>
+</html>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerlock/resources/pointerevent_movementxy-iframe.html b/LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerlock/resources/pointerevent_movementxy-iframe.html
new file mode 100644 (file)
index 0000000..627af3b
--- /dev/null
@@ -0,0 +1,8 @@
+<!doctype html>
+<html>
+    <head>
+        <meta name="viewport" content="width=device-width">
+    </head>
+    <body>
+    </body>
+</html>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerlock/resources/w3c-import.log b/LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerlock/resources/w3c-import.log
new file mode 100644 (file)
index 0000000..acf565e
--- /dev/null
@@ -0,0 +1,17 @@
+The tests in this directory were imported from the W3C repository.
+Do NOT modify these tests directly in WebKit.
+Instead, create a pull request on the WPT github:
+       https://github.com/web-platform-tests/wpt
+
+Then run the Tools/Scripts/import-w3c-tests in WebKit to reimport
+
+Do NOT modify or remove this file.
+
+------------------------------------------------------------------------
+Properties requiring vendor prefixes:
+None
+Property values requiring vendor prefixes:
+None
+------------------------------------------------------------------------
+List of files:
+/LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerlock/resources/pointerevent_movementxy-iframe.html
diff --git a/LayoutTests/imported/w3c/web-platform-tests/pointerevents/resources/pointerevent_attributes_hoverable_pointers-iframe.html b/LayoutTests/imported/w3c/web-platform-tests/pointerevents/resources/pointerevent_attributes_hoverable_pointers-iframe.html
new file mode 100644 (file)
index 0000000..5e55868
--- /dev/null
@@ -0,0 +1,10 @@
+<!doctype html>
+<html>
+    <head>
+        <meta name="viewport" content="width=device-width">
+        <link rel="stylesheet" type="text/css" href="../pointerevent_styles.css">
+    </head>
+    <body>
+        <div id="square2" class="square"></div>
+    </body>
+</html>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/pointerevents/resources/pointerevent_fractional_coordinates-iframe.html b/LayoutTests/imported/w3c/web-platform-tests/pointerevents/resources/pointerevent_fractional_coordinates-iframe.html
new file mode 100644 (file)
index 0000000..5245a3f
--- /dev/null
@@ -0,0 +1,32 @@
+<!doctype html>
+<html>
+    <head>
+        <meta name="viewport" content="width=device-width">
+        <link rel="stylesheet" type="text/css" href="../pointerevent_styles.css">
+    </head>
+    <style>
+        .square {
+            width: 3px;
+            height:3px;
+            background: black;
+            cursor: pointer;
+        }
+        #s1 {
+            top: 10px;
+            left: 10px;
+        }
+        #s2 {
+            top: 30px;
+            left: 50px;
+        }
+        #s3 {
+            top: 50px;
+            left: 30px;
+        }
+    </style>
+    <body>
+        <div id="s1" class="square"></div>
+        <div id="s2" class="square"></div>
+        <div id="s3" class="square"></div>
+    </body>
+</html>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/pointerevents/resources/pointerevent_pointerId_scope-iframe.html b/LayoutTests/imported/w3c/web-platform-tests/pointerevents/resources/pointerevent_pointerId_scope-iframe.html
new file mode 100644 (file)
index 0000000..ab33560
--- /dev/null
@@ -0,0 +1,35 @@
+<!doctype html>
+<html>
+    <!--
+Test cases for Pointer Events v1 spec
+This document references Test Assertions (abbrev TA below) written by Cathy Chan
+http://www.w3.org/wiki/PointerEvents/TestAssertions
+-->
+    <head>
+        <title>Pointer Events pointerdown tests</title>
+        <meta name="viewport" content="width=device-width">
+        <link rel="stylesheet" type="text/css" href="../pointerevent_styles.css">
+        <script>
+            function run() {
+                var target1 = document.getElementById("target1");
+
+                var eventList = ['pointerenter', 'pointerover', 'pointermove', 'pointerout', 'pointerleave'];
+
+                eventList.forEach(function(eventName) {
+                    target1.addEventListener(eventName, function (event) {
+                        var pass_data = {
+                            'pointerId' : event.pointerId,
+                            'type' : event.type,
+                            'pointerType' : event.pointerType
+                        };
+                        top.postMessage(JSON.stringify(pass_data), "*");
+                    });
+               });
+            }
+        </script>
+    </head>
+    <body onload="run()">
+        <div id="target1" class="touchActionNone">
+        </div>
+    </body>
+</html>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/pointerevents/resources/w3c-import.log b/LayoutTests/imported/w3c/web-platform-tests/pointerevents/resources/w3c-import.log
new file mode 100644 (file)
index 0000000..644409a
--- /dev/null
@@ -0,0 +1,19 @@
+The tests in this directory were imported from the W3C repository.
+Do NOT modify these tests directly in WebKit.
+Instead, create a pull request on the WPT github:
+       https://github.com/web-platform-tests/wpt
+
+Then run the Tools/Scripts/import-w3c-tests in WebKit to reimport
+
+Do NOT modify or remove this file.
+
+------------------------------------------------------------------------
+Properties requiring vendor prefixes:
+None
+Property values requiring vendor prefixes:
+None
+------------------------------------------------------------------------
+List of files:
+/LayoutTests/imported/w3c/web-platform-tests/pointerevents/resources/pointerevent_attributes_hoverable_pointers-iframe.html
+/LayoutTests/imported/w3c/web-platform-tests/pointerevents/resources/pointerevent_fractional_coordinates-iframe.html
+/LayoutTests/imported/w3c/web-platform-tests/pointerevents/resources/pointerevent_pointerId_scope-iframe.html
diff --git a/LayoutTests/imported/w3c/web-platform-tests/pointerevents/w3c-import.log b/LayoutTests/imported/w3c/web-platform-tests/pointerevents/w3c-import.log
new file mode 100644 (file)
index 0000000..e943402
--- /dev/null
@@ -0,0 +1,25 @@
+The tests in this directory were imported from the W3C repository.
+Do NOT modify these tests directly in WebKit.
+Instead, create a pull request on the WPT github:
+       https://github.com/web-platform-tests/wpt
+
+Then run the Tools/Scripts/import-w3c-tests in WebKit to reimport
+
+Do NOT modify or remove this file.
+
+------------------------------------------------------------------------
+Properties requiring vendor prefixes:
+None
+Property values requiring vendor prefixes:
+None
+------------------------------------------------------------------------
+List of files:
+/LayoutTests/imported/w3c/web-platform-tests/pointerevents/META.yml
+/LayoutTests/imported/w3c/web-platform-tests/pointerevents/README.md
+/LayoutTests/imported/w3c/web-platform-tests/pointerevents/idlharness.window.js
+/LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_constructor.html
+/LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_on_event_handlers.html
+/LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_styles.css
+/LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_support.js
+/LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_touch-action-illegal.html
+/LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_touch-action-verification.html
index 546fb78..6878f6d 100644 (file)
@@ -618,6 +618,7 @@ set(WebCore_NON_SVG_IDL_FILES
     dom/OverflowEvent.idl
     dom/PageTransitionEvent.idl
     dom/ParentNode.idl
+    dom/PointerEvent.idl
     dom/PopStateEvent.idl
     dom/ProcessingInstruction.idl
     dom/ProgressEvent.idl
index 05f4115..9d815f6 100644 (file)
@@ -1,3 +1,43 @@
+2018-09-21  Dean Jackson  <dino@apple.com>
+
+        Add PointerEvent, plus feature flag, plus Web Platform Tests
+        https://bugs.webkit.org/show_bug.cgi?id=189867
+        <rdar://problem/44697384>
+
+        Reviewed by Simon Fraser.
+
+        Add the PointerEvent interface.
+
+        Tests: imported/w3c/web-platform-tests/pointerevents/extension/idlharness.window.html
+               imported/w3c/web-platform-tests/pointerevents/extension/pointerevent_constructor.html
+               imported/w3c/web-platform-tests/pointerevents/extension/pointerevent_touch-action-verification.html
+               imported/w3c/web-platform-tests/pointerevents/idlharness.window.html
+               imported/w3c/web-platform-tests/pointerevents/pointerevent_constructor.html
+               imported/w3c/web-platform-tests/pointerevents/pointerevent_on_event_handlers.html
+               imported/w3c/web-platform-tests/pointerevents/pointerevent_touch-action-illegal.html
+               imported/w3c/web-platform-tests/pointerevents/pointerevent_touch-action-verification.html
+
+        * DerivedSources.make:
+        * Sources.txt:
+        * WebCore.xcodeproj/project.pbxproj:
+                Add the new files.
+
+        * dom/Event.h:
+        (WebCore::Event::isPointerEvent const): New virtual identification method.
+
+        * dom/EventNames.in: Add PointerEvent so the InterfaceType code is generated.
+
+        * dom/PointerEvent.cpp: The PointerEvent interface, as specified by W3C.
+        (WebCore::PointerEvent::PointerEvent):
+        (WebCore::PointerEvent::eventInterface const):
+        * dom/PointerEvent.h: Added.
+        * dom/PointerEvent.idl: Added.
+
+        * page/RuntimeEnabledFeatures.h: Clean up the ordering of the features, so there aren't
+        confusing blank lines interspersed with #if USE macros.
+        (WebCore::RuntimeEnabledFeatures::setPointerEventsEnabled): Add a new flag for Pointer Events.
+        (WebCore::RuntimeEnabledFeatures::pointerEventsEnabled const):
+
 2018-09-21  Ryosuke Niwa  <rniwa@webkit.org>
 
         Custom elements in a reaction queue can lose its JS wrapper and become HTMLUnknownElement
index d420d46..9f2af11 100644 (file)
@@ -534,6 +534,7 @@ JS_BINDING_IDLS = \
     $(WebCore)/dom/OverflowEvent.idl \
     $(WebCore)/dom/PageTransitionEvent.idl \
     $(WebCore)/dom/ParentNode.idl \
+    $(WebCore)/dom/PointerEvent.idl \
     $(WebCore)/dom/PopStateEvent.idl \
     $(WebCore)/dom/ProcessingInstruction.idl \
     $(WebCore)/dom/ProgressEvent.idl \
index 2c00030..115c838 100644 (file)
@@ -785,6 +785,7 @@ dom/NodeTraversal.cpp
 dom/OverflowEvent.cpp
 dom/PageTransitionEvent.cpp
 dom/PendingScript.cpp
+dom/PointerEvent.cpp
 dom/PopStateEvent.cpp
 dom/Position.cpp
 dom/PositionIterator.cpp
@@ -2849,6 +2850,7 @@ JSPerformanceServerTiming.cpp
 JSPerformanceTiming.cpp
 JSPeriodicWave.cpp
 JSPlaybackDirection.cpp
+JSPointerEvent.cpp
 JSPopStateEvent.cpp
 JSPositionCallback.cpp
 JSPositionError.cpp
index 3a7fabd..1803a45 100644 (file)
                316FE1180E6E1DA700BF6088 /* ImplicitAnimation.h in Headers */ = {isa = PBXBuildFile; fileRef = 316FE10E0E6E1DA700BF6088 /* ImplicitAnimation.h */; };
                316FE11A0E6E1DA700BF6088 /* KeyframeAnimation.h in Headers */ = {isa = PBXBuildFile; fileRef = 316FE1100E6E1DA700BF6088 /* KeyframeAnimation.h */; };
                31741AAD16636609008A5B7E /* SimulatedClickOptions.h in Headers */ = {isa = PBXBuildFile; fileRef = 31741AAB16635E45008A5B7E /* SimulatedClickOptions.h */; settings = {ATTRIBUTES = (Private, ); }; };
+               317D3FF3215599F40034E3B9 /* PointerEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 317D3FF2215599E30034E3B9 /* PointerEvent.h */; };
                31815A311F9A6C8F00FCBF89 /* ImageBitmap.h in Headers */ = {isa = PBXBuildFile; fileRef = 31D26BBF1F86D189008FF255 /* ImageBitmap.h */; settings = {ATTRIBUTES = (Private, ); }; };
                318891611AB7EEA100EA627B /* missingImage@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = CDF419991AB0DA14004E64E1 /* missingImage@3x.png */; };
                318EAD4D1FA91380008CEF86 /* ImageBitmapRenderingContextSettings.h in Headers */ = {isa = PBXBuildFile; fileRef = 318EAD4A1FA91157008CEF86 /* ImageBitmapRenderingContextSettings.h */; settings = {ATTRIBUTES = (Private, ); }; };
                316FE10F0E6E1DA700BF6088 /* KeyframeAnimation.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = KeyframeAnimation.cpp; sourceTree = "<group>"; };
                316FE1100E6E1DA700BF6088 /* KeyframeAnimation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = KeyframeAnimation.h; sourceTree = "<group>"; };
                31741AAB16635E45008A5B7E /* SimulatedClickOptions.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SimulatedClickOptions.h; sourceTree = "<group>"; };
+               317D3FEF215599E10034E3B9 /* PointerEvent.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = PointerEvent.idl; sourceTree = "<group>"; };
+               317D3FF1215599E20034E3B9 /* PointerEvent.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = PointerEvent.cpp; sourceTree = "<group>"; };
+               317D3FF2215599E30034E3B9 /* PointerEvent.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PointerEvent.h; sourceTree = "<group>"; };
                3189E6DB16B2103500386EA3 /* plugIns.css */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.css; path = plugIns.css; sourceTree = "<group>"; };
                318EAD4A1FA91157008CEF86 /* ImageBitmapRenderingContextSettings.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ImageBitmapRenderingContextSettings.h; sourceTree = "<group>"; };
                318EAD4C1FA91352008CEF86 /* ImageBitmapRenderingContextSettings.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = ImageBitmapRenderingContextSettings.idl; sourceTree = "<group>"; };
                                8A7CC96F12076F8A001D4588 /* PendingScript.cpp */,
                                8A7CC96A12076D73001D4588 /* PendingScript.h */,
                                E3FA38611D716E7600AA5950 /* PendingScriptClient.h */,
+                               317D3FF1215599E20034E3B9 /* PointerEvent.cpp */,
+                               317D3FF2215599E30034E3B9 /* PointerEvent.h */,
+                               317D3FEF215599E10034E3B9 /* PointerEvent.idl */,
                                5189F0DD10B46B0E00F3C739 /* PopStateEvent.cpp */,
                                5174E20810A1F44F00F95E6F /* PopStateEvent.h */,
                                5174E20B10A1F49A00F95E6F /* PopStateEvent.idl */,
                                BCBB8AB913F1AFB000734DF0 /* PODInterval.h in Headers */,
                                BCBB8ABA13F1AFB000734DF0 /* PODIntervalTree.h in Headers */,
                                BCBB8ABB13F1AFB000734DF0 /* PODRedBlackTree.h in Headers */,
+                               317D3FF3215599F40034E3B9 /* PointerEvent.h in Headers */,
                                B2B1F7170D00CAA8004AEA64 /* PointerEventsHitRules.h in Headers */,
                                3FF813A71DBA8640009BF001 /* PointerLockController.h in Headers */,
                                84730D921248F0B300D3A9C9 /* PointLightSource.h in Headers */,
index bba8444..1136085 100644 (file)
@@ -104,6 +104,7 @@ public:
     virtual bool isInputEvent() const { return false; }
     virtual bool isKeyboardEvent() const { return false; }
     virtual bool isMouseEvent() const { return false; }
+    virtual bool isPointerEvent() const { return false; }
     virtual bool isTextEvent() const { return false; }
     virtual bool isTouchEvent() const { return false; }
     virtual bool isUIEvent() const { return false; }
index 81e79cf..c6b94ca 100644 (file)
@@ -80,3 +80,4 @@ MediaEncryptedEvent conditional=ENCRYPTED_MEDIA
 MediaKeyMessageEvent conditional=ENCRYPTED_MEDIA
 VRDisplayEvent
 AccessibleSetValueEvent
+PointerEvent
diff --git a/Source/WebCore/dom/PointerEvent.cpp b/Source/WebCore/dom/PointerEvent.cpp
new file mode 100644 (file)
index 0000000..43001f7
--- /dev/null
@@ -0,0 +1,58 @@
+/*
+ * Copyright (C) 2018 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
+ */
+
+#include "config.h"
+#include "PointerEvent.h"
+
+namespace WebCore {
+
+using namespace JSC;
+
+PointerEvent::PointerEvent() = default;
+
+PointerEvent::PointerEvent(const AtomicString& type, Init&& initializer)
+    : MouseEvent(type, initializer)
+    , m_pointerId(initializer.pointerId)
+    , m_width(initializer.width)
+    , m_height(initializer.height)
+    , m_pressure(initializer.pressure)
+    , m_tangentialPressure(initializer.tangentialPressure)
+    , m_tiltX(initializer.tiltX)
+    , m_tiltY(initializer.tiltY)
+    , m_twist(initializer.twist)
+    , m_pointerType(initializer.pointerType)
+    , m_isPrimary(initializer.isPrimary)
+{
+}
+
+PointerEvent::~PointerEvent() = default;
+
+EventInterface PointerEvent::eventInterface() const
+{
+    return PointerEventInterfaceType;
+}
+
+} // namespace WebCore
+
diff --git a/Source/WebCore/dom/PointerEvent.h b/Source/WebCore/dom/PointerEvent.h
new file mode 100644 (file)
index 0000000..e8fdada
--- /dev/null
@@ -0,0 +1,93 @@
+/*
+ * Copyright (C) 2018 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
+ */
+
+#pragma once
+
+#include "MouseEvent.h"
+#include <wtf/text/WTFString.h>
+
+namespace WebCore {
+
+class PointerEvent final : public MouseEvent {
+public:
+    struct Init : MouseEventInit {
+        long pointerId { 0 };
+        double width { 1 };
+        double height { 1 };
+        float pressure { 0 };
+        float tangentialPressure { 0 };
+        long tiltX { 0 };
+        long tiltY { 0 };
+        long twist { 0 };
+        String pointerType;
+        bool isPrimary { false };
+    };
+
+    static RefPtr<PointerEvent> create(const AtomicString& type, Init&& initializer)
+    {
+        return adoptRef(*new PointerEvent(type, WTFMove(initializer)));
+    }
+
+    static Ref<PointerEvent> createForBindings()
+    {
+        return adoptRef(*new PointerEvent);
+    }
+
+    virtual ~PointerEvent();
+
+    long pointerId() const { return m_pointerId; }
+    double width() const { return m_width; }
+    double height() const { return m_height; }
+    float pressure() const { return m_pressure; }
+    float tangentialPressure() const { return m_tangentialPressure; }
+    long tiltX() const { return m_tiltX; }
+    long tiltY() const { return m_tiltY; }
+    long twist() const { return m_twist; }
+    String pointerType() const { return m_pointerType; }
+    bool isPrimary() const { return m_isPrimary; }
+
+    bool isPointerEvent() const override { return true; }
+
+    EventInterface eventInterface() const override;
+
+private:
+    PointerEvent();
+    PointerEvent(const AtomicString&, Init&&);
+
+    long m_pointerId { 0 };
+    double m_width { 1 };
+    double m_height { 1 };
+    float m_pressure { 0 };
+    float m_tangentialPressure { 0 };
+    long m_tiltX { 0 };
+    long m_tiltY { 0 };
+    long m_twist { 0 };
+    String m_pointerType;
+    bool m_isPrimary { false };
+};
+
+} // namespace WebCore
+
+SPECIALIZE_TYPE_TRAITS_EVENT(PointerEvent)
diff --git a/Source/WebCore/dom/PointerEvent.idl b/Source/WebCore/dom/PointerEvent.idl
new file mode 100644 (file)
index 0000000..16ff64c
--- /dev/null
@@ -0,0 +1,53 @@
+/*
+ * Copyright (C) 2018 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
+ */
+
+dictionary PointerEventInit : MouseEventInit {
+    long pointerId = 0;
+    double width = 1;
+    double height = 1;
+    float pressure = 0;
+    float tangentialPressure = 0;
+    long tiltX = 0;
+    long tiltY = 0;
+    long twist = 0;
+    DOMString pointerType = "";
+    boolean isPrimary = false;
+};
+
+[Constructor(DOMString type, optional PointerEventInit eventInitDict),
+ Exposed=Window]
+interface PointerEvent : MouseEvent {
+    readonly attribute long pointerId;
+    readonly attribute double width;
+    readonly attribute double height;
+    readonly attribute float pressure;
+    readonly attribute float tangentialPressure;
+    readonly attribute long tiltX;
+    readonly attribute long tiltY;
+    readonly attribute long twist;
+    readonly attribute DOMString pointerType;
+    readonly attribute boolean isPrimary;
+};
+
index c2ea39d..b6430fa 100644 (file)
         }
     },
     {
+        "name": "Pointer Events",
+        "status": {
+            "status": "In Development",
+            "enabled-by-default": false
+        },
+        "url": "https://www.w3.org/TR/pointerevents/",
+        "specification": "Pointer Events Level 2",
+        "description": "Pointer Events describes events and related interfaces for handling hardware agnostic pointer input from devices including a mouse, pen, touchscreen, etc."
+    },
+    {
         "name": "Position: sticky",
         "status": {
             "status": "Supported",
index e163678..148d2ef 100644 (file)
@@ -90,11 +90,6 @@ public:
     void setWebShareEnabled(bool isEnabled) { m_isWebShareEnabled = isEnabled; }
     bool webShareEnabled() const { return m_isWebShareEnabled; }
 
-#if ENABLE(ATTACHMENT_ELEMENT)
-    void setAttachmentElementEnabled(bool areEnabled) { m_isAttachmentElementEnabled = areEnabled; }
-    bool attachmentElementEnabled() const { return m_isAttachmentElementEnabled; }
-#endif
-
     void setModernMediaControlsEnabled(bool areEnabled) { m_areModernMediaControlsEnabled = areEnabled; }
     bool modernMediaControlsEnabled() const { return m_areModernMediaControlsEnabled; }
 
@@ -104,6 +99,82 @@ public:
     void setIsSecureContextAttributeEnabled(bool isEnabled) { m_isSecureContextAttributeEnabled = isEnabled; }
     bool isSecureContextAttributeEnabled() const { return m_isSecureContextAttributeEnabled; }
 
+    void setWebAnimationsEnabled(bool areEnabled) { m_areWebAnimationsEnabled = areEnabled; }
+    bool webAnimationsEnabled() const { return m_areWebAnimationsEnabled; }
+
+    void setWebAnimationsCSSIntegrationEnabled(bool isEnabled) { m_isWebAnimationsCSSIntegrationEnabled = isEnabled; }
+    bool webAnimationsCSSIntegrationEnabled() const { return m_areWebAnimationsEnabled && m_isWebAnimationsCSSIntegrationEnabled; }
+
+    void setImageBitmapOffscreenCanvasEnabled(bool isEnabled) { m_isImageBitmapOffscreenCanvasEnabled = isEnabled; }
+    bool imageBitmapOffscreenCanvasEnabled() const { return m_isImageBitmapOffscreenCanvasEnabled; }
+
+    void setCacheAPIEnabled(bool isEnabled) { m_isCacheAPIEnabled = isEnabled; }
+    bool cacheAPIEnabled() const { return m_isCacheAPIEnabled; }
+
+    void setFetchAPIEnabled(bool isEnabled) { m_isFetchAPIEnabled = isEnabled; }
+    bool fetchAPIEnabled() const { return m_isFetchAPIEnabled; }
+
+    void setWebSocketEnabled(bool isEnabled) { m_isWebSocketEnabled = isEnabled; }
+    bool webSocketEnabled() const { return m_isWebSocketEnabled; }
+
+    bool fetchAPIKeepAliveEnabled() const { return m_fetchAPIKeepAliveEnabled; }
+    void setFetchAPIKeepAliveEnabled(bool isEnabled) { m_fetchAPIKeepAliveEnabled = isEnabled; }
+
+    bool spectreGadgetsEnabled() const;
+
+    void setInspectorAdditionsEnabled(bool isEnabled) { m_inspectorAdditionsEnabled = isEnabled; }
+    bool inspectorAdditionsEnabled() const { return m_inspectorAdditionsEnabled; }
+
+    void setWebVREnabled(bool isEnabled) { m_webVREnabled = isEnabled; }
+    bool webVREnabled() const { return m_webVREnabled; }
+
+    void setAccessibilityObjectModelEnabled(bool isEnabled) { m_accessibilityObjectModelEnabled = isEnabled; }
+    bool accessibilityObjectModelEnabled() const { return m_accessibilityObjectModelEnabled; }
+
+    void setAriaReflectionEnabled(bool isEnabled) { m_ariaReflectionEnabled = isEnabled; }
+    bool ariaReflectionEnabled() const { return m_ariaReflectionEnabled; }
+
+    void setResourceLoadStatisticsDebugMode(bool isEnabled) { m_resourceLoadStatisticsDebugMode = isEnabled; }
+    bool resourceLoadStatisticsDebugMode() const { return m_resourceLoadStatisticsDebugMode; }
+
+    void setRestrictedHTTPResponseAccess(bool isEnabled) { m_isRestrictedHTTPResponseAccess = isEnabled; }
+    bool restrictedHTTPResponseAccess() const { return m_isRestrictedHTTPResponseAccess; }
+
+    void setCrossOriginResourcePolicyEnabled(bool isEnabled) { m_crossOriginResourcePolicyEnabled = isEnabled; }
+    bool crossOriginResourcePolicyEnabled() const { return m_crossOriginResourcePolicyEnabled; }
+
+    void setWebGLCompressedTextureASTCSupportEnabled(bool isEnabled) { m_isWebGLCompressedTextureASTCSupportEnabled = isEnabled; }
+    bool webGLCompressedTextureASTCSupportEnabled() const { return m_isWebGLCompressedTextureASTCSupportEnabled; }
+
+    void setStorageAccessPromptsEnabled(bool isEnabled)  { m_promptForStorageAccessAPIEnabled = isEnabled; }
+    bool storageAccessPromptsEnabled() const { return m_promptForStorageAccessAPIEnabled; }
+
+    void setServerTimingEnabled(bool isEnabled) { m_isServerTimingEnabled = isEnabled; }
+    bool serverTimingEnabled() const { return m_isServerTimingEnabled; }
+
+    void setExperimentalPlugInSandboxProfilesEnabled(bool isEnabled) { m_experimentalPlugInSandboxProfilesEnabled = isEnabled; }
+    bool experimentalPlugInSandboxProfilesEnabled() const { return m_experimentalPlugInSandboxProfilesEnabled; }
+
+    void setDisabledAdaptationsMetaTagEnabled(bool isEnabled) { m_disabledAdaptationsMetaTagEnabled = isEnabled; }
+    bool disabledAdaptationsMetaTagEnabled() const { return m_disabledAdaptationsMetaTagEnabled; }
+
+    void setAttrStyleEnabled(bool isEnabled) { m_attrStyleEnabled = isEnabled; }
+    bool attrStyleEnabled() const { return m_attrStyleEnabled; }
+
+    void setWebAPIStatisticsEnabled(bool isEnabled) { m_webAPIStatisticsEnabled = isEnabled; }
+    bool webAPIStatisticsEnabled() const { return m_webAPIStatisticsEnabled; }
+
+    void setCSSCustomPropertiesAndValuesEnabled(bool isEnabled) { m_CSSCustomPropertiesAndValuesEnabled = isEnabled; }
+    bool cssCustomPropertiesAndValuesEnabled() const { return m_CSSCustomPropertiesAndValuesEnabled; }
+
+    void setPointerEventsEnabled(bool isEnabled) { m_pointerEventsEnabled = isEnabled; }
+    bool pointerEventsEnabled() const { return m_pointerEventsEnabled; }
+
+#if ENABLE(ATTACHMENT_ELEMENT)
+    void setAttachmentElementEnabled(bool areEnabled) { m_isAttachmentElementEnabled = areEnabled; }
+    bool attachmentElementEnabled() const { return m_isAttachmentElementEnabled; }
+#endif
+
 #if ENABLE(INDEXED_DATABASE_IN_WORKERS)
     void setIndexedDBWorkersEnabled(bool isEnabled) { m_isIndexedDBWorkersEnabled = isEnabled; }
     bool indexedDBWorkersEnabled() const { return m_isIndexedDBWorkersEnabled; }
@@ -173,12 +244,6 @@ public:
     bool animationTriggersEnabled() const { return m_areAnimationTriggersEnabled; }
 #endif
 
-    void setWebAnimationsEnabled(bool areEnabled) { m_areWebAnimationsEnabled = areEnabled; }
-    bool webAnimationsEnabled() const { return m_areWebAnimationsEnabled; }
-
-    void setWebAnimationsCSSIntegrationEnabled(bool isEnabled) { m_isWebAnimationsCSSIntegrationEnabled = isEnabled; }
-    bool webAnimationsCSSIntegrationEnabled() const { return m_areWebAnimationsEnabled && m_isWebAnimationsCSSIntegrationEnabled; }
-
 #if ENABLE(WEBGL2)
     void setWebGL2Enabled(bool isEnabled) { m_isWebGL2Enabled = isEnabled; }
     bool webGL2Enabled() const { return m_isWebGL2Enabled; }
@@ -189,18 +254,6 @@ public:
     bool webGPUEnabled() const { return m_isWebGPUEnabled; }
 #endif
 
-    void setImageBitmapOffscreenCanvasEnabled(bool isEnabled) { m_isImageBitmapOffscreenCanvasEnabled = isEnabled; }
-    bool imageBitmapOffscreenCanvasEnabled() const { return m_isImageBitmapOffscreenCanvasEnabled; }
-
-    void setCacheAPIEnabled(bool isEnabled) { m_isCacheAPIEnabled = isEnabled; }
-    bool cacheAPIEnabled() const { return m_isCacheAPIEnabled; }
-
-    void setFetchAPIEnabled(bool isEnabled) { m_isFetchAPIEnabled = isEnabled; }
-    bool fetchAPIEnabled() const { return m_isFetchAPIEnabled; }
-
-    void setWebSocketEnabled(bool isEnabled) { m_isWebSocketEnabled = isEnabled; }
-    bool webSocketEnabled() const { return m_isWebSocketEnabled; }
-
 #if ENABLE(STREAMS_API)
     void setReadableByteStreamAPIEnabled(bool isEnabled) { m_isReadableByteStreamAPIEnabled = isEnabled; }
     bool readableByteStreamAPIEnabled() const { return m_isReadableByteStreamAPIEnabled; }
@@ -233,61 +286,11 @@ public:
     void setServiceWorkerEnabled(bool isEnabled) { m_serviceWorkerEnabled = isEnabled; }
 #endif
 
-    bool fetchAPIKeepAliveEnabled() const { return m_fetchAPIKeepAliveEnabled; }
-    void setFetchAPIKeepAliveEnabled(bool isEnabled) { m_fetchAPIKeepAliveEnabled = isEnabled; }
-
-    bool spectreGadgetsEnabled() const;
-
-    void setInspectorAdditionsEnabled(bool isEnabled) { m_inspectorAdditionsEnabled = isEnabled; }
-    bool inspectorAdditionsEnabled() const { return m_inspectorAdditionsEnabled; }
-
-    void setWebVREnabled(bool isEnabled) { m_webVREnabled = isEnabled; }
-    bool webVREnabled() const { return m_webVREnabled; }
-
-    void setAccessibilityObjectModelEnabled(bool isEnabled) { m_accessibilityObjectModelEnabled = isEnabled; }
-    bool accessibilityObjectModelEnabled() const { return m_accessibilityObjectModelEnabled; }
-    
-    void setAriaReflectionEnabled(bool isEnabled) { m_ariaReflectionEnabled = isEnabled; }
-    bool ariaReflectionEnabled() const { return m_ariaReflectionEnabled; }
-
-    void setResourceLoadStatisticsDebugMode(bool isEnabled) { m_resourceLoadStatisticsDebugMode = isEnabled; }
-    bool resourceLoadStatisticsDebugMode() const { return m_resourceLoadStatisticsDebugMode; }
-
-    void setRestrictedHTTPResponseAccess(bool isEnabled) { m_isRestrictedHTTPResponseAccess = isEnabled; }
-    bool restrictedHTTPResponseAccess() const { return m_isRestrictedHTTPResponseAccess; }
-
-    void setCrossOriginResourcePolicyEnabled(bool isEnabled) { m_crossOriginResourcePolicyEnabled = isEnabled; }
-    bool crossOriginResourcePolicyEnabled() const { return m_crossOriginResourcePolicyEnabled; }
-    
-    void setWebGLCompressedTextureASTCSupportEnabled(bool isEnabled) { m_isWebGLCompressedTextureASTCSupportEnabled = isEnabled; }
-    bool webGLCompressedTextureASTCSupportEnabled() const { return m_isWebGLCompressedTextureASTCSupportEnabled; }
-
-    void setStorageAccessPromptsEnabled(bool isEnabled)  { m_promptForStorageAccessAPIEnabled = isEnabled; }
-    bool storageAccessPromptsEnabled() const { return m_promptForStorageAccessAPIEnabled; }
-
-    void setServerTimingEnabled(bool isEnabled) { m_isServerTimingEnabled = isEnabled; }
-    bool serverTimingEnabled() const { return m_isServerTimingEnabled; }
-
-    void setExperimentalPlugInSandboxProfilesEnabled(bool isEnabled) { m_experimentalPlugInSandboxProfilesEnabled = isEnabled; }
-    bool experimentalPlugInSandboxProfilesEnabled() const { return m_experimentalPlugInSandboxProfilesEnabled; }
-
-    void setDisabledAdaptationsMetaTagEnabled(bool isEnabled) { m_disabledAdaptationsMetaTagEnabled = isEnabled; }
-    bool disabledAdaptationsMetaTagEnabled() const { return m_disabledAdaptationsMetaTagEnabled; }
-
 #if USE(SYSTEM_PREVIEW)
     void setSystemPreviewEnabled(bool isEnabled) { m_systemPreviewEnabled = isEnabled; }
     bool systemPreviewEnabled() const { return m_systemPreviewEnabled; }
 #endif
 
-    void setAttrStyleEnabled(bool isEnabled) { m_attrStyleEnabled = isEnabled; }
-    bool attrStyleEnabled() const { return m_attrStyleEnabled; }
-
-    void setWebAPIStatisticsEnabled(bool isEnabled) { m_webAPIStatisticsEnabled = isEnabled; }
-    bool webAPIStatisticsEnabled() const { return m_webAPIStatisticsEnabled; }
-
-    void setCSSCustomPropertiesAndValuesEnabled(bool isEnabled) { m_CSSCustomPropertiesAndValuesEnabled = isEnabled; }
-    bool cssCustomPropertiesAndValuesEnabled() const { return m_CSSCustomPropertiesAndValuesEnabled; }
-
     WEBCORE_EXPORT static RuntimeEnabledFeatures& sharedFeatures();
 
 private:
@@ -312,6 +315,29 @@ private:
     bool m_isCustomPasteboardDataEnabled { false };
     bool m_isWebShareEnabled { false };
     bool m_inputEventsEnabled { true };
+    bool m_areWebAnimationsEnabled { true };
+    bool m_isWebAnimationsCSSIntegrationEnabled { false };
+    bool m_isImageBitmapOffscreenCanvasEnabled { true };
+    bool m_isCacheAPIEnabled { false };
+    bool m_isFetchAPIEnabled { true };
+    bool m_isWebSocketEnabled { true };
+    bool m_fetchAPIKeepAliveEnabled { false };
+    bool m_inspectorAdditionsEnabled { false };
+    bool m_webVREnabled { false };
+    bool m_accessibilityObjectModelEnabled { false };
+    bool m_ariaReflectionEnabled { true };
+    bool m_resourceLoadStatisticsDebugMode { false };
+    bool m_isRestrictedHTTPResponseAccess { true };
+    bool m_crossOriginResourcePolicyEnabled { true };
+    bool m_isWebGLCompressedTextureASTCSupportEnabled { false };
+    bool m_promptForStorageAccessAPIEnabled { false };
+    bool m_isServerTimingEnabled { false };
+    bool m_experimentalPlugInSandboxProfilesEnabled { false };
+    bool m_disabledAdaptationsMetaTagEnabled { false };
+    bool m_attrStyleEnabled { false };
+    bool m_webAPIStatisticsEnabled { false };
+    bool m_CSSCustomPropertiesAndValuesEnabled { false };
+    bool m_pointerEventsEnabled { false };
 
 #if ENABLE(ATTACHMENT_ELEMENT)
     bool m_isAttachmentElementEnabled { false };
@@ -374,9 +400,6 @@ private:
     bool m_isWritableStreamAPIEnabled { false };
 #endif
 
-    bool m_areWebAnimationsEnabled { true };
-    bool m_isWebAnimationsCSSIntegrationEnabled { false };
-
 #if ENABLE(WEBGL2)
     bool m_isWebGL2Enabled { false };
 #endif
@@ -385,12 +408,6 @@ private:
     bool m_isWebGPUEnabled { false };
 #endif
 
-    bool m_isImageBitmapOffscreenCanvasEnabled { true };
-    bool m_isCacheAPIEnabled { false };
-    bool m_isFetchAPIEnabled { true };
-
-    bool m_isWebSocketEnabled { true };
-
 #if ENABLE(DOWNLOAD_ATTRIBUTE)
     bool m_isDownloadAttributeEnabled { false };
 #endif
@@ -411,30 +428,10 @@ private:
     bool m_serviceWorkerEnabled { false };
 #endif
 
-    bool m_fetchAPIKeepAliveEnabled { false };
-    bool m_inspectorAdditionsEnabled { false };
-    bool m_webVREnabled { false };
-    bool m_accessibilityObjectModelEnabled { false };
-    bool m_ariaReflectionEnabled { true };
-    bool m_resourceLoadStatisticsDebugMode { false };
-    bool m_isRestrictedHTTPResponseAccess { true };
-    bool m_crossOriginResourcePolicyEnabled { true };
-    bool m_isWebGLCompressedTextureASTCSupportEnabled { false };
-    bool m_promptForStorageAccessAPIEnabled { false };
-    bool m_isServerTimingEnabled { false };
-    bool m_experimentalPlugInSandboxProfilesEnabled { false };
-    bool m_disabledAdaptationsMetaTagEnabled { false };
-
 #if USE(SYSTEM_PREVIEW)
     bool m_systemPreviewEnabled { false };
 #endif
 
-    bool m_attrStyleEnabled { false };
-
-    bool m_webAPIStatisticsEnabled { false };
-
-    bool m_CSSCustomPropertiesAndValuesEnabled { false };
-
     friend class WTF::NeverDestroyed<RuntimeEnabledFeatures>;
 };
 
index 29a63b6..91440ba 100644 (file)
@@ -1,3 +1,15 @@
+2018-09-21  Dean Jackson  <dino@apple.com>
+
+        Add PointerEvent, plus feature flag, plus Web Platform Tests
+        https://bugs.webkit.org/show_bug.cgi?id=189867
+        <rdar://problem/44697384>
+
+        Reviewed by Simon Fraser.
+
+        Add PointerEvents as an experimental feature.
+
+        * Shared/WebPreferences.yaml:
+
 2018-09-21  Brian Burg  <bburg@apple.com>
 
         Web Inspector: dock buttons disappear if Web Inspector goes fullscreen
index 393722a..a82ab12 100644 (file)
@@ -1183,6 +1183,14 @@ VisualViewportAPIEnabled:
   humanReadableDescription: "Enable Visual Viewport API"
   category: experimental
 
+PointerEventsEnabled:
+  type: bool
+  defaultValue: false
+  humanReadableName: "Pointer Events"
+  humanReadableDescription: "Enable Pointer Events"
+  webcoreBinding: RuntimeEnabledFeatures
+  category: experimental
+
 CSSOMViewScrollingAPIEnabled:
   type: bool
   defaultValue: false