[Pointer Events WPT] Update WPT tests and provide macOS testdriver
authorgraouts@webkit.org <graouts@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 17 Apr 2019 19:13:21 +0000 (19:13 +0000)
committergraouts@webkit.org <graouts@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 17 Apr 2019 19:13:21 +0000 (19:13 +0000)
https://bugs.webkit.org/show_bug.cgi?id=197011
<rdar://problem/49976553>

Reviewed by Dean Jackson.

LayoutTests/imported/w3c:

We update the WPT tests from the latest state of the WPT GitHub repository and provide a testdriver to dispatch mouse events on macOS.

* web-platform-tests/payment-request/payment-request-canmakepayment-method.https-expected.txt: Update expectations now that an (incomplete)
test driver is available.
* web-platform-tests/pointerevents/META.yml:
* web-platform-tests/pointerevents/compat/pointerevent_touch-action_two-finger_interaction-manual.html: Added.
* web-platform-tests/pointerevents/extension/idlharness.window-expected.txt: Removed.
* web-platform-tests/pointerevents/extension/idlharness.window.html: Removed.
* web-platform-tests/pointerevents/extension/pointerevent_coalesced_events_attributes-manual.html: Added.
* web-platform-tests/pointerevents/extension/pointerevent_constructor.html:
* web-platform-tests/pointerevents/extension/pointerevent_getCoalescedEvents_when_pointerlocked-manual.html: Added.
* web-platform-tests/pointerevents/extension/pointerevent_getPredictedEvents_when_pointerlocked-manual.html: Added.
* web-platform-tests/pointerevents/extension/pointerevent_pointerrawmove-manual.html: Added.
* web-platform-tests/pointerevents/extension/pointerevent_pointerrawmove_in_pointerlock-manual.html: Added.
* web-platform-tests/pointerevents/extension/pointerevent_predicted_events_attributes-manual.html: Added.
* web-platform-tests/pointerevents/extension/pointerevent_touch-action-pan-down-css_touch-manual.html: Added.
* web-platform-tests/pointerevents/extension/pointerevent_touch-action-pan-left-css_touch-manual.html: Added.
* web-platform-tests/pointerevents/extension/pointerevent_touch-action-pan-right-css_touch-manual.html: Added.
* web-platform-tests/pointerevents/extension/pointerevent_touch-action-pan-up-css_touch-manual.html: Added.
* web-platform-tests/pointerevents/extension/w3c-import.log: Removed.
* web-platform-tests/pointerevents/html/pointerevent_drag_interaction-manual.html: Added.
* web-platform-tests/pointerevents/idlharness.window-expected.txt: Removed.
* web-platform-tests/pointerevents/idlharness.window.html: Removed.
* web-platform-tests/pointerevents/pointerevent_attributes_hoverable_pointers-manual-expected.txt: Added.
* web-platform-tests/pointerevents/pointerevent_attributes_hoverable_pointers-manual.html: Added.
* web-platform-tests/pointerevents/pointerevent_attributes_nohover_pointers-manual-expected.txt: Added.
* web-platform-tests/pointerevents/pointerevent_attributes_nohover_pointers-manual.html: Added.
* web-platform-tests/pointerevents/pointerevent_boundary_events_at_implicit_release_hoverable_pointers-expected.txt: Added.
* web-platform-tests/pointerevents/pointerevent_boundary_events_at_implicit_release_hoverable_pointers.html: Added.
* web-platform-tests/pointerevents/pointerevent_boundary_events_in_capturing-manual.html: Added.
* web-platform-tests/pointerevents/pointerevent_capture_mouse-expected.txt: Added.
* web-platform-tests/pointerevents/pointerevent_capture_mouse.html: Added.
* web-platform-tests/pointerevents/pointerevent_capture_suppressing_mouse-manual.html: Added.
* web-platform-tests/pointerevents/pointerevent_change-touch-action-onpointerdown_touch.html: Added.
* web-platform-tests/pointerevents/pointerevent_click_during_capture-expected.txt: Added.
* web-platform-tests/pointerevents/pointerevent_click_during_capture.html: Added.
* web-platform-tests/pointerevents/pointerevent_disabled_form_control-manual.html: Added.
* web-platform-tests/pointerevents/pointerevent_element_haspointercapture-manual.html: Added.
* web-platform-tests/pointerevents/pointerevent_element_haspointercapture_release_pending_capture-manual.html: Added.
* web-platform-tests/pointerevents/pointerevent_fractional_coordinates-manual.html: Added.
* web-platform-tests/pointerevents/pointerevent_lostpointercapture_for_disconnected_node.html: Added.
* web-platform-tests/pointerevents/pointerevent_lostpointercapture_is_first.html: Added.
* web-platform-tests/pointerevents/pointerevent_mouse_capture_change_hover-expected.txt: Added.
* web-platform-tests/pointerevents/pointerevent_mouse_capture_change_hover.html: Added.
* web-platform-tests/pointerevents/pointerevent_mouse_pointercapture_in_frame-expected.txt: Added.
* web-platform-tests/pointerevents/pointerevent_mouse_pointercapture_in_frame.html: Added.
* web-platform-tests/pointerevents/pointerevent_mouse_pointercapture_inactivate_pointer-expected.txt: Added.
* web-platform-tests/pointerevents/pointerevent_mouse_pointercapture_inactivate_pointer.html: Added.
* web-platform-tests/pointerevents/pointerevent_multiple_primary_pointers_boundary_events-manual.html: Added.
* web-platform-tests/pointerevents/pointerevent_on_event_handlers-expected.txt: Removed.
* web-platform-tests/pointerevents/pointerevent_pointerId_scope-manual.html: Added.
* web-platform-tests/pointerevents/pointerevent_pointercancel_touch.html: Added.
* web-platform-tests/pointerevents/pointerevent_pointerenter_does_not_bubble-expected.txt: Added.
* web-platform-tests/pointerevents/pointerevent_pointerenter_does_not_bubble.html: Added.
* web-platform-tests/pointerevents/pointerevent_pointerleave_after_pointercancel_touch.html: Added.
* web-platform-tests/pointerevents/pointerevent_pointerleave_descendant_over-expected.txt: Added.
* web-platform-tests/pointerevents/pointerevent_pointerleave_descendant_over.html: Added.
* web-platform-tests/pointerevents/pointerevent_pointerleave_descendants-expected.txt: Added.
* web-platform-tests/pointerevents/pointerevent_pointerleave_descendants.html: Added.
* web-platform-tests/pointerevents/pointerevent_pointerleave_does_not_bubble-expected.txt: Added.
* web-platform-tests/pointerevents/pointerevent_pointerleave_does_not_bubble.html: Added.
* web-platform-tests/pointerevents/pointerevent_pointerleave_pen-manual.html: Added.
* web-platform-tests/pointerevents/pointerevent_pointermove-expected.txt: Added.
* web-platform-tests/pointerevents/pointerevent_pointermove.html: Added.
* web-platform-tests/pointerevents/pointerevent_pointermove_isprimary_same_as_pointerdown-expected.txt: Added.
* web-platform-tests/pointerevents/pointerevent_pointermove_isprimary_same_as_pointerdown.html: Added.
* web-platform-tests/pointerevents/pointerevent_pointermove_on_chorded_mouse_button-expected.txt: Added.
* web-platform-tests/pointerevents/pointerevent_pointermove_on_chorded_mouse_button.html: Added.
* web-platform-tests/pointerevents/pointerevent_pointerout_after_pointercancel_touch.html: Added.
* web-platform-tests/pointerevents/pointerevent_pointerout_pen.html: Added.
* web-platform-tests/pointerevents/pointerevent_pointerout_received_once-expected.txt: Added.
* web-platform-tests/pointerevents/pointerevent_pointerout_received_once.html: Added.
* web-platform-tests/pointerevents/pointerevent_releasepointercapture_events_to_original_target-manual.html: Added.
* web-platform-tests/pointerevents/pointerevent_releasepointercapture_invalid_pointerid-expected.txt: Added.
* web-platform-tests/pointerevents/pointerevent_releasepointercapture_invalid_pointerid.html: Added.
* web-platform-tests/pointerevents/pointerevent_releasepointercapture_onpointercancel_touch.html: Added.
* web-platform-tests/pointerevents/pointerevent_releasepointercapture_onpointerup_mouse-expected.txt: Added.
* web-platform-tests/pointerevents/pointerevent_releasepointercapture_onpointerup_mouse.html: Added.
* web-platform-tests/pointerevents/pointerevent_releasepointercapture_release_right_after_capture-manual.html: Added.
* web-platform-tests/pointerevents/pointerevent_root_computed_style-expected.txt: Added.
* web-platform-tests/pointerevents/pointerevent_root_computed_style.html: Added.
* web-platform-tests/pointerevents/pointerevent_root_hit_test-expected.txt: Added.
* web-platform-tests/pointerevents/pointerevent_root_hit_test.html: Added.
* web-platform-tests/pointerevents/pointerevent_sequence_at_implicit_release_on_click-manual.html: Added.
* web-platform-tests/pointerevents/pointerevent_sequence_at_implicit_release_on_drag-manual.html: Added.
* web-platform-tests/pointerevents/pointerevent_setpointercapture_disconnected-expected.txt: Added.
* web-platform-tests/pointerevents/pointerevent_setpointercapture_disconnected.html: Added.
* web-platform-tests/pointerevents/pointerevent_setpointercapture_inactive_button_mouse-expected.txt: Added.
* web-platform-tests/pointerevents/pointerevent_setpointercapture_inactive_button_mouse.html: Added.
* web-platform-tests/pointerevents/pointerevent_setpointercapture_invalid_pointerid-expected.txt: Added.
* web-platform-tests/pointerevents/pointerevent_setpointercapture_invalid_pointerid.html: Added.
* web-platform-tests/pointerevents/pointerevent_setpointercapture_override_pending_capture_element-manual.html: Added.
* web-platform-tests/pointerevents/pointerevent_setpointercapture_relatedtarget-expected.txt: Added.
* web-platform-tests/pointerevents/pointerevent_setpointercapture_relatedtarget.html: Added.
* web-platform-tests/pointerevents/pointerevent_setpointercapture_to_same_element_twice-manual.html: Added.
* web-platform-tests/pointerevents/pointerevent_support.js:
* web-platform-tests/pointerevents/pointerevent_suppress_compat_events_on_click-expected.txt: Added.
* web-platform-tests/pointerevents/pointerevent_suppress_compat_events_on_click.html: Added.
* web-platform-tests/pointerevents/pointerevent_suppress_compat_events_on_drag_mouse-expected.txt: Added.
* web-platform-tests/pointerevents/pointerevent_suppress_compat_events_on_drag_mouse.html: Added.
* web-platform-tests/pointerevents/pointerevent_touch-action-auto-css_touch.html: Added.
* web-platform-tests/pointerevents/pointerevent_touch-action-button-test_touch-manual.html: Added.
* web-platform-tests/pointerevents/pointerevent_touch-action-inherit_child-auto-child-none_touch-manual.html: Added.
* web-platform-tests/pointerevents/pointerevent_touch-action-inherit_child-none_touch-manual.html: Added.
* web-platform-tests/pointerevents/pointerevent_touch-action-inherit_child-pan-x-child-pan-x_touch-manual.html: Added.
* web-platform-tests/pointerevents/pointerevent_touch-action-inherit_child-pan-x-child-pan-y_touch-manual.html: Added.
* web-platform-tests/pointerevents/pointerevent_touch-action-inherit_highest-parent-none_touch.html: Added.
* web-platform-tests/pointerevents/pointerevent_touch-action-inherit_parent-none_touch-manual.html: Added.
* web-platform-tests/pointerevents/pointerevent_touch-action-keyboard-manual.html: Added.
* web-platform-tests/pointerevents/pointerevent_touch-action-mouse-manual.html: Added.
* web-platform-tests/pointerevents/pointerevent_touch-action-none-css_touch-manual.html: Added.
* web-platform-tests/pointerevents/pointerevent_touch-action-pan-x-css_touch-manual.html: Added.
* web-platform-tests/pointerevents/pointerevent_touch-action-pan-x-pan-y-pan-y_touch-manual.html: Added.
* web-platform-tests/pointerevents/pointerevent_touch-action-pan-x-pan-y_touch.html: Added.
* web-platform-tests/pointerevents/pointerevent_touch-action-pan-y-css_touch-manual.html: Added.
* web-platform-tests/pointerevents/pointerevent_touch-action-rotated-divs_touch-manual.html: Added.
* web-platform-tests/pointerevents/pointerevent_touch-action-span-test_touch-manual.html: Added.
* web-platform-tests/pointerevents/pointerevent_touch-action-svg-test_touch-manual.html: Added.
* web-platform-tests/pointerevents/pointerevent_touch-action-table-test_touch-manual.html: Added.
* web-platform-tests/pointerevents/pointerlock/pointerevent_coordinates_when_locked.html: Added.
* web-platform-tests/pointerevents/pointerlock/pointerevent_movementxy-manual.html: Added.
* web-platform-tests/pointerevents/pointerlock/pointerevent_movementxy_when_locked-manual.html: Added.
* web-platform-tests/pointerevents/pointerlock/pointerevent_pointerlock_after_pointercapture-manual.html: Added.
* web-platform-tests/pointerevents/pointerlock/pointerevent_pointerlock_supercedes_capture-manual.html: Added.
* web-platform-tests/pointerevents/pointerlock/pointerevent_pointermove_in_pointerlock-manual.html: Added.
* web-platform-tests/pointerevents/pointerlock/pointerevent_pointermove_on_chorded_mouse_button_when_locked-manual.html: Added.
* web-platform-tests/pointerevents/pointerlock/resources/pointerevent_pointermove_in_pointerlock-iframe.html: Added.
* web-platform-tests/pointerevents/pointerlock/resources/w3c-import.log: Removed.
* web-platform-tests/pointerevents/resources/pointerevent_mouse_pointercapture-iframe.html: Added.
* web-platform-tests/pointerevents/resources/pointerevent_mouse_pointercapture_inactivate_pointer-iframe.html: Added.
* web-platform-tests/pointerevents/resources/pointerevent_pointerrawmove_in_pointerlock-iframe.html: Added.
* web-platform-tests/pointerevents/resources/w3c-import.log: Removed.
* web-platform-tests/pointerevents/w3c-import.log: Removed.
* web-platform-tests/resources/testdriver-actions.js: Added.
* web-platform-tests/resources/testdriver-vendor.js: Added.
(logDebug):
(dispatchMouseActions):
(window.test_driver_internal.action_sequence):
* web-platform-tests/resources/testdriver.js: Added.

LayoutTests:

* platform/mac-wk1/imported/w3c/web-platform-tests/pointerevents/pointerevent_boundary_events_at_implicit_release_hoverable_pointers-expected.txt: Added.
* platform/mac-wk1/imported/w3c/web-platform-tests/pointerevents/pointerevent_mouse_capture_change_hover-expected.txt: Added.
* platform/mac-wk1/imported/w3c/web-platform-tests/pointerevents/pointerevent_mouse_pointercapture_in_frame-expected.txt: Added.
* platform/mac-wk1/imported/w3c/web-platform-tests/pointerevents/pointerevent_setpointercapture_relatedtarget-expected.txt: Added.
* platform/mac/TestExpectations:

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

141 files changed:
LayoutTests/ChangeLog
LayoutTests/TestExpectations
LayoutTests/imported/w3c/ChangeLog
LayoutTests/imported/w3c/web-platform-tests/payment-request/payment-request-canmakepayment-method.https-expected.txt
LayoutTests/imported/w3c/web-platform-tests/pointerevents/META.yml
LayoutTests/imported/w3c/web-platform-tests/pointerevents/compat/pointerevent_touch-action_two-finger_interaction-manual.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/pointerevents/extension/idlharness.window-expected.txt [deleted file]
LayoutTests/imported/w3c/web-platform-tests/pointerevents/extension/idlharness.window.html [deleted file]
LayoutTests/imported/w3c/web-platform-tests/pointerevents/extension/pointerevent_coalesced_events_attributes-manual.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/pointerevents/extension/pointerevent_constructor.html
LayoutTests/imported/w3c/web-platform-tests/pointerevents/extension/pointerevent_getCoalescedEvents_when_pointerlocked-manual.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/pointerevents/extension/pointerevent_getPredictedEvents_when_pointerlocked-manual.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/pointerevents/extension/pointerevent_pointerrawmove-manual.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/pointerevents/extension/pointerevent_pointerrawmove_in_pointerlock-manual.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/pointerevents/extension/pointerevent_predicted_events_attributes-manual.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/pointerevents/extension/pointerevent_touch-action-pan-down-css_touch-manual.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/pointerevents/extension/pointerevent_touch-action-pan-left-css_touch-manual.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/pointerevents/extension/pointerevent_touch-action-pan-right-css_touch-manual.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/pointerevents/extension/pointerevent_touch-action-pan-up-css_touch-manual.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/pointerevents/extension/w3c-import.log [deleted file]
LayoutTests/imported/w3c/web-platform-tests/pointerevents/html/pointerevent_drag_interaction-manual.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/pointerevents/idlharness.window-expected.txt [deleted file]
LayoutTests/imported/w3c/web-platform-tests/pointerevents/idlharness.window.html [deleted file]
LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_attributes_hoverable_pointers-manual-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_attributes_hoverable_pointers-manual.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_attributes_nohover_pointers-manual-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_attributes_nohover_pointers-manual.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_boundary_events_at_implicit_release_hoverable_pointers-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_boundary_events_at_implicit_release_hoverable_pointers.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_boundary_events_in_capturing-manual.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_capture_mouse-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_capture_mouse.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_capture_suppressing_mouse-manual.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_change-touch-action-onpointerdown_touch.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_click_during_capture-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_click_during_capture.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_disabled_form_control-manual.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_element_haspointercapture-manual.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_element_haspointercapture_release_pending_capture-manual.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_fractional_coordinates-manual.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_lostpointercapture_for_disconnected_node.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_lostpointercapture_is_first.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_mouse_capture_change_hover-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_mouse_capture_change_hover.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_mouse_pointercapture_in_frame-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_mouse_pointercapture_in_frame.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_mouse_pointercapture_inactivate_pointer-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_mouse_pointercapture_inactivate_pointer.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_multiple_primary_pointers_boundary_events-manual.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_on_event_handlers-expected.txt [deleted file]
LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_pointerId_scope-manual.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_pointercancel_touch.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_pointerenter_does_not_bubble-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_pointerenter_does_not_bubble.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_pointerleave_after_pointercancel_touch.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_pointerleave_descendant_over-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_pointerleave_descendant_over.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_pointerleave_descendants-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_pointerleave_descendants.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_pointerleave_does_not_bubble-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_pointerleave_does_not_bubble.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_pointerleave_pen-manual.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_pointermove-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_pointermove.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_pointermove_isprimary_same_as_pointerdown-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_pointermove_isprimary_same_as_pointerdown.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_pointermove_on_chorded_mouse_button-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_pointermove_on_chorded_mouse_button.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_pointerout_after_pointercancel_touch.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_pointerout_pen.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_pointerout_received_once-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_pointerout_received_once.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_releasepointercapture_events_to_original_target-manual.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_releasepointercapture_invalid_pointerid-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_releasepointercapture_invalid_pointerid.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_releasepointercapture_onpointercancel_touch.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_releasepointercapture_onpointerup_mouse-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_releasepointercapture_onpointerup_mouse.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_releasepointercapture_release_right_after_capture-manual.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_root_computed_style-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_root_computed_style.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_root_hit_test-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_root_hit_test.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_sequence_at_implicit_release_on_click-manual.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_sequence_at_implicit_release_on_drag-manual.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_setpointercapture_disconnected-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_setpointercapture_disconnected.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_setpointercapture_inactive_button_mouse-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_setpointercapture_inactive_button_mouse.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_setpointercapture_invalid_pointerid-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_setpointercapture_invalid_pointerid.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_setpointercapture_override_pending_capture_element-manual.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_setpointercapture_relatedtarget-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_setpointercapture_relatedtarget.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_setpointercapture_to_same_element_twice-manual.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_support.js
LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_suppress_compat_events_on_click-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_suppress_compat_events_on_click.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_suppress_compat_events_on_drag_mouse-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_suppress_compat_events_on_drag_mouse.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_touch-action-auto-css_touch.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_touch-action-button-test_touch-manual.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_touch-action-inherit_child-auto-child-none_touch-manual.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_touch-action-inherit_child-none_touch-manual.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_touch-action-inherit_child-pan-x-child-pan-x_touch-manual.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_touch-action-inherit_child-pan-x-child-pan-y_touch-manual.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_touch-action-inherit_highest-parent-none_touch.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_touch-action-inherit_parent-none_touch-manual.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_touch-action-keyboard-manual.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_touch-action-mouse-manual.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_touch-action-none-css_touch-manual.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_touch-action-pan-x-css_touch-manual.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_touch-action-pan-x-pan-y-pan-y_touch-manual.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_touch-action-pan-x-pan-y_touch.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_touch-action-pan-y-css_touch-manual.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_touch-action-rotated-divs_touch-manual.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_touch-action-span-test_touch-manual.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_touch-action-svg-test_touch-manual.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_touch-action-table-test_touch-manual.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerlock/pointerevent_coordinates_when_locked.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerlock/pointerevent_movementxy-manual.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerlock/pointerevent_movementxy_when_locked-manual.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerlock/pointerevent_pointerlock_after_pointercapture-manual.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerlock/pointerevent_pointerlock_supercedes_capture-manual.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerlock/pointerevent_pointermove_in_pointerlock-manual.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerlock/pointerevent_pointermove_on_chorded_mouse_button_when_locked-manual.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerlock/resources/pointerevent_pointermove_in_pointerlock-iframe.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerlock/resources/w3c-import.log [deleted file]
LayoutTests/imported/w3c/web-platform-tests/pointerevents/resources/pointerevent_mouse_pointercapture-iframe.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/pointerevents/resources/pointerevent_mouse_pointercapture_inactivate_pointer-iframe.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/pointerevents/resources/pointerevent_pointerrawmove_in_pointerlock-iframe.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/pointerevents/resources/w3c-import.log [deleted file]
LayoutTests/imported/w3c/web-platform-tests/pointerevents/w3c-import.log [deleted file]
LayoutTests/imported/w3c/web-platform-tests/resources/testdriver-actions.js [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/resources/testdriver-vendor.js [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/resources/testdriver.js [new file with mode: 0644]
LayoutTests/platform/mac-wk1/imported/w3c/web-platform-tests/pointerevents/pointerevent_boundary_events_at_implicit_release_hoverable_pointers-expected.txt [new file with mode: 0644]
LayoutTests/platform/mac-wk1/imported/w3c/web-platform-tests/pointerevents/pointerevent_mouse_capture_change_hover-expected.txt [new file with mode: 0644]
LayoutTests/platform/mac-wk1/imported/w3c/web-platform-tests/pointerevents/pointerevent_mouse_pointercapture_in_frame-expected.txt [new file with mode: 0644]
LayoutTests/platform/mac-wk1/imported/w3c/web-platform-tests/pointerevents/pointerevent_setpointercapture_relatedtarget-expected.txt [new file with mode: 0644]
LayoutTests/platform/mac/TestExpectations

index 8af7f82..da7e867 100644 (file)
@@ -1,3 +1,17 @@
+2019-04-17  Antoine Quint  <graouts@apple.com>
+
+        [Pointer Events WPT] Update WPT tests and provide macOS testdriver
+        https://bugs.webkit.org/show_bug.cgi?id=197011
+        <rdar://problem/49976553>
+
+        Reviewed by Dean Jackson.
+
+        * platform/mac-wk1/imported/w3c/web-platform-tests/pointerevents/pointerevent_boundary_events_at_implicit_release_hoverable_pointers-expected.txt: Added.
+        * platform/mac-wk1/imported/w3c/web-platform-tests/pointerevents/pointerevent_mouse_capture_change_hover-expected.txt: Added.
+        * platform/mac-wk1/imported/w3c/web-platform-tests/pointerevents/pointerevent_mouse_pointercapture_in_frame-expected.txt: Added.
+        * platform/mac-wk1/imported/w3c/web-platform-tests/pointerevents/pointerevent_setpointercapture_relatedtarget-expected.txt: Added.
+        * platform/mac/TestExpectations:
+
 2019-04-17  Zalan Bujtas  <zalan@apple.com>
 
         [ContentChangeObserver] Use aria role as a hint whether a tap should result in a synthetic click
index f22b020..bdc45ae 100644 (file)
@@ -3056,3 +3056,6 @@ imported/w3c/web-platform-tests/css/css-lists/list-with-image-display-changed-00
 [ Debug ] fast/css/first-letter-and-float-crash.html [ Skip ]
 
 webkit.org/b/196274 imported/w3c/web-platform-tests/xhr/send-redirect-post-upload.htm [ Pass Failure ]
+
+# If requestAnimationFrame is invoked before ResizeObserver timer fired, it would pass, otherwise it would fail same as eventloop-expected.txt
+webkit.org/b/157743 imported/w3c/web-platform-tests/resize-observer/eventloop.html [ Pass Failure ]
index 9745a4e..9c14374 100644 (file)
@@ -1,3 +1,151 @@
+2019-04-17  Antoine Quint  <graouts@apple.com>
+
+        [Pointer Events WPT] Update WPT tests and provide macOS testdriver
+        https://bugs.webkit.org/show_bug.cgi?id=197011
+        <rdar://problem/49976553>
+
+        Reviewed by Dean Jackson.
+
+        We update the WPT tests from the latest state of the WPT GitHub repository and provide a testdriver to dispatch mouse events on macOS.
+
+        * web-platform-tests/payment-request/payment-request-canmakepayment-method.https-expected.txt: Update expectations now that an (incomplete)
+        test driver is available.
+        * web-platform-tests/pointerevents/META.yml:
+        * web-platform-tests/pointerevents/compat/pointerevent_touch-action_two-finger_interaction-manual.html: Added.
+        * web-platform-tests/pointerevents/extension/idlharness.window-expected.txt: Removed.
+        * web-platform-tests/pointerevents/extension/idlharness.window.html: Removed.
+        * web-platform-tests/pointerevents/extension/pointerevent_coalesced_events_attributes-manual.html: Added.
+        * web-platform-tests/pointerevents/extension/pointerevent_constructor.html:
+        * web-platform-tests/pointerevents/extension/pointerevent_getCoalescedEvents_when_pointerlocked-manual.html: Added.
+        * web-platform-tests/pointerevents/extension/pointerevent_getPredictedEvents_when_pointerlocked-manual.html: Added.
+        * web-platform-tests/pointerevents/extension/pointerevent_pointerrawmove-manual.html: Added.
+        * web-platform-tests/pointerevents/extension/pointerevent_pointerrawmove_in_pointerlock-manual.html: Added.
+        * web-platform-tests/pointerevents/extension/pointerevent_predicted_events_attributes-manual.html: Added.
+        * web-platform-tests/pointerevents/extension/pointerevent_touch-action-pan-down-css_touch-manual.html: Added.
+        * web-platform-tests/pointerevents/extension/pointerevent_touch-action-pan-left-css_touch-manual.html: Added.
+        * web-platform-tests/pointerevents/extension/pointerevent_touch-action-pan-right-css_touch-manual.html: Added.
+        * web-platform-tests/pointerevents/extension/pointerevent_touch-action-pan-up-css_touch-manual.html: Added.
+        * web-platform-tests/pointerevents/extension/w3c-import.log: Removed.
+        * web-platform-tests/pointerevents/html/pointerevent_drag_interaction-manual.html: Added.
+        * web-platform-tests/pointerevents/idlharness.window-expected.txt: Removed.
+        * web-platform-tests/pointerevents/idlharness.window.html: Removed.
+        * web-platform-tests/pointerevents/pointerevent_attributes_hoverable_pointers-manual-expected.txt: Added.
+        * web-platform-tests/pointerevents/pointerevent_attributes_hoverable_pointers-manual.html: Added.
+        * web-platform-tests/pointerevents/pointerevent_attributes_nohover_pointers-manual-expected.txt: Added.
+        * web-platform-tests/pointerevents/pointerevent_attributes_nohover_pointers-manual.html: Added.
+        * web-platform-tests/pointerevents/pointerevent_boundary_events_at_implicit_release_hoverable_pointers-expected.txt: Added.
+        * web-platform-tests/pointerevents/pointerevent_boundary_events_at_implicit_release_hoverable_pointers.html: Added.
+        * web-platform-tests/pointerevents/pointerevent_boundary_events_in_capturing-manual.html: Added.
+        * web-platform-tests/pointerevents/pointerevent_capture_mouse-expected.txt: Added.
+        * web-platform-tests/pointerevents/pointerevent_capture_mouse.html: Added.
+        * web-platform-tests/pointerevents/pointerevent_capture_suppressing_mouse-manual.html: Added.
+        * web-platform-tests/pointerevents/pointerevent_change-touch-action-onpointerdown_touch.html: Added.
+        * web-platform-tests/pointerevents/pointerevent_click_during_capture-expected.txt: Added.
+        * web-platform-tests/pointerevents/pointerevent_click_during_capture.html: Added.
+        * web-platform-tests/pointerevents/pointerevent_disabled_form_control-manual.html: Added.
+        * web-platform-tests/pointerevents/pointerevent_element_haspointercapture-manual.html: Added.
+        * web-platform-tests/pointerevents/pointerevent_element_haspointercapture_release_pending_capture-manual.html: Added.
+        * web-platform-tests/pointerevents/pointerevent_fractional_coordinates-manual.html: Added.
+        * web-platform-tests/pointerevents/pointerevent_lostpointercapture_for_disconnected_node.html: Added.
+        * web-platform-tests/pointerevents/pointerevent_lostpointercapture_is_first.html: Added.
+        * web-platform-tests/pointerevents/pointerevent_mouse_capture_change_hover-expected.txt: Added.
+        * web-platform-tests/pointerevents/pointerevent_mouse_capture_change_hover.html: Added.
+        * web-platform-tests/pointerevents/pointerevent_mouse_pointercapture_in_frame-expected.txt: Added.
+        * web-platform-tests/pointerevents/pointerevent_mouse_pointercapture_in_frame.html: Added.
+        * web-platform-tests/pointerevents/pointerevent_mouse_pointercapture_inactivate_pointer-expected.txt: Added.
+        * web-platform-tests/pointerevents/pointerevent_mouse_pointercapture_inactivate_pointer.html: Added.
+        * web-platform-tests/pointerevents/pointerevent_multiple_primary_pointers_boundary_events-manual.html: Added.
+        * web-platform-tests/pointerevents/pointerevent_on_event_handlers-expected.txt: Removed.
+        * web-platform-tests/pointerevents/pointerevent_pointerId_scope-manual.html: Added.
+        * web-platform-tests/pointerevents/pointerevent_pointercancel_touch.html: Added.
+        * web-platform-tests/pointerevents/pointerevent_pointerenter_does_not_bubble-expected.txt: Added.
+        * web-platform-tests/pointerevents/pointerevent_pointerenter_does_not_bubble.html: Added.
+        * web-platform-tests/pointerevents/pointerevent_pointerleave_after_pointercancel_touch.html: Added.
+        * web-platform-tests/pointerevents/pointerevent_pointerleave_descendant_over-expected.txt: Added.
+        * web-platform-tests/pointerevents/pointerevent_pointerleave_descendant_over.html: Added.
+        * web-platform-tests/pointerevents/pointerevent_pointerleave_descendants-expected.txt: Added.
+        * web-platform-tests/pointerevents/pointerevent_pointerleave_descendants.html: Added.
+        * web-platform-tests/pointerevents/pointerevent_pointerleave_does_not_bubble-expected.txt: Added.
+        * web-platform-tests/pointerevents/pointerevent_pointerleave_does_not_bubble.html: Added.
+        * web-platform-tests/pointerevents/pointerevent_pointerleave_pen-manual.html: Added.
+        * web-platform-tests/pointerevents/pointerevent_pointermove-expected.txt: Added.
+        * web-platform-tests/pointerevents/pointerevent_pointermove.html: Added.
+        * web-platform-tests/pointerevents/pointerevent_pointermove_isprimary_same_as_pointerdown-expected.txt: Added.
+        * web-platform-tests/pointerevents/pointerevent_pointermove_isprimary_same_as_pointerdown.html: Added.
+        * web-platform-tests/pointerevents/pointerevent_pointermove_on_chorded_mouse_button-expected.txt: Added.
+        * web-platform-tests/pointerevents/pointerevent_pointermove_on_chorded_mouse_button.html: Added.
+        * web-platform-tests/pointerevents/pointerevent_pointerout_after_pointercancel_touch.html: Added.
+        * web-platform-tests/pointerevents/pointerevent_pointerout_pen.html: Added.
+        * web-platform-tests/pointerevents/pointerevent_pointerout_received_once-expected.txt: Added.
+        * web-platform-tests/pointerevents/pointerevent_pointerout_received_once.html: Added.
+        * web-platform-tests/pointerevents/pointerevent_releasepointercapture_events_to_original_target-manual.html: Added.
+        * web-platform-tests/pointerevents/pointerevent_releasepointercapture_invalid_pointerid-expected.txt: Added.
+        * web-platform-tests/pointerevents/pointerevent_releasepointercapture_invalid_pointerid.html: Added.
+        * web-platform-tests/pointerevents/pointerevent_releasepointercapture_onpointercancel_touch.html: Added.
+        * web-platform-tests/pointerevents/pointerevent_releasepointercapture_onpointerup_mouse-expected.txt: Added.
+        * web-platform-tests/pointerevents/pointerevent_releasepointercapture_onpointerup_mouse.html: Added.
+        * web-platform-tests/pointerevents/pointerevent_releasepointercapture_release_right_after_capture-manual.html: Added.
+        * web-platform-tests/pointerevents/pointerevent_root_computed_style-expected.txt: Added.
+        * web-platform-tests/pointerevents/pointerevent_root_computed_style.html: Added.
+        * web-platform-tests/pointerevents/pointerevent_root_hit_test-expected.txt: Added.
+        * web-platform-tests/pointerevents/pointerevent_root_hit_test.html: Added.
+        * web-platform-tests/pointerevents/pointerevent_sequence_at_implicit_release_on_click-manual.html: Added.
+        * web-platform-tests/pointerevents/pointerevent_sequence_at_implicit_release_on_drag-manual.html: Added.
+        * web-platform-tests/pointerevents/pointerevent_setpointercapture_disconnected-expected.txt: Added.
+        * web-platform-tests/pointerevents/pointerevent_setpointercapture_disconnected.html: Added.
+        * web-platform-tests/pointerevents/pointerevent_setpointercapture_inactive_button_mouse-expected.txt: Added.
+        * web-platform-tests/pointerevents/pointerevent_setpointercapture_inactive_button_mouse.html: Added.
+        * web-platform-tests/pointerevents/pointerevent_setpointercapture_invalid_pointerid-expected.txt: Added.
+        * web-platform-tests/pointerevents/pointerevent_setpointercapture_invalid_pointerid.html: Added.
+        * web-platform-tests/pointerevents/pointerevent_setpointercapture_override_pending_capture_element-manual.html: Added.
+        * web-platform-tests/pointerevents/pointerevent_setpointercapture_relatedtarget-expected.txt: Added.
+        * web-platform-tests/pointerevents/pointerevent_setpointercapture_relatedtarget.html: Added.
+        * web-platform-tests/pointerevents/pointerevent_setpointercapture_to_same_element_twice-manual.html: Added.
+        * web-platform-tests/pointerevents/pointerevent_support.js:
+        * web-platform-tests/pointerevents/pointerevent_suppress_compat_events_on_click-expected.txt: Added.
+        * web-platform-tests/pointerevents/pointerevent_suppress_compat_events_on_click.html: Added.
+        * web-platform-tests/pointerevents/pointerevent_suppress_compat_events_on_drag_mouse-expected.txt: Added.
+        * web-platform-tests/pointerevents/pointerevent_suppress_compat_events_on_drag_mouse.html: Added.
+        * web-platform-tests/pointerevents/pointerevent_touch-action-auto-css_touch.html: Added.
+        * web-platform-tests/pointerevents/pointerevent_touch-action-button-test_touch-manual.html: Added.
+        * web-platform-tests/pointerevents/pointerevent_touch-action-inherit_child-auto-child-none_touch-manual.html: Added.
+        * web-platform-tests/pointerevents/pointerevent_touch-action-inherit_child-none_touch-manual.html: Added.
+        * web-platform-tests/pointerevents/pointerevent_touch-action-inherit_child-pan-x-child-pan-x_touch-manual.html: Added.
+        * web-platform-tests/pointerevents/pointerevent_touch-action-inherit_child-pan-x-child-pan-y_touch-manual.html: Added.
+        * web-platform-tests/pointerevents/pointerevent_touch-action-inherit_highest-parent-none_touch.html: Added.
+        * web-platform-tests/pointerevents/pointerevent_touch-action-inherit_parent-none_touch-manual.html: Added.
+        * web-platform-tests/pointerevents/pointerevent_touch-action-keyboard-manual.html: Added.
+        * web-platform-tests/pointerevents/pointerevent_touch-action-mouse-manual.html: Added.
+        * web-platform-tests/pointerevents/pointerevent_touch-action-none-css_touch-manual.html: Added.
+        * web-platform-tests/pointerevents/pointerevent_touch-action-pan-x-css_touch-manual.html: Added.
+        * web-platform-tests/pointerevents/pointerevent_touch-action-pan-x-pan-y-pan-y_touch-manual.html: Added.
+        * web-platform-tests/pointerevents/pointerevent_touch-action-pan-x-pan-y_touch.html: Added.
+        * web-platform-tests/pointerevents/pointerevent_touch-action-pan-y-css_touch-manual.html: Added.
+        * web-platform-tests/pointerevents/pointerevent_touch-action-rotated-divs_touch-manual.html: Added.
+        * web-platform-tests/pointerevents/pointerevent_touch-action-span-test_touch-manual.html: Added.
+        * web-platform-tests/pointerevents/pointerevent_touch-action-svg-test_touch-manual.html: Added.
+        * web-platform-tests/pointerevents/pointerevent_touch-action-table-test_touch-manual.html: Added.
+        * web-platform-tests/pointerevents/pointerlock/pointerevent_coordinates_when_locked.html: Added.
+        * web-platform-tests/pointerevents/pointerlock/pointerevent_movementxy-manual.html: Added.
+        * web-platform-tests/pointerevents/pointerlock/pointerevent_movementxy_when_locked-manual.html: Added.
+        * web-platform-tests/pointerevents/pointerlock/pointerevent_pointerlock_after_pointercapture-manual.html: Added.
+        * web-platform-tests/pointerevents/pointerlock/pointerevent_pointerlock_supercedes_capture-manual.html: Added.
+        * web-platform-tests/pointerevents/pointerlock/pointerevent_pointermove_in_pointerlock-manual.html: Added.
+        * web-platform-tests/pointerevents/pointerlock/pointerevent_pointermove_on_chorded_mouse_button_when_locked-manual.html: Added.
+        * web-platform-tests/pointerevents/pointerlock/resources/pointerevent_pointermove_in_pointerlock-iframe.html: Added.
+        * web-platform-tests/pointerevents/pointerlock/resources/w3c-import.log: Removed.
+        * web-platform-tests/pointerevents/resources/pointerevent_mouse_pointercapture-iframe.html: Added.
+        * web-platform-tests/pointerevents/resources/pointerevent_mouse_pointercapture_inactivate_pointer-iframe.html: Added.
+        * web-platform-tests/pointerevents/resources/pointerevent_pointerrawmove_in_pointerlock-iframe.html: Added.
+        * web-platform-tests/pointerevents/resources/w3c-import.log: Removed.
+        * web-platform-tests/pointerevents/w3c-import.log: Removed.
+        * web-platform-tests/resources/testdriver-actions.js: Added.
+        * web-platform-tests/resources/testdriver-vendor.js: Added.
+        (logDebug):
+        (dispatchMouseActions):
+        (window.test_driver_internal.action_sequence):
+        * web-platform-tests/resources/testdriver.js: Added.
+
 2019-04-17  Rob Buis  <rbuis@igalia.com>
 
         XMLHttpRequest has the wrong fallback encoding
index 9f2d9d5..e6e82e3 100644 (file)
@@ -1,8 +1,10 @@
-If you find a buggy test, please file a bug and tag one of the suggested reviewers.
+This test requires user interaction.
+Please click here to allow show payment request.This test requires user interaction.
+Please click here to allow show payment request. If you find a buggy test, please file a bug and tag one of the suggested reviewers.
 
 PASS If payment method identifier are supported, resolve promise with true. 
-FAIL If request.[[state]] is "interactive", then return a promise rejected with an "InvalidStateError" DOMException. promise_test: Unhandled rejection with value: object "ReferenceError: Can't find variable: test_driver"
-FAIL If request.[[state]] is "closed", then return a promise rejected with an "InvalidStateError" DOMException. promise_test: Unhandled rejection with value: object "ReferenceError: Can't find variable: test_driver"
+FAIL If request.[[state]] is "interactive", then return a promise rejected with an "InvalidStateError" DOMException. assert_unreached: Should have rejected: undefined Reached unreachable code
+FAIL If request.[[state]] is "closed", then return a promise rejected with an "InvalidStateError" DOMException. promise_test: Unhandled rejection with value: object "InvalidStateError: The object is in an invalid state."
 PASS If request.[[state]] is "created", then return a promise that resolves to true for known method. 
 PASS All methods are unsupported 
 PASS Mix of supported and unsupported methods, at least one method is supported. 
index ef94157..1962fea 100644 (file)
@@ -1,9 +1,6 @@
 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/compat/pointerevent_touch-action_two-finger_interaction-manual.html b/LayoutTests/imported/w3c/web-platform-tests/pointerevents/compat/pointerevent_touch-action_two-finger_interaction-manual.html
new file mode 100644 (file)
index 0000000..3537e0e
--- /dev/null
@@ -0,0 +1,102 @@
+<!doctype html>
+<html>
+  <head>
+    <title>Pointer Event: touch-action test for two-finger interaction</title>
+    <meta content="text/html; charset=UTF-8" http-equiv="Content-Type"/>
+    <link rel="author" title="Google" href="http://www.google.com "/>
+    <link rel="help" href="https://compat.spec.whatwg.org/#touch-action" />
+    <meta name="assert" content="Tests that a two-finger pan gesture is cancelled in 'touch-action: pan-x pan-y' but is allowed in 'touch-action: pinch-zoom'"/>
+    <link rel="stylesheet" type="text/css" href="../pointerevent_styles.css">
+    <script src="/resources/testharness.js"></script>
+    <script src="/resources/testharnessreport.js"></script>
+    <script type="text/javascript" src="../pointerevent_support.js"></script>
+    <script type="text/javascript">
+      var event_log = [];
+      var active_pointers = 0;
+
+      function resetTestState() {
+        event_log = [];
+        active_pointers = 0;
+      }
+
+      function run() {
+        var test_pointer_events = [
+          setup_pointerevent_test("two-finger pan on 'touch-action: pan-x pan-y'", ["touch"]),
+          setup_pointerevent_test("two-finger pan on 'touch-action: pinch-zoom'", ["touch"])
+        ];
+        var expected_events = [
+          "pointerdown@black, pointerdown@black, pointerup@black, pointerup@black",
+          "pointerdown@grey, pointerdown@grey, pointercancel@grey, pointercancel@grey"
+        ];
+        var current_test_index = 0;
+
+        on_event(document.getElementById("done"), "click", function() {
+          test_pointer_events[current_test_index].step(function () {
+            assert_equals(active_pointers, 0);
+            assert_equals(event_log.join(", "), expected_events[current_test_index]);
+          });
+          event_log = [];
+
+          test_pointer_events[current_test_index++].done();
+        });
+
+        var targets = [document.getElementById("black"), document.getElementById("grey")];
+
+        ["pointerdown", "pointerup", "pointercancel"].forEach(function(eventName) {
+          targets.forEach(function(target){
+            on_event(target, eventName, function (event) {
+              event_log.push(event.type + "@" + event.target.id);
+
+              if (event.type == "pointerdown") {
+                active_pointers++;
+
+              } else {
+                active_pointers--;
+              }
+            });
+          });
+        });
+      }
+    </script>
+    <style>
+      .box {
+        width: 250px;
+        height: 150px;
+        float: left;
+        margin: 10px;
+      }
+
+      #black {
+        touch-action: pan-x pan-y;
+        background-color: black;
+      }
+
+      #grey {
+        touch-action: pinch-zoom;
+        background-color: grey;
+      }
+
+      #done {
+        float: left;
+        padding: 20px;
+      }
+    </style>
+  </head>
+  <body onload="run()">
+    <h1>Pointer Event: touch-action test for two-finger interaction</h1>
+    <h2 id="pointerTypeDescription"></h2>
+    <h4>
+      Tests that a two-finger pan gesture is cancelled in 'touch-action: pan-x pan-y' but is allowed in 'touch-action: pinch-zoom'
+    </h4>
+    <ol>
+      <li>Touch on Black with two fingers and drag both fingers down at same speed.</li>
+      <li>Tap on Done.</li>
+      <li>Touch on Grey with two fingers and drag both fingers down at same speed.</li>
+      <li>Tap on Done.</li>
+    </ol>
+    <div class="box" id="black"></div>
+    <input type="button" id="done" value="Done" />
+    <div class="box" id="grey"></div>
+    <div id="log"></div>
+  </body>
+</html>
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
deleted file mode 100644 (file)
index a7ea327..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-
-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
deleted file mode 100644 (file)
index 2382913..0000000
+++ /dev/null
@@ -1 +0,0 @@
-<!-- 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/pointerevent_coalesced_events_attributes-manual.html b/LayoutTests/imported/w3c/web-platform-tests/pointerevents/extension/pointerevent_coalesced_events_attributes-manual.html
new file mode 100644 (file)
index 0000000..8914946
--- /dev/null
@@ -0,0 +1,144 @@
+<!doctype html>
+<html>
+    <head>
+        <title>Pointer Events coalesced events count and properties<</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>
+        <script>
+            var eventList = All_Pointer_Events;
+            PhaseEnum = {
+              WaitingForCancel:   0,
+              WaitingForOver:     1,
+              WaitingForEnter:    2,
+              WaitingForDown:     3,
+              WaitingForMove:     4,
+              WaitingForUp:       5,
+              WaitingForOut:      6,
+              WaitingForLeave:    7,
+              Done:               8,
+            };
+            var phase = PhaseEnum.WaitingForCancel;
+
+            function resetTestState() {
+                phase = PhaseEnum.WaitingForCancel;
+            }
+            function expect_no_coalesced_events(event, eventName) {
+                test(function () {
+                    assert_equals(event.getCoalescedEvents().length, 0, eventName + ' should not have any coalesced events');
+                }, expectedPointerType + ' ' + eventName + ' should not have any coalesced events'); 
+            }
+            function run() {
+                var test_pointerEvent = setup_pointerevent_test("coalesced events attributes in pointerevents", ['touch']);
+                var target0 = document.getElementById("target0");
+                var target1 = document.getElementById("target1");
+
+                on_event(target0, 'pointercancel', function (event) {
+                    if (phase == PhaseEnum.WaitingForCancel) {
+                        expect_no_coalesced_events(event, 'pointercancel');
+                        phase++;
+                    }
+                });
+                eventList.forEach(function(eventName) {
+                    on_event(target1, eventName, function (event) {
+                        switch (phase) {
+                          case PhaseEnum.WaitingForOver:
+                            if (eventName == 'pointerover') {
+                              expect_no_coalesced_events(event, eventName);
+                              phase++;
+                            }
+                            break;
+                          case PhaseEnum.WaitingForEnter:
+                            if (eventName == 'pointerenter') {
+                              expect_no_coalesced_events(event, eventName);
+                              phase++;
+                            }
+                            break;
+                          case PhaseEnum.WaitingForDown:
+                            if (eventName == 'pointerdown') {
+                              expect_no_coalesced_events(event, eventName);
+                              phase++;
+                              setTimeout(function(){
+                                // This is just a way to block the main thread.
+                                var current = new Date().getTime();
+                                for (; new Date().getTime() - current < 500;);
+                              }, 0);
+                            }
+                            break;
+                          case PhaseEnum.WaitingForMove:
+                            if (eventName == 'pointermove') {
+                              var coalescedEvents = event.getCoalescedEvents();
+                              test (function() {
+                                assert_greater_than(event.getCoalescedEvents().length, 1, 'pointermove should have at least 2 coalesced events.');
+                              }, expectedPointerType + ' pointermove should have >2 coalesced events as main thread is busy.');
+                              test (function() {
+                                for (var i=0; i<coalescedEvents.length; i++) {
+                                  assert_equals(coalescedEvents[i].isTrusted, true, 'isTrusted flag should be true for coalesced events.');
+                                  if (i > 0)
+                                    assert_greater_than_equal(coalescedEvents[i].timeStamp, coalescedEvents[i-1].timeStamp, 'Time stamps of coalesced events must be ascending.');
+                                }
+                              }, expectedPointerType + ' pointermove coalesced events should all be marked as trusted.');
+                              test (function() {
+                                for (var i=1; i<coalescedEvents.length; i++)
+                                  assert_greater_than_equal(coalescedEvents[i].timeStamp, coalescedEvents[i-1].timeStamp, 'Time stamps of coalesced events must be ascending.');
+                              }, expectedPointerType + ' time stamps of coalesced events must be ascending.');
+                              test (function() {
+                                for (var i=0; i<coalescedEvents.length; i++) {
+                                  assert_equals(coalescedEvents[i].bubbles, false, 'Bubbles attribute should be false for coalesced events.');
+                                  assert_equals(coalescedEvents[i].cancelable, false, 'Cancelable attribute should be false for coalesced events.');
+                                }
+                              }, expectedPointerType + ' pointermove coalesced events should all bubbles and cancelable as false.');
+                              phase++;
+                            }
+                            break;
+                          case PhaseEnum.WaitingForUp:
+                            if (eventName == 'pointerup') {
+                              expect_no_coalesced_events(event, eventName);
+                              phase++;
+                            }
+                            break;
+                          case PhaseEnum.WaitingForOut:
+                            if (eventName == 'pointerout') {
+                              expect_no_coalesced_events(event, eventName);
+                              phase++;
+                            }
+                            break;
+                          case PhaseEnum.WaitingForLeave:
+                            if (eventName == 'pointerleave') {
+                              expect_no_coalesced_events(event, eventName);
+                              phase++;
+                              test_pointerEvent.done();
+                            }
+                            break;
+                        }
+                    });
+                });
+            }
+        </script>
+    </head>
+    <body onload="run()">
+        <h1>Pointer Events coalesced events count and properties</h1>
+        <h2 id="pointerTypeDescription"></h2>
+        <h4>
+            Test Description: This test checks the coalesced events of all types of pointer events.
+            <ol>
+                 <li>Pointer down in the black square and drag inside the black square immediately</li>
+                 <li>Release the pointer.</li>
+                 <li>Pointer down in the purple square and drag inside the purple square immediately</li>
+                 <li>Release the pointer and move out of the purple square</li>
+            </ol>
+
+            Test passes if the proper behavior of the events is observed.
+        </h4>
+        <div id="target0"></div>
+        <div id="target1" class="touchActionNone"></div>
+        <div id="complete-notice">
+            <p>The following pointer types were detected: <span id="pointertype-log"></span>.</p>
+            <p>Refresh the page to run the tests again with a different pointer type.</p>
+        </div>
+    </body>
+</html>
+
index 43d0aa5..6971dce 100644 (file)
             on_event(target0, "pointermove", this.step_func(function(event) {
                 generate_tests(assert_equals, [
                     ["getCoalescedEvents().length", event.getCoalescedEvents().length, 2],
+                    ["getPredictedEvents().length", event.getPredictedEvents().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],
+                    ["getPredictedEvents()[0].clientX", event.getPredictedEvents()[0].clientX, 320],
+                    ["getPredictedEvents()[1].clientX", event.getPredictedEvents()[1].clientX, 330],
                 ]);
                 for (var i=0; i<event.getCoalescedEvents().length; i++) {
                     var coalescedEvent = event.getCoalescedEvents()[i];
@@ -33,6 +36,7 @@
                         ["getCoalescedEvents()[" + i + "].pointerType", coalescedEvent.pointerType, event.pointerType],
                         ["getCoalescedEvents()[" + i + "].isPrimary", coalescedEvent.isPrimary, event.isPrimary],
                         ["getCoalescedEvents()[" + i + "].getCoalescedEvents().length", coalescedEvent.getCoalescedEvents().length, 0],
+                        ["getCoalescedEvents()[" + i + "].getPredictedEvents().length", coalescedEvent.getPredictedEvents().length, 0],
                         ["getCoalescedEvents()[" + i + "].target", coalescedEvent.target, target0],
                         ["getCoalescedEvents()[" + i + "].currentTarget", coalescedEvent.currentTarget, null],
                         ["getCoalescedEvents()[" + i + "].eventPhase", coalescedEvent.eventPhase, Event.NONE],
                         ["getCoalescedEvents()[" + i + "].offsetY", coalescedEvent.offsetY, event.offsetY],
                     ]);
                 }
+                for (var i=0; i<event.getPredictedEvents().length; i++) {
+                    var predictedEvent = event.getPredictedEvents()[i];
+                    generate_tests(assert_equals, [
+                        ["getPredictedEvents()[" + i + "].pointerId", predictedEvent.pointerId, event.pointerId],
+                        ["getPredictedEvents()[" + i + "].pointerType", predictedEvent.pointerType, event.pointerType],
+                        ["getPredictedEvents()[" + i + "].isPrimary", predictedEvent.isPrimary, event.isPrimary],
+                        ["getPredictedEvents()[" + i + "].getCoalescedEvents().length", predictedEvent.getCoalescedEvents().length, 0],
+                        ["getPredictedEvents()[" + i + "].getPredictedEvents().length", predictedEvent.getPredictedEvents().length, 0],
+                        ["getPredictedEvents()[" + i + "].target", predictedEvent.target, target0],
+                        ["getPredictedEvents()[" + i + "].currentTarget", predictedEvent.currentTarget, null],
+                        ["getPredictedEvents()[" + i + "].eventPhase", predictedEvent.eventPhase, Event.NONE],
+                        ["getPredictedEvents()[" + i + "].cancelable", predictedEvent.cancelable, false],
+                        ["getPredictedEvents()[" + i + "].bubbles", predictedEvent.bubbles, false],
+                        ["getPredictedEvents()[" + i + "].offsetX", predictedEvent.offsetX, event.offsetX + (i==0?10:20)],
+                        ["getPredictedEvents()[" + i + "].offsetY", predictedEvent.offsetY, event.offsetY],
+                    ]);
+                }
             }));
             on_event(target0, "pointerout", this.step_func(function(event) {
                 generate_tests(assert_equals, [
                     ["default getCoalescedEvents().length", event.getCoalescedEvents().length, 0],
+                    ["default getPredictedEvents().length", event.getPredictedEvents().length, 0],
                 ]);
             }));
 
                 var p1 = new PointerEvent("pointermove", pointerEventInitDict);
                 pointerEventInitDict.clientX += 10;
                 var p2 = new PointerEvent("pointermove", pointerEventInitDict);
+                pointerEventInitDict.clientX += 10;
+                var p3 = new PointerEvent("pointermove", pointerEventInitDict);
+                pointerEventInitDict.clientX += 10;
+                var p4 = new PointerEvent("pointermove", pointerEventInitDict);
                 pointerEventInitDict.coalescedEvents = [p1, p2];
+                pointerEventInitDict.predictedEvents = [p3, p4];
+                pointerEventInitDict.clientX = 310;
                 var event = new PointerEvent("pointermove", pointerEventInitDict);
                 target0.dispatchEvent(event);
 
diff --git a/LayoutTests/imported/w3c/web-platform-tests/pointerevents/extension/pointerevent_getCoalescedEvents_when_pointerlocked-manual.html b/LayoutTests/imported/w3c/web-platform-tests/pointerevents/extension/pointerevent_getCoalescedEvents_when_pointerlocked-manual.html
new file mode 100644 (file)
index 0000000..6efded8
--- /dev/null
@@ -0,0 +1,62 @@
+<!doctype html>
+<html>
+    <head>
+        <title>Pointer Events pointer lock tests</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 type="text/javascript" src="../pointerevent_support.js"></script>
+        <style>
+          #testContainer {
+            touch-action: none;
+            user-select: none;
+            position: relative;
+          }
+        </style>
+        <script>
+            var lock_change_count = 0;
+            var mouseeventMovements = []
+            var pointereventMovements = []
+
+            function resetTestState() {
+            }
+
+            function run() {
+                var test_pointerEvent = setup_pointerevent_test("pointermove getCoalescedEvents when lock test", ['mouse']);
+                var div1 = document.getElementById("target");
+
+                on_event(div1, 'pointerdown', function(event) {
+                    div1.requestPointerLock();
+                });
+                on_event(div1, 'pointermove', function(event) {
+                    if (document.pointerLockElement == div1) {
+                        test_pointerEvent.step(function() {
+                            assert_greater_than(event.getCoalescedEvents().length, 0, "document.pointerLockElement should have coalesced events.");
+                            document.exitPointerLock();
+                            test_pointerEvent.done();
+                        });
+                    }
+                });
+            }
+        </script>
+    </head>
+    <body onload="run()">
+        <h1>PointerMove getCoalescedEvent in locked state test</h1>
+        <h2 id="pointerTypeDescription"></h2>
+        <h4>
+            Test Description: This test checks if pointerevent.getCoalescedEvent work correctly when pointer is locked.
+            <ol>
+                 <li>Press left button down on the green rectangle to lock pointer.</li>
+                 <li>Move the mouse</li>
+            </ol>
+            </ol>
+
+            Test passes if the proper behavior of the events is observed.
+        </h4>
+        <div id="testContainer">
+            <div id="target" style="width:800px;height:250px;background:green"></div>
+        </div>
+        <div class="spacer"></div>
+    </body>
+</html>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/pointerevents/extension/pointerevent_getPredictedEvents_when_pointerlocked-manual.html b/LayoutTests/imported/w3c/web-platform-tests/pointerevents/extension/pointerevent_getPredictedEvents_when_pointerlocked-manual.html
new file mode 100644 (file)
index 0000000..eaf08d6
--- /dev/null
@@ -0,0 +1,76 @@
+<!doctype html>
+<html>
+    <head>
+        <title>Pointer Events pointer lock tests</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 type="text/javascript" src="../pointerevent_support.js"></script>
+        <style>
+          #testContainer {
+            touch-action: none;
+            user-select: none;
+            position: relative;
+          }
+        </style>
+        <script>
+            var lock_change_count = 0;
+            var move_event_count = 0;
+            var mouseeventMovements = []
+            var pointereventMovements = []
+
+            function resetTestState() {
+            }
+
+            function run() {
+                var test_pointerEvent = setup_pointerevent_test("pointermove getPredictedEvents when lock test", ['mouse']);
+                var div1 = document.getElementById("target");
+
+                on_event(div1, 'pointerdown', function(event) {
+                    div1.requestPointerLock();
+                });
+                on_event(div1, 'pointermove', function(event) {
+                    if (document.pointerLockElement == div1) {
+                        test_pointerEvent.step(function() {
+                            if (event.getPredictedEvents().length > 0) {
+                                 for (var i=0; i<event.getPredictedEvents().length; i++) {
+                                    var predictedEvent = event.getPredictedEvents()[i];
+                                    test_pointerEvent.step(function() {
+                                        assert_equals(predictedEvent.pointerId, event.pointerId, "getPredictedEvents()[" + i + "].pointerId");
+                                        assert_equals(predictedEvent.pointerType, event.pointerType, "getPredictedEvents()[" + i + "].pointerType");
+                                        assert_equals(predictedEvent.target, document.pointerLockElement, "getPredictedEvents()[" + i + "].target");
+                                        assert_equals(predictedEvent.clientX, event.clientX, "getPredictedEvents()[" + i + "].clientX");
+                                        assert_equals(predictedEvent.clientY, event.clientY, "getPredictedEvents()[" + i + "].clientY");
+                                    });
+                                }
+                                document.exitPointerLock();
+                                test_pointerEvent.done();
+                            } else {
+                                assert_less_than(++move_event_count, 20, "pointermove have no predicted event in 20 moves")
+                            }
+                        });
+                    }
+                });
+            }
+        </script>
+    </head>
+    <body onload="run()">
+        <h1>PointerMove getPredictedEvent in locked state test</h1>
+        <h2 id="pointerTypeDescription"></h2>
+        <h4>
+            Test Description: This test checks if pointerevent.getPredictedEvent work correctly when pointer is locked.
+            <ol>
+                 <li>Press left button down on the green rectangle to lock pointer.</li>
+                 <li>Move the mouse</li>
+            </ol>
+            </ol>
+
+            Test passes if the proper behavior of the events is observed.
+        </h4>
+        <div id="testContainer">
+            <div id="target" style="width:800px;height:250px;background:green"></div>
+        </div>
+        <div class="spacer"></div>
+    </body>
+</html>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/pointerevents/extension/pointerevent_pointerrawmove-manual.html b/LayoutTests/imported/w3c/web-platform-tests/pointerevents/extension/pointerevent_pointerrawmove-manual.html
new file mode 100644 (file)
index 0000000..0c4ccf9
--- /dev/null
@@ -0,0 +1,55 @@
+<!doctype html>
+<html>
+    <head>
+        <title>pointerrawmove</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 onload="run()">
+        <h2>pointerrawmove</h2>
+        <h4>Test Description: This test checks if pointerrawmove is dispatched correctly. </h4>
+        <p>Move your mouse within the black box.</p>
+        <p>Press left button down and then press middle button while holding down left button. Then release the buttons</p>
+        <div id="target0"></div>
+        <script>
+            var test_pointerrawmove = async_test("pointerrawmove event received");
+
+            var pointerrawmoveReceived = false;
+            var pointerdownReceived = false;
+            var pointerrawmoveFromButtonChangeReceived = false;
+
+            function run() {
+                var target0 = document.getElementById("target0");
+
+                on_event(target0, "pointerrawmove", function (event) {
+                    pointerrawmoveReceived = true;
+                    if (pointerdownReceived && event.button != -1)
+                      pointerrawmoveFromButtonChangeReceived = true;
+                });
+                on_event(target0, "pointermove", function (event) {
+                    test_pointerrawmove.step(function() {
+                        assert_true(pointerrawmoveReceived,
+                                    "Pointerrawmove event should have been received before pointermove.");
+                        }, "Pointerrawmove event should have been received before pointermove.");
+                });
+                on_event(target0, "pointerdown", function (event) {
+                    pointerdownReceived = true;
+                });
+                on_event(target0, "pointerup", function (event) {
+                    test_pointerrawmove.step(function() {
+                        assert_true(pointerrawmoveFromButtonChangeReceived,
+                                    "Pointerrawmove event should have been received from chorded button changes.");
+                        }, "Pointerrawmove event should have been received from chorded button changes.");
+                    test_pointerrawmove.done();
+                });
+            }
+
+        </script>
+        <div id="complete-notice">
+        </div>
+    </body>
+</html>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/pointerevents/extension/pointerevent_pointerrawmove_in_pointerlock-manual.html b/LayoutTests/imported/w3c/web-platform-tests/pointerevents/extension/pointerevent_pointerrawmove_in_pointerlock-manual.html
new file mode 100644 (file)
index 0000000..9703558
--- /dev/null
@@ -0,0 +1,88 @@
+<!doctype html>
+<html>
+    <head>
+        <title>pointerrawmove</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 onload="run()">
+        <h2>pointerrawmove</h2>
+        <h4>Test Description: This test checks if pointerrawmove is dispatched correctly while in pointerlock mode.
+            <ol>
+                <li>Click in the black box (and accept the pointerlock permission if asked).</li>
+                <li>Move your mouse.</li>
+                <li>Click in the purple box inside the iframe</li>
+                <li>Move your mouse.</li>
+            </ol>
+        </h4>
+        <div id="target0"></div>
+        <iframe id="innerframe" src="../resources/pointerevent_pointerrawmove_in_pointerlock-iframe.html"></iframe>
+        <script>
+            window.name="outerframe";
+            var test_pointerrawmove = async_test("pointerrawmove event received");
+
+            var outerframe_pointerrawmoveReceived = false;
+            var innerframe_pointerrawmoveReceived = false;
+
+            function run() {
+                var target0 = document.getElementById("target0");
+                var innerframe = document.getElementById('innerframe');
+                var target1 = innerframe.contentDocument.getElementById('target1');
+                innerframe.contentWindow.name = "innerframe";
+
+                on_event(document, "pointerlockchange", function(event) {
+                  if (document.pointerLockElement == target0) {
+                    on_event(target0, "pointerrawmove", function (event) {
+                      outerframe_pointerrawmoveReceived = true;
+                      test_pointerrawmove.step(function() {
+                        assert_equals(event.view.name, "outerframe", "View attribute of pointerrawmove should be the target frame.");
+                      }, "View attribute of pointerrawmove should be the target frame.");
+                    });
+                    on_event(target0, "pointermove", function (event) {
+                      test_pointerrawmove.step(function() {
+                        assert_true(outerframe_pointerrawmoveReceived,
+                                    "Pointerrawmove event should have been received before pointermove while in pointerlock mode.");
+                        assert_equals(event.view.name, "outerframe", "View attribute of pointerrawmove should be the target frame.");
+                      }, "Pointerrawmove event should have been received before pointermove while in pointerlock mode.");
+                      document.exitPointerLock();
+
+                      on_event(target1, "click", function(event) {
+                        target1.requestPointerLock();
+                      });
+
+                      on_event(innerframe.contentDocument, "pointerlockchange", function(event) {
+                        if (innerframe.contentDocument.pointerLockElement == target1) {
+                          on_event(target1, "pointerrawmove", function (event) {
+                            innerframe_pointerrawmoveReceived = true;
+                            test_pointerrawmove.step(function() {
+                              assert_equals(event.view.name, "innerframe", "View attribute of pointerrawmove should be the target frame.");
+                            }, "View attribute of pointerrawmove should be the target frame.");
+                          });
+                          on_event(target1, "pointermove", function (event) {
+                            test_pointerrawmove.step(function() {
+                              assert_true(innerframe_pointerrawmoveReceived,
+                                    "Pointerrawmove event should have been received before pointermove while in pointerlock mode.");
+                            }, "Pointerrawmove event should have been received before pointermove while in pointerlock mode.");
+                            innerframe.contentDocument.exitPointerLock();
+                            test_pointerrawmove.done();
+                          });
+                        }
+                      });
+
+                    });
+                  }
+                });
+                on_event(target0, "click", function(event) {
+                  target0.requestPointerLock();
+                });
+            }
+
+        </script>
+        <div id="complete-notice">
+        </div>
+    </body>
+</html>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/pointerevents/extension/pointerevent_predicted_events_attributes-manual.html b/LayoutTests/imported/w3c/web-platform-tests/pointerevents/extension/pointerevent_predicted_events_attributes-manual.html
new file mode 100644 (file)
index 0000000..220a4b8
--- /dev/null
@@ -0,0 +1,149 @@
+<!doctype html>
+<html>
+    <head>
+        <title>Pointer Events predicted events count and properties<</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>
+        <script>
+            var eventList = All_Pointer_Events;
+            PhaseEnum = {
+              WaitingForCancel:   0,
+              WaitingForOver:     1,
+              WaitingForEnter:    2,
+              WaitingForDown:     3,
+              WaitingForMove:     4,
+              WaitingForUp:       5,
+              WaitingForOut:      6,
+              WaitingForLeave:    7,
+              Done:               8,
+            };
+            var phase = PhaseEnum.WaitingForCancel;
+            var move_event_count = 0;
+
+            function resetTestState() {
+                phase = PhaseEnum.WaitingForCancel;
+            }
+            function expect_no_predicted_events(event, eventName) {
+                test(function () {
+                    assert_equals(event.getPredictedEvents().length, 0, eventName + ' should not have any predicted events');
+                }, expectedPointerType + ' ' + eventName + ' should not have any predicted events'); 
+            }
+            function run() {
+                var test_pointerEvent = setup_pointerevent_test("predicted events attributes in pointerevents", ['touch']);
+                var target0 = document.getElementById("target0");
+                var target1 = document.getElementById("target1");
+
+                on_event(target0, 'pointercancel', function (event) {
+                    if (phase == PhaseEnum.WaitingForCancel) {
+                        expect_no_predicted_events(event, 'pointercancel');
+                        phase++;
+                    }
+                });
+                eventList.forEach(function(eventName) {
+                    on_event(target1, eventName, function (event) {
+                        switch (phase) {
+                          case PhaseEnum.WaitingForOver:
+                            if (eventName == 'pointerover') {
+                              expect_no_predicted_events(event, eventName);
+                              phase++;
+                            }
+                            break;
+                          case PhaseEnum.WaitingForEnter:
+                            if (eventName == 'pointerenter') {
+                              expect_no_predicted_events(event, eventName);
+                              phase++;
+                            }
+                            break;
+                          case PhaseEnum.WaitingForDown:
+                            if (eventName == 'pointerdown') {
+                              expect_no_predicted_events(event, eventName);
+                              phase++;
+                              setTimeout(function(){
+                                // This is just a way to block the main thread.
+                                var current = new Date().getTime();
+                                for (; new Date().getTime() - current < 500;);
+                              }, 0);
+                            }
+                            break;
+                          case PhaseEnum.WaitingForMove:
+                            if (eventName == 'pointermove') {
+                              if (event.getPredictedEvents().length > 0) {
+                                var predictedEvents = event.getPredictedEvents();
+                                test (function() {
+                                  for (var i=0; i<predictedEvents.length; i++) {
+                                    assert_equals(predictedEvents[i].isTrusted, true, 'isTrusted flag should be true for predicted events.');
+                                    if (i > 0)
+                                      assert_greater_than_equal(predictedEvents[i].timeStamp, predictedEvents[i-1].timeStamp, 'Time stamps of predicted events must be ascending.');
+                                  }
+                                }, expectedPointerType + ' pointermove predicted events should all be marked as trusted.');
+                                test (function() {
+                                  for (var i=1; i<predictedEvents.length; i++)
+                                    assert_greater_than_equal(predictedEvents[i].timeStamp, predictedEvents[i-1].timeStamp, 'Time stamps of predicted events must be ascending.');
+                                }, expectedPointerType + ' time stamps of predicted events must be ascending.');
+                                test (function() {
+                                  for (var i=0; i<predictedEvents.length; i++) {
+                                    assert_equals(predictedEvents[i].bubbles, false, 'Bubbles attribute should be false for predicted events.');
+                                    assert_equals(predictedEvents[i].cancelable, false, 'Cancelable attribute should be false for predicted events.');
+                                  }
+                                }, expectedPointerType + ' pointermove predicted events should all bubbles and cancelable as false.');
+                                phase++;
+                              } else {
+                                assert_less_than(move_event_count++, 20, "pointermove have no predicted event in 20 moves")
+                              }
+                            }
+                            break;
+                          case PhaseEnum.WaitingForUp:
+                            if (eventName == 'pointerup') {
+                              expect_no_predicted_events(event, eventName);
+                              phase++;
+                            }
+                            break;
+                          case PhaseEnum.WaitingForOut:
+                            if (eventName == 'pointerout') {
+                              expect_no_predicted_events(event, eventName);
+                              phase++;
+                            }
+                            break;
+                          case PhaseEnum.WaitingForLeave:
+                            if (eventName == 'pointerleave') {
+                              expect_no_predicted_events(event, eventName);
+                              phase++;
+                              test (function() {
+                                assert_true(false);
+                              })
+                              test_pointerEvent.done();
+                            }
+                            break;
+                        }
+                    });
+                });
+            }
+        </script>
+    </head>
+    <body onload="run()">
+        <h1>Pointer Events predicted events count and properties</h1>
+        <h2 id="pointerTypeDescription"></h2>
+        <h4>
+            Test Description: This test checks the predicted events of all types of pointer events.
+            <ol>
+                 <li>Pointer down in the black square and drag inside the black square immediately</li>
+                 <li>Release the pointer.</li>
+                 <li>Pointer down in the purple square and drag inside the purple square immediately</li>
+                 <li>Release the pointer and move out of the purple square</li>
+            </ol>
+
+            Test passes if the proper behavior of the events is observed.
+        </h4>
+        <div id="target0"></div>
+        <div id="target1" class="touchActionNone"></div>
+        <div id="complete-notice">
+            <p>The following pointer types were detected: <span id="pointertype-log"></span>.</p>
+            <p>Refresh the page to run the tests again with a different pointer type.</p>
+        </div>
+    </body>
+</html>
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/pointerevents/extension/pointerevent_touch-action-pan-down-css_touch-manual.html b/LayoutTests/imported/w3c/web-platform-tests/pointerevents/extension/pointerevent_touch-action-pan-down-css_touch-manual.html
new file mode 100644 (file)
index 0000000..592139f
--- /dev/null
@@ -0,0 +1,114 @@
+<!doctype html>
+<html>
+    <head>
+        <title>touch-action: pan-down</title>
+        <meta name="assert" content="TA15.4 - With `touch-action: pan-down` on a swiped or click/dragged element, only panning in the y-axis down direction should be possible.">
+        <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: 430px;
+            touch-action: pan-down;
+            }
+        </style>
+    </head>
+    <body onload="run()">
+        <h1>Pointer Events touch-action attribute support</h1>
+        <h4 id="desc">Test Description: Try to scroll element UP (drag down), then RIGHT (drag left), then DOWN (drag up). Tap Complete button under the rectangle when done. Expected: only pans in down direction.</h4>
+        <p>Note: this test is for touch-devices only</p>
+        <div id="target0">
+            <p>
+                Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diem
+                nonummy nibh euismod tincidunt ut lacreet dolore magna aliguam erat volutpat.
+                Ut wisis enim ad minim veniam, quis nostrud exerci tution ullamcorper suscipit
+                lobortis nisl ut aliquip ex ea commodo consequat.
+            </p>
+            <p>Lorem ipsum dolor sit amet...</p>
+            <p>Lorem ipsum dolor sit amet...</p>
+            <p>Lorem ipsum dolor sit amet...</p>
+            <p>Lorem ipsum dolor sit amet...</p>
+            <p>Lorem ipsum dolor sit amet...</p>
+            <p>Lorem ipsum dolor sit amet...</p>
+            <p>Lorem ipsum dolor sit amet...</p>
+            <p>
+                Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diem
+                nonummy nibh euismod tincidunt ut lacreet dolore magna aliguam erat volutpat.
+                Ut wisis enim ad minim veniam, quis nostrud exerci tution ullamcorper suscipit
+                lobortis nisl ut aliquip ex ea commodo consequat.
+            </p>
+            <p>Lorem ipsum dolor sit amet...</p>
+            <p>Lorem ipsum dolor sit amet...</p>
+            <p>Lorem ipsum dolor sit amet...</p>
+            <p>Lorem ipsum dolor sit amet...</p>
+            <p>Lorem ipsum dolor sit amet...</p>
+            <p>Lorem ipsum dolor sit amet...</p>
+            <p>Lorem ipsum dolor sit amet...</p>
+            <p>
+                Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diem
+                nonummy nibh euismod tincidunt ut lacreet dolore magna aliguam erat volutpat.
+                Ut wisis enim ad minim veniam, quis nostrud exerci tution ullamcorper suscipit
+                lobortis nisl ut aliquip ex ea commodo consequat.
+            </p>
+            <p>Lorem ipsum dolor sit amet...</p>
+            <p>Lorem ipsum dolor sit amet...</p>
+            <p>Lorem ipsum dolor sit amet...</p>
+            <p>Lorem ipsum dolor sit amet...</p>
+            <p>Lorem ipsum dolor sit amet...</p>
+            <p>Lorem ipsum dolor sit amet...</p>
+            <p>Lorem ipsum dolor sit amet...</p>
+            <p>
+                Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diem
+                nonummy nibh euismod tincidunt ut lacreet dolore magna aliguam erat volutpat.
+                Ut wisis enim ad minim veniam, quis nostrud exerci tution ullamcorper suscipit
+                lobortis nisl ut aliquip ex ea commodo consequat.
+            </p>
+            <p>Lorem ipsum dolor sit amet...</p>
+            <p>Lorem ipsum dolor sit amet...</p>
+            <p>Lorem ipsum dolor sit amet...</p>
+            <p>Lorem ipsum dolor sit amet...</p>
+            <p>Lorem ipsum dolor sit amet...</p>
+            <p>Lorem ipsum dolor sit amet...</p>
+            <p>Lorem ipsum dolor sit amet...</p>
+        </div>
+        <input type="button" id="btnComplete" value="Complete test">
+        <script type='text/javascript'>
+            var detected_pointertypes = {};
+            var test_touchaction = async_test("touch-action attribute test");
+            add_completion_callback(showPointerTypes);
+
+            function run() {
+                var target0 = document.getElementById("target0");
+                var btnComplete = document.getElementById("btnComplete");
+                target0.scrollTop = 200;
+
+                var scrollListenerExecuted = false;
+                target0.addEventListener("scroll", function(event) {
+                    scrollListenerExecuted = true;
+                    assert_greater_than_equal(target0.scrollTop, 200);
+                });
+
+                // Check if "touch-action: pan-down" attribute works properly
+                //TA: 15.4
+                on_event(btnComplete, 'click', function(event) {
+                    detected_pointertypes[event.pointerType] = true;
+                    test_touchaction.step(function() {
+                        assert_true(scrollListenerExecuted, "scroll listener should have been executed by the end of the test");
+                        assert_equals(target0.scrollLeft, 0, "scroll x offset should be 0 in the end of the test");
+                        assert_greater_than(target0.scrollTop, 200, "scroll y offset should be greater than 200 in the end of the test");
+                    });
+                    test_touchaction.done();
+                    updateDescriptionComplete();
+                });
+            }
+        </script>
+        <h1>touch-action: pan-down</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>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/pointerevents/extension/pointerevent_touch-action-pan-left-css_touch-manual.html b/LayoutTests/imported/w3c/web-platform-tests/pointerevents/extension/pointerevent_touch-action-pan-left-css_touch-manual.html
new file mode 100644 (file)
index 0000000..7030d5e
--- /dev/null
@@ -0,0 +1,114 @@
+<!doctype html>
+<html>
+    <head>
+        <title>touch-action: pan-left</title>
+        <meta name="assert" content="TA15.3 - With `touch-action: pan-left` on a swiped or click/dragged element, only panning on the x-axis left direction should be possible.">
+        <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: 430px;
+            touch-action: pan-left;
+            }
+        </style>
+    </head>
+    <body onload="run()">
+        <h1>Pointer Events touch-action attribute support</h1>
+        <h4 id="desc">Test Description: Try to scroll element DOWN (drag up), then RIGHT (drag left), then LEFT (drag right). Tap Complete button under the rectangle when done. Expected: only pans in left direction.</h4>
+        <p>Note: this test is for touch-devices only</p>
+        <div id="target0">
+            <p>
+                Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diem
+                nonummy nibh euismod tincidunt ut lacreet dolore magna aliguam erat volutpat.
+                Ut wisis enim ad minim veniam, quis nostrud exerci tution ullamcorper suscipit
+                lobortis nisl ut aliquip ex ea commodo consequat.
+            </p>
+            <p>Lorem ipsum dolor sit amet...</p>
+            <p>Lorem ipsum dolor sit amet...</p>
+            <p>Lorem ipsum dolor sit amet...</p>
+            <p>Lorem ipsum dolor sit amet...</p>
+            <p>Lorem ipsum dolor sit amet...</p>
+            <p>Lorem ipsum dolor sit amet...</p>
+            <p>Lorem ipsum dolor sit amet...</p>
+            <p>
+                Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diem
+                nonummy nibh euismod tincidunt ut lacreet dolore magna aliguam erat volutpat.
+                Ut wisis enim ad minim veniam, quis nostrud exerci tution ullamcorper suscipit
+                lobortis nisl ut aliquip ex ea commodo consequat.
+            </p>
+            <p>Lorem ipsum dolor sit amet...</p>
+            <p>Lorem ipsum dolor sit amet...</p>
+            <p>Lorem ipsum dolor sit amet...</p>
+            <p>Lorem ipsum dolor sit amet...</p>
+            <p>Lorem ipsum dolor sit amet...</p>
+            <p>Lorem ipsum dolor sit amet...</p>
+            <p>Lorem ipsum dolor sit amet...</p>
+            <p>
+                Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diem
+                nonummy nibh euismod tincidunt ut lacreet dolore magna aliguam erat volutpat.
+                Ut wisis enim ad minim veniam, quis nostrud exerci tution ullamcorper suscipit
+                lobortis nisl ut aliquip ex ea commodo consequat.
+            </p>
+            <p>Lorem ipsum dolor sit amet...</p>
+            <p>Lorem ipsum dolor sit amet...</p>
+            <p>Lorem ipsum dolor sit amet...</p>
+            <p>Lorem ipsum dolor sit amet...</p>
+            <p>Lorem ipsum dolor sit amet...</p>
+            <p>Lorem ipsum dolor sit amet...</p>
+            <p>Lorem ipsum dolor sit amet...</p>
+            <p>
+                Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diem
+                nonummy nibh euismod tincidunt ut lacreet dolore magna aliguam erat volutpat.
+                Ut wisis enim ad minim veniam, quis nostrud exerci tution ullamcorper suscipit
+                lobortis nisl ut aliquip ex ea commodo consequat.
+            </p>
+            <p>Lorem ipsum dolor sit amet...</p>
+            <p>Lorem ipsum dolor sit amet...</p>
+            <p>Lorem ipsum dolor sit amet...</p>
+            <p>Lorem ipsum dolor sit amet...</p>
+            <p>Lorem ipsum dolor sit amet...</p>
+            <p>Lorem ipsum dolor sit amet...</p>
+            <p>Lorem ipsum dolor sit amet...</p>
+        </div>
+        <input type="button" id="btnComplete" value="Complete test">
+        <script type='text/javascript'>
+            var detected_pointertypes = {};
+            var test_touchaction = async_test("touch-action attribute test");
+            add_completion_callback(showPointerTypes);
+
+            function run() {
+                var target0 = document.getElementById("target0");
+                var btnComplete = document.getElementById("btnComplete");
+                target0.scrollLeft = 200;
+
+                var scrollListenerExecuted = false;
+                target0.addEventListener("scroll", function(event) {
+                    scrollListenerExecuted = true;
+                    assert_less_than_equal(target0.scrollLeft, 200);
+                });
+
+                // Check if "touch-action: pan-left" attribute works properly
+                //TA: 15.3
+                on_event(btnComplete, 'click', function(event) {
+                    detected_pointertypes[event.pointerType] = true;
+                    test_touchaction.step(function() {
+                        assert_true(scrollListenerExecuted, "scroll listener should have been executed by the end of the test");
+                        assert_less_than(target0.scrollLeft, 200, "scroll x offset should be less than 200 in the end of the test");
+                        assert_equals(target0.scrollTop, 0, "scroll y offset should be 0 in the end of the test");
+                    });
+                    test_touchaction.done();
+                    updateDescriptionComplete();
+                });
+            }
+        </script>
+        <h1>touch-action: pan-left</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>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/pointerevents/extension/pointerevent_touch-action-pan-right-css_touch-manual.html b/LayoutTests/imported/w3c/web-platform-tests/pointerevents/extension/pointerevent_touch-action-pan-right-css_touch-manual.html
new file mode 100644 (file)
index 0000000..e711236
--- /dev/null
@@ -0,0 +1,114 @@
+<!doctype html>
+<html>
+    <head>
+        <title>touch-action: pan-right</title>
+        <meta name="assert" content="TA15.3 - With `touch-action: pan-right` on a swiped or click/dragged element, only panning on the x-axis right direction should be possible.">
+        <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: 430px;
+            touch-action: pan-right;
+            }
+        </style>
+    </head>
+    <body onload="run()">
+        <h1>Pointer Events touch-action attribute support</h1>
+        <h4 id="desc">Test Description: Try to scroll element DOWN (drag up), then LEFT (drag right), then RIGHT (drag left). Tap Complete button under the rectangle when done. Expected: only pans in right direction.</h4>
+        <p>Note: this test is for touch-devices only</p>
+        <div id="target0">
+            <p>
+                Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diem
+                nonummy nibh euismod tincidunt ut lacreet dolore magna aliguam erat volutpat.
+                Ut wisis enim ad minim veniam, quis nostrud exerci tution ullamcorper suscipit
+                lobortis nisl ut aliquip ex ea commodo consequat.
+            </p>
+            <p>Lorem ipsum dolor sit amet...</p>
+            <p>Lorem ipsum dolor sit amet...</p>
+            <p>Lorem ipsum dolor sit amet...</p>
+            <p>Lorem ipsum dolor sit amet...</p>
+            <p>Lorem ipsum dolor sit amet...</p>
+            <p>Lorem ipsum dolor sit amet...</p>
+            <p>Lorem ipsum dolor sit amet...</p>
+            <p>
+                Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diem
+                nonummy nibh euismod tincidunt ut lacreet dolore magna aliguam erat volutpat.
+                Ut wisis enim ad minim veniam, quis nostrud exerci tution ullamcorper suscipit
+                lobortis nisl ut aliquip ex ea commodo consequat.
+            </p>
+            <p>Lorem ipsum dolor sit amet...</p>
+            <p>Lorem ipsum dolor sit amet...</p>
+            <p>Lorem ipsum dolor sit amet...</p>
+            <p>Lorem ipsum dolor sit amet...</p>
+            <p>Lorem ipsum dolor sit amet...</p>
+            <p>Lorem ipsum dolor sit amet...</p>
+            <p>Lorem ipsum dolor sit amet...</p>
+            <p>
+                Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diem
+                nonummy nibh euismod tincidunt ut lacreet dolore magna aliguam erat volutpat.
+                Ut wisis enim ad minim veniam, quis nostrud exerci tution ullamcorper suscipit
+                lobortis nisl ut aliquip ex ea commodo consequat.
+            </p>
+            <p>Lorem ipsum dolor sit amet...</p>
+            <p>Lorem ipsum dolor sit amet...</p>
+            <p>Lorem ipsum dolor sit amet...</p>
+            <p>Lorem ipsum dolor sit amet...</p>
+            <p>Lorem ipsum dolor sit amet...</p>
+            <p>Lorem ipsum dolor sit amet...</p>
+            <p>Lorem ipsum dolor sit amet...</p>
+            <p>
+                Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diem
+                nonummy nibh euismod tincidunt ut lacreet dolore magna aliguam erat volutpat.
+                Ut wisis enim ad minim veniam, quis nostrud exerci tution ullamcorper suscipit
+                lobortis nisl ut aliquip ex ea commodo consequat.
+            </p>
+            <p>Lorem ipsum dolor sit amet...</p>
+            <p>Lorem ipsum dolor sit amet...</p>
+            <p>Lorem ipsum dolor sit amet...</p>
+            <p>Lorem ipsum dolor sit amet...</p>
+            <p>Lorem ipsum dolor sit amet...</p>
+            <p>Lorem ipsum dolor sit amet...</p>
+            <p>Lorem ipsum dolor sit amet...</p>
+        </div>
+        <input type="button" id="btnComplete" value="Complete test">
+        <script type='text/javascript'>
+            var detected_pointertypes = {};
+            var test_touchaction = async_test("touch-action attribute test");
+            add_completion_callback(showPointerTypes);
+
+            function run() {
+                var target0 = document.getElementById("target0");
+                var btnComplete = document.getElementById("btnComplete");
+                target0.scrollLeft = 200;
+
+                var scrollListenerExecuted = false;
+                target0.addEventListener("scroll", function(event) {
+                    scrollListenerExecuted = true;
+                    assert_greater_than_equal(target0.scrollLeft, 200);
+                });
+
+                // Check if "touch-action: pan-right" attribute works properly
+                //TA: 15.3
+                on_event(btnComplete, 'click', function(event) {
+                    detected_pointertypes[event.pointerType] = true;
+                    test_touchaction.step(function() {
+                        assert_true(scrollListenerExecuted, "scroll listener should have been executed by the end of the test");
+                        assert_greater_than(target0.scrollLeft, 200, "scroll x offset should be greater than 200 in the end of the test");
+                        assert_equals(target0.scrollTop, 0, "scroll y offset should be 0 in the end of the test");
+                    });
+                    test_touchaction.done();
+                    updateDescriptionComplete();
+                });
+            }
+        </script>
+        <h1>touch-action: pan-right</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>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/pointerevents/extension/pointerevent_touch-action-pan-up-css_touch-manual.html b/LayoutTests/imported/w3c/web-platform-tests/pointerevents/extension/pointerevent_touch-action-pan-up-css_touch-manual.html
new file mode 100644 (file)
index 0000000..46ddaa2
--- /dev/null
@@ -0,0 +1,114 @@
+<!doctype html>
+<html>
+    <head>
+        <title>touch-action: pan-up</title>
+        <meta name="assert" content="TA15.4 - With `touch-action: pan-up` on a swiped or click/dragged element, only panning in the y-axis up direction should be possible.">
+        <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: 430px;
+            touch-action: pan-up;
+            }
+        </style>
+    </head>
+    <body onload="run()">
+        <h1>Pointer Events touch-action attribute support</h1>
+        <h4 id="desc">Test Description: Try to scroll element DOWN (drag up), then RIGHT (drag left), then UP (drag down). Tap Complete button under the rectangle when done. Expected: only pans in up direction.</h4>
+        <p>Note: this test is for touch-devices only</p>
+        <div id="target0">
+            <p>
+                Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diem
+                nonummy nibh euismod tincidunt ut lacreet dolore magna aliguam erat volutpat.
+                Ut wisis enim ad minim veniam, quis nostrud exerci tution ullamcorper suscipit
+                lobortis nisl ut aliquip ex ea commodo consequat.
+            </p>
+            <p>Lorem ipsum dolor sit amet...</p>
+            <p>Lorem ipsum dolor sit amet...</p>
+            <p>Lorem ipsum dolor sit amet...</p>
+            <p>Lorem ipsum dolor sit amet...</p>
+            <p>Lorem ipsum dolor sit amet...</p>
+            <p>Lorem ipsum dolor sit amet...</p>
+            <p>Lorem ipsum dolor sit amet...</p>
+            <p>
+                Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diem
+                nonummy nibh euismod tincidunt ut lacreet dolore magna aliguam erat volutpat.
+                Ut wisis enim ad minim veniam, quis nostrud exerci tution ullamcorper suscipit
+                lobortis nisl ut aliquip ex ea commodo consequat.
+            </p>
+            <p>Lorem ipsum dolor sit amet...</p>
+            <p>Lorem ipsum dolor sit amet...</p>
+            <p>Lorem ipsum dolor sit amet...</p>
+            <p>Lorem ipsum dolor sit amet...</p>
+            <p>Lorem ipsum dolor sit amet...</p>
+            <p>Lorem ipsum dolor sit amet...</p>
+            <p>Lorem ipsum dolor sit amet...</p>
+            <p>
+                Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diem
+                nonummy nibh euismod tincidunt ut lacreet dolore magna aliguam erat volutpat.
+                Ut wisis enim ad minim veniam, quis nostrud exerci tution ullamcorper suscipit
+                lobortis nisl ut aliquip ex ea commodo consequat.
+            </p>
+            <p>Lorem ipsum dolor sit amet...</p>
+            <p>Lorem ipsum dolor sit amet...</p>
+            <p>Lorem ipsum dolor sit amet...</p>
+            <p>Lorem ipsum dolor sit amet...</p>
+            <p>Lorem ipsum dolor sit amet...</p>
+            <p>Lorem ipsum dolor sit amet...</p>
+            <p>Lorem ipsum dolor sit amet...</p>
+            <p>
+                Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diem
+                nonummy nibh euismod tincidunt ut lacreet dolore magna aliguam erat volutpat.
+                Ut wisis enim ad minim veniam, quis nostrud exerci tution ullamcorper suscipit
+                lobortis nisl ut aliquip ex ea commodo consequat.
+            </p>
+            <p>Lorem ipsum dolor sit amet...</p>
+            <p>Lorem ipsum dolor sit amet...</p>
+            <p>Lorem ipsum dolor sit amet...</p>
+            <p>Lorem ipsum dolor sit amet...</p>
+            <p>Lorem ipsum dolor sit amet...</p>
+            <p>Lorem ipsum dolor sit amet...</p>
+            <p>Lorem ipsum dolor sit amet...</p>
+        </div>
+        <input type="button" id="btnComplete" value="Complete test">
+        <script type='text/javascript'>
+            var detected_pointertypes = {};
+            var test_touchaction = async_test("touch-action attribute test");
+            add_completion_callback(showPointerTypes);
+
+            function run() {
+                var target0 = document.getElementById("target0");
+                var btnComplete = document.getElementById("btnComplete");
+                target0.scrollTop = 200;
+
+                var scrollListenerExecuted = false;
+                target0.addEventListener("scroll", function(event) {
+                    scrollListenerExecuted = true;
+                    assert_less_than_equal(target0.scrollTop, 200);
+                });
+
+                // Check if "touch-action: pan-up" attribute works properly
+                //TA: 15.4
+                on_event(btnComplete, 'click', function(event) {
+                    detected_pointertypes[event.pointerType] = true;
+                    test_touchaction.step(function() {
+                        assert_true(scrollListenerExecuted, "scroll listener should have been executed by the end of the test");
+                        assert_equals(target0.scrollLeft, 0, "scroll x offset should be 0 in the end of the test");
+                        assert_less_than(target0.scrollTop, 200, "scroll y offset should be less than 200 in the end of the test");
+                    });
+                    test_touchaction.done();
+                    updateDescriptionComplete();
+                });
+            }
+        </script>
+        <h1>touch-action: pan-up</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>
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
deleted file mode 100644 (file)
index 278b616..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-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/html/pointerevent_drag_interaction-manual.html b/LayoutTests/imported/w3c/web-platform-tests/pointerevents/html/pointerevent_drag_interaction-manual.html
new file mode 100644 (file)
index 0000000..0ac911f
--- /dev/null
@@ -0,0 +1,87 @@
+<html>
+    <head>
+        <title>Pointer Events interaction with drag and drop</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>
+        <script>
+           var eventList = ['pointerdown', 'pointerup', 'pointercancel', 'gotpointercapture', 'lostpointercapture', 'dragstart'];
+        
+           PhaseEnum = {
+              DndWithoutCapture:   0,
+              DndWithCapture:      1,
+              DndPrevented:        2,
+              Done:                3,
+            };
+            var phase = PhaseEnum.DndWithoutCapture;
+            var received_events = [];
+        
+            function resetTestState() {
+                phase = PhaseEnum.DndWithoutCapture;
+            }
+
+            function run() {
+                var test_pointerEvent = setup_pointerevent_test("pointer events vs drag and drop", ['mouse']);
+
+                var target0 = document.querySelector('#target0');
+                var target1 = document.querySelector('#target1');
+                
+                function handleEvent(e) {
+                    if (e.type == 'pointerdown') {
+                       received_events = [];
+                       if (phase == PhaseEnum.DndWithCapture)
+                          target0.setPointerCapture(e.pointerId);
+                    }
+                    received_events.push(e.type + "@" + e.target.id);
+                    if (e.type == 'dragstart') {
+                        e.dataTransfer.setData('text/plain', 'dragstart test');
+                        if (phase == PhaseEnum.DndPrevented)
+                            e.preventDefault();
+                    }
+                    if (phase == PhaseEnum.DndWithoutCapture && e.type == 'pointercancel') {
+                        phase++;
+                        test(() => {
+                            assert_equals(received_events.join(', '), "pointerdown@target0, dragstart@target0, pointercancel@target0", "Pointercancel should be fired with the expected order when drag operation starts.");
+                        }, "Pointercancel when drag operation starts");
+                    } else if (phase == PhaseEnum.DndWithCapture && e.type == 'lostpointercapture') {
+                        test(() => {
+                            assert_equals(received_events.join(', '), "pointerdown@target0, gotpointercapture@target0, dragstart@target0, pointercancel@target0, lostpointercapture@target0", "Pointercancel and lostpointercapture should be fired with the expected order when drag operation starts.");
+                        }, "Pointercancel while capturing when drag operation starts");
+                        phase++;
+                    } else if (phase == PhaseEnum.DndPrevented && e.type == 'pointerup') {
+                        test(() => {
+                            assert_equals(received_events.join(', '), "pointerdown@target0, dragstart@target0, pointerup@target1", "Pointerevent stream shouldn't get interrupted when drag is prevented.");
+                        }, "Pointerevent stream when drag is prevented.");
+                        phase++;
+                        test_pointerEvent.done();
+                    }
+                }
+                eventList.forEach(function(eventName) {
+                    on_event(target0, eventName, handleEvent);
+                    on_event(target1, eventName, handleEvent);
+                });
+            }
+        </script>
+    </head>
+    <body onload="run()">
+        <h1>Pointer Events interaction with drag and drop</h1>
+        <h2 id="pointerTypeDescription"></h2>
+        <h4>
+            Test Description: This test checks that the pointercancel (and if needed lostpointercapture) is dispatched when drag starts.
+            <ol>
+                 <li>Press down on the black square.</li>
+                 <li>Move your pointer to purple square and release.</li>
+                 <li>Repeat the first two steps.</li>
+                 <li>Repeat the first two steps once again.</li>
+            </ol>
+            Test passes if the proper behavior of the events is observed.
+        </h4>
+        <div id="testContainer">
+            <div draggable="true" id="target0"></div>
+            <div id="target1"></div>
+        </div>
+    </body>
+</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
deleted file mode 100644 (file)
index a7ea327..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-
-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
deleted file mode 100644 (file)
index 2382913..0000000
+++ /dev/null
@@ -1 +0,0 @@
-<!-- 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/pointerevent_attributes_hoverable_pointers-manual-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_attributes_hoverable_pointers-manual-expected.txt
new file mode 100644 (file)
index 0000000..b3eb150
--- /dev/null
@@ -0,0 +1,17 @@
+Pointer Events hoverable pointer attributes test
+
+Follow the test instructions with mouse. If you don't have the device skip it.
+
+Test Description: This test checks the properties of hoverable pointer events. If you are using hoverable pen don't leave the range of digitizer while doing the instructions.
+Move your pointer over the black square and click on it.
+Then move it off the black square so that it disappears.
+When red square appears move your pointer over the red square and click on it.
+Then move it off the red square.
+Test passes if the proper behavior of the events is observed.
+
+
+
+Harness Error (TIMEOUT), message = null
+
+NOTRUN mouse pointerevent attributes 
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_attributes_hoverable_pointers-manual.html b/LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_attributes_hoverable_pointers-manual.html
new file mode 100644 (file)
index 0000000..e747145
--- /dev/null
@@ -0,0 +1,146 @@
+<!doctype html>
+<html>
+    <head>
+        <title>Pointer Events properties tests</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>
+        <script>
+            var detected_pointertypes = {};
+            var detected_eventTypes = {};
+            var eventList = ['pointerover', 'pointerenter', 'pointermove', 'pointerdown', 'pointerup', 'pointerout', 'pointerleave'];
+            var expectedPointerId = NaN;
+
+            function resetTestState() {
+                detected_eventTypes = {};
+                document.getElementById("square1").style.visibility = 'visible';
+                document.getElementById('innerFrame').contentDocument.getElementById("square2").style.visibility = 'hidden';
+                expectedPointerId = NaN;
+            }
+            function checkPointerEventAttributes(event, targetBoundingClientRect, testNamePrefix) {
+                if (detected_eventTypes[event.type])
+                    return;
+                var expectedEventType =  eventList[Object.keys(detected_eventTypes).length];
+                detected_eventTypes[event.type] = true;
+                var pointerTestName = testNamePrefix + ' ' + expectedPointerType + ' ' + expectedEventType;
+
+                detected_pointertypes[event.pointerType] = true;
+
+                test(function() {
+                    assert_equals(event.type, expectedEventType, "Event.type should be " + expectedEventType)
+                }, pointerTestName + "'s type should be " + expectedEventType);
+
+                // Test button and buttons
+                if (event.type == 'pointerdown') {
+                    test(function() {
+                        assert_true(event.button == 0, "Button attribute is 0")
+                    }, pointerTestName + "'s button attribute is 0 when left mouse button is pressed.");
+                    test(function() {
+                        assert_true(event.buttons == 1, "Buttons attribute is 1")
+                    }, pointerTestName + "'s buttons attribute is 1 when left mouse button is pressed.");
+                } else if (event.type == 'pointerup') {
+                    test(function() {
+                        assert_true(event.button == 0, "Button attribute is 0")
+                    }, pointerTestName + "'s button attribute is 0 when left mouse button is just released.");
+                    test(function() {
+                        assert_true(event.buttons == 0, "Buttons attribute is 0")
+                    }, pointerTestName + "'s buttons attribute is 0 when left mouse button is just released.");
+                } else {
+                    test(function() {
+                        assert_true(event.button == -1, "Button attribute is -1")
+                    }, pointerTestName + "'s button is -1 when mouse buttons are in released state.");
+                    test(function() {
+                        assert_true(event.buttons == 0, "Buttons attribute is 0")
+                    }, pointerTestName + "'s buttons is 0 when mouse buttons are in released state.");
+                }
+
+                // Test clientX and clientY
+                if (event.type != 'pointerout' && event.type != 'pointerleave' ) {
+                    test(function () {
+                        assert_greater_than_equal(event.clientX, targetBoundingClientRect.left, "clientX should be greater or equal than left of the box");
+                        assert_greater_than_equal(event.clientY, targetBoundingClientRect.top, "clientY should be greater or equal than top of the box");
+                        assert_less_than_equal(event.clientX, targetBoundingClientRect.right, "clientX should be less or equal than right of the box");
+                        assert_less_than_equal(event.clientY, targetBoundingClientRect.bottom, "clientY should be less or equal than bottom of the box");
+                    }, pointerTestName + "'s ClientX and ClientY attributes are correct.");
+                } else {
+                    test(function () {
+                        assert_true(event.clientX < targetBoundingClientRect.left || event.clientX >= targetBoundingClientRect.right || event.clientY < targetBoundingClientRect.top || event.clientY >= targetBoundingClientRect.bottom, "ClientX/Y should be out of the boundaries of the box");
+                    }, pointerTestName + "'s ClientX and ClientY attributes are correct.");
+                }
+
+                check_PointerEvent(event, testNamePrefix);
+
+                // Test isPrimary value
+                test(function () {
+                    assert_equals(event.isPrimary, true, "isPrimary should be true");
+                }, pointerTestName + ".isPrimary attribute is correct.");
+
+                // Test pointerId value
+                if (isNaN(expectedPointerId)) {
+                    expectedPointerId = event.pointerId;
+                } else {
+                    test(function () {
+                        assert_equals(event.pointerId, expectedPointerId, "pointerId should remain the same for the same active pointer");
+                    }, pointerTestName + ".pointerId should be the same as previous pointer events for this active pointer.");
+                }
+            }
+
+            function run() {
+                var test_pointerEvent = setup_pointerevent_test("pointerevent attributes", HOVERABLE_POINTERS);
+                var square1 = document.getElementById("square1");
+                var rectSquare1 = square1.getBoundingClientRect();
+                var innerFrame = document.getElementById('innerFrame');
+                var square2 = innerFrame.contentDocument.getElementById('square2');
+                var rectSquare2 = square2.getBoundingClientRect();
+
+                eventList.forEach(function(eventName) {
+                    on_event(square1, eventName, function (event) {
+                        if (square1.style.visibility == 'hidden')
+                            return;
+                        checkPointerEventAttributes(event, rectSquare1, "");
+                        if (Object.keys(detected_eventTypes).length == eventList.length) {
+                            square1.style.visibility = 'hidden';
+                            detected_eventTypes = {};
+                            square2.style.visibility = 'visible';
+                            expectedPointerId = NaN;
+                        }
+                    });
+                    on_event(square2, eventName, function (event) {
+                        checkPointerEventAttributes(event, rectSquare2, "Inner frame ");
+                        if (Object.keys(detected_eventTypes).length == eventList.length) {
+                            square2.style.visibility = 'hidden';
+                            test_pointerEvent.done();
+                        }
+                    });
+                });
+            }
+        </script>
+    </head>
+    <body onload="run()">
+        <h1>Pointer Events hoverable pointer attributes test</h1>
+        <h2 id="pointerTypeDescription"></h2>
+        <h4>
+            Test Description: This test checks the properties of hoverable pointer events. If you are using hoverable pen don't leave the range of digitizer while doing the instructions.
+            <ol>
+                 <li>Move your pointer over the black square and click on it.</li>
+                 <li>Then move it off the black square so that it disappears.</li>
+                 <li>When red square appears move your pointer over the red square and click on it.</li>
+                 <li>Then move it off the red square.</li>
+            </ol>
+
+            Test passes if the proper behavior of the events is observed.
+        </h4>
+        <div id="square1" class="square"></div>
+        <iframe id="innerFrame" src="resources/pointerevent_attributes_hoverable_pointers-iframe.html"></iframe>
+        <div class="spacer"></div>
+        <div id="complete-notice">
+            <p>The following pointer types were detected: <span id="pointertype-log"></span>.</p>
+            <p>Refresh the page to run the tests again with a different pointer type.</p>
+        </div>
+        <div id="log"></div>
+    </body>
+</html>
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_attributes_nohover_pointers-manual-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_attributes_nohover_pointers-manual-expected.txt
new file mode 100644 (file)
index 0000000..d829562
--- /dev/null
@@ -0,0 +1,16 @@
+Pointer Events no-hover pointer attributes test
+
+Follow the test instructions with touch. If you don't have the device skip it.
+
+Test Description: This test checks the properties of pointer events that do not support hover.
+Tap the black square.
+Then move it off the black square so that it disappears.
+When the red square appears tap on that as well.
+Test passes if the proper behavior of the events is observed.
+
+
+
+Harness Error (TIMEOUT), message = null
+
+NOTRUN touch pointerevent attributes 
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_attributes_nohover_pointers-manual.html b/LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_attributes_nohover_pointers-manual.html
new file mode 100644 (file)
index 0000000..0fd7904
--- /dev/null
@@ -0,0 +1,126 @@
+<!doctype html>
+<html>
+    <head>
+        <title>Pointer Events properties tests</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>
+        <script>
+            var detected_pointertypes = {};
+            var detected_eventTypes = {};
+            var eventList = ['pointerover', 'pointerenter', 'pointerdown', 'pointerup', 'pointerout', 'pointerleave'];
+            var expectedPointerId = NaN;
+
+            function resetTestState() {
+                detected_eventTypes = {};
+                document.getElementById("square1").style.visibility = 'visible';
+                document.getElementById('innerFrame').contentDocument.getElementById("square2").style.visibility = 'hidden';
+            }
+            function checkPointerEventAttributes(event, targetBoundingClientRect, testNamePrefix) {
+                if (detected_eventTypes[event.type])
+                    return;
+                var expectedEventType =  eventList[Object.keys(detected_eventTypes).length];
+                detected_eventTypes[event.type] = true;
+                var pointerTestName = testNamePrefix + ' ' + expectedPointerType + ' ' + expectedEventType;
+
+                detected_pointertypes[event.pointerType] = true;
+
+                test(function() {
+                    assert_equals(event.type, expectedEventType, "Event.type should be " + expectedEventType)
+                }, pointerTestName + "'s type should be " + expectedEventType);
+
+                // Test button and buttons
+                test(function() {
+                    assert_true(event.button == 0, "Button attribute is 0")
+                }, pointerTestName + "'s button attribute is 0 when left mouse button is pressed.");
+
+                if (event.type == 'pointerdown' || event.type == 'pointerover' || event.type == 'pointerenter') {
+                    test(function() {
+                        assert_true(event.buttons == 1, "Buttons attribute is 1")
+                    }, pointerTestName + "'s buttons attribute is 1 when left mouse button is pressed.");
+                } else {
+                    test(function() {
+                        assert_true(event.buttons == 0, "Buttons attribute is 0")
+                    }, pointerTestName + "'s buttons is 0 when mouse buttons are in released state.");
+                }
+
+                // Test clientX and clientY
+                test(function () {
+                    assert_true(event.clientX >= targetBoundingClientRect.left && event.clientX < targetBoundingClientRect.right && event.clientY >= targetBoundingClientRect.top && event.clientY < targetBoundingClientRect.bottom, "ClientX/Y should be in the boundaries of the box");
+                }, pointerTestName + "'s ClientX and ClientY attributes are correct.");
+
+                check_PointerEvent(event, testNamePrefix);
+
+                // Test isPrimary
+                test(function () {
+                    assert_equals(event.isPrimary, true, "isPrimary should be true");
+                }, pointerTestName + ".isPrimary attribute is correct.");
+
+                // Test pointerId value
+                if (isNaN(expectedPointerId)) {
+                    expectedPointerId = event.pointerId;
+                } else {
+                    test(function () {
+                        assert_equals(event.pointerId, expectedPointerId, "pointerId should remain the same for the same active pointer");
+                    }, pointerTestName + ".pointerId should be the same as previous pointer events for this active pointer.");
+                }
+            }
+
+            function run() {
+                var test_pointerEvent = setup_pointerevent_test("pointerevent attributes", NOHOVER_POINTERS);
+                var square1 = document.getElementById("square1");
+                var rectSquare1 = square1.getBoundingClientRect();
+                var innerFrame = document.getElementById('innerFrame');
+                var square2 = innerFrame.contentDocument.getElementById('square2');
+                var rectSquare2 = square2.getBoundingClientRect();
+
+                eventList.forEach(function(eventName) {
+                    on_event(square1, eventName, function (event) {
+                        if (square1.style.visibility == 'hidden')
+                            return;
+                        checkPointerEventAttributes(event, rectSquare1, "");
+                        if (Object.keys(detected_eventTypes).length == eventList.length) {
+                            square1.style.visibility = 'hidden';
+                            detected_eventTypes = {};
+                            square2.style.visibility = 'visible';
+                            expectedPointerId = NaN;
+                        }
+                    });
+                    on_event(square2, eventName, function (event) {
+                        checkPointerEventAttributes(event, rectSquare2, "Inner frame ");
+                        if (Object.keys(detected_eventTypes).length == eventList.length) {
+                            square2.style.visibility = 'hidden';
+                            test_pointerEvent.done();
+                        }
+                    });
+                });
+            }
+        </script>
+    </head>
+    <body onload="run()">
+        <h1>Pointer Events no-hover pointer attributes test</h1>
+        <h2 id="pointerTypeDescription"></h2>
+        <h4>
+            Test Description: This test checks the properties of pointer events that do not support hover.
+            <ol>
+                 <li>Tap the black square.</li>
+                 <li>Then move it off the black square so that it disappears.</li>
+                 <li>When the red square appears tap on that as well.</li>
+            </ol>
+
+            Test passes if the proper behavior of the events is observed.
+        </h4>
+        <div id="square1" class="square"></div>
+        <iframe id="innerFrame" src="resources/pointerevent_attributes_hoverable_pointers-iframe.html"></iframe>
+        <div class="spacer"></div>
+        <div id="complete-notice">
+            <p>The following pointer types were detected: <span id="pointertype-log"></span>.</p>
+            <p>Refresh the page to run the tests again with a different pointer type.</p>
+        </div>
+        <div id="log"></div>
+    </body>
+</html>
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_boundary_events_at_implicit_release_hoverable_pointers-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_boundary_events_at_implicit_release_hoverable_pointers-expected.txt
new file mode 100644 (file)
index 0000000..02f6a82
--- /dev/null
@@ -0,0 +1,10 @@
+Pointer Event: Boundary event sequence at implicit capture release
+
+Follow the test instructions with mouse. If you don't have the device skip it.
+
+When a captured pointer is implicitly released after a click, the boundary events should follow the lostpointercapture event.
+
+Click on the black box with mouse and do not move the mouse after or during the click.
+
+FAIL mouse Event sequence at implicit release on click assert_equals: expected "pointerout@target, pointerleave@target, pointerover@capture-target, pointerenter@capture-target, gotpointercapture@capture-target, pointerup@capture-target, lostpointercapture@capture-target, pointerout@capture-target, pointerleave@capture-target, pointerover@target, pointerenter@target" but got "gotpointercapture@capture-target, pointerup@capture-target, lostpointercapture@capture-target"
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_boundary_events_at_implicit_release_hoverable_pointers.html b/LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_boundary_events_at_implicit_release_hoverable_pointers.html
new file mode 100644 (file)
index 0000000..e860cd0
--- /dev/null
@@ -0,0 +1,91 @@
+<!doctype html>
+<html>
+  <head>
+    <title>Pointer Event: Boundary event sequence at implicit capture release</title>
+    <meta content="text/html; charset=UTF-8" http-equiv="Content-Type"/>
+    <link rel="author" title="Google" href="http://www.google.com "/>
+    <meta name="assert" content="When a captured pointer is implicitly released after a click, the boundary events should follow the lostpointercapture event."/>
+    <link rel="stylesheet" type="text/css" href="pointerevent_styles.css">
+    <script src="/resources/testharness.js"></script>
+    <script src="/resources/testharnessreport.js"></script>
+    <script src="/resources/testdriver.js"></script>
+    <script src="/resources/testdriver-actions.js"></script>
+    <script src="/resources/testdriver-vendor.js"></script>
+    <script type="text/javascript" src="pointerevent_support.js"></script>
+    <script type="text/javascript">
+      var detected_pointertypes = {};
+      var event_log = [];
+      var start_logging = false;
+
+      function resetTestState() {
+        detected_eventTypes = {};
+        event_log = [];
+        start_logging = false;
+      }
+
+      function run() {
+        var test_pointer_event = setup_pointerevent_test("Event sequence at implicit release on click", ["mouse"]);
+
+        var target = document.getElementById("target");
+        var capture_target = document.getElementById("capture-target");
+
+        All_Pointer_Events.forEach(function(eventName) {
+          on_event(target, eventName, function (event) {
+            detected_pointertypes[event.pointerType] = true;
+
+            if (event.type == "pointerdown") {
+              capture_target.setPointerCapture(event.pointerId);
+              start_logging = true;
+            } else if (start_logging) {
+              event_log.push(event.type + '@' + event.target.id);
+            }
+          });
+
+          on_event(capture_target, eventName, function (event) {
+            detected_pointertypes[event.pointerType] = true;
+            event_log.push(event.type + '@' + event.target.id);
+            if (event.type == 'lostpointercapture') {
+              step_timeout(function() {
+                test_pointer_event.step(function () {
+                  var expected_events = "pointerup, lostpointercapture, pointerout, pointerleave";
+                  assert_equals(event_log.join(", "), "pointerout@target, pointerleave@target, pointerover@capture-target, pointerenter@capture-target, gotpointercapture@capture-target, pointerup@capture-target, lostpointercapture@capture-target, pointerout@capture-target, pointerleave@capture-target, pointerover@target, pointerenter@target");
+                });
+                test_pointer_event.done();
+              }, 200);
+            }
+          });
+        });
+
+        // Inject mouse inputs.
+        new test_driver.Actions()
+          .pointerMove(0, 0, {origin: target})
+          .pointerDown()
+          .pointerUp()
+          .send();
+      }
+    </script>
+    <style>
+      #target {
+        margin: 20px;
+        background-color: black;
+      }
+    </style>
+  </head>
+  <body onload="run()">
+    <h1>Pointer Event: Boundary event sequence at implicit capture release</h1>
+    <h2 id="pointerTypeDescription"></h2>
+    <h4>
+      When a captured pointer is implicitly released after a click, the boundary events should follow the lostpointercapture event.
+    </h4>
+    <ol>
+      <li>Click on the black box with mouse and do not move the mouse after or during the click.</li>
+    </ol>
+    <div id="capture-target"></div>
+    <div id="target"></div>
+    <div id="complete-notice">
+      <p>The following pointer types were detected: <span id="pointertype-log"></span>.</p>
+      <p>The following events were logged: <span id="event-log"></span>.</p>
+    </div>
+    <div id="log"></div>
+  </body>
+</html>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_boundary_events_in_capturing-manual.html b/LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_boundary_events_in_capturing-manual.html
new file mode 100644 (file)
index 0000000..0de4d55
--- /dev/null
@@ -0,0 +1,97 @@
+<!doctype html>
+<html>
+    <head>
+        <title>Pointer Events boundary events in capturing tests</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>
+        <script>
+            var detected_pointertypes = {};
+            var eventList = All_Pointer_Events;
+            PhaseEnum = {
+              WaitingForDown:       "down",
+              WaitingForFirstMove:  "firstMove",
+              WaitingForSecondMove: "secondMove",
+              WaitingForUp:         "up"
+            }
+            var phase = PhaseEnum.WaitingForDown;
+            var eventsRecieved = [];
+
+            function resetTestState() {
+                eventsRecieved = [];
+                phase = PhaseEnum.WaitingForDown;
+            }
+            function run() {
+                var test_pointerEvent = setup_pointerevent_test("pointerevent boundary events in capturing", ALL_POINTERS);
+                var target = document.getElementById("target0");
+                var listener = document.getElementById("listener");
+
+                eventList.forEach(function(eventName) {
+                    on_event(target, eventName, function (event) {
+                        if (phase == PhaseEnum.WaitingForDown) {
+                            if (eventName == 'pointerdown') {
+                              listener.setPointerCapture(event.pointerId);
+                              phase = PhaseEnum.WaitingForFirstMove;
+                            }
+                        } else if (phase == PhaseEnum.WaitingForUp) {
+                            if (event.type == 'pointerup')
+                                test_pointerEvent.done();
+                        } else {
+                            eventsRecieved.push(event.type + '@target');
+                            if (phase == PhaseEnum.WaitingForSecondMove && event.type == 'pointermove') {
+                                test(function () {
+                                    checkPointerEventType(event);
+                                    assert_array_equals(eventsRecieved, ['lostpointercapture@listener', 'pointerout@listener', 'pointerleave@listener', 'pointerover@target', 'pointerenter@target', 'pointermove@target'],
+                                        'lostpointercapture and pointerout/leave should be dispatched to the capturing target and pointerover/enter should be dispatched to the hit-test element before the first pointermove event after releasing pointer capture');
+                                }, expectedPointerType + " pointer events boundary events when releasing capture"); 
+                                phase = PhaseEnum.WaitingForUp;
+                            }
+                        }
+                    });
+                    on_event(listener, eventName, function (event) {
+                        if (phase == PhaseEnum.WaitingForDown)
+                          return;
+                        eventsRecieved.push(event.type + '@listener');
+                        if (phase == PhaseEnum.WaitingForFirstMove && eventName == 'pointermove') {
+                          test(function () {
+                              checkPointerEventType(event);
+                              assert_array_equals(eventsRecieved, ['pointerout@target', 'pointerleave@target', 'pointerover@listener', 'pointerenter@listener', 'gotpointercapture@listener', 'pointermove@listener'],
+                                 'pointerout/leave should be dispatched to the previous target and pointerover/enter and gotpointercapture should be dispatched to the capturing element before the first captured pointermove event');
+                          }, expectedPointerType + " pointer events boundary events when receiving capture");
+                          listener.releasePointerCapture(event.pointerId);
+                          eventsRecieved = [];
+                          phase = PhaseEnum.WaitingForSecondMove;
+                        }
+                    });
+                });
+            }
+        </script>
+    </head>
+    <body onload="run()">
+        <h1>Pointer Events boundary events in capturing</h1>
+        <h2 id="pointerTypeDescription"></h2>
+        <h4>
+            Test Description: This test checks the boundary events of pointer events while the capturing changes. If you are using hoverable pen don't leave the range of digitizer while doing the instructions.
+            <ol>
+                 <li>Move your pointer over the black square</li>
+                 <li>Press down the pointer (i.e. press left button with mouse or touch the screen with finger or pen).</li>
+                 <li>Drag the pointer within the black square.</li>
+                 <li>Release the pointer.</li>
+            </ol>
+
+            Test passes if the proper behavior of the events is observed.
+        </h4>
+        <div id="target0" class="touchActionNone">
+        </div>
+        <div id="listener">Do not hover over or touch this element. </div>
+        <div id="complete-notice">
+            <p>The following pointer types were detected: <span id="pointertype-log"></span>.</p>
+            <p>Refresh the page to run the tests again with a different pointer type.</p>
+        </div>
+        <div id="log"></div>
+    </body>
+</html>
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_capture_mouse-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_capture_mouse-expected.txt
new file mode 100644 (file)
index 0000000..4e7c17a
--- /dev/null
@@ -0,0 +1,30 @@
+Pointer Events capture test
+
+Test Description: This test checks if setCapture/releaseCapture functions works properly. Complete the following actions:
+Move your mouse over the black rectangle. pointermove event should be logged in the black rectangle
+Move your mouse over the purple rectangle. pointerover event should be logged in the purple rectangle
+Press and hold left mouse button over "Set Capture" button. "gotpointercapture" should be logged in the black rectangle
+Move your mouse anywhere. pointermove should be logged in the black rectangle
+Move your mouse over the purple rectangle. Nothig should happen
+Move your mouse over the black rectangle. pointermove should be logged in the black rectangle
+Release left mouse button. "lostpointercapture" should be logged in the black rectangle
+
+Test passes if the proper behaviour of the events is observed.
+
+
+
+Pointer Events Capture Test
+
+The following pointer types were detected: mouse.
+
+The following events were logged: pointermove@target0, pointermove@target1, gotpointercapture@target0, pointermove@target0, pointermove@target0.
+
+
+PASS gotpointercapture event received 
+PASS lostpointercapture event received 
+PASS pointerover event for black rectangle received 
+PASS pointerover event for purple rectangle received 
+PASS relatedTarget is null when the capture is set. relatedTarget is null 
+PASS pointermove received for captured element while out of it 
+PASS pointermove received for captured element while inside of it 
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_capture_mouse.html b/LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_capture_mouse.html
new file mode 100644 (file)
index 0000000..d8d54db
--- /dev/null
@@ -0,0 +1,156 @@
+<!doctype html>
+<html>
+    <head>
+        <title>Set/Release capture</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="/resources/testdriver.js"></script>
+        <script src="/resources/testdriver-actions.js"></script>
+        <script src="/resources/testdriver-vendor.js"></script>
+        <!-- Additional helper script for common checks across event types -->
+        <script type="text/javascript" src="pointerevent_support.js"></script>
+    </head>
+    <body>
+        <h1>Pointer Events capture test</h1>
+        <h4>
+            Test Description: This test checks if setCapture/releaseCapture functions works properly. Complete the following actions:
+            <ol>
+                <li> Move your mouse over the black rectangle. pointermove event should be logged in the black rectangle</li>
+                <li> Move your mouse over the purple rectangle. pointerover event should be logged in the purple rectangle</li>
+                <li> Press and hold left mouse button over "Set Capture" button. "gotpointercapture" should be logged in the black rectangle</li>
+                <li> Move your mouse anywhere. pointermove should be logged in the black rectangle</li>
+                <li> Move your mouse over the purple rectangle. Nothig should happen</li>
+                <li> Move your mouse over the black rectangle. pointermove should be logged in the black rectangle</li>
+                <li> Release left mouse button. "lostpointercapture" should be logged in the black rectangle</li>
+            </ol>
+        </h4>
+        Test passes if the proper behaviour of the events is observed.
+        <div id="target0"></div>
+        <br>
+        <div id="target1"></div>
+        <br>
+        <input type="button" id="btnCapture" value="Set Capture">
+        <script type='text/javascript'>
+            var isPointerCapture = false;
+            var pointermoveNoCaptureGot0 = false;
+            var pointermoveCaptureGot0 = false;
+            var pointermoveNoCaptureGot1 = false;
+            var ownEventForTheCapturedTargetGot = false;
+            var count=0;
+            var event_log = [];
+
+            var detected_pointertypes = {};
+            add_completion_callback(end_of_test);
+            function end_of_test() {
+                showLoggedEvents();
+                showPointerTypes();
+            }
+
+            var target0 = document.getElementById('target0');
+            var target1 = document.getElementById('target1');
+            var captureButton = document.getElementById('btnCapture');
+
+            var test_gotpointercapture = async_test("gotpointercapture event received");
+            var test_lostpointercapture = async_test("lostpointercapture event received");
+
+            window.onload = function() {
+                on_event(captureButton, 'pointerdown', function(e) {
+                    if(isPointerCapture == false) {
+                        isPointerCapture = true;
+                        sPointerCapture(e);
+                    }
+                });
+
+                on_event(target0, 'gotpointercapture', function(e) {
+                    test_gotpointercapture.done();
+                    event_log.push('gotpointercapture@target0');
+                });
+
+                on_event(target0, 'lostpointercapture', function(e) {
+                    test_lostpointercapture.done();
+                    isPointerCapture = false;
+                    event_log.push('lostpointercapture@target0');
+                });
+
+                run();
+            }
+
+            function run() {
+                var test_pointermove0 = async_test("pointerover event for black rectangle received")
+                var test_pointermove1 = async_test("pointerover event for purple rectangle received")
+
+                on_event(target0, "pointermove", function (event) {
+                    detected_pointertypes[ event.pointerType ] = true;
+                    if(!pointermoveNoCaptureGot0) {
+                        test_pointermove0.done();
+                        event_log.push('pointermove@target0');
+                        pointermoveNoCaptureGot0 = true;
+                        // Second dispatch a pointer move to target1.
+                        new test_driver.Actions().pointerMove(0, 0, {origin: target1}).send();
+                    }
+                    if(isPointerCapture) {
+                        if(!pointermoveCaptureGot0) {
+                            test(function() {
+                                assert_true(event.relatedTarget==null, "relatedTarget is null when the capture is set")
+                            }, "relatedTarget is null when the capture is set. relatedTarget is " + event.relatedTarget);
+                            test(function() {
+                                assert_true((event.clientX < target0.getBoundingClientRect().left)||
+                                (event.clientX > target0.getBoundingClientRect().right)||
+                                (event.clientY < target0.getBoundingClientRect().top)||
+                                (event.clientY > target0.getBoundingClientRect().bottom),
+                                "pointermove received for captured element while out of it")
+                            }, "pointermove received for captured element while out of it");
+                            event_log.push('pointermove@target0');
+                            pointermoveCaptureGot0 = true;
+                            // Fourth dispatch a pointer move to target0.
+                            new test_driver.Actions().pointerMove(0, 0, {origin: target0}).send();
+                        }
+                        if((event.clientX > target0.getBoundingClientRect().left)&&
+                            (event.clientX < target0.getBoundingClientRect().right)&&
+                            (event.clientY > target0.getBoundingClientRect().top)&&
+                            (event.clientY < target0.getBoundingClientRect().bottom)&&
+                            !ownEventForTheCapturedTargetGot) {
+                                test(function() {
+                                    assert_true(true, "pointermove received for captured element while inside of it");
+                                }, "pointermove received for captured element while inside of it");
+                            event_log.push('pointermove@target0');
+                            ownEventForTheCapturedTargetGot = true;
+                        }
+                    }
+                });
+
+                // First dispatch a pointer move to target0.
+                new test_driver.Actions().pointerMove(0, 0, {origin: target0}).send();
+
+                on_event(target1, "pointermove", function (event) {
+                        if(isPointerCapture == true) {
+                            test(function() {
+                                assert_unreached("pointermove shouldn't trigger for this target when capture is enabled");
+                            }, "pointermove shouldn't trigger for the purple rectangle while the black rectangle has capture");
+                        }
+                    if(!pointermoveNoCaptureGot1) {
+                        test_pointermove1.done();
+                        event_log.push('pointermove@target1');
+                        pointermoveNoCaptureGot1 = true;
+                        // Third, drag the mouse from btnCapture, target1 to target0.
+                        new test_driver.Actions()
+                            .pointerMove(0, 0, {origin: btnCapture})
+                            .pointerDown()
+                            .pointerMove(0, 0, {origin: target1})
+                            .pointerMove(0, 0, {origin: target0})
+                            .pointerUp()
+                            .send();
+                    }
+                });
+            }
+        </script>
+        <h1>Pointer Events Capture Test</h1>
+        <div id="complete-notice">
+            <p>The following pointer types were detected: <span id="pointertype-log"></span>.</p>
+            <p>The following events were logged: <span id="event-log"></span>.</p>
+        </div>
+        <div id="log"></div>
+    </body>
+</html>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_capture_suppressing_mouse-manual.html b/LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_capture_suppressing_mouse-manual.html
new file mode 100644 (file)
index 0000000..127b07a
--- /dev/null
@@ -0,0 +1,202 @@
+<!doctype html>
+<html>
+    <head>
+        <title>Set/Release capture</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>Pointer Events capture test</h1>
+        <h4>
+            Test Description: This test checks if setCapture/releaseCapture functions works properly. Complete the following actions:
+            <ol>
+                <li> Put your mouse over the black rectangle. pointerover and pointerenter should be logged inside of it.</li>
+                <li> Move your mouse out of the black rectangle. pointerout and pointerleave should be logged inside of it</li>
+                <li> Put your mouse over the purple rectangle. pointerover and pointerenter should be logged inside of it.</li>
+                <li> Move your mouse out of the purple rectangle. pointerout and pointerleave should be logged inside of it</li>
+                <li> Press and hold left mouse button over "Set Capture" button and move mouse a litte inside the button. "gotpointercapture", "pointerover", and "pointerenter" should be logged in the black rectangle</li>
+                <li> Put your mouse over the purple rectangle and then move it out. Nothing should happen</li>
+                <li> Put your mouse over the black rectangle and then move it out. Nothing should happen.</li>
+                <li> Put your mouse over the purple rectangle and then release left mouse button. "lostpointercapture" should be logged in the black rectangle. Move your mouse in the purple rectangle a little. "pointerout" and "pointerleave" should be logged in the black rectangle. Also "pointerover" and "pointerenter" should be logged in the purple rectangle"</li>
+            </ol>
+        </h4>
+        Test passes if the proper behaviour of the events is observed.
+        <div id="target0"></div>
+        <br>
+        <div id="target1"></div>
+        <br>
+        <input type="button" id="btnCapture" value="Set Capture">
+        <script type='text/javascript'>
+            var isPointerCapture = false;
+            var isRelatedTargetValueTested = false;
+            var isTargetAuthenticityTested = false;
+            var lostPointerCaptureReceived = false;
+            var count = 0;
+            var event_log = [];
+
+            var detected_pointertypes = {};
+            add_completion_callback(end_of_test);
+            function end_of_test() {
+                showLoggedEvents();
+                showPointerTypes();
+            }
+
+            var target0 = document.getElementById('target0');
+            var target1 = document.getElementById('target1');
+            var captureButton = document.getElementById('btnCapture');
+
+            var test_gotpointercapture = async_test("gotpointercapture event received");
+            var test_lostpointercapture = async_test("lostpointercapture event received");
+
+            var test_pointerover_no_capture = async_test("pointerover event without capture received");
+            var test_pointerover_capture = async_test("pointerover event with capture received");
+
+            var test_pointerout_no_capture = async_test("pointerout event without capture received");
+            var test_pointerout_after_capture = async_test("pointerout event after lostpointercapture received");
+
+            var test_pointerenter_no_capture = async_test("pointerenter event without capture received");
+            var test_pointerenter_capture = async_test("pointerenter event with capture received");
+
+            var test_pointerleave_no_capture = async_test("pointerleave event without capture received");
+            var test_pointerleave_after_capture = async_test("pointerleave event after lostpointercapture received");
+
+            window.onload = function() {
+                on_event(captureButton, 'pointerdown', function(e) {
+                    if(isPointerCapture == false) {
+                        sPointerCapture(e);
+                        isPointerCapture = true;
+                    }
+                });
+
+                on_event(target0, 'gotpointercapture', function(e) {
+                    test_gotpointercapture.done();
+                    event_log.push('gotpointercapture@target0');
+                });
+
+                on_event(target0, 'lostpointercapture', function(e) {
+                    isPointerCapture = false;
+                    lostPointerCaptureReceived = true;
+                    test_lostpointercapture.done();
+                    event_log.push('lostpointercapture@target0');
+                });
+
+                run();
+            }
+
+            function run() {
+                on_event(target0, "pointerover", function (event) {
+                    detected_pointertypes[ event.pointerType ] = true;
+                    event_log.push('pointerover@target0');
+                    if(isPointerCapture) {
+                        test_pointerover_capture.done();
+                        if (!isRelatedTargetValueTested) {
+                            test(function() {
+                                assert_not_equals(event.relatedTarget, null, "relatedTarget should behave the same as when the capture is not set")
+                            }, "relatedTarget is not null for boundary events even when the capture is set.");
+                            isRelatedTargetValueTested = true;
+                        }
+                        var hitTest = document.elementFromPoint(event.clientX, event.clientY);
+                        if(event.target !== hitTest && !isTargetAuthenticityTested) {
+                            test(function () {
+                                assert_not_equals(event.target, hitTest, "pointerover should be fired on capture target even if the pointer it not over the capture target");
+                            }, "pointerover should trigger the black rectangle even when pointer is not over black rectangle.");
+                            isTargetAuthenticityTested = true;
+                        }
+                    }
+                    else {
+                        test_pointerover_no_capture.done();
+                    }
+                });
+
+                on_event(target0, "pointerout", function (event) {
+                    event_log.push('pointerout@target0');
+                    if(isPointerCapture) {
+                        test(function() {
+                            assert_unreached("pointerout shouldn't be sent to captured node as all the events are targeted at the capturing node");
+                        }, "pointerout shouldn't be sent to captured node as all the events are targeted at the capturing node.");
+                    }
+                    else {
+                        if (lostPointerCaptureReceived) {
+                            test_pointerout_after_capture.done();
+                        } else {
+                            test_pointerout_no_capture.done();
+                        }
+                    }
+                });
+
+                on_event(target0, "pointerenter", function (event) {
+                    event_log.push('pointerenter@target0');
+                    if(isPointerCapture) {
+                        test_pointerenter_capture.done();
+                    }
+                    else {
+                        test_pointerenter_no_capture.done();
+                    }
+                });
+
+                on_event(target0, "pointerleave", function (event) {
+                    event_log.push('pointerleave@target0');
+                    if(isPointerCapture) {
+                        test(function() {
+                            assert_unreached("pointerleave shouldn't be sent to captured node as all the events are targeted at the capturing node");
+                        }, "pointerleave shouldn't be sent to captured node as all the events are targeted at the capturing node.");
+                    }
+                    else {
+                        if (lostPointerCaptureReceived) {
+                            test_pointerleave_after_capture.done();
+                        } else {
+                            test_pointerleave_no_capture.done();
+                        }
+                    }
+                });
+
+                // fail if capture is set but event is received for the non-captured target
+                on_event(target1, "pointerover", function (event) {
+                    event_log.push('pointerover@target1');
+                    if(isPointerCapture == true) {
+                        test(function() {
+                            assert_unreached("pointerover shouldn't trigger for this target when capture is enabled");
+                        }, "pointerover shouldn't trigger for the purple rectangle while the black rectangle has capture");
+                    }
+                });
+
+                on_event(target1, "pointerout", function (event) {
+                    event_log.push('pointerout@target1');
+                    if(isPointerCapture == true) {
+                        test(function() {
+                            assert_unreached("pointerout shouldn't trigger for this target when capture is enabled");
+                        }, "pointerout shouldn't trigger for the purple rectangle while the black rectangle has capture");
+                    }
+                });
+
+                on_event(target1, "pointerenter", function (event) {
+                    event_log.push('pointerenter@target1');
+                    if(isPointerCapture == true) {
+                        test(function() {
+                            assert_unreached("pointerenter shouldn't trigger for this target when capture is enabled");
+                        }, "pointerenter shouldn't trigger for the purple rectangle while the black rectangle has capture");
+                    }
+                });
+
+                on_event(target1, "pointerleave", function (event) {
+                    event_log.push('pointerleave@target1');
+                    if(isPointerCapture == true) {
+                        test(function() {
+                            assert_unreached("pointerleave shouldn't trigger for this target when capture is enabled");
+                        }, "pointerleave shouldn't trigger for the purple rectangle while the black rectangle has capture");
+                    }
+                });
+            }
+        </script>
+        <h1>Pointer Events Capture Test</h1>
+        <div id="complete-notice">
+            <p>The following pointer types were detected: <span id="pointertype-log"></span>.</p>
+            <p>The following events were logged: <span id="event-log"></span>.</p>
+        </div>
+        <div id="log"></div>
+    </body>
+</html>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_change-touch-action-onpointerdown_touch.html b/LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_change-touch-action-onpointerdown_touch.html
new file mode 100644 (file)
index 0000000..7b09a17
--- /dev/null
@@ -0,0 +1,147 @@
+<!doctype html>
+<html>
+    <head>
+        <title>Change touch-action on pointerdown</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="/resources/testdriver.js"></script>
+        <script src="/resources/testdriver-actions.js"></script>
+        <script src="/resources/testdriver-vendor.js"></script>
+        <script src="pointerevent_support.js"></script>
+        <style>
+            #target0 {
+            background: black;
+            width: 700px;
+            height: 430px;
+            color: white;
+            overflow-y: auto;
+            overflow-x: auto;
+            white-space: nowrap;
+            }
+        </style>
+    </head>
+    <body onload="run()">
+        <h1>Pointer Events touch-action attribute support</h1>
+        <h4>Test Description: Press and hold your touch. Try to scroll text in any direction.
+            Then release your touch and try to scroll again. Expected: no panning.
+        </h4>
+        <p>Note: this test is for touch-devices only</p>
+        <div id="target0" style="touch-action: auto;">
+            <p>
+                Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diem
+                nonummy nibh euismod tincidunt ut lacreet dolore magna aliguam erat volutpat.
+                Ut wisis enim ad minim veniam, quis nostrud exerci tution ullamcorper suscipit
+                lobortis nisl ut aliquip ex ea commodo consequat.
+            </p>
+            <p>Lorem ipsum dolor sit amet...</p>
+            <p>Lorem ipsum dolor sit amet...</p>
+            <p>Lorem ipsum dolor sit amet...</p>
+            <p>Lorem ipsum dolor sit amet...</p>
+            <p>Lorem ipsum dolor sit amet...</p>
+            <p>Lorem ipsum dolor sit amet...</p>
+            <p>Lorem ipsum dolor sit amet...</p>
+            <p>
+                Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diem
+                nonummy nibh euismod tincidunt ut lacreet dolore magna aliguam erat volutpat.
+                Ut wisis enim ad minim veniam, quis nostrud exerci tution ullamcorper suscipit
+                lobortis nisl ut aliquip ex ea commodo consequat.
+            </p>
+            <p>Lorem ipsum dolor sit amet...</p>
+            <p>Lorem ipsum dolor sit amet...</p>
+            <p>Lorem ipsum dolor sit amet...</p>
+            <p>Lorem ipsum dolor sit amet...</p>
+            <p>Lorem ipsum dolor sit amet...</p>
+            <p>Lorem ipsum dolor sit amet...</p>
+            <p>Lorem ipsum dolor sit amet...</p>
+            <p>
+                Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diem
+                nonummy nibh euismod tincidunt ut lacreet dolore magna aliguam erat volutpat.
+                Ut wisis enim ad minim veniam, quis nostrud exerci tution ullamcorper suscipit
+                lobortis nisl ut aliquip ex ea commodo consequat.
+            </p>
+            <p>Lorem ipsum dolor sit amet...</p>
+            <p>Lorem ipsum dolor sit amet...</p>
+            <p>Lorem ipsum dolor sit amet...</p>
+            <p>Lorem ipsum dolor sit amet...</p>
+            <p>Lorem ipsum dolor sit amet...</p>
+            <p>Lorem ipsum dolor sit amet...</p>
+            <p>Lorem ipsum dolor sit amet...</p>
+            <p>
+                Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diem
+                nonummy nibh euismod tincidunt ut lacreet dolore magna aliguam erat volutpat.
+                Ut wisis enim ad minim veniam, quis nostrud exerci tution ullamcorper suscipit
+                lobortis nisl ut aliquip ex ea commodo consequat.
+            </p>
+            <p>Lorem ipsum dolor sit amet...</p>
+            <p>Lorem ipsum dolor sit amet...</p>
+            <p>Lorem ipsum dolor sit amet...</p>
+            <p>Lorem ipsum dolor sit amet...</p>
+            <p>Lorem ipsum dolor sit amet...</p>
+            <p>Lorem ipsum dolor sit amet...</p>
+            <p>Lorem ipsum dolor sit amet...</p>
+        </div>
+        <script type='text/javascript'>
+            var detected_pointertypes = {};
+
+            var styleIsChanged = false;
+            var scrollIsReceived = false;
+            var scrollReceivedCorrectly = false;
+            var firstTouchCompleted = false;
+            var countToPass = 50;
+            var xScr0, yScr0, xScr1, yScr1;
+
+            setup({ explicit_done: true });
+            add_completion_callback(showPointerTypes);
+
+            function run() {
+                var target0 = document.getElementById("target0");
+
+                on_event(target0, 'scroll', function(event) {
+                    if(!scrollIsReceived && firstTouchCompleted) {
+                        test(function() {
+                            failOnScroll();
+                        }, "scroll was received while shouldn't");
+                        scrollIsReceived = true;
+                    }
+                    scrollReceivedCorrectly = true;
+                });
+
+                on_event(target0, 'pointerdown', function(event) {
+                    detected_pointertypes[event.pointerType] = true;
+                    if(!styleIsChanged) {
+                        var before = document.getElementById('target0').style.touchAction;
+
+                        document.getElementById('target0').style.touchAction = 'none';
+
+                        var after = document.getElementById('target0').style.touchAction;
+
+                        test(function() {
+                            assert_true(before != after, "touch-action was changed");
+                        }, "touch-action was changed");
+
+                        styleIsChanged = true;
+                    }
+                });
+
+                on_event(target0, 'pointerup', function(event) {
+                    firstTouchCompleted = true;
+                });
+
+                // Inject touch inputs and wait for all the actions finish to end the test.
+                touchScrollInTarget(target0, 'down').then(function() {
+                    test(function () {
+                        assert_true(scrollReceivedCorrectly, "scroll should be received before the test finishes");
+                    }, "scroll should be received before the test finishes");
+                    done();
+                });
+            }
+        </script>
+        <h1>touch-action: auto to 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_click_during_capture-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_click_during_capture-expected.txt
new file mode 100644 (file)
index 0000000..2db1bcc
--- /dev/null
@@ -0,0 +1,15 @@
+Pointer Event: click event during capture
+
+Follow the test instructions with mouse. If you don't have the device skip it.
+
+Test Description: Click event should be sent to the first common ancestor of the pointerdown and pointerup targets.
+Click on the green box with the left button of mouse.
+Press down the left button on the blue box and drag to the green box and release the button.
+Repeat the two steps above once again.
+
+
+
+FAIL mouse click target during capture assert_equals: An element should only receive click when it is the first common ancestor of pointerdown and pointerup targets expected "pointerdown@green,gotpointercapture@blue,pointerup@blue,click@grey,lostpointercapture@blue" but got "pointerdown@green,gotpointercapture@blue,pointerup@blue,lostpointercapture@blue"
+PASS Click target when pointerup/down targeted at the same element with no capture 
+PASS Click target when pointerup/down targeted at different elements with no capture 
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_click_during_capture.html b/LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_click_during_capture.html
new file mode 100644 (file)
index 0000000..7f63283
--- /dev/null
@@ -0,0 +1,132 @@
+<!doctype html>
+<html>
+    <head>
+        <title>click event target during capture</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>
+        <script src="/resources/testdriver.js"></script>
+        <script src="/resources/testdriver-actions.js"></script>
+        <script src="/resources/testdriver-vendor.js"></script>
+        <style>
+        .box {
+          margin: 10px;
+        }
+        #grey {
+          background: grey;
+        }
+        #blue {
+          background: blue;
+        }
+        #green {
+          background: green;
+        }
+        </style>
+        <script type="text/javascript">
+            PhaseEnum = {
+              Phase1:               "phase1",
+              Phase2:               "phase2",
+              Phase1WithCapturing:  "phase1withcapturing",
+              Phase2WithCapturing:  "phase2withcapturing",
+            }
+            var phase;
+            var receivedEvents;
+
+            function resetTestState() {
+              phase = PhaseEnum.Phase1;
+              receivedEvents = [];
+            }
+
+            function run() {
+                var test_pointerEvent = setup_pointerevent_test("click target during capture", ['mouse']);
+                var grey = document.getElementById('grey');
+                var blue = document.getElementById('blue');
+                var green = document.getElementById('green');
+
+                ['gotpointercapture', 'lostpointercapture', 'pointerdown', 'pointerup', 'click'].forEach(function(eventName) {
+                  [grey, blue, green].forEach(function(target) {
+                    target.addEventListener(eventName, function(event) {
+                      if (event.eventPhase == event.AT_TARGET) {
+                        receivedEvents.push(event.type + '@' + target.id);
+                        if (phase == PhaseEnum.Phase1 && target == green && event.type == 'click') {
+                            test(function() {
+                              assert_equals(receivedEvents.join(','), 'pointerdown@green,pointerup@green,click@green', 'An element should only receive click when it is the first common ancestor of pointerdown and pointerup targets');
+                            }, "Click target when pointerup/down targeted at the same element with no capture");
+                            phase = PhaseEnum.Phase2;
+                            receivedEvents = [];
+                        }
+                        if (phase == PhaseEnum.Phase2 && target == grey && event.type == 'click') {
+                            test(function() {
+                              assert_equals(receivedEvents.join(','), 'pointerdown@blue,pointerup@green,click@grey', 'An element should only receive click when it is the first common ancestor of pointerdown and pointerup targets');
+                            }, "Click target when pointerup/down targeted at different elements with no capture");
+                            phase = PhaseEnum.Phase1WithCapturing;
+                            receivedEvents = [];
+                        }
+                        if (target == blue && event.type == 'lostpointercapture') {
+                          if (phase == PhaseEnum.Phase1WithCapturing) {
+                            test_pointerEvent.step(function() {
+                              assert_equals(receivedEvents.join(','), 'pointerdown@green,gotpointercapture@blue,pointerup@blue,click@grey,lostpointercapture@blue', 'An element should only receive click when it is the first common ancestor of pointerdown and pointerup targets');
+                            });
+                            phase = PhaseEnum.Phase2WithCapturing;
+                            receivedEvents = [];
+                          } else if (phase == PhaseEnum.Phase2WithCapturing) {
+                            test_pointerEvent.step(function() {
+                              assert_equals(receivedEvents.join(','), 'pointerdown@blue,gotpointercapture@blue,pointerup@blue,click@blue,lostpointercapture@blue', 'An element should only receive click when it is the first common ancestor of pointerdown and pointerup targets');
+                            });
+                            test_pointerEvent.done();
+                          }
+                        }
+                        if (event.type == 'pointerdown' && (target == blue || target == green)) {
+                          if (phase == PhaseEnum.Phase1WithCapturing || phase == PhaseEnum.Phase2WithCapturing)
+                            blue.setPointerCapture(event.pointerId);
+                        }
+                      }
+                    });
+                  });
+                });
+
+                // Inject mouse inputs.
+                var green = document.getElementById('green');
+                var blue = document.getElementById('blue');
+                new test_driver.Actions()
+                    .pointerMove(0, 0, {origin: green})
+                    .pointerDown()
+                    .pointerUp()
+                    .pointerMove(0, 0, {origin: blue})
+                    .pointerDown()
+                    .pointerMove(0, 0, {origin: green})
+                    .pointerUp()
+                    .pointerMove(0, 0, {origin: green})
+                    .pointerDown()
+                    .pointerUp()
+                    .pointerMove(0, 0, {origin: blue})
+                    .pointerDown()
+                    .pointerMove(0, 0, {origin: green})
+                    .pointerUp()
+                    .send();
+
+            }
+        </script>
+    </head>
+    <body onload="run()">
+        <h1>Pointer Event: click event during capture</h1>
+        <h2 id="pointerTypeDescription"></h2>
+        <h4>Test Description:
+            Click event should be sent to the first common ancestor of the pointerdown and pointerup targets.
+            <ol>
+                 <li>Click on the green box with the left button of mouse.</li>
+                 <li>Press down the left button on the blue box and drag to the green box and release the button.</li>
+                 <li>Repeat the two steps above once again.</li>
+            </ol>
+        </h4>
+        <br>
+        <div>
+          <div id="grey" class="box">
+            <div id="green" class="box"></div>
+            <div id="blue" class="box"></div>
+          </div>
+        </div>
+    </body>
+</html>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_disabled_form_control-manual.html b/LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_disabled_form_control-manual.html
new file mode 100644 (file)
index 0000000..20e07a9
--- /dev/null
@@ -0,0 +1,66 @@
+<!doctype html>
+<html>
+    <head>
+        <title>Pointer Events properties tests</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>
+        <script>
+            var detected_pointertypes = {};
+            var detected_eventTypes = {};
+            var eventList = ['pointerout', 'pointerover', 'pointerenter', 'pointermove', 'pointerdown', 'pointerup', 'pointerleave'];
+
+            function resetTestState() {
+                detected_eventTypes = {};
+            }
+            function run() {
+                var test_pointerEvent = setup_pointerevent_test("pointerevent attributes", ALL_POINTERS);
+                var target = document.getElementById("target0");
+
+                eventList.forEach(function(eventName) {
+                on_event(target, eventName, function (event) {
+                        detected_eventTypes[event.type] = true;
+                        detected_pointertypes[event.pointerType] = true;
+
+                        if (Object.keys(detected_eventTypes).length == eventList.length) {
+                            test_pointerEvent.done();
+                        }
+                    });
+                });
+                on_event(target, "click", function (event) {
+                    assert_unreached("click should not fire on disabled element");
+                });
+            }
+        </script>
+        <style>
+            #target0 {
+            background: purple;
+            border: 1px solid orange;
+            touch-action: none;
+            width: 200px;
+            height: 100px;
+            }
+        </style>
+    </head>
+    <body onload="run()">
+        <h1> Pointer Event: pointerevents fire to disabled form controls</h1>
+        <h2 id="pointerTypeDescription"></h2>
+        <h4>
+            Test Description:
+            Pointerevents are dispatched to disabled form controls.
+        </h4>
+        <div id="instructions">
+            Use the mouse or pen to press on the purple button. Or with touch, tap on the purple box.
+        </div>
+        <button id="target0" disabled>Disabled button</button>
+        <div id="complete-notice">
+            <p>Test complete: Scroll to Summary to view Pass/Fail Results.</p>
+            <p>The following pointer types were detected: <span id="pointertype-log"></span>.</p>
+            <p>Refresh the page to run the tests again with a different pointer type.</p>
+        </div>
+        <div id="log"></div>
+    </body>
+</html>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_element_haspointercapture-manual.html b/LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_element_haspointercapture-manual.html
new file mode 100644 (file)
index 0000000..1b479a6
--- /dev/null
@@ -0,0 +1,127 @@
+<!doctype html>
+<html>
+    <head>
+        <title>Element.hasPointerCapture 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>
+        <script type="text/javascript" src="pointerevent_support.js"></script>
+        <script>
+            var detected_pointertypes = {};
+            add_completion_callback(showPointerTypes);
+            var test_pointerEvent = async_test("hasPointerCapture");
+            var listening_events = [
+                "pointerover",
+                "pointerenter",
+                "pointerout",
+                "pointerleave",
+                "pointermove",
+                "gotpointercapture"
+            ];
+            var set_capture_to_target0 = false;
+
+            function run() {
+                var target0 = document.getElementById("target0");
+                var target1 = document.getElementById("target1");
+
+                on_event(target0, "pointerdown", function (e) {
+                    detected_pointertypes[e.pointerType] = true;
+                    test_pointerEvent.step(function () {
+                        assert_equals(target0.hasPointerCapture(e.pointerId), false,
+                                      "before target0.setPointerCapture, target0.hasPointerCapture should be false");
+                    });
+                    target1.setPointerCapture(e.pointerId);
+                    test_pointerEvent.step(function () {
+                        assert_equals(target0.hasPointerCapture(e.pointerId), false,
+                                      "after target1.setPointerCapture, target0.hasPointerCapture should be false");
+                        assert_equals(target1.hasPointerCapture(e.pointerId), true,
+                                      "after target1.setPointerCapture, target1.hasPointerCapture should be true");
+                    });
+                    target0.setPointerCapture(e.pointerId);
+                    set_capture_to_target0 = true;
+                    // hasPointerCapture will return true immediately after a call to setPointerCapture
+                    test_pointerEvent.step(function () {
+                        assert_equals(target0.hasPointerCapture(e.pointerId), true,
+                                      "after target0.setPointerCapture, target0.hasPointerCapture should be true");
+                    });
+                    // hasPointerCapture will return false immediately after a call to releasePointerCapture
+                    target0.releasePointerCapture(e.pointerId);
+                    set_capture_to_target0 = false;
+                    test_pointerEvent.step(function () {
+                        assert_equals(target0.hasPointerCapture(e.pointerId), false,
+                                      "after target0.releasePointerCapture, target0.hasPointerCapture should be false");
+                        assert_equals(target1.hasPointerCapture(e.pointerId), false,
+                                      "after target0.releasePointerCapture, target1.hasPointerCapture should be false");
+                    });
+                    target0.setPointerCapture(e.pointerId);
+                    set_capture_to_target0 = true;
+                    test_pointerEvent.step(function () {
+                        assert_equals(target0.hasPointerCapture(e.pointerId), true,
+                                      "after target0.setPointerCapture, target0.hasPointerCapture should be true");
+                    });
+                    // If the element.hasPointerCapture is false element.releasePointerCapture does nothing
+                    target1.releasePointerCapture(e.pointerId);
+                    test_pointerEvent.step(function () {
+                        assert_equals(target0.hasPointerCapture(e.pointerId), true,
+                                      "while target1.hasPointerCapture is false, target1.releasePointerCapture should not change hasPointerCapture");
+                    });
+                });
+
+                for (var i = 0; i < listening_events.length; i++) {
+                    on_event(target0, listening_events[i], function (e) {
+                        test_pointerEvent.step(function () {
+                            assert_equals(target0.hasPointerCapture(e.pointerId), set_capture_to_target0,
+                                          "Received " + e.type + " target0.hasPointerCapture should be " + set_capture_to_target0);
+                        });
+                    });
+                }
+
+                on_event(target0, "pointerup", function (e) {
+                    // Immediately after firing the pointerup or pointercancel events, a user agent must clear
+                    // the pending pointer capture target override for the pointerId, and then run
+                    // "Process Pending Pointer Capture" steps to fire lostpointercapture if necessary.
+                    test_pointerEvent.step(function () {
+                        assert_equals(target0.hasPointerCapture(e.pointerId), true,
+                                      "pointerup target0.hasPointerCapture should be true");
+                    });
+                    set_capture_to_target0 = false;
+                });
+
+                on_event(target0, "lostpointercapture", function (e) {
+                    test_pointerEvent.step(function () {
+                        assert_equals(target0.hasPointerCapture(e.pointerId), false,
+                                      "pointerup target0.hasPointerCapture should be false");
+                    });
+                });
+
+                on_event(target1, "pointerup", function (e) {
+                    test_pointerEvent.step(function () {
+                        assert_equals(target1.hasPointerCapture(e.pointerId), false,
+                                      "pointerup target1.hasPointerCapture should be false");
+                    });
+                    test_pointerEvent.done();
+                });
+            }
+        </script>
+    </head>
+    <body onload="run()">
+        <h1>Element.hasPointerCapture test</h1>
+        <h4>
+            Test Description: This test checks if Element.hasPointerCapture returns value correctly
+            <ol>
+                <li> Press black rectangle and do not release
+                <li> Move your pointer to purple rectangle
+                <li> Release the pointer
+                <li> Click purple rectangle
+            </ol>
+        </h4>
+        <p>
+        <div id="target0" touch-action:none></div>
+        <div id="target1" touch-action:none></div>
+        <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_element_haspointercapture_release_pending_capture-manual.html b/LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_element_haspointercapture_release_pending_capture-manual.html
new file mode 100644 (file)
index 0000000..17ad3e2
--- /dev/null
@@ -0,0 +1,73 @@
+<!doctype html>
+<html>
+    <head>
+        <title>Element.hasPointerCapture test after the pending pointer capture element releases pointer capture</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 type="text/javascript" src="pointerevent_support.js"></script>
+        <script>
+            var detected_pointertypes = {};
+            add_completion_callback(showPointerTypes);
+            var test_pointerEvent = async_test("hasPointerCapture test after the pending pointer capture element releases pointer capture");
+
+            function run() {
+                var target0 = document.getElementById("target0");
+                var target1 = document.getElementById("target1");
+
+                on_event(target0, "pointerdown", function (e) {
+                    detected_pointertypes[e.pointerType] = true;
+                    target0.setPointerCapture(e.pointerId);
+                    test_pointerEvent.step(function () {
+                        assert_equals(target0.hasPointerCapture(e.pointerId), true, "After target0.setPointerCapture, target0.hasPointerCapture should return true");
+                    });
+                });
+
+                on_event(target0, "gotpointercapture", function (e) {
+                    test_pointerEvent.step(function () {
+                        assert_equals(target0.hasPointerCapture(e.pointerId), true, "After target0 received gotpointercapture, target0.hasPointerCapture should return true");
+                    });
+                    target1.setPointerCapture(e.pointerId);
+                    test_pointerEvent.step(function () {
+                        assert_equals(target0.hasPointerCapture(e.pointerId), false, "After target1.setPointerCapture, target0.hasPointerCapture should return false");
+                        assert_equals(target1.hasPointerCapture(e.pointerId), true, "After target1.setPointerCapture, target1.hasPointerCapture should return true");
+                    });
+                    target1.releasePointerCapture(e.pointerId);
+                    test_pointerEvent.step(function () {
+                        assert_equals(target0.hasPointerCapture(e.pointerId), false, "After target1.releasePointerCapture, target0.hasPointerCapture should be false");
+                        assert_equals(target1.hasPointerCapture(e.pointerId), false, "After target1.releasePointerCapture, target1.hasPointerCapture should be false");
+                    });
+                });
+
+                on_event(target1, "gotpointercapture", function (e) {
+                    test_pointerEvent.step(function () {
+                        assert_true(false, "target1 should never receive gotpointercapture in this test");
+                    });
+                });
+
+                on_event(target0, "lostpointercapture", function (e) {
+                    test_pointerEvent.done();
+                });
+            }
+        </script>
+    </head>
+    <body onload="run()">
+        <h1>Element.hasPointerCapture test after the pending pointer capture element releases pointer capture</h1>
+        <h4>
+            Test Description: This test checks if Element.hasPointerCapture returns value correctly after the pending pointer capture element releases pointer capture
+            <ol>
+                <li> Press black rectangle and do not release
+                <li> Move your pointer to purple rectangle
+                <li> Release the pointer
+            </ol>
+        </h4>
+        <p>
+        <div id="target0" touch-action:none></div>
+        <div id="target1" touch-action:none></div>
+        <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_fractional_coordinates-manual.html b/LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_fractional_coordinates-manual.html
new file mode 100644 (file)
index 0000000..e0e2fdc
--- /dev/null
@@ -0,0 +1,98 @@
+<!doctype html>
+<html>
+    <head>
+        <title>Pointer Events coordinates can have fractional value<</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 type="text/javascript" src="pointerevent_support.js"></script>
+        <style>
+            #innerFrame {
+                transform: scale(5);
+                width: 60px;
+                height: 60px;
+                margin-left: 120px;
+                margin-top: 120px;
+                border: 0.01px solid black;
+            }
+        </style>
+        <script>
+            var eventList = [
+                  "pointerdown",
+                  "pointerup",
+                  "pointermove",
+                  "pointerover",
+                  "pointerout",
+                  "pointerenter",
+                  "pointerleave"];
+            var eventsRecieved = {};
+            var clickedTargetList = [];
+
+            function resetTestState() {
+                eventsRecieved = {};
+                clickedTargetList = [];
+                ['s1', 's2', 's3'].forEach(function(id){
+                    var target = document.getElementById('innerFrame').contentDocument.getElementById(id);
+                    target.style.background = "black"
+                });
+            }
+
+            function checkPointerEventCoordinates(event) {
+              if (event.clientX != Math.floor(event.clientX) || event.clientY != Math.floor(event.clientY))
+                eventsRecieved[event.type] = true;
+            }
+
+            function run() {
+                var test_pointerEvent = setup_pointerevent_test("pointerevent events in capturing", ALL_POINTERS);
+                var innerFrame = document.getElementById('innerFrame');
+                var innerDocument = innerFrame.contentDocument;
+                ['s1', 's2', 's3'].forEach(function(id){
+                    var target = innerDocument.getElementById(id);
+                    eventList.forEach(function(eventName) {
+                        on_event(target, eventName, checkPointerEventCoordinates);
+                    });
+
+                    on_event(target, "click", function (event) {
+                      if (!(event.target.id in clickedTargetList)) {
+                          clickedTargetList.push(event.target.id);
+                          event.target.style.background = "red"
+                      }
+                      if (clickedTargetList.length == 3) {
+                          test(function () {
+                              if (Object.keys(eventsRecieved).length != eventList.length){
+                                  eventList.forEach(function(eventName){
+                                     assert_true(eventName in eventsRecieved, eventName + " should have fractional coordinates");
+                                  });
+                              }
+                          }, expectedPointerType);
+                          test_pointerEvent.done();
+                      }
+                    });
+                });
+            }
+        </script>
+    </head>
+    <body onload="run()">
+        <h1>Pointer Events coordinates support fractional value</h1>
+        <h2 id="pointerTypeDescription"></h2>
+        <h4>
+            Test Description: This test checks pointer events has fractional client coordinates
+            <ol>
+                 <li>Move your pointer over one black square</li>
+                 <li>Press down the pointer (i.e. press left button with mouse or touch the screen with finger or pen).</li>
+                 <li>Release the pointer.</li>
+                 <li>Move to next black square and repreat 2 and 3</li>
+            </ol>
+
+            Test passes if pointer events has fractional coordinates.
+        </h4>
+        <iframe id=innerFrame src="resources/pointerevent_fractional_coordinates-iframe.html"></iframe>
+        <div id="complete-notice">
+            <p>The following pointer types were detected: <span id="pointertype-log"></span>.</p>
+            <p>Refresh the page to run the tests again with a different pointer type.</p>
+        </div>
+        <div id="log"></div>
+    </body>
+</html>
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_lostpointercapture_for_disconnected_node.html b/LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_lostpointercapture_for_disconnected_node.html
new file mode 100644 (file)
index 0000000..b77d9e3
--- /dev/null
@@ -0,0 +1,99 @@
+<!doctype html>
+<html>
+    <head>
+        <title>Lostpointercapture fires on document when target is removed</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="/resources/testdriver.js"></script>
+        <script src="/resources/testdriver-actions.js"></script>
+        <script src="/resources/testdriver-vendor.js"></script>
+        <script src="pointerevent_support.js"></script>
+    </head>
+    <body>
+        <h1>Pointer Events - lostpointercapture when capturing element is removed</h1>
+        <h4>
+            Test Description:
+            This test checks if lostpointercapture is fired at the document when the capturing node is removed from the document.
+            Complete the following actions:
+            <ol>
+                <li>Press and hold left mouse button over "Set Capture" button. "gotpointercapture" should be logged inside of the black rectangle.
+                <li>"lostpointercapture" should be logged inside of the black rectangle after a short delay.
+            </ol>
+        </h4>
+        <div id="target0"></div>
+        <div id="target1" style="background:black; color:white"></div>
+        <br>
+        <input type="button" id="btnCapture" value="Set Capture">
+        <script type='text/javascript'>
+            var isDisconnected = false;
+            var count = 0;
+            var event_log = [];
+
+            var detected_pointertypes = {};
+            add_completion_callback(end_of_test);
+            function end_of_test() {
+                showLoggedEvents();
+                showPointerTypes();
+            }
+
+            var target0 = document.getElementById('target0');
+            var target1 = document.getElementById('target1');
+            var captureButton = document.getElementById('btnCapture');
+
+            var test_lostpointercapture = async_test("lostpointercapture event received");
+
+            window.onload = function() {
+                var actions_promise;
+
+                on_event(captureButton, 'pointerdown', function(event) {
+                    detected_pointertypes[event.pointerType] = true;
+                    target0.setPointerCapture(event.pointerId);
+                });
+
+                on_event(target0, 'gotpointercapture', function(e) {
+                    event_log.push('gotpointercapture@target1');
+                    isDisconnected = true;
+                    target0.parentNode.removeChild(target0);
+                });
+
+                on_event(target0, 'lostpointercapture', function(e) {
+                    event_log.push('lostpointercapture@target0');
+                    test(function() {
+                        // TA: 11.3
+                        assert_unreached("lostpointercapture must be fired on the document, not the capturing element");
+                    }, "lostpointercapture must not be dispatched on the disconnected node");
+                });
+
+                on_event(document, 'lostpointercapture', function(e) {
+                    event_log.push('lostpointercapture@document');
+                    test(function() {
+                        // TA: 11.3
+                        assert_true(isDisconnected, "lostpointercapture must be fired on the document");
+                    }, "lostpointercapture is dispatched on the document");
+
+                    actions_promise.then( () => {
+                      test_lostpointercapture.done();
+                    });
+                });
+
+                // Inject mouse inputs.
+                actions_promise = new test_driver.Actions()
+                    .pointerMove(0, 0, {origin: captureButton})
+                    .pointerDown()
+                    .pointerMove(2, 0, {origin: captureButton})
+                    .pointerMove(5, 0, {origin: captureButton})
+                    .pointerMove(8, 0, {origin: captureButton})
+                    .pointerMove(10, 0, {origin: captureButton})
+                    .send();
+            }
+        </script>
+        <h1>Pointer Events Capture Test</h1>
+        <div id="complete-notice">
+            <p>The following pointer types were detected: <span id="pointertype-log"></span>.</p>
+            <p>The following events were logged: <span id="event-log"></span>.</p>
+        </div>
+        <div id="log"></div>
+    </body>
+</html>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_lostpointercapture_is_first.html b/LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_lostpointercapture_is_first.html
new file mode 100644 (file)
index 0000000..6ce0f3e
--- /dev/null
@@ -0,0 +1,147 @@
+<!doctype html>
+<html>
+    <head>
+        <title>Lostpointercapture triggers first and asynchronously</title>
+        <meta name="assert" content="TA5.2.10: A user agent must fire a pointer event named lostpointercapture after pointer capture is released for a pointer. This event must be fired prior to any subsequent events for the pointer after capture was released. This event is fired at the element from which pointer capture was removed;">
+        <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="/resources/testdriver.js"></script>
+        <script src="/resources/testdriver-actions.js"></script>
+        <script src="/resources/testdriver-vendor.js"></script>
+        <script src="pointerevent_support.js"></script>
+    </head>
+    <body onload="run()">
+        <h1>Pointer Events capture test - lostpointercapture order</h1>
+        <h4>
+            Test Description:
+            This test checks if lostpointercapture is handled asynchronously and prior to all subsequent events.
+            Complete the following actions:
+            <ol>
+                <li>Press and hold left mouse button over "Set Capture" button and move a little. "gotpointercapture" should be logged inside of the black rectangle
+                <li>"lostpointercapture" should be logged inside of the black rectangle after pointerup
+            </ol>
+        </h4>
+        Test passes if lostpointercapture is dispatched after releasing the mouse button and before any additional pointer events.
+        <div id="target0" style="background:black; color:white"></div>
+        <br>
+        <input type="button" id="btnCapture" value="Set Capture">
+        <script type='text/javascript'>
+            var detected_pointertypes = {};
+            var detected_pointerEvents = new Array();
+            var pointerdown_event = null;
+            var firstPointermoveReceived = false; // To handle the first pointermove right after gotpointercapture which gotpointercapture was sent right before it.
+            var firstPointeroverReceived = false; // To handle the first pointerover right after gotpointercapture which gotpointercapture was sent right before it.
+            var firstPointerenterReceived = false; // To handle the first pointeenter right after gotpointercapture which gotpointercapture was sent right before it.
+
+            var test_pointerEvent = async_test("lostpointercapture is dispatched prior to subsequent events"); // set up test harness
+
+            var isPointerCapture = false;
+            var count=0;
+
+            var testStarted = false;
+            var eventRcvd = false;
+            var isAsync = false;
+            var event_log = [];
+
+            add_completion_callback(end_of_test);
+            function end_of_test() {
+                showLoggedEvents();
+                showPointerTypes();
+            }
+
+            var target0 = document.getElementById('target0');
+            var captureButton = document.getElementById('btnCapture');
+
+            function run() {
+                on_event(captureButton, 'pointerdown', function(event) {
+                    detected_pointertypes[event.pointerType] = true;
+                    pointerdown_event = event;
+                    if(isPointerCapture == false) {
+                        isPointerCapture = true;
+                        captureButton.value = 'Release Capture';
+                        sPointerCapture(event);
+                    }
+                });
+
+                // TA5.1.3.1: Process Pending Pointer Capture
+                // Whenever a user agent is to fire a Pointer Event that is not gotpointercapture or lostpointercapture,
+                // it must first run the steps of processing pending pointer capture
+                //
+                // TA5.2.12: The lostpointercapture event
+                // After pointer capture is released for a pointer, and prior to any subsequent events for the pointer,
+                // the lostpointercapture event must be dispatched to the element from which pointer capture was removed.
+                // listen to all events
+                for (var i = 0; i < All_Pointer_Events.length; i++) {
+                    on_event(target0, All_Pointer_Events[i], function (event) {
+                        // if the event was gotpointercapture, just log it and return
+                        if (event.type == "gotpointercapture") {
+                            testStarted = true;
+                            rPointerCapture(event);
+                            isAsync = true;
+                            event_log.push('gotpointercapture@target0');
+                            return;
+                        }
+                        else if (event.type == "lostpointercapture") {
+                            event_log.push('lostpointercapture@target0');
+                            captureButton.value = 'Set Capture';
+                            isPointerCapture = false;
+
+                            // TA: 11.2
+                            test_pointerEvent.step(function () {
+                                assert_true(isAsync, "lostpointercapture must be fired asynchronously");
+                             });
+
+                            // if any events except pointerup have been received with same pointerId before lostpointercapture, then fail
+                            var eventsRcvd_str = "";
+                            if (eventRcvd) {
+                                eventsRcvd_str = "Events received before lostpointercapture: ";
+                                for (var i = 0; i < detected_pointerEvents.length; i++) {
+                                    eventsRcvd_str += detected_pointerEvents[i] + ", ";
+                                }
+                            }
+                            test_pointerEvent.step(function () {
+                                assert_false(eventRcvd, "no other events should be received before lostpointercapture." + eventsRcvd_str);
+                                assert_equals(event.pointerId, pointerdown_event.pointerId, "pointerID is same for pointerdown and lostpointercapture");
+                            });
+                            test_pointerEvent.done(); // complete test
+                        }
+                        else {
+                            if (testStarted && pointerdown_event != null && pointerdown_event.pointerId === event.pointerId) {
+                                if (event.type == "pointermove" && !firstPointermoveReceived) {
+                                  firstPointermoveReceived = true;
+                                }
+                                else if (event.type == "pointerenter" && !firstPointerenterReceived) {
+                                  firstPointerenterReceived = true;
+                                }
+                                else if (event.type == "pointerover" && !firstPointeroverReceived) {
+                                  firstPointeroverReceived = true;
+                                }
+                                else if (event.type != "pointerup") {
+                                    detected_pointerEvents.push(event.type);
+                                    eventRcvd = true;
+                                }
+                            }
+                        }
+                    });
+                }
+
+                // Inject mouse inputs.
+                new test_driver.Actions()
+                    .pointerMove(0, 0, {origin: captureButton})
+                    .pointerDown()
+                    .pointerMove(2, 0, {origin: captureButton})
+                    .pointerMove(5, 0, {origin: captureButton})
+                    .pointerUp()
+                    .send();
+            }
+        </script>
+        <h1>Pointer Events Capture Test</h1>
+        <div id="complete-notice">
+            <p>The following pointer types were detected: <span id="pointertype-log"></span>.</p>
+            <p>The following events were logged: <span id="event-log"></span>.</p>
+        </div>
+        <div id="log"></div>
+    </body>
+</html>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_mouse_capture_change_hover-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_mouse_capture_change_hover-expected.txt
new file mode 100644 (file)
index 0000000..801620b
--- /dev/null
@@ -0,0 +1,5 @@
+
+FAIL Mouse down and capture to green. assert_array_equals: Received events: green received pointerover,green received pointerenter,green received pointermove,green received pointerdown,green received gotpointercapture,green received pointermove,green received pointerout,green received pointerleave,green received pointerover,green received pointerenter,green received pointermove lengths differ, expected 7 got 11
+FAIL Mouse down at green and capture to blue. assert_array_equals: Received events: green received pointerout,green received pointerover,green received pointerenter,green received pointermove,green received pointerdown,green received lostpointercapture,blue received gotpointercapture,blue received pointermove,blue received pointermove lengths differ, expected 11 got 9
+FAIL Mouse down and capture to green, move to blue and release capture assert_array_equals: Received events: blue received pointerout,blue received pointerover,blue received pointerenter,blue received pointermove,blue received pointerdown,blue received pointerout,blue received pointerleave,blue received pointerover,blue received pointerenter,blue received pointermove,blue received pointermove lengths differ, expected 12 got 11
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_mouse_capture_change_hover.html b/LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_mouse_capture_change_hover.html
new file mode 100644 (file)
index 0000000..10b19f8
--- /dev/null
@@ -0,0 +1,167 @@
+<!DOCTYPE HTML>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/resources/testdriver.js"></script>
+<script src="/resources/testdriver-vendor.js"></script>
+<script src="/resources/testdriver-actions.js"></script>
+<style>
+body {
+  user-select: none;
+}
+#green:hover {
+  background-color: red;
+}
+#blue:hover {
+  background-color: red;
+}
+#green {
+  background-color: green;
+}
+#blue {
+  background-color: blue;
+}
+div.box {
+  margin: 5px;
+  padding: 20px;
+  width: 50px;
+  height: 50px;
+}
+</style>
+<body onload="run()">
+  <div id="green" class="box"></div>
+  <div id="blue" class="box"></div>
+</body>
+<script>
+var receivedEventList = [];
+var setcapture = "";
+
+let testEventList = ['pointerup', 'pointerdown', 'pointermove', 'gotpointercapture', 'lostpointercapture', "pointerover", "pointerout", "pointerleave", "pointerenter"];
+testEventList.forEach(function(eventName) {
+  green.addEventListener(eventName, logEvent);
+  blue.addEventListener(eventName, logEvent);
+});
+
+function logEvent(event) {
+  receivedEventList.push(event.target.id + " received " + event.type)
+}
+
+function setCaptureGreen(event) {
+  green.setPointerCapture(event.pointerId);
+}
+
+function setCaptureBlue(event) {
+  blue.setPointerCapture(event.pointerId);
+}
+
+function releaseCapture(event) {
+  if (event.target.hasPointerCapture(event.pointerId)) {
+    event.target.releasePointerCapture(event.pointerId);
+  }
+}
+
+function run() {
+  promise_test (async() => {
+    // Move to (0, 0) to reset hovering.
+    await new test_driver.Actions().pointerMove(0, 0).send();
+    receivedEventList = [];
+
+    // pointerdown at green -> set capture to green -> green receive the following moves.
+    document.addEventListener("pointerdown", setCaptureGreen);
+
+    await new test_driver.Actions()
+                         .pointerMove(25, 25, {origin: green})
+                         .pointerDown()
+                         .pointerMove(30, 30, {origin: green})
+                         .pointerMove(25, 25, {origin: blue})
+                         .send();
+
+    expectedEventList = ["green received pointerover",
+                         "green received pointerenter",
+                         "green received pointermove",
+                         "green received pointerdown",
+                         "green received gotpointercapture",
+                         "green received pointermove",
+                         "green received pointermove"];
+
+    assert_array_equals(receivedEventList, expectedEventList, "Received events: " + receivedEventList);
+    assert_equals(getComputedStyle(green).backgroundColor, "rgb(255, 0, 0)", "green should be red (hover).");
+    assert_equals(getComputedStyle(blue).backgroundColor, "rgb(0, 0, 255)", "blue should be blue.");
+    document.removeEventListener("pointerdown", setCaptureGreen);
+    // Release mouse button.
+    await new test_driver.Actions().pointerUp().send();
+  }, "Mouse down and capture to green.");
+
+  promise_test (async() => {
+    // Move to (0, 0) to reset hovering.
+    await new test_driver.Actions().pointerMove(0, 0).send();
+    receivedEventList = [];
+
+    // pointerdown at green -> set capture to blue -> blue receive the following moves.
+    document.addEventListener("pointerdown", setCaptureBlue);
+
+    await new test_driver.Actions()
+                         .pointerMove(25, 25, {origin: green})
+                         .pointerDown()
+                         .pointerMove(30, 30, {origin: green})
+                         .pointerMove(30, 30, {origin: green})
+                         .send();
+
+    expectedEventList = ["green received pointerover",
+                         "green received pointerenter",
+                         "green received pointermove",
+                         "green received pointerdown",
+                         "green received pointerout",
+                         "green received pointerleave",
+                         "blue received pointerover",
+                         "blue received pointerenter",
+                         "blue received gotpointercapture",
+                         "blue received pointermove",
+                         "blue received pointermove"];
+
+    assert_array_equals(receivedEventList, expectedEventList, "Received events: " + receivedEventList);
+    assert_equals(getComputedStyle(green).backgroundColor, "rgb(0, 128, 0)", "green should be green.");
+    assert_equals(getComputedStyle(blue).backgroundColor, "rgb(255, 0, 0)", "blue should be red (hover).");
+    document.removeEventListener("pointerdown", setCaptureBlue);
+    // Release mouse button.
+    await new test_driver.Actions().pointerUp().send();
+  }, "Mouse down at green and capture to blue.");
+
+  promise_test (async() => {
+    // Move to (0, 0) to reset hovering.
+    await new test_driver.Actions().pointerMove(0, 0).send();
+    receivedEventList = [];
+
+    // pointerdown at green -> set capture to green -> green receive first move -> release capture -> blue receive the next move
+    green.addEventListener("pointerdown", setCaptureGreen);
+    green.addEventListener("pointermove", releaseCapture);
+
+    await new test_driver.Actions()
+                         .pointerMove(25, 25, {origin: green})
+                         .pointerDown()
+                         .pointerMove(30, 30, {origin: blue})
+                         .pointerMove(25, 25, {origin: blue})
+                         .send();
+
+    expectedEventList = ["green received pointerover",
+                         "green received pointerenter",
+                         "green received pointermove",
+                         "green received pointerdown",
+                         "green received gotpointercapture",
+                         "green received pointermove",
+                         "green received lostpointercapture",
+                         "green received pointerout",
+                         "green received pointerleave",
+                         "blue received pointerover",
+                         "blue received pointerenter",
+                         "blue received pointermove"]
+
+    assert_array_equals(receivedEventList, expectedEventList, "Received events: " + receivedEventList);
+    assert_equals(getComputedStyle(green).backgroundColor, "rgb(0, 128, 0)", "green should be green.");
+    assert_equals(getComputedStyle(blue).backgroundColor, "rgb(255, 0, 0)", "blue should be red (hover).");
+    green.removeEventListener("pointerdown", setCaptureBlue);
+    green.removeEventListener("pointermove", releaseCapture);
+    // Release mouse button.
+    await new test_driver.Actions().pointerUp().send();
+  }, "Mouse down and capture to green, move to blue and release capture");
+}
+</script>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_mouse_pointercapture_in_frame-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_mouse_pointercapture_in_frame-expected.txt
new file mode 100644 (file)
index 0000000..1e64cf1
--- /dev/null
@@ -0,0 +1,7 @@
+
+
+PASS Test pointer capture event route across the same-origin frame: Mouse down at inner frame and set pointer capture. 
+PASS Test pointer capture event route across the same-origin frame: Mouse down at outer frame body and set pointer capture. 
+PASS Test pointer capture event route across the same-origin frame: Mouse down with set capture at inner frame, then release on next mouse move. 
+PASS Test pointercapture event route across the same-origin frame: Mouse down with set capture at outer frame, then release on next mouse move. 
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_mouse_pointercapture_in_frame.html b/LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_mouse_pointercapture_in_frame.html
new file mode 100644 (file)
index 0000000..83b4c1b
--- /dev/null
@@ -0,0 +1,143 @@
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/resources/testdriver.js"></script>
+<script src="/resources/testdriver-vendor.js"></script>
+<script src="/resources/testdriver-actions.js"></script>
+<style>
+iframe {
+  width: 300px;
+  height: 300px;
+  top: 100px;
+  left: 100px;
+  border: 0;
+  position: absolute;
+  background: green;
+}
+#outerFrame {
+  width: 500px;
+  height: 500px;
+  background: blue;
+}
+</style>
+<body id="outerFrame body" onload="run()">
+<div id='outerFrame'>
+<iframe id='innerFrameElement' src="resources/pointerevent_mouse_pointercapture-iframe.html"></iframe>
+</div>
+</body>
+<script>
+var receivedEventList = [];
+function handleEvent(event) {
+  receivedEventList.push(event.target.id + ' received ' + event.type);
+
+  if (event.type == 'pointerdown') {
+    if (document.setPointerCaptureOnPointerDown) {
+      event.target.setPointerCapture(event.pointerId);
+    }
+  }
+
+  if (event.type == "pointermove") {
+    if (document.releasePointerCaptureOnFirstMove && event.target.hasPointerCapture(event.pointerId))
+        event.target.releasePointerCapture(event.pointerId);
+  }
+};
+
+document.testEventList = ['pointerup', 'pointerdown', 'pointermove', 'gotpointercapture', 'lostpointercapture'];
+document.testEventList.forEach(function(eventName) {
+  document.getElementById('outerFrame').addEventListener(eventName, handleEvent);
+});
+
+document.setPointerCaptureOnPointerDown = false;
+document.releasePointerCaptureOnFirstMove = false;
+
+function run() {
+    promise_test (async() => {
+        document.setPointerCaptureOnPointerDown = true;
+        receivedEventList = [];
+        expectedEventList = ["innerFrame received pointermove",
+                             "innerFrame received pointerdown",
+                             "innerFrame received gotpointercapture",
+                             "innerFrame received pointermove",
+                             "innerFrame received pointermove",
+                             "innerFrame received pointerup",
+                             "innerFrame received lostpointercapture"];
+        await new test_driver.Actions()
+                             .pointerMove(200, 200)
+                             .pointerDown()
+                             .pointerMove(150, 150)
+                             .pointerMove(50, 50)
+                             .pointerUp()
+                             .send();
+        assert_array_equals(receivedEventList, expectedEventList, "Received events: " + receivedEventList);
+        document.setPointerCaptureOnPointerDown = false;
+    }, "Test pointer capture event route across the same-origin frame: Mouse down at inner frame and set pointer capture.");
+
+
+    promise_test (async() => {
+        document.setPointerCaptureOnPointerDown = true;
+        receivedEventList = [];
+        expectedEventList = ["outerFrame received pointermove",
+                             "outerFrame received pointerdown",
+                             "outerFrame received gotpointercapture",
+                             "outerFrame received pointermove",
+                             "outerFrame received pointerup",
+                             "outerFrame received lostpointercapture"];
+        await new test_driver.Actions()
+                             .pointerMove(25, 25)
+                             .pointerDown()
+                             .pointerMove(200, 200)
+                             .pointerUp()
+                             .send();
+        assert_array_equals(receivedEventList, expectedEventList, "Received events: " + receivedEventList);
+        document.setPointerCaptureOnPointerDown = false;
+    }, "Test pointer capture event route across the same-origin frame: Mouse down at outer frame body and set pointer capture.");
+
+
+    promise_test (async() => {
+        document.setPointerCaptureOnPointerDown = true;
+        document.releasePointerCaptureOnFirstMove = true;
+        receivedEventList = [];
+        expectedEventList = ["innerFrame received pointermove",
+                             "innerFrame received pointerdown",
+                             "innerFrame received gotpointercapture",
+                             "innerFrame received pointermove",
+                             "innerFrame received lostpointercapture",
+                             "innerFrameDocument received pointermove",
+                             "innerFrameDocument received pointerup",];
+        await new test_driver.Actions()
+                             .pointerMove(200, 200)
+                             .pointerDown()
+                             .pointerMove(150, 150)
+                             .pointerMove(50, 50)
+                             .pointerUp()
+                             .send();
+        assert_array_equals(receivedEventList, expectedEventList, "Received events: " + receivedEventList);
+        document.releasePointerCaptureOnFirstMove = false;
+        document.setPointerCaptureOnPointerDown = false;
+    }, "Test pointer capture event route across the same-origin frame: Mouse down with set capture at inner frame, then release on next mouse move.");
+
+
+    promise_test (async() => {
+        document.setPointerCaptureOnPointerDown = true;
+        document.releasePointerCaptureOnFirstMove = true;
+        receivedEventList = [];
+        expectedEventList = ["outerFrame received pointermove",
+                             "outerFrame received pointerdown",
+                             "outerFrame received gotpointercapture",
+                             "outerFrame received pointermove",
+                             "outerFrame received lostpointercapture",
+                             "innerFrame received pointermove",
+                             "innerFrame received pointerup"];
+        await new test_driver.Actions()
+                             .pointerMove(50, 50)
+                             .pointerDown()
+                             .pointerMove(200, 200)
+                             .pointerMove(250, 250)
+                             .pointerUp()
+                             .send();
+        assert_array_equals(receivedEventList, expectedEventList, "Received events: " + receivedEventList);
+        document.releasePointerCaptureOnFirstMove = false;
+        document.setPointerCaptureOnPointerDown = false;
+    }, "Test pointercapture event route across the same-origin frame: Mouse down with set capture at outer frame, then release on next mouse move.");
+}
+</script>
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_mouse_pointercapture_inactivate_pointer-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_mouse_pointercapture_inactivate_pointer-expected.txt
new file mode 100644 (file)
index 0000000..9995fdc
--- /dev/null
@@ -0,0 +1,4 @@
+
+
+FAIL setPointerCapture: outer frame capture pointer active in inner frame assert_unreached: It should not be possible to capture mouse pointer when it's activate in inner frame Reached unreachable code
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_mouse_pointercapture_inactivate_pointer.html b/LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_mouse_pointercapture_inactivate_pointer.html
new file mode 100644 (file)
index 0000000..524d19e
--- /dev/null
@@ -0,0 +1,55 @@
+<!doctype html>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/resources/testdriver.js"></script>
+<script src="/resources/testdriver-vendor.js"></script>
+<script src="/resources/testdriver-actions.js"></script>
+<style>
+    iframe {
+      width: 300px;
+      height: 300px;
+      top: 100px;
+      left: 50px;
+      border: 0;
+      position: absolute;
+      background: green;
+    }
+    #outerFrame {
+      width: 500px;
+      height: 500px;
+      background: blue;
+    }
+</style>
+<body onload="run()">
+    <div id='outerFrame'>
+        <iframe id='innerFrameElement' src="resources/pointerevent_mouse_pointercapture_inactivate_pointer-iframe.html"></iframe>
+    </div>
+</body>
+
+<script type="text/javascript">
+    var test_pointerEvent = async_test("setPointerCapture: outer frame capture pointer active in inner frame");
+
+    document.addEventListener("gotpointercapture", function(){
+        test_pointerEvent.step(function() {
+            assert_unreached("It should not be possible to capture mouse pointer when it's activate in inner frame");
+        });
+    })
+
+    function captureMousePointer(event) {
+        outerFrame.setPointerCapture(event.pointerId);
+    }
+
+    function finishTest() {
+        test_pointerEvent.done();
+    }
+
+    function run() {
+        new test_driver.Actions()
+            .pointerMove(200, 200)
+            .pointerDown()
+            .pointerMove(250, 250)
+            .pointerUp()
+            .send();
+    }
+</script>
+</html>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_multiple_primary_pointers_boundary_events-manual.html b/LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_multiple_primary_pointers_boundary_events-manual.html
new file mode 100644 (file)
index 0000000..eb758c7
--- /dev/null
@@ -0,0 +1,145 @@
+<!doctype html>
+<html>
+  <head>
+    <title>Pointer Event: Boundary compatibility events for multiple primary pointers</title>
+    <meta content="text/html; charset=UTF-8" http-equiv="Content-Type"/>
+    <link rel="author" title="Google" href="http://www.google.com "/>
+    <meta name="assert" content="When more than one primary pointers are active, each will have an independent sequence of pointer boundary events but the compatibilty mouse boundary events have their own sequence."/>
+    <link rel="stylesheet" type="text/css" href="pointerevent_styles.css">
+    <script src="/resources/testharness.js"></script>
+    <script src="/resources/testharnessreport.js"></script>
+    <script type="text/javascript" src="pointerevent_support.js"></script>
+    <script type="text/javascript">
+      var test_pointerEvent = async_test("Multi-pointer boundary compat events");
+      add_completion_callback(end_of_test);
+
+      var detected_pointertypes = {};
+      var event_log = [];
+
+      // These two ids help us detect two different pointing devices.
+      var first_entry_pointer_id = -1;
+      var second_entry_pointer_id = -1;
+
+      // Current node for each pointer id
+      var current_node_for_id = {};
+
+      function end_of_test() {
+          showLoggedEvents();
+          showPointerTypes();
+      }
+
+      function end_of_interaction() {
+          test(function () {
+              assert_equals(event_log.join(", "),
+                  "mouseover@target0, mouseenter@target0, mouseout@target0, mouseleave@target0, " +
+                  "mouseover@target1, mouseenter@target1, mouseout@target1, mouseleave@target1, " +
+                  "mouseover@target0, mouseenter@target0, mouseout@target0, mouseleave@target0"
+              );
+          }, "Event log");
+
+          test_pointerEvent.done(); // complete test
+      }
+
+      function log_event(label) {
+          event_log.push(label);
+      }
+
+      function run() {
+          on_event(document.getElementById("done"), "click", end_of_interaction);
+
+          var target_list = ["target0", "target1"];
+          var pointer_event_list = ["pointerenter", "pointerleave", "pointerover", "pointerout", "pointerdown"];
+          var mouse_event_list = ["mouseenter", "mouseleave", "mouseover", "mouseout"];
+
+          target_list.forEach(function(targetId) {
+              var target = document.getElementById(targetId);
+
+              pointer_event_list.forEach(function(eventName) {
+                  on_event(target, eventName, function (event) {
+                      var label = event.type + "@" + targetId;
+
+                      detected_pointertypes[event.pointerType] = true;
+
+                      if (!event.isPrimary) {
+                          test(function () {
+                              assert_unreached("Non-primary pointer " + label);
+                          }, "Non-primary pointer " + label);
+                      }
+
+                      if (event.type === "pointerenter") {
+                          var pointer_id = event.pointerId;
+                          if (current_node_for_id[pointer_id] !== undefined) {
+                              test(function () {
+                                  assert_unreached("Double entry " + label);
+                              }, "Double entry " + label);
+                          }
+                          current_node_for_id[pointer_id] = event.target;
+
+                          // Test that two different pointing devices are used
+                          if (first_entry_pointer_id === -1) {
+                              first_entry_pointer_id = pointer_id;
+                          } else if (second_entry_pointer_id === -1) {
+                              second_entry_pointer_id = pointer_id;
+                              test(function () {
+                                  assert_true(first_entry_pointer_id !== second_entry_pointer_id);
+                              }, "Different pointing devices");
+                          }
+                      } else if (event.type === "pointerleave") {
+                          var pointer_id = event.pointerId;
+                          if (current_node_for_id[pointer_id] !== event.target) {
+                              test(function () {
+                                  assert_unreached("Double exit " + label);
+                              }, "Double exit " + label);
+                          }
+                          current_node_for_id[pointer_id] = undefined;
+                      }
+                  });
+              });
+
+              mouse_event_list.forEach(function(eventName) {
+                  on_event(target, eventName, function (event) {
+                      log_event(event.type + "@" + targetId);
+                  });
+              });
+          });
+      }
+    </script>
+    <style>
+      #target0, #target1 {
+        margin: 20px;
+      }
+
+      #done {
+        margin: 20px;
+        border: 2px solid black;
+      }
+  </style>
+  </head>
+  <body onload="run()">
+    <h1>Pointer Event: Boundary compatibility events for multiple primary pointers</h1>
+    <h4>
+      When more than one primary pointers are active, each will have an independent sequence of pointer boundary events but the compatibilty mouse boundary events have their own sequence.
+    </h4>
+    Instruction:
+    <ol>
+      <li>Move the mouse directly into Target0 (without going through Target1), and then leave the mouse there unmoved.</li>
+      <li>Tap directly on Target1 with a finger or a stylus, and then lift the finger/stylus off the screen/digitizer without crossing Target1 boundary.</li>
+      <li>Move the mouse into Target0 (if not there already) and move inside it.</li>
+      <li>Click Done (without passing over Target1).</li>
+    </ol>
+    <div id="done">
+      Done
+    </div>
+    <div id="target0">
+      Target0
+    </div>
+    <div id="target1">
+      Target1
+    </div>
+    <div id="complete-notice">
+      <p>The following pointer types were detected: <span id="pointertype-log"></span>.</p>
+      <p>The following events were logged: <span id="event-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
deleted file mode 100644 (file)
index 339316a..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-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_pointerId_scope-manual.html b/LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_pointerId_scope-manual.html
new file mode 100644 (file)
index 0000000..3640cb6
--- /dev/null
@@ -0,0 +1,82 @@
+<!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 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>
+        <script>
+            var detected_pointertypes = {};
+            var test_pointerEvent = async_test("pointerId of an active pointer is the same across iframes");
+            // showPointerTypes is defined in pointerevent_support.js
+            // Requirements: the callback function will reference the test_pointerEvent object and
+            // will fail unless the async_test is created with the var name "test_pointerEvent".
+            add_completion_callback(showPointerTypes);
+            var detected_pointertypes = {};
+
+            function run() {
+                var target0 = document.getElementById("target0");
+                var pointerover_pointerId = null;
+                var pointerover_pointerType = null;
+
+                var eventList = ['pointerenter', 'pointerover', 'pointermove', 'pointerout', 'pointerleave'];
+                var receivedEvents = {};
+                var receivedEventsInnerFrame = {};
+
+
+                function checkPointerId(event, inner) {
+                    detected_pointertypes[event.pointerType] = true;
+                    var eventName = (inner ? "inner frame " : "" ) + event.type;
+                    test_pointerEvent.step(function() {
+                        assert_equals(event.pointerId, pointerover_pointerId, "PointerId of " + eventName + " is not correct");
+                        assert_equals(event.pointerType, pointerover_pointerType, "PointerType of " + eventName + " is not correct");
+                    }, eventName + ".pointerId were the same as first pointerover");
+                }
+
+                on_event(window, "message", function(event) {
+                    var pe_event = JSON.parse(event.data);
+                    receivedEventsInnerFrame[pe_event.type] = 1;
+                    checkPointerId(pe_event, true);
+                    if (Object.keys(receivedEvents).length == eventList.length && Object.keys(receivedEventsInnerFrame).length == eventList.length)
+                        test_pointerEvent.done();
+                });
+
+                eventList.forEach(function(eventName) {
+                    on_event(target0, eventName, function (event) {
+                        if (pointerover_pointerId === null && event.type == 'pointerover') {
+                            pointerover_pointerId = event.pointerId;
+                            pointerover_pointerType = event.pointerType;
+                        } else {
+                            checkPointerId(event, false);
+                        }
+                        receivedEvents[event.type] = 1;
+                    });
+               });
+            }
+        </script>
+    </head>
+    <body onload="run()">
+        <h1>Pointer Events pointerdown tests</h1>
+        Complete the following actions:
+        <ol>
+            <li>Start with your pointing device outside of black box, then move it into black box. If using touch just press in black box and don't release.
+            <li>Move your pointing device into purple box (without leaving the digitizer range if you are using hover supported pen or without releasing touch if using touch). Then move it out of the purple box.
+        </ol>
+        <div id="target0" class="touchActionNone">
+        </div>
+        <iframe src="resources/pointerevent_pointerId_scope-iframe.html" id="innerframe"></iframe>
+        <div id="complete-notice">
+            <p>The following pointer types were detected: <span id="pointertype-log"></span>.</p>
+            <p>Refresh the page to run the tests again with a different pointer type.</p>
+        </div>
+        <div id="log"></div>
+    </body>
+</html>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_pointercancel_touch.html b/LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_pointercancel_touch.html
new file mode 100644 (file)
index 0000000..a645033
--- /dev/null
@@ -0,0 +1,89 @@
+<!doctype html>
+<html>
+    <head>
+        <title>PointerCancel - touch</title>
+        <meta name="viewport" content="width=device-width">
+        <script src="/resources/testharness.js"></script>
+        <script src="/resources/testharnessreport.js"></script>
+        <script src="/resources/testdriver.js"></script>
+        <script src="/resources/testdriver-actions.js"></script>
+        <script src="/resources/testdriver-vendor.js"></script>
+        <link rel="stylesheet" type="text/css" href="pointerevent_styles.css">
+        <!-- Additional helper script for common checks across event types -->
+        <script type="text/javascript" src="pointerevent_support.js"></script>
+    </head>
+    <body class="scrollable" onload="run()">
+        <h1>pointercancel test</h1>
+        <h3>Warning: this test works properly only for devices that have touchscreen</h3>
+        <h4>
+        Test Description: This test checks if pointercancel event triggers.
+        <p>Start touch over the black rectangle and then move your finger to scroll the page.</p>
+        </h4>
+        <p>
+        <div id="target0" style="background: black"></div>
+        <script>
+            var detected_pointertypes = {};
+            var test_pointerEvent = async_test("pointercancel event received");
+            // showPointerTypes is defined in pointerevent_support.js
+            // Requirements: the callback function will reference the test_pointerEvent object and
+            // will fail unless the async_test is created with the var name "test_pointerEvent".
+            add_completion_callback(showPointerTypes);
+
+            var pointerdown_event = null;
+            var pointercancel_event = null;
+            var received_pointerleave = false;
+
+            function run() {
+                var target0 = document.getElementById("target0");
+
+                on_event(target0, "pointerdown", function (event) {
+                    pointerdown_event = event;
+                    detected_pointertypes[event.pointerType] = true;
+                });
+
+                on_event(target0, "pointercancel", function (event) {
+                    pointercancel_event = event;
+                    test_pointerEvent.step(function () {
+                        assert_not_equals(pointerdown_event, null, "pointerdown was received: ");
+                        assert_equals(event.pointerId, pointerdown_event.pointerId, "pointerId should be the same for pointerdown and pointercancel");
+                        assert_equals(event.pointerType, pointerdown_event.pointerType, "pointerType should be the same for pointerdown and pointercancel");
+                        assert_equals(event.isPrimary, pointerdown_event.isPrimary, "isPrimary should be the same for pointerdown and pointercancel");
+                        check_PointerEvent(event);
+                    });
+                });
+
+                on_event(target0, "pointerout", function (event) {
+                    test_pointerEvent.step(function () {
+                        assert_not_equals(pointercancel_event, null, "pointercancel was received before pointerout: ");
+                        assert_equals(event.pointerId, pointerdown_event.pointerId, "pointerId should be the same for pointerout and pointercancel");
+                        assert_equals(event.pointerType, pointerdown_event.pointerType, "pointerType should be the same for pointerout and pointercancel");
+                        assert_equals(event.isPrimary, pointerdown_event.isPrimary, "isPrimary should be the same for pointerout and pointercancel");
+                    });
+                });
+
+                on_event(target0, "pointerleave", function (event) {
+                    test_pointerEvent.step(function () {
+                        assert_not_equals(pointercancel_event, null, "pointercancel was received before pointerleave: ");
+                        assert_equals(event.pointerId, pointerdown_event.pointerId, "pointerId should be the same for pointerleave and pointercancel");
+                        assert_equals(event.pointerType, pointerdown_event.pointerType, "pointerType should be the same for pointerleave and pointercancel");
+                        assert_equals(event.isPrimary, pointerdown_event.isPrimary, "isPrimary should be the same for pointerleave and pointercancel");
+                    });
+                    received_pointerleave = true;
+                });
+
+                // Inject touch inputs and wait for all the actions finish to end the test.
+                touchScrollInTarget(target0, 'down').then(function() {
+                    test_pointerEvent.step(function () {
+                        assert_true(received_pointerleave, "pointerleave should be received before the test finished");
+                    });
+                    test_pointerEvent.done();
+                });
+            }
+        </script>
+        <h1>Pointer Events pointercancel Tests</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>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_pointerenter_does_not_bubble-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_pointerenter_does_not_bubble-expected.txt
new file mode 100644 (file)
index 0000000..44705ed
--- /dev/null
@@ -0,0 +1,53 @@
+Pointer Event: pointerenter does not bubble
+
+Test Description: The pointerenter event must not bubble up to parent elements.
+
+Use the mouse or pen to hover over then out of the purple box nested in the black box. Or with touch, tap on the purple box.
+Test complete: Scroll to Summary to view Pass/Fail Results.
+
+The following pointer types were detected: mouse.
+
+Refresh the page to run the tests again with a different pointer type.
+
+
+PASS pointerEnter event does not bubble 
+PASS  mouse pointerenter event is a PointerEvent event 
+PASS  mouse pointerenter.pointerId attribute exists 
+PASS  mouse pointerenter.pointerId is readonly 
+PASS  mouse pointerenter.pointerId IDL type long (JS type was number) 
+PASS  mouse pointerenter.width attribute exists 
+PASS  mouse pointerenter.width is readonly 
+PASS  mouse pointerenter.width IDL type float (JS type was number) 
+PASS  mouse pointerenter.height attribute exists 
+PASS  mouse pointerenter.height is readonly 
+PASS  mouse pointerenter.height IDL type float (JS type was number) 
+PASS  mouse pointerenter.pressure attribute exists 
+PASS  mouse pointerenter.pressure is readonly 
+PASS  mouse pointerenter.pressure IDL type float (JS type was number) 
+PASS  mouse pointerenter.tiltX attribute exists 
+PASS  mouse pointerenter.tiltX is readonly 
+PASS  mouse pointerenter.tiltX IDL type long (JS type was number) 
+PASS  mouse pointerenter.tiltY attribute exists 
+PASS  mouse pointerenter.tiltY is readonly 
+PASS  mouse pointerenter.tiltY IDL type long (JS type was number) 
+PASS  mouse pointerenter.pointerType attribute exists 
+PASS  mouse pointerenter.pointerType is readonly 
+PASS  mouse pointerenter.pointerType IDL type string (JS type was string) 
+PASS  mouse pointerenter.isPrimary attribute exists 
+PASS  mouse pointerenter.isPrimary is readonly 
+PASS  mouse pointerenter.isPrimary IDL type boolean (JS type was boolean) 
+PASS  mouse pointerenter.detail attribute exists 
+PASS  mouse pointerenter.detail is readonly 
+PASS  mouse pointerenter.detail IDL type long (JS type was number) 
+PASS  mouse pointerenter.detail value is 0. 
+PASS  mouse pointerenter.fromElement attribute exists 
+PASS  mouse pointerenter.fromElement is readonly 
+PASS  mouse pointerenter.fromElement IDL type object (JS type was object) 
+PASS  mouse pointerenter.fromElement value is null. 
+PASS  mouse pointerenter.toElement attribute exists 
+PASS  mouse pointerenter.toElement is readonly 
+PASS  mouse pointerenter.toElement IDL type object (JS type was object) 
+FAIL  mouse pointerenter.toElement value is null. assert_equals: toElement attribute value expected null but got Element node <div id="target0"></div>
+PASS  mouse pointerenter.pressure value is valid 
+PASS  mouse pointerenter properties for pointerType = mouse 
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_pointerenter_does_not_bubble.html b/LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_pointerenter_does_not_bubble.html
new file mode 100644 (file)
index 0000000..7d38de7
--- /dev/null
@@ -0,0 +1,99 @@
+<!doctype html>
+<html>
+    <head>
+        <title>Pointer Event: The pointerenter event does not bubble </title>
+        <meta content="text/html; charset=UTF-8" http-equiv="Content-Type"/>
+        <link rel="author" title="Microsoft" href="http://www.microsoft.com/"/>
+        <meta name="assert" content="The pointerenter event must not bubble up to parent elements."/>
+        <link rel="stylesheet" type="text/css" href="pointerevent_styles.css">
+        <!-- /resources/testharness.js -->
+        <script src="/resources/testharness.js"></script>
+        <script src="/resources/testharnessreport.js"></script>
+        <script src="/resources/testdriver.js"></script>
+        <script src="/resources/testdriver-actions.js"></script>
+        <script src="/resources/testdriver-vendor.js"></script>
+        <!-- Additional helper script for common checks across event types -->
+        <script type="text/javascript" src="pointerevent_support.js"></script>
+        <script type="text/javascript">
+            var detected_pointertypes = {};
+            var test_pointerEvent = async_test("pointerEnter event does not bubble"); // set up test harness
+            // showPointerTypes is defined in pointerevent_support.js
+            // Requirements: the callback function will reference the test_pointerEvent object and
+            // will fail unless the async_test is created with the var name "test_pointerEvent".
+            add_completion_callback(showPointerTypes);
+
+            var pointerenter_event = null;
+
+            function run() {
+                var target0 = document.getElementById("target0");
+                var parent0 = document.getElementById("parent0");
+
+                on_event(target0, "pointerenter", function (event) {
+                    pointerenter_event = event;
+
+                    check_PointerEvent(event);
+                    test_pointerEvent.step(function () {
+                        assert_equals(event.type, "pointerenter", "pointer event received: " + event.type);
+                        assert_false(event.bubbles, "pointerenter event.bubbles should be false: " + event.bubbles);
+                    });
+                });
+                on_event(target0, "pointerout", function (event) {
+                    test_pointerEvent.step(function () {
+                        assert_not_equals(pointerenter_event, null, "pointerout event was never received: ");
+                    });
+                    test_pointerEvent.done(); // complete test
+                });
+
+                // parent
+                on_event(parent0, "pointerenter", function (event) {
+                    detected_pointertypes[event.pointerType] = true;
+                    test_pointerEvent.step(function () {
+                        assert_equals(event.target.id, "parent0", "Recieved " + event.type + " in parent for " + event.target.id);
+                    });
+                });
+
+                // Inject mouse inputs.
+                new test_driver.Actions()
+                    .pointerMove(0, 0, {origin: target0})
+                    .pointerMove(-10, -10, {origin: target0})
+                    .pointerMove(-20, -20, {origin: target0})
+                    .pointerMove(0, 0)
+                    .send();
+            }
+
+        </script>
+        <style>
+            #target0 {
+            background: purple;
+            border: 1px solid orange;
+            width:50px;
+            height:50px;
+            }
+            #parent0 {
+            background: black;
+            border: 1px solid orange;
+            width:100px;
+            height:100px;
+            }
+        </style>
+    </head>
+    <body onload="run()">
+        <h1> Pointer Event: pointerenter does not bubble</h1>
+        <h4>
+            Test Description:
+            The pointerenter event must not bubble up to parent elements.
+        </h4>
+        <div id="instructions">
+            Use the mouse or pen to hover over then out of the purple box nested in the black box. Or with touch, tap on the purple box.
+        </div>
+        <div id="parent0">
+            <div id="target0"></div>
+        </div>
+        <div id="complete-notice">
+            <p>Test complete: Scroll to Summary to view Pass/Fail Results.</p>
+            <p>The following pointer types were detected: <span id="pointertype-log"></span>.</p>
+            <p>Refresh the page to run the tests again with a different pointer type.</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_pointerleave_after_pointercancel_touch.html b/LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_pointerleave_after_pointercancel_touch.html
new file mode 100644 (file)
index 0000000..555e5fe
--- /dev/null
@@ -0,0 +1,76 @@
+<!doctype html>
+<html>
+    <head>
+        <title>pointerleave after pointercancel</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="/resources/testdriver.js"></script>
+        <script src="/resources/testdriver-actions.js"></script>
+        <script src="/resources/testdriver-vendor.js"></script>
+        <!-- Additional helper script for common checks across event types -->
+        <script type="text/javascript" src="pointerevent_support.js"></script>
+    </head>
+    <body class="scrollable" onload="run()">
+        <h2>pointerleave after pointercancel</h2>
+        <h4>Test Description: This test checks if pointerleave event triggers after pointercancel. Start touch on the black rectangle and move your touch to scroll in any direction. </h4>
+        <p>Note: this test is for touch devices only</p>
+        <div id="target0"></div>
+        <script>
+            var test_pointerleave = async_test("pointerleave event received");
+            // showPointerTypes is defined in pointerevent_support.js
+            // Requirements: the callback function will reference the test_pointerEvent object and
+            // will fail unless the async_test is created with the var name "test_pointerEvent".
+            add_completion_callback(showPointerTypes);
+
+            var eventTested = false;
+            var pointercancel_event = null;
+            var detected_pointertypes = {};
+
+            function run() {
+                var target0 = document.getElementById("target0");
+
+                on_event(target0, "pointercancel", function (event) {
+                    detected_pointertypes[event.pointerType] = true;
+                    pointercancel_event = event;
+                });
+
+                // After firing the pointercancel event the pointerleave event must be dispatched.
+                // TA: 4.3.1
+                on_event(target0, "pointerleave", function (event) {
+                    if(event.pointerType == 'touch') {
+                        if(pointercancel_event != null) {
+                            if(eventTested == false) {
+                                test_pointerleave.step(function() {
+                                    assert_equals(event.pointerType, pointercancel_event.pointerType, "pointerType is same for pointercancel and pointerleave");
+                                    assert_equals(event.isPrimary, pointercancel_event.isPrimary, "isPrimary is same for pointercancel and pointerleave");
+                                });
+                                eventTested = true;
+                            }
+                        }
+                        else {
+                            test_pointerleave.step(function() {
+                                assert_unreached("pointerleave received before pointercancel");
+                            }, "pointerleave received before pointercancel");
+                        }
+                    }
+                });
+
+                // Inject touch inputs and wait for all the actions finish to end the test.
+                touchScrollInTarget(target0, 'down').then(function() {
+                    test_pointerleave.step(function () {
+                        assert_true(eventTested, "pointerleave should be received before the test finishes");
+                    }, "pointerleave should be received before the test finishes");
+                    test_pointerleave.done();
+                });
+            }
+
+        </script>
+        <h1>Pointer Events pointerleave tests</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>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_pointerleave_descendant_over-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_pointerleave_descendant_over-expected.txt
new file mode 100644 (file)
index 0000000..de886ba
--- /dev/null
@@ -0,0 +1,17 @@
+pointerleave
+
+Test Description: This test checks if pointerleave event works properly.
+Put your mouse over the black rectangle
+Then move it into the purple rectangle
+Click on the purple rectangle to complete the test
+Note: when you entered the black rectangle once don't leave it before the end of the test to get proper results.
+
+Pointer Events pointerleave tests
+
+The following pointer types were detected: mouse.
+
+Refresh the page to run the tests again with a different pointer type.
+
+
+PASS pointerleave shouldn't be received on descendant's pointerover 
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_pointerleave_descendant_over.html b/LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_pointerleave_descendant_over.html
new file mode 100644 (file)
index 0000000..ccc5f37
--- /dev/null
@@ -0,0 +1,72 @@
+<!doctype html>
+<html>
+    <head>
+        <title>pointerleave + descendant</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="/resources/testdriver.js"></script>
+        <script src="/resources/testdriver-actions.js"></script>
+        <script src="/resources/testdriver-vendor.js"></script>
+        <script src="pointerevent_support.js"></script>
+    </head>
+    <body onload="run()">
+        <h1>pointerleave</h1>
+        <h4>
+            Test Description: This test checks if pointerleave event works properly.
+            <ol>
+                <li>Put your mouse over the black rectangle
+                <li>Then move it into the purple rectangle
+                <li>Click on the purple rectangle to complete the test
+            </ol>
+            Note: when you entered the black rectangle once don't leave it before the end of the test to get proper results.
+        </h4>
+        <p>
+        <div id="target0" style="background:black">
+            <div id="target1" style="background:purple"></div>
+        </div>
+        <script>
+            var eventTested = false;
+            var pointerleaveReceived = false;
+            var detected_pointertypes = {};
+
+            add_completion_callback(showPointerTypes);
+
+            function run() {
+                var target0 = document.getElementById("target0");
+
+                // The pointerleave event must not be dispatched when the pointer enters a child element without leaving the hit test boundaries of the parent. (as distinct from pointerout)
+                // TA: 9.2
+                on_event(target1, "pointerdown", function(event) {
+                    detected_pointertypes[event.pointerType] = true;
+
+                    test(function() {
+                        assert_true(!pointerleaveReceived, "pointerleave shouldn't be received on descendant's pointerover")
+                    }, "pointerleave shouldn't be received on descendant's pointerover");
+                });
+
+                on_event(target0, "pointerleave", function (event) {
+                    if (eventTested == false) {
+                        pointerleaveReceived = true;
+                        eventTested = true;
+                    }
+                });
+
+                // Inject mouse inputs.
+                new test_driver.Actions()
+                    .pointerMove(0, 0, {origin: target0})
+                    .pointerMove(0, 0, {origin: target1})
+                    .pointerDown()
+                    .pointerUp()
+                    .send();
+            }
+        </script>
+        <h1>Pointer Events pointerleave tests</h1>
+        <div id="complete-notice">
+            <p>The following pointer types were detected: <span id="pointertype-log"></span>.</p>
+            <p>Refresh the page to run the tests again with a different pointer type.</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_pointerleave_descendants-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_pointerleave_descendants-expected.txt
new file mode 100644 (file)
index 0000000..7ccd831
--- /dev/null
@@ -0,0 +1,15 @@
+pointerleave
+
+Test Description: This test checks if pointerleave event works properly.
+Put your mouse over the black rectangle and then move it out through purple rectangle boundaries.
+
+
+Pointer Events pointerleave tests
+
+The following pointer types were detected: mouse.
+
+Refresh the page to run the tests again with a different pointer type.
+
+
+PASS pointerleave event received 
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_pointerleave_descendants.html b/LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_pointerleave_descendants.html
new file mode 100644 (file)
index 0000000..fe121a8
--- /dev/null
@@ -0,0 +1,63 @@
+<!doctype html>
+<html>
+    <head>
+        <title>Pointerleave + descendant</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="/resources/testdriver.js"></script>
+        <script src="/resources/testdriver-actions.js"></script>
+        <script src="/resources/testdriver-vendor.js"></script>
+        <script src="pointerevent_support.js"></script>
+    </head>
+    <body onload="run()">
+        <h1>pointerleave</h1>
+        <h4>
+            Test Description: This test checks if pointerleave event works properly.
+            <p>Put your mouse over the black rectangle and then move it out through purple rectangle boundaries.</p>
+        </h4>
+        <p>
+        <div id="target0" style="background:black; height: 47px;">
+            <div style="background:purple; height: 35px; width: 90%; position: absolute"></div>
+        </div>
+        <script>
+            var eventTested = false;
+            var detected_pointertypes = {};
+
+            add_completion_callback(showPointerTypes);
+
+            function run() {
+                var target0 = document.getElementById("target0");
+                var target1 = document.querySelector("#target0 > div");
+                var test_pointerleave = async_test("pointerleave event received");
+
+                on_event(target0, "pointerover", function(event) {
+                    detected_pointertypes[ event.pointerType ] = true;
+                });
+
+                // When a pointing device is moved off of the hit test boundaries of an element and all of its descendants, the pointerleave event must be dispatched.
+                // TA: 9.1
+                on_event(target0, "pointerleave", function (event) {
+                    if (eventTested == false) {
+                        test_pointerleave.done();
+                        eventTested = true;
+                    }
+                });
+
+                // Inject mouse inputs.
+                new test_driver.Actions()
+                    .pointerMove(0, 0, {origin: target0})
+                    .pointerMove(0, 0, {origin: target1})
+                    .pointerMove(0, 0)
+                    .send();
+            }
+        </script>
+        <h1>Pointer Events pointerleave tests</h1>
+        <div id="complete-notice">
+            <p>The following pointer types were detected: <span id="pointertype-log"></span>.</p>
+            <p>Refresh the page to run the tests again with a different pointer type.</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_pointerleave_does_not_bubble-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_pointerleave_does_not_bubble-expected.txt
new file mode 100644 (file)
index 0000000..3e4fe7f
--- /dev/null
@@ -0,0 +1,54 @@
+Pointer Event: pointerleave does not bubble
+
+Test Description: The pointerleave event must not bubble up to parent elements.
+
+Use the mouse or pen to hover over then out of the purple box nested in the black box. Or with touch, tap on the purple box.
+Test complete: Scroll to Summary to view Pass/Fail Results.
+
+The following pointer types were detected: mouse.
+
+Refresh the page to run the tests again with a different pointer type.
+
+
+PASS pointerLeave event does not bubble 
+PASS  mouse pointerleave event is a PointerEvent event 
+PASS  mouse pointerleave.pointerId attribute exists 
+PASS  mouse pointerleave.pointerId is readonly 
+PASS  mouse pointerleave.pointerId IDL type long (JS type was number) 
+PASS  mouse pointerleave.width attribute exists 
+PASS  mouse pointerleave.width is readonly 
+PASS  mouse pointerleave.width IDL type float (JS type was number) 
+PASS  mouse pointerleave.height attribute exists 
+PASS  mouse pointerleave.height is readonly 
+PASS  mouse pointerleave.height IDL type float (JS type was number) 
+PASS  mouse pointerleave.pressure attribute exists 
+PASS  mouse pointerleave.pressure is readonly 
+PASS  mouse pointerleave.pressure IDL type float (JS type was number) 
+PASS  mouse pointerleave.tiltX attribute exists 
+PASS  mouse pointerleave.tiltX is readonly 
+PASS  mouse pointerleave.tiltX IDL type long (JS type was number) 
+PASS  mouse pointerleave.tiltY attribute exists 
+PASS  mouse pointerleave.tiltY is readonly 
+PASS  mouse pointerleave.tiltY IDL type long (JS type was number) 
+PASS  mouse pointerleave.pointerType attribute exists 
+PASS  mouse pointerleave.pointerType is readonly 
+PASS  mouse pointerleave.pointerType IDL type string (JS type was string) 
+PASS  mouse pointerleave.isPrimary attribute exists 
+PASS  mouse pointerleave.isPrimary is readonly 
+PASS  mouse pointerleave.isPrimary IDL type boolean (JS type was boolean) 
+PASS  mouse pointerleave.detail attribute exists 
+PASS  mouse pointerleave.detail is readonly 
+PASS  mouse pointerleave.detail IDL type long (JS type was number) 
+PASS  mouse pointerleave.detail value is 0. 
+PASS  mouse pointerleave.fromElement attribute exists 
+PASS  mouse pointerleave.fromElement is readonly 
+PASS  mouse pointerleave.fromElement IDL type object (JS type was object) 
+FAIL  mouse pointerleave.fromElement value is null. assert_equals: fromElement attribute value expected null but got Element node <html><head>
+        <title>Pointer Event: The pointerlea...
+PASS  mouse pointerleave.toElement attribute exists 
+PASS  mouse pointerleave.toElement is readonly 
+PASS  mouse pointerleave.toElement IDL type object (JS type was object) 
+FAIL  mouse pointerleave.toElement value is null. assert_equals: toElement attribute value expected null but got Element node <div id="target0"></div>
+PASS  mouse pointerleave.pressure value is valid 
+PASS  mouse pointerleave properties for pointerType = mouse 
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_pointerleave_does_not_bubble.html b/LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_pointerleave_does_not_bubble.html
new file mode 100644 (file)
index 0000000..b19820e
--- /dev/null
@@ -0,0 +1,86 @@
+<!doctype html>
+<html>
+    <head>
+        <title>Pointer Event: The pointerleave event does not bubble </title>
+        <meta content="text/html; charset=UTF-8" http-equiv="Content-Type"/>
+        <link rel="author" title="Microsoft" href="http://www.microsoft.com/"/>
+        <meta name="assert" content="The pointerleave event must not bubble up to parent elements."/>
+        <link rel="stylesheet" type="text/css" href="pointerevent_styles.css">
+        <!-- /resources/testharness.js -->
+        <script src="/resources/testharness.js"></script>
+        <script src="/resources/testharnessreport.js"></script>
+        <script src="/resources/testdriver.js"></script>
+        <script src="/resources/testdriver-actions.js"></script>
+        <script src="/resources/testdriver-vendor.js"></script>
+        <!-- Additional helper script for common checks across event types -->
+        <script type="text/javascript" src="pointerevent_support.js"></script>
+        <script type="text/javascript">
+            var detected_pointertypes = {};
+            var test_pointerEvent = async_test("pointerLeave event does not bubble"); // set up test harness
+            // showPointerTypes is defined in pointerevent_support.js
+            // Requirements: the callback function will reference the test_pointerEvent object and
+            // will fail unless the async_test is created with the var name "test_pointerEvent".
+            add_completion_callback(showPointerTypes);
+
+            function run() {
+                var target0 = document.getElementById("target0");
+                var parent0 = document.getElementById("parent0");
+
+                on_event(target0, "pointerleave", function (event) {
+                    detected_pointertypes[event.pointerType] = true;
+                    check_PointerEvent(event);
+                    test_pointerEvent.step(function () {
+                        assert_equals(event.type, "pointerleave", "pointer event received: " + event.type);
+                        assert_false(event.bubbles, "pointerleave event.bubbles should be false: " + event.bubbles);
+                    });
+                });
+
+                on_event(parent0, "pointerleave", function (event) {
+                    test_pointerEvent.step(function () {
+                        assert_equals(event.target.id, "parent0", "Recieved " + event.type + " in parent for " + event.target.id);
+                    });
+                    test_pointerEvent.done(); // complete test
+                });
+
+                // Inject mouse inputs.
+                new test_driver.Actions()
+                    .pointerMove(0, 0, {origin: target0})
+                    .pointerMove(0, 0)
+                    .send();
+            }
+        </script>
+        <style>
+            #target0 {
+            background: purple;
+            border: 1px solid orange;
+            width:50px;
+            height:50px;
+            }
+            #parent0 {
+            background: black;
+            border: 1px solid orange;
+            width:100px;
+            height:100px;
+            }
+        </style>
+    </head>
+    <body onload="run()">
+        <h1> Pointer Event: pointerleave does not bubble</h1>
+        <h4>
+            Test Description:
+            The pointerleave event must not bubble up to parent elements.
+        </h4>
+        <div id="instructions">
+            Use the mouse or pen to hover over then out of the purple box nested in the black box. Or with touch, tap on the purple box.
+        </div>
+        <div id="parent0">
+            <div id="target0"></div>
+        </div>
+        <div id="complete-notice">
+            <p>Test complete: Scroll to Summary to view Pass/Fail Results.</p>
+            <p>The following pointer types were detected: <span id="pointertype-log"></span>.</p>
+            <p>Refresh the page to run the tests again with a different pointer type.</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_pointerleave_pen-manual.html b/LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_pointerleave_pen-manual.html
new file mode 100644 (file)
index 0000000..bb6dcc4
--- /dev/null
@@ -0,0 +1,72 @@
+<!doctype html>
+<html>
+    <head>
+        <title>Pointer Event: Dispatch pointerleave (pen). </title>
+        <meta content="text/html; charset=UTF-8" http-equiv="Content-Type"/>
+        <link rel="author" title="Microsoft" href="http://www.microsoft.com/"/>
+        <meta name="assert" content="When a pointing device that supports hover (pen stylus) leaves the range of the digitizer while over an element, the pointerleave event must be dispatched."/>
+        <link rel="stylesheet" type="text/css" href="pointerevent_styles.css">
+        <!-- /resources/testharness.js -->
+        <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>
+        <script type="text/javascript">
+            var detected_pointertypes = {};
+            var test_pointerEvent = async_test("pointerleave event"); // set up test harness
+            // showPointerTypes is defined in pointerevent_support.js
+            // Requirements: the callback function will reference the test_pointerEvent object and
+            // will fail unless the async_test is created with the var name "test_pointerEvent".
+            add_completion_callback(showPointerTypes);
+
+            function run() {
+                var target0 = document.getElementById("target0");
+                var count = 0;
+
+                on_event(target0, "pointerenter", function (event) {
+                    test_pointerEvent.step(function () {
+                        assert_equals(event.pointerType, "pen", "Test should be run using a pen as input");
+                        assert_equals(event.type, "pointerenter", "The " + event.type + " event was received");
+                        assert_equals(event.isPrimary, true, "The " + event.type + ".isPrimary is true");
+                    });
+                });
+
+                on_event(target0, "pointerleave", function (event) {
+                    count++;
+                    detected_pointertypes[event.pointerType] = true;
+                    if (count == 1)
+                        check_PointerEvent(event);
+
+                    test_pointerEvent.step(function () {
+                        assert_equals(event.pointerType, "pen", "Test should be run using a pen as input");
+                        assert_equals(event.type, "pointerleave", "The " + event.type + " event was received");
+                        assert_equals(event.isPrimary, true, "The " + event.type + ".isPrimary is true");
+                        assert_true((event.clientX > target0.getBoundingClientRect().left)&&
+                            (event.clientX < target0.getBoundingClientRect().right)&&
+                            (event.clientY > target0.getBoundingClientRect().top)&&
+                            (event.clientY < target0.getBoundingClientRect().bottom),
+                            "pointerleave should be received inside of target bounds");
+                    });
+                    if (count >= 2)
+                      test_pointerEvent.done(); // complete test
+                });
+            }
+        </script>
+    </head>
+    <body onload="run()">
+        <h1>Pointer Event: Dispatch pointerleave (pen)</h1>
+        <h4>
+            Test Description:
+            When a pointing device that supports hover (pen stylus) leaves the range of the digitizer while over an element, the pointerleave event must be dispatched. In addition, all the pointer events' isPrimary should always be true when the pointing device leaves and enters the range of the digitizer again. 
+        </h4>
+        <br />
+        <div id="target0">
+            Use a pen to hover over then lift up away from this element, and repeat it again.
+        </div>
+        <div id="complete-notice">
+            <p>Test complete: Scroll to Summary to view Pass/Fail Results.</p>
+            <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_pointermove-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_pointermove-expected.txt
new file mode 100644 (file)
index 0000000..02f19a9
--- /dev/null
@@ -0,0 +1,13 @@
+PointerMove
+
+Test Description: This test checks if pointermove event triggers. Move your mouse over the black rectangle or slide it if you are using touchscreen.
+
+Pointer Events pointermove Tests
+
+The following pointer types were detected: mouse.
+
+Refresh the page to run the tests again with a different pointer type.
+
+
+PASS pointermove event received 
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_pointermove.html b/LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_pointermove.html
new file mode 100644 (file)
index 0000000..4b16843
--- /dev/null
@@ -0,0 +1,50 @@
+<!doctype html>
+<html>
+    <head>
+        <title>Pointermove</title>
+        <meta name="viewport" content="width=device-width">
+        <meta name="assert" content="When a pointer changes coordinates, the pointermove event must be dispatched."/>
+        <link rel="stylesheet" type="text/css" href="pointerevent_styles.css">
+        <script src="/resources/testharness.js"></script>
+        <script src="/resources/testharnessreport.js"></script>
+        <script src="/resources/testdriver.js"></script>
+        <script src="/resources/testdriver-actions.js"></script>
+        <script src="/resources/testdriver-vendor.js"></script>
+        <!-- Additional helper script for common checks across event types -->
+        <script type="text/javascript" src="pointerevent_support.js"></script>
+    </head>
+    <body onload="run()">
+        <h2>PointerMove</h2>
+        <h4>Test Description: This test checks if pointermove event triggers. Move your mouse over the black rectangle or slide it if you are using touchscreen.</h4>
+        <div id="target0" style="background:black"></div>
+        <script>
+            var eventTested = false;
+            var detected_pointertypes = {};
+            var test_pointermove = async_test("pointermove event received");
+            add_completion_callback(showPointerTypes);
+
+            function run() {
+                var target0 = document.getElementById("target0");
+
+                // When a pointer changes coordinates, the pointermove event must be dispatched.
+                // TA: 5.3
+                on_event(target0, "pointermove", function (event) {
+                    detected_pointertypes[event.pointerType] = true;
+                    if (eventTested == false) {
+                        test_pointermove.done();
+                        eventTested = true;
+                    }
+                });
+
+                // Inject the inputs to run this test.
+                new test_driver.Actions().pointerMove(0, 0, {origin: target0}).send();
+            }
+        </script>
+        <h1>Pointer Events pointermove Tests</h1>
+        <div id="complete-notice">
+            <p>The following pointer types were detected: <span id="pointertype-log"></span>.</p>
+            <p>Refresh the page to run the tests again with a different pointer type.</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_pointermove_isprimary_same_as_pointerdown-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_pointermove_isprimary_same_as_pointerdown-expected.txt
new file mode 100644 (file)
index 0000000..500a1c0
--- /dev/null
@@ -0,0 +1,16 @@
+Pointer Event: pointermove has the same isPrimary as last pointerdown with the same pointerId
+
+Test Description: The isPrimary attribute of a pointermove event must have the same value as the isPrimary attribute of the last pointerdown event with the same pointerId attribute.
+
+Press and hold a mouse button, touch contact or pen contact on this element. Move around inside the element while maintaining contact/button down. Only use one device per test run.
+Lift off of the element to complete the test.
+
+Test complete: Scroll to Summary to view Pass/Fail Results.
+
+The following pointer types were detected: mouse.
+
+Refresh the page to run the tests again with a different pointer type.
+
+
+PASS pointermove has same isPrimary as last pointerdown 
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_pointermove_isprimary_same_as_pointerdown.html b/LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_pointermove_isprimary_same_as_pointerdown.html
new file mode 100644 (file)
index 0000000..46bfe40
--- /dev/null
@@ -0,0 +1,81 @@
+<!doctype html>
+<html>
+    <head>
+        <title>Pointer Event: pointermove has same isPrimary as last pointerdown with the same pointerId</title>
+        <meta content="text/html; charset=UTF-8" http-equiv="Content-Type"/>
+        <link rel="author" title="Microsoft" href="http://www.microsoft.com/"/>
+        <meta name="assert" content="The isPrimary attribute of a pointermove event must have the same value as the isPrimary attribute of the last pointerdown event with the same pointerId attribute."/>
+        <link rel="stylesheet" type="text/css" href="pointerevent_styles.css">
+        <!-- /resources/testharness.js -->
+        <script src="/resources/testharness.js"></script>
+        <script src="/resources/testharnessreport.js"></script>
+        <script src="/resources/testdriver.js"></script>
+        <script src="/resources/testdriver-actions.js"></script>
+        <script src="/resources/testdriver-vendor.js"></script>
+        <!-- Additional helper script for common checks across event types -->
+        <script type="text/javascript" src="pointerevent_support.js"></script>
+        <script type="text/javascript">
+            var detected_pointertypes = {};
+            var test_pointerEvent = async_test("pointermove has same isPrimary as last pointerdown"); // set up test harness
+            // showPointerTypes is defined in pointerevent_support.js
+            // Requirements: the callback function will reference the test_pointerEvent object and
+            // will fail unless the async_test is created with the var name "test_pointerEvent".
+            add_completion_callback(showPointerTypes);
+
+            var pointermove_event = null;
+            var pointerdown_event = null;
+
+            function run() {
+                var target0 = document.getElementById("target0");
+
+                on_event(target0, "pointermove", function (event) {
+                    if (pointerdown_event != null) {
+                        test_pointerEvent.step(function () {
+                            assert_equals(event.pointerId, pointerdown_event.pointerId, "pointermove.pointerId should be the same as pointerdown.pointerId.");
+                            assert_equals(event.isPrimary, pointerdown_event.isPrimary, "pointermove.isPrimary should be the same as pointerdown.isPrimary.");
+                        });
+                        pointermove_event = event;
+                    }
+                });
+
+                on_event(target