From 36d22d82aa202bb199967e9512281e9a53db42c9 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 21:33:14 +0200 Subject: Adding upstream version 115.7.0esr. Signed-off-by: Daniel Baumann --- dom/events/test/browser.ini | 30 + dom/events/test/browser_alt_keyup_in_content.js | 333 ++ ..._beforeinput_by_execCommand_in_contentscript.js | 106 + dom/events/test/browser_bug1539497.js | 25 + dom/events/test/browser_dragimage.js | 65 + ...vent_init_key_event_enabled_in_contentscript.js | 80 + .../test/browser_mouse_enterleave_switch_tab.js | 158 + ...er_conflicts_with_content_accesskey_modifier.js | 102 + dom/events/test/bug1017086_inner.html | 39 + dom/events/test/bug226361_iframe.xhtml | 47 + dom/events/test/bug299673.js | 150 + dom/events/test/bug322588-popup.html | 1 + dom/events/test/bug415498-doc1.html | 15 + dom/events/test/bug415498-doc2.html | 15 + dom/events/test/bug418986-3.js | 85 + dom/events/test/bug426082.html | 116 + dom/events/test/bug545268.html | 1 + dom/events/test/bug574663.html | 3 + dom/events/test/bug591249_iframe.xhtml | 33 + dom/events/test/bug602962.xhtml | 8 + dom/events/test/bug607464.html | 3 + dom/events/test/bug656379-1.html | 186 + dom/events/test/chrome.ini | 31 + dom/events/test/clipboard/browser.ini | 21 + .../browser_navigator_clipboard_clickjacking.js | 69 + .../clipboard/browser_navigator_clipboard_read.js | 198 ++ .../browser_navigator_clipboard_readText.js | 201 ++ .../clipboard/browser_navigator_clipboard_touch.js | 114 + dom/events/test/clipboard/chrome.ini | 3 + dom/events/test/clipboard/head.js | 169 + .../simple_navigator_clipboard_keydown.html | 15 + .../clipboard/simple_navigator_clipboard_read.html | 65 + .../simple_navigator_clipboard_readText.html | 47 + .../test/clipboard/test_async_clipboard.xhtml | 130 + dom/events/test/dragimage.html | 10 + dom/events/test/empty.js | 0 dom/events/test/error_event_worker.js | 19 + dom/events/test/event_leak_utils.js | 84 + ...eforeinput_by_execCommand_in_contentscript.html | 2 + dom/events/test/file_bug1446834.html | 96 + dom/events/test/file_bug1484371.html | 94 + dom/events/test/file_bug1692052.html | 25 + dom/events/test/file_bug679494.html | 8 + .../test/file_coalesce_touchmove_browserchild.html | 117 + .../file_coalesce_touchmove_browserchild2.html | 193 ++ dom/events/test/file_coalesce_touchmove_ipc.html | 193 ++ dom/events/test/file_empty.html | 15 + dom/events/test/file_event_screenXY.html | 23 + ...focus_blur_on_click_in_cross_origin_iframe.html | 28 + ...on_click_in_deep_cross_origin_iframe_inner.html | 28 + ...n_click_in_deep_cross_origin_iframe_middle.html | 37 + ...nt_init_key_event_enabled_in_contentscript.html | 21 + dom/events/test/file_mouse_enterleave.html | 40 + dom/events/test/green.png | Bin 0 -> 255 bytes .../test/gtest/TestShortcutKeyDefinitions.cpp | 634 ++++ dom/events/test/gtest/moz.build | 18 + dom/events/test/mochitest.ini | 333 ++ ...93174_implicit_pointer_capture_for_touch_1.html | 63 + ...93174_implicit_pointer_capture_for_touch_2.html | 64 + dom/events/test/pointerevents/bug968148_inner.html | 316 ++ .../test/pointerevents/bug968148_inner2.html | 315 ++ .../test/pointerevents/bug_1420589_iframe1.html | 17 + .../test/pointerevents/bug_1420589_iframe2.html | 17 + dom/events/test/pointerevents/chrome.ini | 1 + .../file_pointercapture_xorigin_iframe.html | 62 + ..._pointercapture_xorigin_iframe_pointerlock.html | 111 + .../file_pointercapture_xorigin_iframe_touch.html | 69 + .../file_test_trigger_fullscreen.html | 1 + dom/events/test/pointerevents/iframe.html | 7 + dom/events/test/pointerevents/mochitest.ini | 168 + .../pointerevents/mochitest_support_external.js | 270 ++ .../pointerevents/mochitest_support_internal.js | 125 + .../test/pointerevents/pointerevent_utils.js | 60 + dom/events/test/pointerevents/readme.md | 9 + dom/events/test/pointerevents/test_bug1285128.html | 51 + ...93174_implicit_pointer_capture_for_touch_1.html | 30 + ...93174_implicit_pointer_capture_for_touch_2.html | 30 + dom/events/test/pointerevents/test_bug1303704.html | 135 + dom/events/test/pointerevents/test_bug1315862.html | 66 + dom/events/test/pointerevents/test_bug1323158.html | 91 + dom/events/test/pointerevents/test_bug1403055.html | 90 + .../test/pointerevents/test_bug1420589_1.html | 105 + .../test/pointerevents/test_bug1420589_2.html | 122 + .../test/pointerevents/test_bug1420589_3.html | 115 + .../test/pointerevents/test_bug1697769.xhtml | 74 + dom/events/test/pointerevents/test_bug1725416.html | 37 + dom/events/test/pointerevents/test_bug968148.html | 46 + .../pointerevents/test_getCoalescedEvents.html | 88 + .../test_getCoalescedEvents_touch.html | 111 + .../test/pointerevents/test_multiple_touches.html | 196 ++ .../test_pointercapture_remove_iframe.html | 80 + .../test_pointercapture_xorigin_iframe.html | 55 + .../test_pointermove_drag_scrollbar.html | 77 + ...test_remove_frame_when_got_pointer_capture.html | 166 + .../test/pointerevents/test_synthesized_touch.html | 47 + .../test_trigger_fullscreen_by_pointer_events.html | 54 + ...event_attributes_hoverable_pointers-manual.html | 53 + ...erevent_attributes_nohover_pointers-manual.html | 26 + ...revent_boundary_events_in_capturing-manual.html | 46 + ...ge-touch-action-onpointerdown_touch-manual.html | 39 + .../test_wpt_pointerevent_constructor.html | 26 + ...t_wpt_pointerevent_drag_interaction-manual.html | 38 + .../test_wpt_pointerevent_movementxy-manual.html | 53 + ...le_primary_pointers_boundary_events-manual.html | 31 + ...st_wpt_pointerevent_pointerId_scope-manual.html | 27 + ...pt_pointerevent_pointercancel_touch-manual.html | 30 + ...nterleave_after_pointercancel_touch-manual.html | 30 + ...t_wpt_pointerevent_pointerleave_pen-manual.html | 28 + ...ointerout_after_pointercancel_touch-manual.html | 30 + ...est_wpt_pointerevent_pointerout_pen-manual.html | 28 + ...ercapture_events_to_original_target-manual.html | 49 + ...ointercapture_onpointercancel_touch-manual.html | 30 + ...equence_at_implicit_release_on_drag-manual.html | 27 + .../test/pointerevents/test_wpt_touch_action.html | 98 + .../test/pointerevents/touch_action_helpers.js | 242 ++ ...touch-action_two-finger_interaction-manual.html | 102 + .../html/pointerevent_drag_interaction-manual.html | 103 + dom/events/test/pointerevents/wpt/idlharness.html | 104 + ...event_attributes_hoverable_pointers-manual.html | 143 + ...erevent_attributes_nohover_pointers-manual.html | 126 + ...revent_boundary_events_in_capturing-manual.html | 97 + ...ge-touch-action-onpointerdown_touch-manual.html | 135 + .../wpt/pointerevent_constructor.html | 106 + ...le_primary_pointers_boundary_events-manual.html | 145 + .../wpt/pointerevent_pointerId_scope-manual.html | 82 + .../pointerevent_pointercancel_touch-manual.html | 77 + ...nterleave_after_pointercancel_touch-manual.html | 66 + .../wpt/pointerevent_pointerleave_pen-manual.html | 58 + ...ointerout_after_pointercancel_touch-manual.html | 67 + .../wpt/pointerevent_pointerout_pen-manual.html | 57 + ...ercapture_events_to_original_target-manual.html | 137 + ...ointercapture_onpointercancel_touch-manual.html | 71 + ...quence_at_implicit_release_on_click-manual.html | 83 + ...equence_at_implicit_release_on_drag-manual.html | 84 + .../test/pointerevents/wpt/pointerevent_styles.css | 112 + .../test/pointerevents/wpt/pointerevent_support.js | 333 ++ ...erevent_touch-action-auto-css_touch-manual.html | 129 + ...vent_touch-action-button-test_touch-manual.html | 110 + .../wpt/pointerevent_touch-action-illegal.html | 67 + ...inherit_child-auto-child-none_touch-manual.html | 117 + ...uch-action-inherit_child-none_touch-manual.html | 112 + ...herit_child-pan-x-child-pan-x_touch-manual.html | 112 + ...herit_child-pan-x-child-pan-y_touch-manual.html | 117 + ...n-inherit_highest-parent-none_touch-manual.html | 133 + ...ch-action-inherit_parent-none_touch-manual.html | 112 + .../pointerevent_touch-action-keyboard-manual.html | 124 + .../pointerevent_touch-action-mouse-manual.html | 130 + ...erevent_touch-action-none-css_touch-manual.html | 111 + ...ent_touch-action-pan-down-css_touch-manual.html | 114 + ...ent_touch-action-pan-left-css_touch-manual.html | 114 + ...nt_touch-action-pan-right-css_touch-manual.html | 114 + ...event_touch-action-pan-up-css_touch-manual.html | 114 + ...revent_touch-action-pan-x-css_touch-manual.html | 106 + ...ouch-action-pan-x-pan-y-pan-y_touch-manual.html | 111 + ...vent_touch-action-pan-x-pan-y_touch-manual.html | 126 + ...revent_touch-action-pan-y-css_touch-manual.html | 106 + ...revent_touch-action-span-test_touch-manual.html | 114 + ...erevent_touch-action-svg-test_touch-manual.html | 122 + ...event_touch-action-table-test_touch-manual.html | 145 + .../pointerevent_touch-action-verification.html | 91 + .../pointerevent_movementxy-manual.html | 99 + .../resources/pointerevent_movementxy-iframe.html | 8 + ...event_attributes_hoverable_pointers-iframe.html | 10 + .../pointerevent_pointerId_scope-iframe.html | 35 + dom/events/test/test_DataTransferItemList.html | 233 ++ dom/events/test/test_accel_virtual_modifier.html | 90 + dom/events/test/test_accesskey.html | 160 + dom/events/test/test_addEventListenerExtraArg.html | 31 + dom/events/test/test_all_synthetic_events.html | 479 +++ dom/events/test/test_bug1003432.html | 45 + dom/events/test/test_bug1003432.js | 31 + dom/events/test/test_bug1013412.html | 116 + dom/events/test/test_bug1017086_enable.html | 35 + dom/events/test/test_bug1037990.html | 61 + dom/events/test/test_bug1079236.html | 66 + dom/events/test/test_bug1127588.html | 61 + dom/events/test/test_bug1128787-1.html | 52 + dom/events/test/test_bug1128787-2.html | 54 + dom/events/test/test_bug1128787-3.html | 53 + dom/events/test/test_bug1145910.html | 54 + dom/events/test/test_bug1150308.html | 49 + dom/events/test/test_bug1248459.html | 58 + dom/events/test/test_bug1264380.html | 82 + dom/events/test/test_bug1298970.html | 33 + dom/events/test/test_bug1304044.html | 133 + dom/events/test/test_bug1305458.html | 50 + dom/events/test/test_bug1327798.html | 47 + dom/events/test/test_bug1332699.html | 37 + dom/events/test/test_bug1339758.html | 80 + dom/events/test/test_bug1369072.html | 37 + dom/events/test/test_bug1412775.xhtml | 66 + dom/events/test/test_bug1429572.html | 43 + dom/events/test/test_bug1446834.html | 33 + dom/events/test/test_bug1447993.html | 41 + dom/events/test/test_bug1484371.html | 27 + dom/events/test/test_bug1534562.html | 51 + dom/events/test/test_bug1539497.html | 29 + dom/events/test/test_bug1581192.html | 73 + dom/events/test/test_bug1635018.html | 27 + dom/events/test/test_bug1637259.html | 71 + dom/events/test/test_bug1673434.html | 75 + dom/events/test/test_bug1681800.html | 26 + dom/events/test/test_bug1686716.html | 28 + dom/events/test/test_bug1692052.html | 36 + dom/events/test/test_bug1692277.html | 43 + dom/events/test/test_bug1709832.html | 46 + dom/events/test/test_bug1710509.html | 49 + dom/events/test/test_bug1728171.html | 70 + dom/events/test/test_bug226361.xhtml | 82 + dom/events/test/test_bug238987.html | 279 ++ dom/events/test/test_bug288392.html | 103 + dom/events/test/test_bug299673-1.html | 61 + dom/events/test/test_bug299673-2.html | 60 + dom/events/test/test_bug322588.html | 66 + dom/events/test/test_bug328885.html | 135 + dom/events/test/test_bug336682.js | 96 + dom/events/test/test_bug336682_1.html | 55 + dom/events/test/test_bug336682_2.xhtml | 59 + dom/events/test/test_bug367781.html | 53 + dom/events/test/test_bug379120.html | 55 + dom/events/test/test_bug402089.html | 67 + dom/events/test/test_bug405632.html | 34 + dom/events/test/test_bug409604.html | 379 ++ dom/events/test/test_bug412567.html | 47 + dom/events/test/test_bug415498.xhtml | 95 + dom/events/test/test_bug418986-3.html | 25 + dom/events/test/test_bug418986-3.xhtml | 27 + dom/events/test/test_bug422132.html | 125 + dom/events/test/test_bug426082.html | 30 + dom/events/test/test_bug427537.html | 61 + dom/events/test/test_bug428988.html | 44 + dom/events/test/test_bug432698.html | 223 ++ dom/events/test/test_bug443985.html | 76 + dom/events/test/test_bug447736.html | 47 + dom/events/test/test_bug448602.html | 294 ++ dom/events/test/test_bug450876.html | 47 + dom/events/test/test_bug456273.html | 46 + dom/events/test/test_bug457672.html | 55 + dom/events/test/test_bug489671.html | 55 + dom/events/test/test_bug493251.html | 181 + dom/events/test/test_bug508479.html | 110 + dom/events/test/test_bug517851.html | 122 + dom/events/test/test_bug524674.xhtml | 130 + dom/events/test/test_bug534833.html | 156 + dom/events/test/test_bug545268.html | 129 + dom/events/test/test_bug547996-1.html | 87 + dom/events/test/test_bug547996-2.xhtml | 120 + dom/events/test/test_bug547996-3.xhtml | 65 + dom/events/test/test_bug556493.html | 74 + dom/events/test/test_bug563329.html | 82 + dom/events/test/test_bug574663.html | 194 ++ dom/events/test/test_bug586961.xhtml | 46 + dom/events/test/test_bug591249.xhtml | 73 + dom/events/test/test_bug591815.html | 68 + dom/events/test/test_bug593959.html | 60 + dom/events/test/test_bug602962.xhtml | 87 + dom/events/test/test_bug603008.html | 559 +++ dom/events/test/test_bug605242.html | 58 + dom/events/test/test_bug607464.html | 84 + dom/events/test/test_bug613634.html | 90 + dom/events/test/test_bug615597.html | 39 + dom/events/test/test_bug617528.xhtml | 94 + dom/events/test/test_bug624127.html | 35 + dom/events/test/test_bug635465.html | 90 + dom/events/test/test_bug641477.html | 37 + dom/events/test/test_bug648573.html | 120 + dom/events/test/test_bug650493.html | 215 ++ dom/events/test/test_bug656379-1.html | 30 + dom/events/test/test_bug656379-2.html | 115 + dom/events/test/test_bug656954.html | 42 + dom/events/test/test_bug659071.html | 39 + dom/events/test/test_bug659350.html | 111 + dom/events/test/test_bug662678.html | 153 + dom/events/test/test_bug667612.html | 38 + dom/events/test/test_bug667919-1.html | 41 + dom/events/test/test_bug679494.xhtml | 36 + dom/events/test/test_bug684208.html | 80 + dom/events/test/test_bug687787.html | 610 ++++ dom/events/test/test_bug689564.html | 65 + dom/events/test/test_bug698929.html | 47 + dom/events/test/test_bug704423.html | 40 + dom/events/test/test_bug741666.html | 185 + dom/events/test/test_bug812744.html | 37 + dom/events/test/test_bug822898.html | 343 ++ dom/events/test/test_bug855741.html | 90 + dom/events/test/test_bug864040.html | 87 + dom/events/test/test_bug924087.html | 45 + dom/events/test/test_bug930374-chrome.html | 57 + dom/events/test/test_bug930374-content.html | 70 + dom/events/test/test_bug944011.html | 52 + dom/events/test/test_bug944847.html | 42 + dom/events/test/test_bug946632.html | 156 + dom/events/test/test_bug967796.html | 236 ++ dom/events/test/test_bug985988.html | 89 + dom/events/test/test_bug998809.html | 35 + .../test_click_on_reframed_generated_text.html | 32 + .../test/test_click_on_restyled_element.html | 51 + dom/events/test/test_clickevent_on_input.html | 108 + dom/events/test/test_coalesce_mousewheel.html | 241 ++ dom/events/test/test_coalesce_touchmove.html | 34 + dom/events/test/test_continuous_wheel_events.html | 3294 ++++++++++++++++++ .../test_dblclick_explicit_original_target.html | 52 + .../test/test_deltaMode_lines_always_enabled.html | 40 + dom/events/test/test_deviceSensor.html | 136 + dom/events/test/test_disabled_events.html | 40 + dom/events/test/test_dnd_with_modifiers.html | 78 + dom/events/test/test_dom_activate_event.html | 91 + dom/events/test/test_dom_keyboard_event.html | 541 +++ dom/events/test/test_dom_mouse_event.html | 143 + dom/events/test/test_dom_storage_event.html | 62 + dom/events/test/test_dom_wheel_event.html | 850 +++++ dom/events/test/test_drag_coords.html | 52 + dom/events/test/test_drag_image_file.html | 56 + dom/events/test/test_draggableprop.html | 93 + dom/events/test/test_dragstart.html | 716 ++++ dom/events/test/test_error_events.html | 71 + dom/events/test/test_eventTimeStamp.html | 116 + dom/events/test/test_event_handler_cc.html | 90 + ...test_event_screenXY_in_cross_origin_iframe.html | 101 + dom/events/test/test_event_screenXY_with_zoom.html | 63 + dom/events/test/test_eventctors.html | 936 +++++ dom/events/test/test_eventctors.xhtml | 49 + dom/events/test/test_eventctors_sensors.html | 97 + dom/events/test/test_eventhandler_scoping.html | 17 + dom/events/test/test_focus_abspos.html | 32 + ...focus_blur_on_click_in_cross_origin_iframe.html | 118 + ..._blur_on_click_in_deep_cross_origin_iframe.html | 146 + dom/events/test/test_hover_mouseleave.html | 47 + dom/events/test/test_legacy_event.html | 297 ++ dom/events/test/test_legacy_non-primary_click.html | 53 + dom/events/test/test_legacy_touch_api.html | 65 + dom/events/test/test_marquee_events.html | 31 + dom/events/test/test_messageEvent.html | 79 + dom/events/test/test_messageEvent_init.html | 25 + dom/events/test/test_mouse_capture_iframe.html | 70 + dom/events/test/test_mouse_enterleave_iframe.html | 305 ++ ...st_moving_and_expanding_selection_per_page.html | 353 ++ .../test/test_moz_mouse_pixel_scroll_event.html | 481 +++ dom/events/test/test_offsetxy.html | 98 + dom/events/test/test_onerror_handler_args.html | 36 + dom/events/test/test_passive_listeners.html | 118 + dom/events/test/test_paste_image.html | 191 ++ dom/events/test/test_scroll_per_page.html | 259 ++ dom/events/test/test_slotted_mouse_event.html | 97 + dom/events/test/test_slotted_text_click.html | 72 + dom/events/test/test_submitevent_on_form.html | 67 + dom/events/test/test_text_event_in_content.html | 68 + .../test/test_unbound_before_in_active_chain.html | 38 + ..._event_model_on_newer_Office_Online_Server.html | 59 + ...lit_keypress_event_model_on_old_Confluence.html | 82 + ...ss_event_model_on_old_Office_Online_Server.html | 69 + dom/events/test/test_wheel_default_action.html | 39 + .../test/test_wheel_zoom_on_form_controls.html | 69 + dom/events/test/window_bug1369072.html | 170 + dom/events/test/window_bug1412775.xhtml | 8 + dom/events/test/window_bug1429572.html | 351 ++ dom/events/test/window_bug1447993.html | 239 ++ dom/events/test/window_bug493251.html | 13 + dom/events/test/window_bug617528.xhtml | 9 + dom/events/test/window_bug659071.html | 72 + dom/events/test/window_empty_document.html | 7 + dom/events/test/window_wheel_default_action.html | 3621 ++++++++++++++++++++ 362 files changed, 42667 insertions(+) create mode 100644 dom/events/test/browser.ini create mode 100644 dom/events/test/browser_alt_keyup_in_content.js create mode 100644 dom/events/test/browser_beforeinput_by_execCommand_in_contentscript.js create mode 100644 dom/events/test/browser_bug1539497.js create mode 100644 dom/events/test/browser_dragimage.js create mode 100644 dom/events/test/browser_keyboard_event_init_key_event_enabled_in_contentscript.js create mode 100644 dom/events/test/browser_mouse_enterleave_switch_tab.js create mode 100644 dom/events/test/browser_shortcutkey_modifier_conflicts_with_content_accesskey_modifier.js create mode 100644 dom/events/test/bug1017086_inner.html create mode 100644 dom/events/test/bug226361_iframe.xhtml create mode 100644 dom/events/test/bug299673.js create mode 100644 dom/events/test/bug322588-popup.html create mode 100644 dom/events/test/bug415498-doc1.html create mode 100644 dom/events/test/bug415498-doc2.html create mode 100644 dom/events/test/bug418986-3.js create mode 100644 dom/events/test/bug426082.html create mode 100644 dom/events/test/bug545268.html create mode 100644 dom/events/test/bug574663.html create mode 100644 dom/events/test/bug591249_iframe.xhtml create mode 100644 dom/events/test/bug602962.xhtml create mode 100644 dom/events/test/bug607464.html create mode 100644 dom/events/test/bug656379-1.html create mode 100644 dom/events/test/chrome.ini create mode 100644 dom/events/test/clipboard/browser.ini create mode 100644 dom/events/test/clipboard/browser_navigator_clipboard_clickjacking.js create mode 100644 dom/events/test/clipboard/browser_navigator_clipboard_read.js create mode 100644 dom/events/test/clipboard/browser_navigator_clipboard_readText.js create mode 100644 dom/events/test/clipboard/browser_navigator_clipboard_touch.js create mode 100644 dom/events/test/clipboard/chrome.ini create mode 100644 dom/events/test/clipboard/head.js create mode 100644 dom/events/test/clipboard/simple_navigator_clipboard_keydown.html create mode 100644 dom/events/test/clipboard/simple_navigator_clipboard_read.html create mode 100644 dom/events/test/clipboard/simple_navigator_clipboard_readText.html create mode 100644 dom/events/test/clipboard/test_async_clipboard.xhtml create mode 100644 dom/events/test/dragimage.html create mode 100644 dom/events/test/empty.js create mode 100644 dom/events/test/error_event_worker.js create mode 100644 dom/events/test/event_leak_utils.js create mode 100644 dom/events/test/file_beforeinput_by_execCommand_in_contentscript.html create mode 100644 dom/events/test/file_bug1446834.html create mode 100644 dom/events/test/file_bug1484371.html create mode 100644 dom/events/test/file_bug1692052.html create mode 100644 dom/events/test/file_bug679494.html create mode 100644 dom/events/test/file_coalesce_touchmove_browserchild.html create mode 100644 dom/events/test/file_coalesce_touchmove_browserchild2.html create mode 100644 dom/events/test/file_coalesce_touchmove_ipc.html create mode 100644 dom/events/test/file_empty.html create mode 100644 dom/events/test/file_event_screenXY.html create mode 100644 dom/events/test/file_focus_blur_on_click_in_cross_origin_iframe.html create mode 100644 dom/events/test/file_focus_blur_on_click_in_deep_cross_origin_iframe_inner.html create mode 100644 dom/events/test/file_focus_blur_on_click_in_deep_cross_origin_iframe_middle.html create mode 100644 dom/events/test/file_keyboard_event_init_key_event_enabled_in_contentscript.html create mode 100644 dom/events/test/file_mouse_enterleave.html create mode 100644 dom/events/test/green.png create mode 100644 dom/events/test/gtest/TestShortcutKeyDefinitions.cpp create mode 100644 dom/events/test/gtest/moz.build create mode 100644 dom/events/test/mochitest.ini create mode 100644 dom/events/test/pointerevents/bug1293174_implicit_pointer_capture_for_touch_1.html create mode 100644 dom/events/test/pointerevents/bug1293174_implicit_pointer_capture_for_touch_2.html create mode 100644 dom/events/test/pointerevents/bug968148_inner.html create mode 100644 dom/events/test/pointerevents/bug968148_inner2.html create mode 100644 dom/events/test/pointerevents/bug_1420589_iframe1.html create mode 100644 dom/events/test/pointerevents/bug_1420589_iframe2.html create mode 100644 dom/events/test/pointerevents/chrome.ini create mode 100644 dom/events/test/pointerevents/file_pointercapture_xorigin_iframe.html create mode 100644 dom/events/test/pointerevents/file_pointercapture_xorigin_iframe_pointerlock.html create mode 100644 dom/events/test/pointerevents/file_pointercapture_xorigin_iframe_touch.html create mode 100644 dom/events/test/pointerevents/file_test_trigger_fullscreen.html create mode 100644 dom/events/test/pointerevents/iframe.html create mode 100644 dom/events/test/pointerevents/mochitest.ini create mode 100644 dom/events/test/pointerevents/mochitest_support_external.js create mode 100644 dom/events/test/pointerevents/mochitest_support_internal.js create mode 100644 dom/events/test/pointerevents/pointerevent_utils.js create mode 100644 dom/events/test/pointerevents/readme.md create mode 100644 dom/events/test/pointerevents/test_bug1285128.html create mode 100644 dom/events/test/pointerevents/test_bug1293174_implicit_pointer_capture_for_touch_1.html create mode 100644 dom/events/test/pointerevents/test_bug1293174_implicit_pointer_capture_for_touch_2.html create mode 100644 dom/events/test/pointerevents/test_bug1303704.html create mode 100644 dom/events/test/pointerevents/test_bug1315862.html create mode 100644 dom/events/test/pointerevents/test_bug1323158.html create mode 100644 dom/events/test/pointerevents/test_bug1403055.html create mode 100644 dom/events/test/pointerevents/test_bug1420589_1.html create mode 100644 dom/events/test/pointerevents/test_bug1420589_2.html create mode 100644 dom/events/test/pointerevents/test_bug1420589_3.html create mode 100644 dom/events/test/pointerevents/test_bug1697769.xhtml create mode 100644 dom/events/test/pointerevents/test_bug1725416.html create mode 100644 dom/events/test/pointerevents/test_bug968148.html create mode 100644 dom/events/test/pointerevents/test_getCoalescedEvents.html create mode 100644 dom/events/test/pointerevents/test_getCoalescedEvents_touch.html create mode 100644 dom/events/test/pointerevents/test_multiple_touches.html create mode 100644 dom/events/test/pointerevents/test_pointercapture_remove_iframe.html create mode 100644 dom/events/test/pointerevents/test_pointercapture_xorigin_iframe.html create mode 100644 dom/events/test/pointerevents/test_pointermove_drag_scrollbar.html create mode 100644 dom/events/test/pointerevents/test_remove_frame_when_got_pointer_capture.html create mode 100644 dom/events/test/pointerevents/test_synthesized_touch.html create mode 100644 dom/events/test/pointerevents/test_trigger_fullscreen_by_pointer_events.html create mode 100644 dom/events/test/pointerevents/test_wpt_pointerevent_attributes_hoverable_pointers-manual.html create mode 100644 dom/events/test/pointerevents/test_wpt_pointerevent_attributes_nohover_pointers-manual.html create mode 100644 dom/events/test/pointerevents/test_wpt_pointerevent_boundary_events_in_capturing-manual.html create mode 100644 dom/events/test/pointerevents/test_wpt_pointerevent_change-touch-action-onpointerdown_touch-manual.html create mode 100644 dom/events/test/pointerevents/test_wpt_pointerevent_constructor.html create mode 100644 dom/events/test/pointerevents/test_wpt_pointerevent_drag_interaction-manual.html create mode 100644 dom/events/test/pointerevents/test_wpt_pointerevent_movementxy-manual.html create mode 100644 dom/events/test/pointerevents/test_wpt_pointerevent_multiple_primary_pointers_boundary_events-manual.html create mode 100644 dom/events/test/pointerevents/test_wpt_pointerevent_pointerId_scope-manual.html create mode 100644 dom/events/test/pointerevents/test_wpt_pointerevent_pointercancel_touch-manual.html create mode 100644 dom/events/test/pointerevents/test_wpt_pointerevent_pointerleave_after_pointercancel_touch-manual.html create mode 100644 dom/events/test/pointerevents/test_wpt_pointerevent_pointerleave_pen-manual.html create mode 100644 dom/events/test/pointerevents/test_wpt_pointerevent_pointerout_after_pointercancel_touch-manual.html create mode 100644 dom/events/test/pointerevents/test_wpt_pointerevent_pointerout_pen-manual.html create mode 100644 dom/events/test/pointerevents/test_wpt_pointerevent_releasepointercapture_events_to_original_target-manual.html create mode 100644 dom/events/test/pointerevents/test_wpt_pointerevent_releasepointercapture_onpointercancel_touch-manual.html create mode 100644 dom/events/test/pointerevents/test_wpt_pointerevent_sequence_at_implicit_release_on_drag-manual.html create mode 100644 dom/events/test/pointerevents/test_wpt_touch_action.html create mode 100644 dom/events/test/pointerevents/touch_action_helpers.js create mode 100644 dom/events/test/pointerevents/wpt/compat/pointerevent_touch-action_two-finger_interaction-manual.html create mode 100644 dom/events/test/pointerevents/wpt/html/pointerevent_drag_interaction-manual.html create mode 100644 dom/events/test/pointerevents/wpt/idlharness.html create mode 100644 dom/events/test/pointerevents/wpt/pointerevent_attributes_hoverable_pointers-manual.html create mode 100644 dom/events/test/pointerevents/wpt/pointerevent_attributes_nohover_pointers-manual.html create mode 100644 dom/events/test/pointerevents/wpt/pointerevent_boundary_events_in_capturing-manual.html create mode 100644 dom/events/test/pointerevents/wpt/pointerevent_change-touch-action-onpointerdown_touch-manual.html create mode 100644 dom/events/test/pointerevents/wpt/pointerevent_constructor.html create mode 100644 dom/events/test/pointerevents/wpt/pointerevent_multiple_primary_pointers_boundary_events-manual.html create mode 100644 dom/events/test/pointerevents/wpt/pointerevent_pointerId_scope-manual.html create mode 100644 dom/events/test/pointerevents/wpt/pointerevent_pointercancel_touch-manual.html create mode 100644 dom/events/test/pointerevents/wpt/pointerevent_pointerleave_after_pointercancel_touch-manual.html create mode 100644 dom/events/test/pointerevents/wpt/pointerevent_pointerleave_pen-manual.html create mode 100644 dom/events/test/pointerevents/wpt/pointerevent_pointerout_after_pointercancel_touch-manual.html create mode 100644 dom/events/test/pointerevents/wpt/pointerevent_pointerout_pen-manual.html create mode 100644 dom/events/test/pointerevents/wpt/pointerevent_releasepointercapture_events_to_original_target-manual.html create mode 100644 dom/events/test/pointerevents/wpt/pointerevent_releasepointercapture_onpointercancel_touch-manual.html create mode 100644 dom/events/test/pointerevents/wpt/pointerevent_sequence_at_implicit_release_on_click-manual.html create mode 100644 dom/events/test/pointerevents/wpt/pointerevent_sequence_at_implicit_release_on_drag-manual.html create mode 100644 dom/events/test/pointerevents/wpt/pointerevent_styles.css create mode 100644 dom/events/test/pointerevents/wpt/pointerevent_support.js create mode 100644 dom/events/test/pointerevents/wpt/pointerevent_touch-action-auto-css_touch-manual.html create mode 100644 dom/events/test/pointerevents/wpt/pointerevent_touch-action-button-test_touch-manual.html create mode 100644 dom/events/test/pointerevents/wpt/pointerevent_touch-action-illegal.html create mode 100644 dom/events/test/pointerevents/wpt/pointerevent_touch-action-inherit_child-auto-child-none_touch-manual.html create mode 100644 dom/events/test/pointerevents/wpt/pointerevent_touch-action-inherit_child-none_touch-manual.html create mode 100644 dom/events/test/pointerevents/wpt/pointerevent_touch-action-inherit_child-pan-x-child-pan-x_touch-manual.html create mode 100644 dom/events/test/pointerevents/wpt/pointerevent_touch-action-inherit_child-pan-x-child-pan-y_touch-manual.html create mode 100644 dom/events/test/pointerevents/wpt/pointerevent_touch-action-inherit_highest-parent-none_touch-manual.html create mode 100644 dom/events/test/pointerevents/wpt/pointerevent_touch-action-inherit_parent-none_touch-manual.html create mode 100644 dom/events/test/pointerevents/wpt/pointerevent_touch-action-keyboard-manual.html create mode 100644 dom/events/test/pointerevents/wpt/pointerevent_touch-action-mouse-manual.html create mode 100644 dom/events/test/pointerevents/wpt/pointerevent_touch-action-none-css_touch-manual.html create mode 100644 dom/events/test/pointerevents/wpt/pointerevent_touch-action-pan-down-css_touch-manual.html create mode 100644 dom/events/test/pointerevents/wpt/pointerevent_touch-action-pan-left-css_touch-manual.html create mode 100644 dom/events/test/pointerevents/wpt/pointerevent_touch-action-pan-right-css_touch-manual.html create mode 100644 dom/events/test/pointerevents/wpt/pointerevent_touch-action-pan-up-css_touch-manual.html create mode 100644 dom/events/test/pointerevents/wpt/pointerevent_touch-action-pan-x-css_touch-manual.html create mode 100644 dom/events/test/pointerevents/wpt/pointerevent_touch-action-pan-x-pan-y-pan-y_touch-manual.html create mode 100644 dom/events/test/pointerevents/wpt/pointerevent_touch-action-pan-x-pan-y_touch-manual.html create mode 100644 dom/events/test/pointerevents/wpt/pointerevent_touch-action-pan-y-css_touch-manual.html create mode 100644 dom/events/test/pointerevents/wpt/pointerevent_touch-action-span-test_touch-manual.html create mode 100644 dom/events/test/pointerevents/wpt/pointerevent_touch-action-svg-test_touch-manual.html create mode 100644 dom/events/test/pointerevents/wpt/pointerevent_touch-action-table-test_touch-manual.html create mode 100644 dom/events/test/pointerevents/wpt/pointerevent_touch-action-verification.html create mode 100644 dom/events/test/pointerevents/wpt/pointerlock/pointerevent_movementxy-manual.html create mode 100644 dom/events/test/pointerevents/wpt/pointerlock/resources/pointerevent_movementxy-iframe.html create mode 100644 dom/events/test/pointerevents/wpt/resources/pointerevent_attributes_hoverable_pointers-iframe.html create mode 100644 dom/events/test/pointerevents/wpt/resources/pointerevent_pointerId_scope-iframe.html create mode 100644 dom/events/test/test_DataTransferItemList.html create mode 100644 dom/events/test/test_accel_virtual_modifier.html create mode 100644 dom/events/test/test_accesskey.html create mode 100644 dom/events/test/test_addEventListenerExtraArg.html create mode 100644 dom/events/test/test_all_synthetic_events.html create mode 100644 dom/events/test/test_bug1003432.html create mode 100644 dom/events/test/test_bug1003432.js create mode 100644 dom/events/test/test_bug1013412.html create mode 100644 dom/events/test/test_bug1017086_enable.html create mode 100644 dom/events/test/test_bug1037990.html create mode 100644 dom/events/test/test_bug1079236.html create mode 100644 dom/events/test/test_bug1127588.html create mode 100644 dom/events/test/test_bug1128787-1.html create mode 100644 dom/events/test/test_bug1128787-2.html create mode 100644 dom/events/test/test_bug1128787-3.html create mode 100644 dom/events/test/test_bug1145910.html create mode 100644 dom/events/test/test_bug1150308.html create mode 100644 dom/events/test/test_bug1248459.html create mode 100644 dom/events/test/test_bug1264380.html create mode 100644 dom/events/test/test_bug1298970.html create mode 100644 dom/events/test/test_bug1304044.html create mode 100644 dom/events/test/test_bug1305458.html create mode 100644 dom/events/test/test_bug1327798.html create mode 100644 dom/events/test/test_bug1332699.html create mode 100644 dom/events/test/test_bug1339758.html create mode 100644 dom/events/test/test_bug1369072.html create mode 100644 dom/events/test/test_bug1412775.xhtml create mode 100644 dom/events/test/test_bug1429572.html create mode 100644 dom/events/test/test_bug1446834.html create mode 100644 dom/events/test/test_bug1447993.html create mode 100644 dom/events/test/test_bug1484371.html create mode 100644 dom/events/test/test_bug1534562.html create mode 100644 dom/events/test/test_bug1539497.html create mode 100644 dom/events/test/test_bug1581192.html create mode 100644 dom/events/test/test_bug1635018.html create mode 100644 dom/events/test/test_bug1637259.html create mode 100644 dom/events/test/test_bug1673434.html create mode 100644 dom/events/test/test_bug1681800.html create mode 100644 dom/events/test/test_bug1686716.html create mode 100644 dom/events/test/test_bug1692052.html create mode 100644 dom/events/test/test_bug1692277.html create mode 100644 dom/events/test/test_bug1709832.html create mode 100644 dom/events/test/test_bug1710509.html create mode 100644 dom/events/test/test_bug1728171.html create mode 100644 dom/events/test/test_bug226361.xhtml create mode 100644 dom/events/test/test_bug238987.html create mode 100644 dom/events/test/test_bug288392.html create mode 100644 dom/events/test/test_bug299673-1.html create mode 100644 dom/events/test/test_bug299673-2.html create mode 100644 dom/events/test/test_bug322588.html create mode 100644 dom/events/test/test_bug328885.html create mode 100644 dom/events/test/test_bug336682.js create mode 100644 dom/events/test/test_bug336682_1.html create mode 100644 dom/events/test/test_bug336682_2.xhtml create mode 100644 dom/events/test/test_bug367781.html create mode 100644 dom/events/test/test_bug379120.html create mode 100644 dom/events/test/test_bug402089.html create mode 100644 dom/events/test/test_bug405632.html create mode 100644 dom/events/test/test_bug409604.html create mode 100644 dom/events/test/test_bug412567.html create mode 100644 dom/events/test/test_bug415498.xhtml create mode 100644 dom/events/test/test_bug418986-3.html create mode 100644 dom/events/test/test_bug418986-3.xhtml create mode 100644 dom/events/test/test_bug422132.html create mode 100644 dom/events/test/test_bug426082.html create mode 100644 dom/events/test/test_bug427537.html create mode 100644 dom/events/test/test_bug428988.html create mode 100644 dom/events/test/test_bug432698.html create mode 100644 dom/events/test/test_bug443985.html create mode 100644 dom/events/test/test_bug447736.html create mode 100644 dom/events/test/test_bug448602.html create mode 100644 dom/events/test/test_bug450876.html create mode 100644 dom/events/test/test_bug456273.html create mode 100644 dom/events/test/test_bug457672.html create mode 100644 dom/events/test/test_bug489671.html create mode 100644 dom/events/test/test_bug493251.html create mode 100644 dom/events/test/test_bug508479.html create mode 100644 dom/events/test/test_bug517851.html create mode 100644 dom/events/test/test_bug524674.xhtml create mode 100644 dom/events/test/test_bug534833.html create mode 100644 dom/events/test/test_bug545268.html create mode 100644 dom/events/test/test_bug547996-1.html create mode 100644 dom/events/test/test_bug547996-2.xhtml create mode 100644 dom/events/test/test_bug547996-3.xhtml create mode 100644 dom/events/test/test_bug556493.html create mode 100644 dom/events/test/test_bug563329.html create mode 100644 dom/events/test/test_bug574663.html create mode 100644 dom/events/test/test_bug586961.xhtml create mode 100644 dom/events/test/test_bug591249.xhtml create mode 100644 dom/events/test/test_bug591815.html create mode 100644 dom/events/test/test_bug593959.html create mode 100644 dom/events/test/test_bug602962.xhtml create mode 100644 dom/events/test/test_bug603008.html create mode 100644 dom/events/test/test_bug605242.html create mode 100644 dom/events/test/test_bug607464.html create mode 100644 dom/events/test/test_bug613634.html create mode 100644 dom/events/test/test_bug615597.html create mode 100644 dom/events/test/test_bug617528.xhtml create mode 100644 dom/events/test/test_bug624127.html create mode 100644 dom/events/test/test_bug635465.html create mode 100644 dom/events/test/test_bug641477.html create mode 100644 dom/events/test/test_bug648573.html create mode 100644 dom/events/test/test_bug650493.html create mode 100644 dom/events/test/test_bug656379-1.html create mode 100644 dom/events/test/test_bug656379-2.html create mode 100644 dom/events/test/test_bug656954.html create mode 100644 dom/events/test/test_bug659071.html create mode 100644 dom/events/test/test_bug659350.html create mode 100644 dom/events/test/test_bug662678.html create mode 100644 dom/events/test/test_bug667612.html create mode 100644 dom/events/test/test_bug667919-1.html create mode 100644 dom/events/test/test_bug679494.xhtml create mode 100644 dom/events/test/test_bug684208.html create mode 100644 dom/events/test/test_bug687787.html create mode 100644 dom/events/test/test_bug689564.html create mode 100644 dom/events/test/test_bug698929.html create mode 100644 dom/events/test/test_bug704423.html create mode 100644 dom/events/test/test_bug741666.html create mode 100644 dom/events/test/test_bug812744.html create mode 100644 dom/events/test/test_bug822898.html create mode 100644 dom/events/test/test_bug855741.html create mode 100644 dom/events/test/test_bug864040.html create mode 100644 dom/events/test/test_bug924087.html create mode 100644 dom/events/test/test_bug930374-chrome.html create mode 100644 dom/events/test/test_bug930374-content.html create mode 100644 dom/events/test/test_bug944011.html create mode 100644 dom/events/test/test_bug944847.html create mode 100644 dom/events/test/test_bug946632.html create mode 100644 dom/events/test/test_bug967796.html create mode 100644 dom/events/test/test_bug985988.html create mode 100644 dom/events/test/test_bug998809.html create mode 100644 dom/events/test/test_click_on_reframed_generated_text.html create mode 100644 dom/events/test/test_click_on_restyled_element.html create mode 100644 dom/events/test/test_clickevent_on_input.html create mode 100644 dom/events/test/test_coalesce_mousewheel.html create mode 100644 dom/events/test/test_coalesce_touchmove.html create mode 100644 dom/events/test/test_continuous_wheel_events.html create mode 100644 dom/events/test/test_dblclick_explicit_original_target.html create mode 100644 dom/events/test/test_deltaMode_lines_always_enabled.html create mode 100644 dom/events/test/test_deviceSensor.html create mode 100644 dom/events/test/test_disabled_events.html create mode 100644 dom/events/test/test_dnd_with_modifiers.html create mode 100644 dom/events/test/test_dom_activate_event.html create mode 100644 dom/events/test/test_dom_keyboard_event.html create mode 100644 dom/events/test/test_dom_mouse_event.html create mode 100644 dom/events/test/test_dom_storage_event.html create mode 100644 dom/events/test/test_dom_wheel_event.html create mode 100644 dom/events/test/test_drag_coords.html create mode 100644 dom/events/test/test_drag_image_file.html create mode 100644 dom/events/test/test_draggableprop.html create mode 100644 dom/events/test/test_dragstart.html create mode 100644 dom/events/test/test_error_events.html create mode 100644 dom/events/test/test_eventTimeStamp.html create mode 100644 dom/events/test/test_event_handler_cc.html create mode 100644 dom/events/test/test_event_screenXY_in_cross_origin_iframe.html create mode 100644 dom/events/test/test_event_screenXY_with_zoom.html create mode 100644 dom/events/test/test_eventctors.html create mode 100644 dom/events/test/test_eventctors.xhtml create mode 100644 dom/events/test/test_eventctors_sensors.html create mode 100644 dom/events/test/test_eventhandler_scoping.html create mode 100644 dom/events/test/test_focus_abspos.html create mode 100644 dom/events/test/test_focus_blur_on_click_in_cross_origin_iframe.html create mode 100644 dom/events/test/test_focus_blur_on_click_in_deep_cross_origin_iframe.html create mode 100644 dom/events/test/test_hover_mouseleave.html create mode 100644 dom/events/test/test_legacy_event.html create mode 100644 dom/events/test/test_legacy_non-primary_click.html create mode 100644 dom/events/test/test_legacy_touch_api.html create mode 100644 dom/events/test/test_marquee_events.html create mode 100644 dom/events/test/test_messageEvent.html create mode 100644 dom/events/test/test_messageEvent_init.html create mode 100644 dom/events/test/test_mouse_capture_iframe.html create mode 100644 dom/events/test/test_mouse_enterleave_iframe.html create mode 100644 dom/events/test/test_moving_and_expanding_selection_per_page.html create mode 100644 dom/events/test/test_moz_mouse_pixel_scroll_event.html create mode 100644 dom/events/test/test_offsetxy.html create mode 100644 dom/events/test/test_onerror_handler_args.html create mode 100644 dom/events/test/test_passive_listeners.html create mode 100644 dom/events/test/test_paste_image.html create mode 100644 dom/events/test/test_scroll_per_page.html create mode 100644 dom/events/test/test_slotted_mouse_event.html create mode 100644 dom/events/test/test_slotted_text_click.html create mode 100644 dom/events/test/test_submitevent_on_form.html create mode 100644 dom/events/test/test_text_event_in_content.html create mode 100644 dom/events/test/test_unbound_before_in_active_chain.html create mode 100644 dom/events/test/test_use_conflated_keypress_event_model_on_newer_Office_Online_Server.html create mode 100644 dom/events/test/test_use_split_keypress_event_model_on_old_Confluence.html create mode 100644 dom/events/test/test_use_split_keypress_event_model_on_old_Office_Online_Server.html create mode 100644 dom/events/test/test_wheel_default_action.html create mode 100644 dom/events/test/test_wheel_zoom_on_form_controls.html create mode 100644 dom/events/test/window_bug1369072.html create mode 100644 dom/events/test/window_bug1412775.xhtml create mode 100644 dom/events/test/window_bug1429572.html create mode 100644 dom/events/test/window_bug1447993.html create mode 100644 dom/events/test/window_bug493251.html create mode 100644 dom/events/test/window_bug617528.xhtml create mode 100644 dom/events/test/window_bug659071.html create mode 100644 dom/events/test/window_empty_document.html create mode 100644 dom/events/test/window_wheel_default_action.html (limited to 'dom/events/test') diff --git a/dom/events/test/browser.ini b/dom/events/test/browser.ini new file mode 100644 index 0000000000..722a833d53 --- /dev/null +++ b/dom/events/test/browser.ini @@ -0,0 +1,30 @@ +[DEFAULT] + +[browser_alt_keyup_in_content.js] +skip-if = + os == 'mac' + os == "win" && os_version == "6.1" # Skip on Azure - frequent failure + +[browser_beforeinput_by_execCommand_in_contentscript.js] +support-files = + file_beforeinput_by_execCommand_in_contentscript.html + ../../../browser/base/content/test/general/head.js + +[browser_bug1539497.js] +[browser_dragimage.js] +support-files = + dragimage.html + green.png +[browser_keyboard_event_init_key_event_enabled_in_contentscript.js] +support-files = + file_keyboard_event_init_key_event_enabled_in_contentscript.html + ../../../browser/base/content/test/general/head.js + +[browser_mouse_enterleave_switch_tab.js] +support-files = + ../../../browser/base/content/test/general/dummy_page.html +skip-if = + os == "win" && os_version == "6.1" # Skip on Azure - frequent failure + +[browser_shortcutkey_modifier_conflicts_with_content_accesskey_modifier.js] +skip-if = os == 'mac' # Alt + D is defined only on Linux and Windows diff --git a/dom/events/test/browser_alt_keyup_in_content.js b/dom/events/test/browser_alt_keyup_in_content.js new file mode 100644 index 0000000000..746e442d65 --- /dev/null +++ b/dom/events/test/browser_alt_keyup_in_content.js @@ -0,0 +1,333 @@ +"use strict"; + +add_task(async function runTests() { + const menubar = document.getElementById("toolbar-menubar"); + const autohide = menubar.getAttribute("autohide"); + // This test requires that the window is active because of the limitation of + // menubar. Therefore, we should abort if the window becomes inactive during + // the tests. + let runningTests = true; + function onWindowActive(aEvent) { + // Don't warn after timed out. + if (runningTests && aEvent.target === window) { + info( + "WARNING: This window shouldn't have been inactivated during tests, but received an activated event!" + ); + } + } + function onWindowInactive(aEvent) { + // Don't warn after timed out. + if (runningTests && aEvent.target === window) { + info( + "WARNING: This window should be active during tests, but inactivated!" + ); + window.focus(); + } + } + let menubarActivated = false; + function onMenubarActive() { + menubarActivated = true; + } + // In this test, menu popups shouldn't be open, but this helps avoiding + // intermittent failure after inactivating the menubar. + let popupEvents = 0; + function getPopupInfo(aPopupEventTarget) { + return `<${ + aPopupEventTarget.nodeName + }${aPopupEventTarget.getAttribute("id") !== null ? ` id="${aPopupEventTarget.getAttribute("id")}"` : ""}>`; + } + function onPopupShown(aEvent) { + // Don't warn after timed out. + if (!runningTests) { + return; + } + popupEvents++; + info( + `A popup (${getPopupInfo( + aEvent.target + )}) is shown (visible popups: ${popupEvents})` + ); + } + function onPopupHidden(aEvent) { + // Don't warn after timed out. + if (!runningTests) { + return; + } + if (popupEvents === 0) { + info( + `WARNING: There are some unexpected popups which may be not cleaned up by the previous test (${getPopupInfo( + aEvent.target + )})` + ); + return; + } + popupEvents--; + info( + `A popup (${getPopupInfo( + aEvent.target + )}) is hidden (visible popups: ${popupEvents})` + ); + } + try { + Services.prefs.setBoolPref("ui.key.menuAccessKeyFocuses", true); + // If this fails, you need to replace "KEY_Alt" with a variable whose + // value is considered from the pref. + is( + Services.prefs.getIntPref("ui.key.menuAccessKey"), + 18, + "This test assumes that Alt key activates the menubar" + ); + window.addEventListener("activate", onWindowActive); + window.addEventListener("deactivate", onWindowInactive); + window.addEventListener("popupshown", onPopupShown); + window.addEventListener("popuphidden", onPopupHidden); + menubar.addEventListener("DOMMenuBarActive", onMenubarActive); + async function doTest(aTest) { + await new Promise(resolve => { + if (Services.focus.activeWindow === window) { + resolve(); + return; + } + info( + `${aTest.description}: The testing window is inactive, trying to activate it...` + ); + Services.focus.focusedWindow = window; + TestUtils.waitForCondition(() => { + if (Services.focus.activeWindow === window) { + resolve(); + return true; + } + Services.focus.focusedWindow = window; + return false; + }, `${aTest.description}: Waiting the window is activated`); + }); + let startTime = performance.now(); + info(`Start to test: ${aTest.description}...`); + + async function ensureMenubarInactive() { + if (!menubar.querySelector("[_moz-menuactive=true]")) { + return; + } + info(`${aTest.description}: Inactivating the menubar...`); + let waitForMenuBarInactive = BrowserTestUtils.waitForEvent( + menubar, + "DOMMenuBarInactive" + ); + EventUtils.synthesizeKey("KEY_Escape", {}, window); + await waitForMenuBarInactive; + await TestUtils.waitForCondition(() => { + return popupEvents === 0; + }, `${aTest.description}: Waiting for closing all popups`); + } + + try { + await BrowserTestUtils.withNewTab( + { + gBrowser, + url: aTest.url, + }, + async browser => { + info(`${aTest.description}: Waiting browser getting focus...`); + await SimpleTest.promiseFocus(browser); + await ensureMenubarInactive(); + menubarActivated = false; + + let keyupEventFiredInContent = false; + BrowserTestUtils.addContentEventListener( + browser, + "keyup", + () => { + keyupEventFiredInContent = true; + }, + { capture: true }, + event => { + return event.key === "Alt"; + } + ); + + // For making sure adding the above content event listener and + // it'll get `keyup` event, let's run `SpecialPowers.spawn` and + // wait for focus in the content process. + info( + `${aTest.description}: Waiting content process getting focus...` + ); + await SpecialPowers.spawn( + browser, + [aTest.description], + async aTestDescription => { + await ContentTaskUtils.waitForCondition(() => { + if ( + content.browsingContext.isActive && + content.document.hasFocus() + ) { + return true; + } + content.window.focus(); + return false; + }, `${aTestDescription}: Waiting for content gets focus in content process`); + } + ); + + let waitForAllKeyUpEventsInChrome = new Promise(resolve => { + // Wait 2 `keyup` events in the main process. First one is + // synthesized one. The other is replay event from content. + let firstKeyUpEvent; + window.addEventListener( + "keyup", + function onKeyUpInChrome(event) { + if (!firstKeyUpEvent) { + firstKeyUpEvent = event; + return; + } + window.removeEventListener("keyup", onKeyUpInChrome, { + capture: true, + }); + resolve(); + }, + { capture: true } + ); + }); + + let menubarActivatedPromise; + if (aTest.expectMenubarActive) { + menubarActivatedPromise = BrowserTestUtils.waitForEvent( + menubar, + "DOMMenuBarActive" + ); + } + + EventUtils.synthesizeKey("KEY_Alt", {}, window); + info( + `${aTest.description}: Waiting keyup events of Alt in chrome...` + ); + await waitForAllKeyUpEventsInChrome; + info(`${aTest.description}: Waiting keyup event in content...`); + try { + await TestUtils.waitForCondition(() => { + return keyupEventFiredInContent; + }, `${aTest.description}: Waiting for content gets focus in chrome process`); + } catch (ex) { + ok( + false, + `${aTest.description}: Failed to synthesize Alt key press in the content process` + ); + return; + } + + if (aTest.expectMenubarActive) { + await menubarActivatedPromise; + ok( + menubarActivated, + `${aTest.description}: Menubar should've been activated by the synthesized Alt key press` + ); + } else { + // Wait some ticks to verify not receiving "DOMMenuBarActive" event. + // eslint-disable-next-line mozilla/no-arbitrary-setTimeout + await new Promise(resolve => setTimeout(resolve, 500)); + ok( + !menubarActivated, + `${aTest.description}: Menubar should not have been activated by the synthesized Alt key press` + ); + } + } + ); + } catch (ex) { + ok( + false, + `${aTest.description}: Thrown an exception: ${ex.toString()}` + ); + } finally { + await ensureMenubarInactive(); + info(`End testing: ${aTest.description}`); + ChromeUtils.addProfilerMarker( + "browser-test", + { startTime, category: "Test" }, + aTest.description + ); + } + } + + // Testcases for users who use collapsible menubar (by default) + menubar.setAttribute("autohide", "true"); + await doTest({ + description: "Testing menubar is shown by Alt keyup", + url: "data:text/html;charset=utf-8,

static page

", + expectMenubarActive: true, + }); + await doTest({ + description: + "Testing menubar is shown by Alt keyup when an has focus", + url: + "data:text/html;charset=utf-8," + + '', + expectMenubarActive: true, + }); + await doTest({ + description: + "Testing menubar is shown by Alt keyup when an editing host has focus", + url: + "data:text/html;charset=utf-8,

" + + '', + expectMenubarActive: true, + }); + await doTest({ + description: + "Testing menubar won't be shown by Alt keyup due to suppressed by the page", + url: + "data:text/html;charset=utf-8,

dynamic page

" + + '', + expectMenubarActive: false, + }); + + // Testcases for users who always show the menubar. + menubar.setAttribute("autohide", "false"); + await doTest({ + description: "Testing menubar is activated by Alt keyup", + url: "data:text/html;charset=utf-8,

static page

", + expectMenubarActive: true, + }); + await doTest({ + description: + "Testing menubar is activated by Alt keyup when an has focus", + url: + "data:text/html;charset=utf-8," + + '', + expectMenubarActive: true, + }); + await doTest({ + description: + "Testing menubar is activated by Alt keyup when an editing host has focus", + url: + "data:text/html;charset=utf-8,

" + + '', + expectMenubarActive: true, + }); + await doTest({ + description: + "Testing menubar won't be activated by Alt keyup due to suppressed by the page", + url: + "data:text/html;charset=utf-8,

dynamic page

" + + '', + expectMenubarActive: false, + }); + runningTests = false; + } catch (ex) { + ok( + false, + `Aborting this test due to unexpected the exception (${ex.toString()})` + ); + runningTests = false; + } finally { + if (autohide !== null) { + menubar.setAttribute("autohide", autohide); + } else { + menubar.removeAttribute("autohide"); + } + Services.prefs.clearUserPref("ui.key.menuAccessKeyFocuses"); + menubar.removeEventListener("DOMMenuBarActive", onMenubarActive); + window.removeEventListener("activate", onWindowActive); + window.removeEventListener("deactivate", onWindowInactive); + window.removeEventListener("popupshown", onPopupShown); + window.removeEventListener("popuphidden", onPopupHidden); + } +}); diff --git a/dom/events/test/browser_beforeinput_by_execCommand_in_contentscript.js b/dom/events/test/browser_beforeinput_by_execCommand_in_contentscript.js new file mode 100644 index 0000000000..d995e6f4d4 --- /dev/null +++ b/dom/events/test/browser_beforeinput_by_execCommand_in_contentscript.js @@ -0,0 +1,106 @@ +"use strict"; + +async function installAndStartExtension() { + function contentScript() { + window.addEventListener("keydown", aEvent => { + console.log("keydown event is fired"); + if (aEvent.defaultPrevented) { + return; + } + let selection = window.getSelection(); + if (selection.isCollapsed) { + return; + } + if (aEvent.ctrlKey && aEvent.key === "k") { + document.execCommand("createLink", false, "http://example.com/"); + aEvent.preventDefault(); + } + }); + } + + let extension = ExtensionTestUtils.loadExtension({ + manifest: { + content_scripts: [ + { + js: ["content_script.js"], + matches: [""], + run_at: "document_start", + }, + ], + }, + files: { + "content_script.js": contentScript, + }, + }); + + await extension.startup(); + + return extension; +} + +add_task(async function () { + const extension = await installAndStartExtension(); + const tab = await BrowserTestUtils.openNewForegroundTab( + gBrowser, + "http://example.com/browser/dom/events/test/file_beforeinput_by_execCommand_in_contentscript.html", + true + ); + + function runTest() { + var editor = content.document.querySelector("[contenteditable]"); + editor.focus(); + content.document.getSelection().selectAllChildren(editor); + var beforeinput; + editor.addEventListener("beforeinput", aEvent => { + beforeinput = aEvent; + }); + editor.addEventListener("input", aEvent => { + if (!beforeinput) { + sendAsyncMessage("Test:BeforeInputInContentEditable", { + succeeded: false, + message: "No beforeinput event is fired", + }); + return; + } + sendAsyncMessage("Test:BeforeInputInContentEditable", { + succeeded: + editor.innerHTML === 'abcdef', + message: `editor.innerHTML=${editor.innerHTML}`, + }); + }); + } + + try { + tab.linkedBrowser.messageManager.loadFrameScript( + "data:,(" + runTest.toString() + ")();", + false + ); + + let received = false; + let testResult = new Promise(resolve => { + let mm = tab.linkedBrowser.messageManager; + mm.addMessageListener( + "Test:BeforeInputInContentEditable", + function onFinish(aMsg) { + mm.removeMessageListener( + "Test:BeforeInputInContentEditable", + onFinish + ); + is(aMsg.data.succeeded, true, aMsg.data.message); + resolve(); + } + ); + }); + info("Sending Ctrl+K..."); + await BrowserTestUtils.synthesizeKey( + "k", + { ctrlKey: true }, + tab.linkedBrowser + ); + info("Waiting test result..."); + await testResult; + } finally { + BrowserTestUtils.removeTab(tab); + await extension.unload(); + } +}); diff --git a/dom/events/test/browser_bug1539497.js b/dom/events/test/browser_bug1539497.js new file mode 100644 index 0000000000..78ea64c119 --- /dev/null +++ b/dom/events/test/browser_bug1539497.js @@ -0,0 +1,25 @@ +/* Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ */ + +"use strict"; + +add_task(async function maxTouchPoints() { + await new Promise(resolve => { + SpecialPowers.pushPrefEnv( + { + set: [["dom.maxtouchpoints.testing.value", 5]], + }, + resolve + ); + }); + + let tab = await BrowserTestUtils.openNewForegroundTab( + gBrowser, + "data:text/html,Test page for navigator.maxTouchPoints" + ); + await SpecialPowers.spawn(tab.linkedBrowser, [], function () { + is(content.navigator.maxTouchPoints, 5, "Should have touch points."); + }); + + BrowserTestUtils.removeTab(tab); +}); diff --git a/dom/events/test/browser_dragimage.js b/dom/events/test/browser_dragimage.js new file mode 100644 index 0000000000..503c0ac449 --- /dev/null +++ b/dom/events/test/browser_dragimage.js @@ -0,0 +1,65 @@ +const TEST_URI = "dragimage.html"; + +// This test checks that dragging an image onto the same document +// does not drop it, even when the page cancels the dragover event. +add_task(async function dragimage_remote_tab() { + var tab = await BrowserTestUtils.openNewForegroundTab( + gBrowser, + "http://www.example.com/browser/dom/events/test/" + TEST_URI + ); + + let dropHappened = false; + let oldHandler = tab.linkedBrowser.droppedLinkHandler; + tab.linkedBrowser.droppedLinkHandler = () => { + dropHappened = true; + }; + + await SpecialPowers.spawn(tab.linkedBrowser, [], async () => { + let image = content.document.body.firstElementChild; + let target = content.document.body.lastElementChild; + + await EventUtils.synthesizePlainDragAndDrop({ + srcElement: image, + destElement: target, + srcWindow: content, + destWindow: content, + id: content.windowUtils.DEFAULT_MOUSE_POINTER_ID, + }); + }); + + tab.linkedBrowser.droppedLinkHandler = oldHandler; + + ok(!dropHappened, "drop did not occur"); + + BrowserTestUtils.removeTab(tab); +}); + +// This test checks the same but with an in-process page. +add_task(async function dragimage_local_tab() { + var tab = await BrowserTestUtils.openNewForegroundTab( + gBrowser, + getRootDirectory(gTestPath) + TEST_URI + ); + + let dropHappened = false; + let oldHandler = tab.linkedBrowser.droppedLinkHandler; + tab.linkedBrowser.droppedLinkHandler = () => { + dropHappened = true; + }; + + let image = tab.linkedBrowser.contentDocument.body.firstElementChild; + let target = tab.linkedBrowser.contentDocument.body.lastElementChild; + + await EventUtils.synthesizePlainDragAndDrop({ + srcElement: image, + destElement: target, + srcWindow: tab.linkedBrowser.contentWindow, + destWindow: tab.linkedBrowser.contentWindow, + }); + + tab.linkedBrowser.droppedLinkHandler = oldHandler; + + ok(!dropHappened, "drop did not occur"); + + BrowserTestUtils.removeTab(tab); +}); diff --git a/dom/events/test/browser_keyboard_event_init_key_event_enabled_in_contentscript.js b/dom/events/test/browser_keyboard_event_init_key_event_enabled_in_contentscript.js new file mode 100644 index 0000000000..e8d51edb3e --- /dev/null +++ b/dom/events/test/browser_keyboard_event_init_key_event_enabled_in_contentscript.js @@ -0,0 +1,80 @@ +/* Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ */ + +"use strict"; + +async function installAndStartExtension() { + function contentScript() { + window.addEventListener( + "load", + () => { + document.documentElement.setAttribute( + "data-initKeyEvent-in-contentscript", + typeof window.KeyboardEvent.prototype.initKeyEvent + ); + }, + { capture: true, once: true } + ); + } + + let extension = ExtensionTestUtils.loadExtension({ + manifest: { + content_scripts: [ + { + js: ["content_script.js"], + matches: [""], + run_at: "document_start", + }, + ], + }, + files: { + "content_script.js": contentScript, + }, + }); + + await extension.startup(); + + return extension; +} + +add_task(async function () { + await SpecialPowers.pushPrefEnv({ + set: [ + ["dom.keyboardevent.init_key_event.enabled", false], + ["dom.keyboardevent.init_key_event.enabled_in_addons", true], + ], + }); + + const extension = await installAndStartExtension(); + await BrowserTestUtils.withNewTab( + "http://example.com/browser/dom/events/test/file_keyboard_event_init_key_event_enabled_in_contentscript.html", + async browser => { + info("Waiting for the test result..."); + await SpecialPowers.spawn(browser, [], () => { + Assert.equal( + content.document.documentElement.getAttribute( + "data-initKeyEvent-before" + ), + "undefined", + "KeyboardEvent.initKeyEvent shouldn't be available in web-content" + ); + Assert.equal( + content.document.documentElement.getAttribute( + "data-initKeyEvent-in-contentscript" + ), + "function", + "KeyboardEvent.initKeyEvent should be available in contentscript" + ); + Assert.equal( + content.document.documentElement.getAttribute( + "data-initKeyEvent-after" + ), + "undefined", + "KeyboardEvent.initKeyEvent shouldn't be available in web-content even after contentscript accesses it" + ); + }); + } + ); + + await extension.unload(); +}); diff --git a/dom/events/test/browser_mouse_enterleave_switch_tab.js b/dom/events/test/browser_mouse_enterleave_switch_tab.js new file mode 100644 index 0000000000..9c24120101 --- /dev/null +++ b/dom/events/test/browser_mouse_enterleave_switch_tab.js @@ -0,0 +1,158 @@ +"use strict"; + +async function synthesizeMouseAndWait(aBrowser, aEvent) { + let promise = SpecialPowers.spawn(aBrowser, [aEvent], async event => { + await new Promise(resolve => { + content.document.documentElement.addEventListener(event, resolve, { + once: true, + }); + }); + }); + // Ensure content has been added event listener. + await SpecialPowers.spawn(aBrowser, [], () => {}); + EventUtils.synthesizeMouse(aBrowser, 10, 10, { type: aEvent }); + return promise; +} + +function AddMouseEventListener(aBrowser) { + return SpecialPowers.spawn(aBrowser, [], () => { + content.catchedEvents = []; + let listener = function (aEvent) { + content.catchedEvents.push(aEvent.type); + }; + + let target = content.document.querySelector("p"); + target.onmouseenter = listener; + target.onmouseleave = listener; + }); +} + +function clearMouseEventListenerAndCheck(aBrowser, aExpectedEvents) { + return SpecialPowers.spawn(aBrowser, [aExpectedEvents], events => { + let target = content.document.querySelector("p"); + target.onmouseenter = null; + target.onmouseleave = null; + + Assert.deepEqual(content.catchedEvents, events); + }); +} + +add_task(async function testSwitchTabs() { + const tabFirst = await BrowserTestUtils.openNewForegroundTab( + gBrowser, + "http://example.com/browser/browser/base/content/test/general/dummy_page.html", + true + ); + + info("Initial mouse move"); + await EventUtils.synthesizeAndWaitNativeMouseMove( + tabFirst.linkedBrowser, + 10, + 10 + ); + + info("Open and move to a new tab"); + await AddMouseEventListener(tabFirst.linkedBrowser); + const tabSecond = await BrowserTestUtils.openNewForegroundTab( + gBrowser, + "http://example.com/browser/browser/base/content/test/general/dummy_page.html" + ); + // Synthesize a mousemove to generate corresponding mouseenter and mouseleave + // events. + await EventUtils.synthesizeAndWaitNativeMouseMove( + tabSecond.linkedBrowser, + 10, + 10 + ); + // Wait a bit to see if there is any unexpected mouse event. + await TestUtils.waitForTick(); + await clearMouseEventListenerAndCheck(tabFirst.linkedBrowser, ["mouseleave"]); + + info("switch back to the previous tab"); + await AddMouseEventListener(tabFirst.linkedBrowser); + await AddMouseEventListener(tabSecond.linkedBrowser); + await BrowserTestUtils.switchTab(gBrowser, tabFirst); + // Synthesize a mousemove to generate corresponding mouseenter and mouseleave + // events. + await EventUtils.synthesizeAndWaitNativeMouseMove( + tabFirst.linkedBrowser, + 10, + 10 + ); + // Wait a bit to see if there is any unexpected mouse event. + await TestUtils.waitForTick(); + await clearMouseEventListenerAndCheck(tabFirst.linkedBrowser, ["mouseenter"]); + await clearMouseEventListenerAndCheck(tabSecond.linkedBrowser, [ + "mouseleave", + ]); + + info("Close tabs"); + BrowserTestUtils.removeTab(tabFirst); + BrowserTestUtils.removeTab(tabSecond); +}); + +add_task(async function testSwitchTabsWithMouseDown() { + const tabFirst = await BrowserTestUtils.openNewForegroundTab( + gBrowser, + "http://example.com/browser/browser/base/content/test/general/dummy_page.html", + true + ); + + info("Initial mouse move"); + await EventUtils.synthesizeAndWaitNativeMouseMove( + tabFirst.linkedBrowser, + 10, + 10 + ); + + info("mouse down"); + await synthesizeMouseAndWait(tabFirst.linkedBrowser, "mousedown"); + + info("Open and move to a new tab"); + await AddMouseEventListener(tabFirst.linkedBrowser); + const tabSecond = await BrowserTestUtils.openNewForegroundTab( + gBrowser, + "http://example.com/browser/browser/base/content/test/general/dummy_page.html" + ); + // Synthesize a mousemove to generate corresponding mouseenter and mouseleave + // events. + await EventUtils.synthesizeAndWaitNativeMouseMove( + tabSecond.linkedBrowser, + 10, + 10 + ); + + info("mouse up"); + await synthesizeMouseAndWait(tabSecond.linkedBrowser, "mouseup"); + // Wait a bit to see if there is any unexpected mouse event. + await TestUtils.waitForTick(); + await clearMouseEventListenerAndCheck(tabFirst.linkedBrowser, ["mouseleave"]); + + info("mouse down"); + await synthesizeMouseAndWait(tabSecond.linkedBrowser, "mousedown"); + + info("switch back to the previous tab"); + await AddMouseEventListener(tabFirst.linkedBrowser); + await AddMouseEventListener(tabSecond.linkedBrowser); + await BrowserTestUtils.switchTab(gBrowser, tabFirst); + // Synthesize a mousemove to generate corresponding mouseenter and mouseleave + // events. + await EventUtils.synthesizeAndWaitNativeMouseMove( + tabFirst.linkedBrowser, + 10, + 10 + ); + + info("mouse up"); + await synthesizeMouseAndWait(tabFirst.linkedBrowser, "mouseup"); + // Wait a bit to see if there is any unexpected mouse event. + await TestUtils.waitForTick(); + await clearMouseEventListenerAndCheck(tabFirst.linkedBrowser, ["mouseenter"]); + await clearMouseEventListenerAndCheck(tabSecond.linkedBrowser, [ + "mouseleave", + ]); + + info("Close tabs"); + BrowserTestUtils.removeTab(tabFirst); + BrowserTestUtils.removeTab(tabSecond); +}); diff --git a/dom/events/test/browser_shortcutkey_modifier_conflicts_with_content_accesskey_modifier.js b/dom/events/test/browser_shortcutkey_modifier_conflicts_with_content_accesskey_modifier.js new file mode 100644 index 0000000000..b12fd3b1df --- /dev/null +++ b/dom/events/test/browser_shortcutkey_modifier_conflicts_with_content_accesskey_modifier.js @@ -0,0 +1,102 @@ +add_task(async function () { + // Even if modifier of a shortcut key same as modifier of content access key, + // the shortcut key should be executed if (remote) content doesn't handle it. + // This test uses existing shortcut key declaration on Linux and Windows. + // If you remove or change Alt + D, you need to keep check this with changing + // the pref or result check. + + await new Promise(resolve => { + SpecialPowers.pushPrefEnv( + { + set: [ + ["ui.key.generalAccessKey", -1], + ["ui.key.chromeAccess", 0 /* disabled */], + ["ui.key.contentAccess", 4 /* Alt */], + ["browser.search.widget.inNavBar", true], + ], + }, + resolve + ); + }); + + const kTestPage = "data:text/html,simple web page"; + let tab = await BrowserTestUtils.openNewForegroundTab(gBrowser, kTestPage); + + let searchBar = BrowserSearch.searchBar; + searchBar.focus(); + + function promiseURLBarHasFocus() { + return new Promise(resolve => { + if (gURLBar.focused) { + ok(true, "The URL bar already has focus"); + resolve(); + return; + } + info("Waiting focus event..."); + gURLBar.addEventListener( + "focus", + () => { + ok(true, "The URL bar gets focus"); + resolve(); + }, + { once: true } + ); + }); + } + + function promiseURLBarSelectsAllText() { + return new Promise(resolve => { + function isAllTextSelected() { + return ( + gURLBar.inputField.selectionStart === 0 && + gURLBar.inputField.selectionEnd === gURLBar.inputField.value.length + ); + } + if (isAllTextSelected()) { + ok(true, "All text of the URL bar is already selected"); + isnot( + gURLBar.inputField.value, + "", + "The URL bar should have non-empty text" + ); + resolve(); + return; + } + info("Waiting selection changes..."); + function tryToCheckItLater() { + if (!isAllTextSelected()) { + SimpleTest.executeSoon(tryToCheckItLater); + return; + } + ok(true, "All text of the URL bar should be selected"); + isnot( + gURLBar.inputField.value, + "", + "The URL bar should have non-empty text" + ); + resolve(); + } + SimpleTest.executeSoon(tryToCheckItLater); + }); + } + + // Alt + D is a shortcut key to move focus to the URL bar and selects its text. + info("Pressing Alt + D in the search bar..."); + EventUtils.synthesizeKey("d", { altKey: true }); + + await promiseURLBarHasFocus(); + await promiseURLBarSelectsAllText(); + + // Alt + D in the URL bar should select all text in it. + await gURLBar.focus(); + await promiseURLBarHasFocus(); + gURLBar.inputField.selectionStart = gURLBar.inputField.selectionEnd = + gURLBar.inputField.value.length; + + info("Pressing Alt + D in the URL bar..."); + EventUtils.synthesizeKey("d", { altKey: true }); + await promiseURLBarHasFocus(); + await promiseURLBarSelectsAllText(); + + gBrowser.removeCurrentTab(); +}); diff --git a/dom/events/test/bug1017086_inner.html b/dom/events/test/bug1017086_inner.html new file mode 100644 index 0000000000..e911d993d5 --- /dev/null +++ b/dom/events/test/bug1017086_inner.html @@ -0,0 +1,39 @@ + + + + + + Test for Bug 1017086 + + + + + + + Mozilla Bug 1017086 +

+ +
+  
+ + diff --git a/dom/events/test/bug226361_iframe.xhtml b/dom/events/test/bug226361_iframe.xhtml new file mode 100644 index 0000000000..df38a8bcbe --- /dev/null +++ b/dom/events/test/bug226361_iframe.xhtml @@ -0,0 +1,47 @@ + + + + Test for Bug 226361 + + +

+ +This is the 1st + +link but the 3rd tabindex
+ +
+ + This is the 2nd + +link but the 4th tabindex
+ +
+ + This is the 3rd + +link but the 1st tabindex
+ +
+ + This is the 4th + +link but the 5th tabindex
+ +
+ + This is the 5th + +link but the 2nd tabindex + +

+ +
+
+
+ + diff --git a/dom/events/test/bug299673.js b/dom/events/test/bug299673.js new file mode 100644 index 0000000000..2775355c40 --- /dev/null +++ b/dom/events/test/bug299673.js @@ -0,0 +1,150 @@ +var popup; + +function OpenWindow() { + log({}, ">>> OpenWindow"); + popup = window.open("", "Test"); + + var output = ""; + + output += ""; + output += "
"; + output += + ""; + output += "
"; + output += ""; + output += ""; + + popup.document.open(); + popup.document.write(output); + popup.document.close(); + + popup.document.onclick = function (event) { + log(event, "popup-doc"); + }; + popup.document.onfocus = function (event) { + log(event, "popup-doc"); + }; + popup.document.onblur = function (event) { + log(event, "popup-doc"); + }; + popup.document.onchange = function (event) { + log(event, "popup-doc"); + }; + + var e = popup.document.getElementById("popupText1"); + popup.focus(); + e.focus(); + is( + popup.document.activeElement, + e, + "input element in popup should be focused" + ); + log({}, "<<< OpenWindow"); +} + +var result; + +function log(event, message) { + if (event && event.eventPhase == 3) { + return; + } + e = event.currentTarget || event.target || event.srcElement; + var id = e ? (e.id ? e.id : e.name ? e.name : e.value ? e.value : "") : ""; + if (id) { + id = "(" + id + ")"; + } + result += + (e ? (e.tagName ? e.tagName : "") : " ") + + id + + ": " + + (event.type ? event.type : "") + + " " + + (message ? message : "") + + "\n"; +} + +document.onclick = function (event) { + log(event, "top-doc"); +}; +document.onfocus = function (event) { + log(event, "top-doc"); +}; +document.onblur = function (event) { + log(event, "top-doc"); +}; +document.onchange = function (event) { + log(event, "top-doc"); +}; + +function doTest1_rest2(expectedEventLog, focusAfterCloseId) { + try { + is( + document.activeElement, + document.getElementById(focusAfterCloseId), + "wrong element is focused after popup was closed" + ); + is(result, expectedEventLog, "unexpected events"); + SimpleTest.finish(); + } catch (e) { + if (popup) { + popup.close(); + } + throw e; + } +} +function doTest1_rest1(expectedEventLog, focusAfterCloseId) { + try { + synthesizeKey("V", {}, popup); + synthesizeKey("A", {}, popup); + synthesizeKey("L", {}, popup); + is( + popup.document.getElementById("popupText1").value, + "VAL", + "input element in popup did not accept input" + ); + + var p = popup; + popup = null; + p.close(); + + SimpleTest.waitForFocus(function () { + doTest1_rest2(expectedEventLog, focusAfterCloseId); + }, window); + } catch (e) { + if (popup) { + popup.close(); + } + throw e; + } +} + +function doTest1(expectedEventLog, focusAfterCloseId) { + try { + var select1 = document.getElementById("Select1"); + select1.focus(); + is(document.activeElement, select1, "select element should be focused"); + synthesizeKey("KEY_ArrowDown"); + synthesizeKey("KEY_Tab"); + SimpleTest.waitForFocus(function () { + doTest1_rest1(expectedEventLog, focusAfterCloseId); + }, popup); + } catch (e) { + if (popup) { + popup.close(); + } + throw e; + } +} + +function setPrefAndDoTest(expectedEventLog, focusAfterCloseId, prefValue) { + var select1 = document.getElementById("Select1"); + select1.blur(); + result = ""; + log({}, "Test with browser.link.open_newwindow = " + prefValue); + SpecialPowers.pushPrefEnv( + { set: [["browser.link.open_newwindow", prefValue]] }, + function () { + doTest1(expectedEventLog, focusAfterCloseId); + } + ); +} diff --git a/dom/events/test/bug322588-popup.html b/dom/events/test/bug322588-popup.html new file mode 100644 index 0000000000..767eb9db9c --- /dev/null +++ b/dom/events/test/bug322588-popup.html @@ -0,0 +1 @@ +a id=target diff --git a/dom/events/test/bug415498-doc1.html b/dom/events/test/bug415498-doc1.html new file mode 100644 index 0000000000..e8fbca6c9a --- /dev/null +++ b/dom/events/test/bug415498-doc1.html @@ -0,0 +1,15 @@ + + + + + + + Testcase for bug 415498. This page should show an exception in Error Console on load + diff --git a/dom/events/test/bug415498-doc2.html b/dom/events/test/bug415498-doc2.html new file mode 100644 index 0000000000..e556a4e4ca --- /dev/null +++ b/dom/events/test/bug415498-doc2.html @@ -0,0 +1,15 @@ + + + + + + + Testcase for bug 415498. This page should show an exception in Error Console on load + diff --git a/dom/events/test/bug418986-3.js b/dom/events/test/bug418986-3.js new file mode 100644 index 0000000000..81d04b9b22 --- /dev/null +++ b/dom/events/test/bug418986-3.js @@ -0,0 +1,85 @@ +SimpleTest.waitForExplicitFinish(); + +// The main testing function. +var test = async function (isContent) { + await SpecialPowers.contentTransformsReceived(window); + + // Each definition is [eventType, prefSetting] + // Where we are setting the "privacy.resistFingerprinting" pref. + let eventDefs = [ + ["mousedown", true], + ["mouseup", true], + ["mousedown", false], + ["mouseup", false], + ]; + + let testCounter = 0; + + // Declare ahead of time. + let setup; + + // This function is called when the event handler fires. + let handleEvent = function (event, prefVal) { + let resisting = prefVal && isContent; + if (resisting) { + is( + event.screenX, + event.clientX, + "event.screenX and event.clientX should be the same" + ); + is( + event.screenY, + event.clientY, + "event.screenY and event.clientY should be the same" + ); + } else { + // We can't be sure about X coordinates not being equal, but we can test Y. + isnot(event.screenY, event.clientY, "event.screenY !== event.clientY"); + } + ++testCounter; + if (testCounter < eventDefs.length) { + nextTest(); + } else { + SimpleTest.finish(); + } + }; + + // In this function, we set up the nth div and event handler, + // and then synthesize a mouse event in the div, to test + // whether the resulting events resist fingerprinting by + // suppressing absolute screen coordinates. + nextTest = function () { + let [eventType, prefVal] = eventDefs[testCounter]; + SpecialPowers.pushPrefEnv( + { set: [["privacy.resistFingerprinting", prefVal]] }, + function () { + // The following code creates a new div for each event in eventDefs, + // attaches a listener to listen for the event, and then generates + // a fake event at the center of the div. + let div = document.createElementNS( + "http://www.w3.org/1999/xhtml", + "div" + ); + div.style.width = "10px"; + div.style.height = "10px"; + div.style.backgroundColor = "red"; + // Name the div after the event we're listening for. + div.id = eventType; + document.getElementById("body").appendChild(div); + // Seems we can't add an event listener in chrome unless we run + // it in a later task. + window.setTimeout(function () { + div.addEventListener(eventType, event => handleEvent(event, prefVal)); + // For some reason, the following synthesizeMouseAtCenter call only seems to run if we + // wrap it in a window.setTimeout(..., 0). + window.setTimeout(function () { + synthesizeMouseAtCenter(div, { type: eventType }); + }, 0); + }, 0); + } + ); + }; + + // Now run by starting with the 0th event. + nextTest(); +}; diff --git a/dom/events/test/bug426082.html b/dom/events/test/bug426082.html new file mode 100644 index 0000000000..b8bf5cb243 --- /dev/null +++ b/dom/events/test/bug426082.html @@ -0,0 +1,116 @@ + + + + + Test for Bug 426082 + + + + + +Mozilla Bug 426082 +

+ +

+

+

Something under the label

+
+
+
+ + diff --git a/dom/events/test/bug545268.html b/dom/events/test/bug545268.html new file mode 100644 index 0000000000..1f90149a54 --- /dev/null +++ b/dom/events/test/bug545268.html @@ -0,0 +1 @@ + + diff --git a/dom/events/test/file_keyboard_event_init_key_event_enabled_in_contentscript.html b/dom/events/test/file_keyboard_event_init_key_event_enabled_in_contentscript.html new file mode 100644 index 0000000000..98691bfe69 --- /dev/null +++ b/dom/events/test/file_keyboard_event_init_key_event_enabled_in_contentscript.html @@ -0,0 +1,21 @@ + + + + +Storing type of `KeyboardEvent.initKeyEvent` + + + + + diff --git a/dom/events/test/file_mouse_enterleave.html b/dom/events/test/file_mouse_enterleave.html new file mode 100644 index 0000000000..9e3d1f1d8b --- /dev/null +++ b/dom/events/test/file_mouse_enterleave.html @@ -0,0 +1,40 @@ + + + +
+
+ + + diff --git a/dom/events/test/green.png b/dom/events/test/green.png new file mode 100644 index 0000000000..7df25f33bd Binary files /dev/null and b/dom/events/test/green.png differ diff --git a/dom/events/test/gtest/TestShortcutKeyDefinitions.cpp b/dom/events/test/gtest/TestShortcutKeyDefinitions.cpp new file mode 100644 index 0000000000..10adbba49f --- /dev/null +++ b/dom/events/test/gtest/TestShortcutKeyDefinitions.cpp @@ -0,0 +1,634 @@ +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* vim: set ts=8 sts=2 et sw=2 tw=80: */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#include "gtest/gtest.h" + +#include "KeyEventHandler.h" +#include "ShortcutKeys.h" + +#include "mozilla/RefPtr.h" +#include "mozilla/TextEvents.h" +#include "mozilla/dom/KeyboardEvent.h" + +namespace mozilla { + +/** + * These tests checks whether the key mapping defined by + * `ShortcutKeyDefinitions.cpp` and its including header files. + * Note that these tests do NOT define how shortcut keys mapped. These tests + * exist for checking unexpected change occurs by cleaning up or changing + * the mapping. + */ + +#ifndef MOZ_WIDGET_COCOA +# define MODIFIER_ACCEL MODIFIER_CONTROL +#else +# define MODIFIER_ACCEL MODIFIER_META +#endif + +struct ShortcutKeyMap final { + uint32_t const mKeyCode; + char32_t const mCharCode; + Modifiers const mModifiers; + const char16ptr_t mCommandWin; + const char16ptr_t mCommandMac; + const char16ptr_t mCommandLinux; + const char16ptr_t mCommandAndroid; + const char16ptr_t mCommandEmacs; +}; + +#if defined(XP_WIN) +# define GetCommandForPlatform(aMap) aMap.mCommandWin +#elif defined(MOZ_WIDGET_COCOA) +# define GetCommandForPlatform(aMap) aMap.mCommandMac +#elif defined(MOZ_WIDGET_GTK) +# define GetCommandForPlatform(aMap) aMap.mCommandLinux +#elif defined(MOZ_WIDGET_ANDROID) +# define GetCommandForPlatform(aMap) aMap.mCommandAndroid +#else +# define GetCommandForPlatform(aMap) aMap.mCommandEmacs +#endif + +static bool GetCommandFor(KeyEventHandler* aFirstHandler, + dom::KeyboardEvent* aDOMEvent, nsAString& aCommand) { + if (!aFirstHandler) { + return false; + } + aCommand.Truncate(); + for (KeyEventHandler* handler = aFirstHandler; handler; + handler = handler->GetNextHandler()) { + if (handler->KeyEventMatched(aDOMEvent, 0, IgnoreModifierState())) { + handler->GetCommand(aCommand); + return true; + } + } + return false; +} + +static char16ptr_t GetExpectedCommandFor( + const nsTArray& aExpectedMap, + const WidgetKeyboardEvent& aWidgetEvent) { + MOZ_ASSERT(!aExpectedMap.IsEmpty()); + for (const ShortcutKeyMap& map : aExpectedMap) { + if (aWidgetEvent.mKeyCode == map.mKeyCode && + aWidgetEvent.mCharCode == map.mCharCode && + aWidgetEvent.mModifiers == map.mModifiers) { + return GetCommandForPlatform(map); + } + } + return nullptr; +} + +struct KeyCodeAndStr final { + uint32_t mKeyCode; + KeyNameIndex mKeyNameIndex; + const char* mStr; +}; +static const KeyCodeAndStr kKeyCodes[] = { + {NS_VK_BACK, KEY_NAME_INDEX_Backspace, "Backspace"}, + {NS_VK_RETURN, KEY_NAME_INDEX_Enter, "Enter"}, + {NS_VK_ESCAPE, KEY_NAME_INDEX_Escape, "Escape"}, + {NS_VK_PAGE_UP, KEY_NAME_INDEX_PageUp, "PageUp"}, + {NS_VK_PAGE_DOWN, KEY_NAME_INDEX_PageDown, "PageDown"}, + {NS_VK_END, KEY_NAME_INDEX_End, "End"}, + {NS_VK_HOME, KEY_NAME_INDEX_Home, "Home"}, + {NS_VK_LEFT, KEY_NAME_INDEX_ArrowLeft, "ArrowLeft"}, + {NS_VK_UP, KEY_NAME_INDEX_ArrowUp, "ArrowUp"}, + {NS_VK_RIGHT, KEY_NAME_INDEX_ArrowRight, "ArrowRight"}, + {NS_VK_DOWN, KEY_NAME_INDEX_ArrowDown, "ArrowDown"}, +#ifndef MOZ_WIDGET_COCOA + // No Insert key on macOS + {NS_VK_INSERT, KEY_NAME_INDEX_Insert, "Insert"}, +#endif + {NS_VK_DELETE, KEY_NAME_INDEX_Delete, "Delete"}, + {NS_VK_F1, KEY_NAME_INDEX_F1, "F1"}, + {NS_VK_F2, KEY_NAME_INDEX_F2, "F2"}, + {NS_VK_F3, KEY_NAME_INDEX_F3, "F3"}, + {NS_VK_F4, KEY_NAME_INDEX_F4, "F4"}, + {NS_VK_F5, KEY_NAME_INDEX_F5, "F5"}, + {NS_VK_F6, KEY_NAME_INDEX_F6, "F6"}, + {NS_VK_F7, KEY_NAME_INDEX_F7, "F7"}, + {NS_VK_F8, KEY_NAME_INDEX_F8, "F8"}, + {NS_VK_F9, KEY_NAME_INDEX_F9, "F9"}, + {NS_VK_F10, KEY_NAME_INDEX_F10, "F10"}, + {NS_VK_F11, KEY_NAME_INDEX_F11, "F11"}, + {NS_VK_F12, KEY_NAME_INDEX_F12, "F12"}, +#if defined(XP_WIN) || defined(MOZ_WIDGET_GTK) || defined(MOZ_WIDGET_ANDROID) + {NS_VK_F13, KEY_NAME_INDEX_F13, "F13"}, + {NS_VK_F14, KEY_NAME_INDEX_F14, "F14"}, + {NS_VK_F15, KEY_NAME_INDEX_F15, "F15"}, + {NS_VK_F16, KEY_NAME_INDEX_F16, "F16"}, + {NS_VK_F17, KEY_NAME_INDEX_F17, "F17"}, + {NS_VK_F18, KEY_NAME_INDEX_F18, "F18"}, + {NS_VK_F19, KEY_NAME_INDEX_F19, "F19"}, +#endif +#if defined(XP_WIN) || defined(MOZ_WIDGET_GTK) + {NS_VK_F20, KEY_NAME_INDEX_F20, "F20"}, + {NS_VK_F21, KEY_NAME_INDEX_F21, "F21"}, + {NS_VK_F22, KEY_NAME_INDEX_F22, "F22"}, + {NS_VK_F23, KEY_NAME_INDEX_F23, "F23"}, + {NS_VK_F24, KEY_NAME_INDEX_F24, "F24"}, +#endif +}; + +static const unsigned char kCharCodes[] = { + ' ', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', + 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', + 'z', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9'}; + +struct ModifiersAndStr final { + Modifiers mModifiers; + const char* mStr; +}; +static const ModifiersAndStr kModifiers[] = { + {MODIFIER_NONE, ""}, + {MODIFIER_SHIFT, "Shift+"}, + {MODIFIER_CONTROL, "Control+"}, + {MODIFIER_CONTROL | MODIFIER_SHIFT, "Contrl+Shift+"}, + {MODIFIER_ALT, "Alt+"}, + {MODIFIER_ALT | MODIFIER_SHIFT, "Alt+Shift+"}, + {MODIFIER_META, "Meta+"}, + {MODIFIER_META | MODIFIER_SHIFT, "Meta+Shift+"}, + {MODIFIER_META | MODIFIER_ALT | MODIFIER_SHIFT, "Meta+Alt+Shift+"}, + {MODIFIER_CONTROL | MODIFIER_ALT, "Control+Alt+"}, + {MODIFIER_CONTROL | MODIFIER_ALT | MODIFIER_SHIFT, "Control+Alt+Shift+"}, +}; + +static void TestAllKeyCodes(KeyEventHandler* aFirstHandler, + const nsTArray& aExpectedMap) { + WidgetKeyboardEvent widgetEvent(true, eKeyPress, nullptr); + RefPtr domEvent = + NS_NewDOMKeyboardEvent(nullptr, nullptr, &widgetEvent); + nsAutoString command; + uint32_t foundCommand = 0; + for (const auto& mod : kModifiers) { + widgetEvent.mModifiers = mod.mModifiers; + for (const auto& keyCode : kKeyCodes) { + widgetEvent.mKeyCode = keyCode.mKeyCode; + widgetEvent.mKeyNameIndex = keyCode.mKeyNameIndex; + const char16ptr_t expectedCommand = + GetExpectedCommandFor(aExpectedMap, widgetEvent); + if (GetCommandFor(aFirstHandler, domEvent, command)) { + foundCommand++; + if (expectedCommand) { + ASSERT_TRUE(command.Equals(expectedCommand)) + << mod.mStr << keyCode.mStr << ": got " + << NS_ConvertUTF16toUTF8(command).get() << ", but expected " + << NS_ConvertUTF16toUTF8(expectedCommand).get(); + } else { + ASSERT_TRUE(false) + << mod.mStr << keyCode.mStr << ": got " + << NS_ConvertUTF16toUTF8(command).get() + << ", but expected no command"; + } + } else if (expectedCommand) { + ASSERT_TRUE(false) + << mod.mStr << keyCode.mStr << ": got no command, but expected " + << NS_ConvertUTF16toUTF8(expectedCommand).get(); + } + } + widgetEvent.mKeyCode = 0; + widgetEvent.mKeyNameIndex = KEY_NAME_INDEX_USE_STRING; + for (unsigned char charCode : kCharCodes) { + widgetEvent.mCharCode = charCode; + widgetEvent.mKeyValue.Assign(charCode); + const char16ptr_t expectedCommand = + GetExpectedCommandFor(aExpectedMap, widgetEvent); + if (GetCommandFor(aFirstHandler, domEvent, command)) { + foundCommand++; + if (expectedCommand) { + ASSERT_TRUE(command.Equals(expectedCommand)) + << mod.mStr << "'" << nsAutoCString(charCode).get() << "': got " + << NS_ConvertUTF16toUTF8(command).get() << ", but expected " + << NS_ConvertUTF16toUTF8(expectedCommand).get(); + } else { + ASSERT_TRUE(false) + << mod.mStr << "'" << nsAutoCString(charCode).get() << "': got " + << NS_ConvertUTF16toUTF8(command).get() + << ", but expected no command"; + } + } else if (expectedCommand) { + ASSERT_TRUE(false) + << mod.mStr << "'" << nsAutoCString(charCode).get() + << "': got no command, but expected " + << NS_ConvertUTF16toUTF8(expectedCommand).get(); + } + } + widgetEvent.mCharCode = 0; + widgetEvent.mKeyValue.Truncate(); + } + uint32_t expectedCommandCount = 0; + for (const auto& map : aExpectedMap) { + if (GetCommandForPlatform(map)) { + expectedCommandCount++; + } + } + ASSERT_EQ(foundCommand, expectedCommandCount) + << "Some expected shortcut keys have not been tested"; + uint32_t countOfHandler = 0; + for (KeyEventHandler* handler = aFirstHandler; handler; + handler = handler->GetNextHandler()) { + countOfHandler++; + } + ASSERT_EQ(countOfHandler, expectedCommandCount) + << "Some unnecessary key handlers found"; +} + +TEST(ShortcutKeyDefinitions, HTMLInputElement) +{ + // clang-format off + const nsTArray expectedMap{ + // KeyCode Modifiers Windows macOS Linux Android Emacs + {NS_VK_LEFT, 0, MODIFIER_NONE, u"cmd_moveLeft", nullptr, u"cmd_moveLeft", u"cmd_moveLeft", u"cmd_moveLeft"}, + {NS_VK_RIGHT, 0, MODIFIER_NONE, u"cmd_moveRight", nullptr, u"cmd_moveRight", u"cmd_moveRight", u"cmd_moveRight"}, + {NS_VK_LEFT, 0, MODIFIER_SHIFT, u"cmd_selectLeft", nullptr, u"cmd_selectLeft", u"cmd_selectLeft", u"cmd_selectLeft"}, + {NS_VK_RIGHT, 0, MODIFIER_SHIFT, u"cmd_selectRight", nullptr, u"cmd_selectRight", u"cmd_selectRight", u"cmd_selectRight"}, + {NS_VK_LEFT, 0, MODIFIER_CONTROL, u"cmd_moveLeft2", nullptr, nullptr, u"cmd_wordPrevious", u"cmd_wordPrevious"}, + {NS_VK_RIGHT, 0, MODIFIER_CONTROL, u"cmd_moveRight2", nullptr, nullptr, u"cmd_wordNext", u"cmd_wordNext"}, + {NS_VK_LEFT, 0, MODIFIER_ALT, nullptr, nullptr, nullptr, u"cmd_beginLine", nullptr}, + {NS_VK_RIGHT, 0, MODIFIER_ALT, nullptr, nullptr, nullptr, u"cmd_endLine", nullptr}, + {NS_VK_UP, 0, MODIFIER_NONE, u"cmd_moveUp", nullptr, u"cmd_moveUp", u"cmd_moveUp", u"cmd_moveUp"}, + {NS_VK_DOWN, 0, MODIFIER_NONE, u"cmd_moveDown", nullptr, u"cmd_moveDown", u"cmd_moveDown", u"cmd_moveDown"}, + {NS_VK_UP, 0, MODIFIER_SHIFT, u"cmd_selectUp", nullptr, u"cmd_selectUp", u"cmd_selectUp", u"cmd_selectUp"}, + {NS_VK_DOWN, 0, MODIFIER_SHIFT, u"cmd_selectDown", nullptr, u"cmd_selectDown", u"cmd_selectDown", u"cmd_selectDown"}, + {NS_VK_UP, 0, MODIFIER_CONTROL, u"cmd_moveUp2", nullptr, nullptr, nullptr, nullptr}, + {NS_VK_DOWN, 0, MODIFIER_CONTROL, u"cmd_moveDown2", nullptr, nullptr, nullptr, nullptr}, + + // KeyCode Modifiers Windows macOS Linux Android Emacs + {NS_VK_LEFT, 0, MODIFIER_SHIFT | MODIFIER_CONTROL, u"cmd_selectLeft2", nullptr, nullptr, u"cmd_selectWordPrevious", u"cmd_selectWordPrevious"}, + {NS_VK_RIGHT, 0, MODIFIER_SHIFT | MODIFIER_CONTROL, u"cmd_selectRight2", nullptr, nullptr, u"cmd_selectWordNext", u"cmd_selectWordNext"}, + {NS_VK_LEFT, 0, MODIFIER_SHIFT | MODIFIER_ALT, nullptr, nullptr, nullptr, u"cmd_selectBeginLine", nullptr}, + {NS_VK_RIGHT, 0, MODIFIER_SHIFT | MODIFIER_ALT, nullptr, nullptr, nullptr, u"cmd_selectEndLine", nullptr}, + {NS_VK_UP, 0, MODIFIER_SHIFT | MODIFIER_CONTROL, u"cmd_selectUp2", nullptr, nullptr, nullptr, nullptr}, + {NS_VK_DOWN, 0, MODIFIER_SHIFT | MODIFIER_CONTROL, u"cmd_selectDown2", nullptr, nullptr, nullptr, nullptr}, + + // KeyCode Modifiers Windows macOS Linux Android Emacs + {NS_VK_HOME, 0, MODIFIER_NONE, u"cmd_beginLine", nullptr, nullptr, u"cmd_beginLine", u"cmd_beginLine"}, + {NS_VK_END, 0, MODIFIER_NONE, u"cmd_endLine", nullptr, nullptr, u"cmd_endLine", u"cmd_endLine"}, + {NS_VK_HOME, 0, MODIFIER_SHIFT, u"cmd_selectBeginLine", nullptr, nullptr, u"cmd_selectBeginLine", u"cmd_selectBeginLine"}, + {NS_VK_END, 0, MODIFIER_SHIFT, u"cmd_selectEndLine", nullptr, nullptr, u"cmd_selectEndLine", u"cmd_selectEndLine"}, + {NS_VK_HOME, 0, MODIFIER_CONTROL, u"cmd_moveTop", nullptr, nullptr, nullptr, u"cmd_beginLine"}, + {NS_VK_END, 0, MODIFIER_CONTROL, u"cmd_moveBottom", nullptr, nullptr, nullptr, u"cmd_endLine"}, + + // KeyCode Modifiers Windows macOS Linux Android Emacs + {NS_VK_HOME, 0, MODIFIER_SHIFT | MODIFIER_CONTROL, u"cmd_selectTop", nullptr, nullptr, nullptr, u"cmd_selectBeginLine"}, + {NS_VK_END, 0, MODIFIER_SHIFT | MODIFIER_CONTROL, u"cmd_selectBottom", nullptr, nullptr, nullptr, u"cmd_selectEndLine"}, + + // KeyCode Modifiers Windows macOS Linux Android + {NS_VK_INSERT, 0, MODIFIER_SHIFT, u"cmd_paste", nullptr, nullptr, nullptr, u"cmd_paste"}, + {NS_VK_INSERT, 0, MODIFIER_CONTROL, u"cmd_copy", nullptr, nullptr, nullptr, u"cmd_copy"}, + {NS_VK_DELETE, 0, MODIFIER_SHIFT, u"cmd_cutOrDelete", nullptr, nullptr, nullptr, u"cmd_cutOrDelete"}, + {NS_VK_DELETE, 0, MODIFIER_CONTROL, u"cmd_deleteWordForward", nullptr, nullptr, u"cmd_deleteWordForward", u"cmd_copyOrDelete"}, + {NS_VK_DELETE, 0, MODIFIER_ALT, nullptr, nullptr, nullptr, u"cmd_deleteToEndOfLine", nullptr}, + {NS_VK_BACK, 0, MODIFIER_CONTROL, u"cmd_deleteWordBackward", nullptr, nullptr, u"cmd_deleteWordBackward", u"cmd_deleteWordBackward"}, + {NS_VK_BACK, 0, MODIFIER_ALT, u"cmd_undo", nullptr, nullptr, u"cmd_deleteToBeginningOfLine", nullptr}, + + // KeyCode Modifiers Windows macOS Linux Android Emacs + {NS_VK_BACK, 0, MODIFIER_SHIFT | MODIFIER_ALT, u"cmd_redo", nullptr, nullptr, nullptr, nullptr}, + + // charCode Modifiers, Windows macOS Linux Android Emacs + {0, 'a', MODIFIER_ACCEL, u"cmd_selectAll", u"cmd_selectAll", u"cmd_selectAll", u"cmd_selectAll", nullptr}, + {0, 'a', MODIFIER_ALT, nullptr, nullptr, nullptr, nullptr, u"cmd_selectAll"}, + {0, 'c', MODIFIER_ACCEL, u"cmd_copy", u"cmd_copy", u"cmd_copy", u"cmd_copy", u"cmd_copy"}, + {0, 'x', MODIFIER_ACCEL, u"cmd_cut", u"cmd_cut", u"cmd_cut", u"cmd_cut", u"cmd_cut"}, + {0, 'v', MODIFIER_ACCEL, u"cmd_paste", u"cmd_paste", u"cmd_paste", u"cmd_paste", u"cmd_paste"}, + {0, 'y', MODIFIER_ACCEL, u"cmd_redo", nullptr, u"cmd_redo", nullptr, u"cmd_redo"}, + {0, 'z', MODIFIER_ACCEL, u"cmd_undo", u"cmd_undo", u"cmd_undo", u"cmd_undo", u"cmd_undo"}, + + // charCode Modifiers, Windows macOS Linux Android Emacs + {0, 'v', MODIFIER_SHIFT | MODIFIER_ACCEL, u"cmd_paste", u"cmd_paste", u"cmd_paste", u"cmd_paste", u"cmd_paste"}, + {0, 'v', MODIFIER_SHIFT | MODIFIER_ALT | MODIFIER_ACCEL, nullptr, u"cmd_paste", nullptr, nullptr, nullptr}, + + // charCode Modifiers Windows macOS Linux Android Emacs + {0, 'z', MODIFIER_SHIFT | MODIFIER_ACCEL, u"cmd_redo", u"cmd_redo", u"cmd_redo", u"cmd_redo", u"cmd_redo"}, + + // charCode Modifiers Windows macOS Linux Android Emacs + {0, 'a', MODIFIER_CONTROL, nullptr, nullptr, nullptr, nullptr, u"cmd_beginLine"}, + {0, 'b', MODIFIER_CONTROL, nullptr, nullptr, nullptr, nullptr, u"cmd_charPrevious"}, + {0, 'd', MODIFIER_CONTROL, nullptr, nullptr, nullptr, nullptr, u"cmd_deleteCharForward"}, + {0, 'e', MODIFIER_CONTROL, nullptr, nullptr, nullptr, nullptr, u"cmd_endLine"}, + {0, 'f', MODIFIER_CONTROL, nullptr, nullptr, nullptr, nullptr, u"cmd_charNext"}, + {0, 'h', MODIFIER_CONTROL, nullptr, nullptr, nullptr, nullptr, u"cmd_deleteCharBackward"}, + {0, 'k', MODIFIER_CONTROL, nullptr, nullptr, nullptr, nullptr, u"cmd_deleteToEndOfLine"}, + {0, 'u', MODIFIER_CONTROL, nullptr, nullptr, nullptr, nullptr, u"cmd_deleteToBeginningOfLine"}, + {0, 'w', MODIFIER_CONTROL, nullptr, nullptr, nullptr, nullptr, u"cmd_deleteWordBackward"}, + }; + // clang-format on + + TestAllKeyCodes(ShortcutKeys::GetHandlers(HandlerType::eInput), expectedMap); + + ShortcutKeys::Shutdown(); // Destroy the singleton instance. +} + +TEST(ShortcutKeyDefinitions, HTMLTextAreaElement) +{ + // clang-format off + const nsTArray expectedMap{ + // KeyCode Modifiers Windows macOS Linux Android Emacs + {NS_VK_LEFT, 0, MODIFIER_NONE, u"cmd_moveLeft", nullptr, u"cmd_moveLeft", u"cmd_moveLeft", u"cmd_moveLeft"}, + {NS_VK_RIGHT, 0, MODIFIER_NONE, u"cmd_moveRight", nullptr, u"cmd_moveRight", u"cmd_moveRight", u"cmd_moveRight"}, + {NS_VK_LEFT, 0, MODIFIER_SHIFT, u"cmd_selectLeft", nullptr, u"cmd_selectLeft", u"cmd_selectLeft", u"cmd_selectLeft"}, + {NS_VK_RIGHT, 0, MODIFIER_SHIFT, u"cmd_selectRight", nullptr, u"cmd_selectRight", u"cmd_selectRight", u"cmd_selectRight"}, + {NS_VK_LEFT, 0, MODIFIER_CONTROL, u"cmd_moveLeft2", nullptr, nullptr, u"cmd_wordPrevious", u"cmd_wordPrevious"}, + {NS_VK_RIGHT, 0, MODIFIER_CONTROL, u"cmd_moveRight2", nullptr, nullptr, u"cmd_wordNext", u"cmd_wordNext"}, + {NS_VK_LEFT, 0, MODIFIER_ALT, nullptr, nullptr, nullptr, u"cmd_beginLine", nullptr}, + {NS_VK_RIGHT, 0, MODIFIER_ALT, nullptr, nullptr, nullptr, u"cmd_endLine", nullptr}, + {NS_VK_UP, 0, MODIFIER_NONE, u"cmd_moveUp", nullptr, u"cmd_moveUp", u"cmd_moveUp", u"cmd_moveUp"}, + {NS_VK_DOWN, 0, MODIFIER_NONE, u"cmd_moveDown", nullptr, u"cmd_moveDown", u"cmd_moveDown", u"cmd_moveDown"}, + {NS_VK_UP, 0, MODIFIER_SHIFT, u"cmd_selectUp", nullptr, u"cmd_selectUp", u"cmd_selectUp", u"cmd_selectUp"}, + {NS_VK_DOWN, 0, MODIFIER_SHIFT, u"cmd_selectDown", nullptr, u"cmd_selectDown", u"cmd_selectDown", u"cmd_selectDown"}, + {NS_VK_UP, 0, MODIFIER_CONTROL, u"cmd_moveUp2", nullptr, nullptr, nullptr, nullptr}, + {NS_VK_DOWN, 0, MODIFIER_CONTROL, u"cmd_moveDown2", nullptr, nullptr, nullptr, nullptr}, + {NS_VK_UP, 0, MODIFIER_ALT, nullptr, nullptr, nullptr, u"cmd_moveTop", nullptr}, + {NS_VK_DOWN, 0, MODIFIER_ALT, nullptr, nullptr, nullptr, u"cmd_moveBottom", nullptr}, + + // KeyCode Modifiers Windows macOS Linux Android Emacs + {NS_VK_LEFT, 0, MODIFIER_SHIFT | MODIFIER_CONTROL, u"cmd_selectLeft2", nullptr, nullptr, u"cmd_selectWordPrevious", u"cmd_selectWordPrevious"}, + {NS_VK_RIGHT, 0, MODIFIER_SHIFT | MODIFIER_CONTROL, u"cmd_selectRight2", nullptr, nullptr, u"cmd_selectWordNext", u"cmd_selectWordNext"}, + {NS_VK_LEFT, 0, MODIFIER_SHIFT | MODIFIER_ALT, nullptr, nullptr, nullptr, u"cmd_selectBeginLine", nullptr}, + {NS_VK_RIGHT, 0, MODIFIER_SHIFT | MODIFIER_ALT, nullptr, nullptr, nullptr, u"cmd_selectEndLine", nullptr}, + {NS_VK_UP, 0, MODIFIER_SHIFT | MODIFIER_CONTROL, u"cmd_selectUp2", nullptr, nullptr, nullptr, nullptr}, + {NS_VK_DOWN, 0, MODIFIER_SHIFT | MODIFIER_CONTROL, u"cmd_selectDown2", nullptr, nullptr, nullptr, nullptr}, + {NS_VK_UP, 0, MODIFIER_SHIFT | MODIFIER_ALT, nullptr, nullptr, nullptr, u"cmd_selectTop", nullptr}, + {NS_VK_DOWN, 0, MODIFIER_SHIFT | MODIFIER_ALT, nullptr, nullptr, nullptr, u"cmd_selectBottom", nullptr}, + + // KeyCode Modifiers Windows macOS Linux Android Emacs + {NS_VK_PAGE_UP, 0, MODIFIER_NONE, u"cmd_movePageUp", nullptr, nullptr, u"cmd_movePageUp", u"cmd_movePageUp"}, + {NS_VK_PAGE_DOWN, 0, MODIFIER_NONE, u"cmd_movePageDown", nullptr, nullptr, u"cmd_movePageDown", u"cmd_movePageDown"}, + {NS_VK_PAGE_UP, 0, MODIFIER_SHIFT, u"cmd_selectPageUp", nullptr, nullptr, u"cmd_selectPageUp", u"cmd_selectPageUp"}, + {NS_VK_PAGE_DOWN, 0, MODIFIER_SHIFT, u"cmd_selectPageDown", nullptr, nullptr, u"cmd_selectPageDown", u"cmd_selectPageDown"}, + {NS_VK_PAGE_UP, 0, MODIFIER_ALT, nullptr, nullptr, nullptr, u"cmd_moveTop", nullptr}, + {NS_VK_PAGE_DOWN, 0, MODIFIER_ALT, nullptr, nullptr, nullptr, u"cmd_moveBottom", nullptr}, + + // KeyCode Modifiers Windows macOS Linux Android Emacs + {NS_VK_PAGE_UP, 0, MODIFIER_SHIFT | MODIFIER_ALT, nullptr, nullptr, nullptr, u"cmd_selectTop", nullptr}, + {NS_VK_PAGE_DOWN, 0, MODIFIER_SHIFT | MODIFIER_ALT, nullptr, nullptr, nullptr, u"cmd_selectBottom", nullptr}, + + // KeyCode Modifiers Windows macOS Linux Android Emacs + {NS_VK_HOME, 0, MODIFIER_NONE, u"cmd_beginLine", nullptr, nullptr, u"cmd_beginLine", u"cmd_beginLine"}, + {NS_VK_END, 0, MODIFIER_NONE, u"cmd_endLine", nullptr, nullptr, u"cmd_endLine", u"cmd_endLine"}, + {NS_VK_HOME, 0, MODIFIER_SHIFT, u"cmd_selectBeginLine", nullptr, nullptr, u"cmd_selectBeginLine", u"cmd_selectBeginLine"}, + {NS_VK_END, 0, MODIFIER_SHIFT, u"cmd_selectEndLine", nullptr, nullptr, u"cmd_selectEndLine", u"cmd_selectEndLine"}, + {NS_VK_HOME, 0, MODIFIER_CONTROL, u"cmd_moveTop", nullptr, nullptr, u"cmd_moveTop", u"cmd_moveTop"}, + {NS_VK_END, 0, MODIFIER_CONTROL, u"cmd_moveBottom", nullptr, nullptr, u"cmd_moveBottom", u"cmd_moveBottom"}, + + // KeyCode Modifiers Windows macOS Linux Android Emacs + {NS_VK_HOME, 0, MODIFIER_SHIFT | MODIFIER_CONTROL, u"cmd_selectTop", nullptr, nullptr, u"cmd_selectTop", u"cmd_selectTop"}, + {NS_VK_END, 0, MODIFIER_SHIFT | MODIFIER_CONTROL, u"cmd_selectBottom", nullptr, nullptr, u"cmd_selectBottom", u"cmd_selectBottom"}, + + // KeyCode Modifiers Windows macOS Linux Android Emacs + {NS_VK_INSERT, 0, MODIFIER_SHIFT, u"cmd_paste", nullptr, nullptr, nullptr, u"cmd_paste"}, + {NS_VK_INSERT, 0, MODIFIER_CONTROL, u"cmd_copy", nullptr, nullptr, nullptr, u"cmd_copy"}, + {NS_VK_DELETE, 0, MODIFIER_SHIFT, u"cmd_cutOrDelete", nullptr, nullptr, nullptr, u"cmd_cutOrDelete"}, + {NS_VK_DELETE, 0, MODIFIER_CONTROL, u"cmd_deleteWordForward", nullptr, nullptr, u"cmd_deleteWordForward", u"cmd_copyOrDelete"}, + {NS_VK_DELETE, 0, MODIFIER_ALT, nullptr, nullptr, nullptr, u"cmd_deleteToEndOfLine", nullptr}, + {NS_VK_BACK, 0, MODIFIER_CONTROL, u"cmd_deleteWordBackward", nullptr, nullptr, u"cmd_deleteWordBackward", u"cmd_deleteWordBackward"}, + {NS_VK_BACK, 0, MODIFIER_ALT, u"cmd_undo", nullptr, nullptr, u"cmd_deleteToBeginningOfLine", nullptr}, + + // KeyCode Modifiers Windows macOS Linux Android Emacs + {NS_VK_BACK, 0, MODIFIER_SHIFT | MODIFIER_ALT, u"cmd_redo", nullptr, nullptr, nullptr, nullptr}, + + // charCode Modifiers, Windows macOS Linux Android Emacs + {0, 'a', MODIFIER_ACCEL, u"cmd_selectAll", u"cmd_selectAll", u"cmd_selectAll", u"cmd_selectAll", nullptr}, + {0, 'a', MODIFIER_ALT, nullptr, nullptr, nullptr, nullptr, u"cmd_selectAll"}, + {0, 'c', MODIFIER_ACCEL, u"cmd_copy", u"cmd_copy", u"cmd_copy", u"cmd_copy", u"cmd_copy"}, + {0, 'x', MODIFIER_ACCEL, u"cmd_cut", u"cmd_cut", u"cmd_cut", u"cmd_cut", u"cmd_cut"}, + {0, 'v', MODIFIER_ACCEL, u"cmd_paste", u"cmd_paste", u"cmd_paste", u"cmd_paste", u"cmd_paste"}, + {0, 'y', MODIFIER_ACCEL, u"cmd_redo", nullptr, u"cmd_redo", nullptr, u"cmd_redo"}, + {0, 'z', MODIFIER_ACCEL, u"cmd_undo", u"cmd_undo", u"cmd_undo", u"cmd_undo", u"cmd_undo"}, + + // charCode Modifiers, Windows macOS Linux Android Emacs + {0, 'v', MODIFIER_SHIFT | MODIFIER_ACCEL, u"cmd_paste", u"cmd_paste", u"cmd_paste", u"cmd_paste", u"cmd_paste"}, + {0, 'v', MODIFIER_SHIFT | MODIFIER_ALT | MODIFIER_ACCEL, nullptr, u"cmd_paste", nullptr, nullptr, nullptr}, + + // charCode Modifiers Windows macOS Linux Android Emacs + {0, 'z', MODIFIER_SHIFT | MODIFIER_ACCEL, u"cmd_redo", u"cmd_redo", u"cmd_redo", u"cmd_redo", u"cmd_redo"}, + + // charCode Modifiers Windows macOS Linux Android Emacs + {0, 'a', MODIFIER_CONTROL, nullptr, nullptr, nullptr, nullptr, u"cmd_beginLine"}, + {0, 'b', MODIFIER_CONTROL, nullptr, nullptr, nullptr, nullptr, u"cmd_charPrevious"}, + {0, 'd', MODIFIER_CONTROL, nullptr, nullptr, nullptr, nullptr, u"cmd_deleteCharForward"}, + {0, 'e', MODIFIER_CONTROL, nullptr, nullptr, nullptr, nullptr, u"cmd_endLine"}, + {0, 'f', MODIFIER_CONTROL, nullptr, nullptr, nullptr, nullptr, u"cmd_charNext"}, + {0, 'h', MODIFIER_CONTROL, nullptr, nullptr, nullptr, nullptr, u"cmd_deleteCharBackward"}, + {0, 'k', MODIFIER_CONTROL, nullptr, nullptr, nullptr, nullptr, u"cmd_deleteToEndOfLine"}, + {0, 'n', MODIFIER_CONTROL, nullptr, nullptr, nullptr, nullptr, u"cmd_lineNext"}, + {0, 'p', MODIFIER_CONTROL, nullptr, nullptr, nullptr, nullptr, u"cmd_linePrevious"}, + {0, 'u', MODIFIER_CONTROL, nullptr, nullptr, nullptr, nullptr, u"cmd_deleteToBeginningOfLine"}, + {0, 'w', MODIFIER_CONTROL, nullptr, nullptr, nullptr, nullptr, u"cmd_deleteWordBackward"}, + }; + // clang-format on + + TestAllKeyCodes(ShortcutKeys::GetHandlers(HandlerType::eTextArea), + expectedMap); + + ShortcutKeys::Shutdown(); // Destroy the singleton instance. +} + +TEST(ShortcutKeyDefinitions, Browser) +{ + // clang-format off + const nsTArray expectedMap{ + // KeyCode Modifiers Windows macOS Linux Android Emacs + {NS_VK_LEFT, 0, MODIFIER_NONE, u"cmd_moveLeft", u"cmd_moveLeft", u"cmd_moveLeft", u"cmd_moveLeft", u"cmd_moveLeft"}, + {NS_VK_RIGHT, 0, MODIFIER_NONE, u"cmd_moveRight", u"cmd_moveRight", u"cmd_moveRight", u"cmd_moveRight", u"cmd_moveRight"}, + {NS_VK_LEFT, 0, MODIFIER_SHIFT, u"cmd_selectLeft", u"cmd_selectLeft", u"cmd_selectLeft", u"cmd_selectCharPrevious", u"cmd_selectLeft"}, + {NS_VK_RIGHT, 0, MODIFIER_SHIFT, u"cmd_selectRight", u"cmd_selectRight", u"cmd_selectRight", u"cmd_selectCharNext", u"cmd_selectRight"}, + {NS_VK_LEFT, 0, MODIFIER_CONTROL, u"cmd_moveLeft2", nullptr, u"cmd_moveLeft2", u"cmd_wordPrevious", u"cmd_wordPrevious"}, + {NS_VK_RIGHT, 0, MODIFIER_CONTROL, u"cmd_moveRight2", nullptr, u"cmd_moveRight2", u"cmd_wordNext", u"cmd_wordNext"}, + {NS_VK_LEFT, 0, MODIFIER_ALT, nullptr, u"cmd_moveLeft2", nullptr, u"cmd_beginLine", nullptr}, + {NS_VK_RIGHT, 0, MODIFIER_ALT, nullptr, u"cmd_moveRight2", nullptr, u"cmd_endLine", nullptr}, + {NS_VK_UP, 0, MODIFIER_NONE, u"cmd_moveUp", u"cmd_moveUp", u"cmd_moveUp", u"cmd_moveUp", u"cmd_moveUp"}, + {NS_VK_DOWN, 0, MODIFIER_NONE, u"cmd_moveDown", u"cmd_moveDown", u"cmd_moveDown", u"cmd_moveDown", u"cmd_moveDown"}, + {NS_VK_UP, 0, MODIFIER_SHIFT, u"cmd_selectUp", u"cmd_selectUp", u"cmd_selectUp", u"cmd_selectLinePrevious", u"cmd_selectUp"}, + {NS_VK_DOWN, 0, MODIFIER_SHIFT, u"cmd_selectDown", u"cmd_selectDown", u"cmd_selectDown", u"cmd_selectLineNext", u"cmd_selectDown"}, + {NS_VK_UP, 0, MODIFIER_CONTROL, u"cmd_moveUp2", nullptr, u"cmd_moveUp2", nullptr, nullptr}, + {NS_VK_DOWN, 0, MODIFIER_CONTROL, u"cmd_moveDown2", nullptr, u"cmd_moveDown2", nullptr, nullptr}, + {NS_VK_UP, 0, MODIFIER_ALT, nullptr, nullptr, nullptr, u"cmd_moveTop", nullptr}, + {NS_VK_DOWN, 0, MODIFIER_ALT, nullptr, nullptr, nullptr, u"cmd_moveBottom", nullptr}, + {NS_VK_UP, 0, MODIFIER_META, nullptr, u"cmd_moveUp2", nullptr, nullptr, nullptr}, + {NS_VK_DOWN, 0, MODIFIER_META, nullptr, u"cmd_moveDown2", nullptr, nullptr, nullptr}, + + // KeyCode Modifiers Windows macOS Linux Android Emacs + {NS_VK_LEFT, 0, MODIFIER_SHIFT | MODIFIER_CONTROL, u"cmd_selectLeft2", nullptr, u"cmd_selectLeft2", u"cmd_selectWordPrevious", u"cmd_selectWordPrevious"}, + {NS_VK_RIGHT, 0, MODIFIER_SHIFT | MODIFIER_CONTROL, u"cmd_selectRight2", nullptr, u"cmd_selectRight2", u"cmd_selectWordNext", u"cmd_selectWordNext"}, + {NS_VK_LEFT, 0, MODIFIER_SHIFT | MODIFIER_ALT, nullptr, u"cmd_selectLeft2", nullptr, u"cmd_selectBeginLine", nullptr}, + {NS_VK_RIGHT, 0, MODIFIER_SHIFT | MODIFIER_ALT, nullptr, u"cmd_selectRight2", nullptr, u"cmd_selectEndLine", nullptr}, + {NS_VK_UP, 0, MODIFIER_SHIFT | MODIFIER_CONTROL, u"cmd_selectUp2", nullptr, u"cmd_selectUp2", nullptr, u"cmd_selectWordPrevious"}, + {NS_VK_DOWN, 0, MODIFIER_SHIFT | MODIFIER_CONTROL, u"cmd_selectDown2", nullptr, u"cmd_selectDown2", nullptr, u"cmd_selectWordNext"}, + {NS_VK_UP, 0, MODIFIER_SHIFT | MODIFIER_ALT, nullptr, u"cmd_selectUp2", nullptr, u"cmd_selectTop", nullptr}, + {NS_VK_DOWN, 0, MODIFIER_SHIFT | MODIFIER_ALT, nullptr, u"cmd_selectDown2", nullptr, u"cmd_selectBottom", nullptr}, + + // KeyCode Modifiers Windows macOS Linux Android Emacs + {NS_VK_PAGE_UP, 0, MODIFIER_NONE, u"cmd_movePageUp", u"cmd_scrollPageUp", u"cmd_movePageUp", u"cmd_movePageUp", u"cmd_movePageUp"}, + {NS_VK_PAGE_DOWN, 0, MODIFIER_NONE, u"cmd_movePageDown", u"cmd_scrollPageDown", u"cmd_movePageDown", u"cmd_movePageDown", u"cmd_movePageDown"}, + {NS_VK_PAGE_UP, 0, MODIFIER_SHIFT, u"cmd_selectPageUp", nullptr, u"cmd_selectPageUp", u"cmd_selectPageUp", u"cmd_selectPageUp"}, + {NS_VK_PAGE_DOWN, 0, MODIFIER_SHIFT, u"cmd_selectPageDown", nullptr, u"cmd_selectPageDown", u"cmd_selectPageDown", u"cmd_selectPageDown"}, + {NS_VK_PAGE_UP, 0, MODIFIER_ALT, nullptr, nullptr, nullptr, u"cmd_moveTop", nullptr}, + {NS_VK_PAGE_DOWN, 0, MODIFIER_ALT, nullptr, nullptr, nullptr, u"cmd_moveBottom", nullptr}, + + // KeyCode Modifiers Windows macOS Linux Android Emacs + {NS_VK_PAGE_UP, 0, MODIFIER_SHIFT | MODIFIER_ALT, nullptr, nullptr, nullptr, u"cmd_selectTop", nullptr}, + {NS_VK_PAGE_DOWN, 0, MODIFIER_SHIFT | MODIFIER_ALT, nullptr, nullptr, nullptr, u"cmd_selectBottom", nullptr}, + + // KeyCode Modifiers Windows macOS Linux Android Emacs + {NS_VK_HOME, 0, MODIFIER_NONE, u"cmd_beginLine", u"cmd_scrollTop", u"cmd_beginLine", u"cmd_beginLine", u"cmd_beginLine"}, + {NS_VK_END, 0, MODIFIER_NONE, u"cmd_endLine", u"cmd_scrollBottom", u"cmd_endLine", u"cmd_endLine", u"cmd_endLine"}, + {NS_VK_HOME, 0, MODIFIER_SHIFT, u"cmd_selectBeginLine", nullptr, u"cmd_selectBeginLine", u"cmd_selectBeginLine", u"cmd_selectBeginLine"}, + {NS_VK_END, 0, MODIFIER_SHIFT, u"cmd_selectEndLine", nullptr, u"cmd_selectEndLine", u"cmd_selectEndLine", u"cmd_selectEndLine"}, + {NS_VK_HOME, 0, MODIFIER_CONTROL, u"cmd_moveTop", nullptr, u"cmd_moveTop", u"cmd_moveTop", u"cmd_moveTop"}, + {NS_VK_END, 0, MODIFIER_CONTROL, u"cmd_moveBottom", nullptr, u"cmd_moveBottom", u"cmd_moveBottom", u"cmd_moveBottom"}, + + // KeyCode Modifiers Windows macOS Linux Android Emacs + {NS_VK_HOME, 0, MODIFIER_SHIFT | MODIFIER_CONTROL, u"cmd_selectTop", nullptr, u"cmd_selectTop", u"cmd_selectTop", u"cmd_selectTop"}, + {NS_VK_END, 0, MODIFIER_SHIFT | MODIFIER_CONTROL, u"cmd_selectBottom", nullptr, u"cmd_selectBottom", u"cmd_selectBottom", u"cmd_selectBottom"}, + + // KeyCode Modifiers Windows macOS Linux Android Emacs + {NS_VK_INSERT, 0, MODIFIER_CONTROL, u"cmd_copy", nullptr, u"cmd_copy", nullptr, u"cmd_copy"}, + {NS_VK_DELETE, 0, MODIFIER_SHIFT, u"cmd_cut", nullptr, u"cmd_cut", nullptr, u"cmd_cut"}, + {NS_VK_DELETE, 0, MODIFIER_CONTROL, u"cmd_deleteWordForward", nullptr, u"cmd_copy", u"cmd_deleteWordForward", u"cmd_copy"}, + {NS_VK_DELETE, 0, MODIFIER_ALT, nullptr, nullptr, nullptr, u"cmd_deleteToEndOfLine", nullptr}, + {NS_VK_BACK, 0, MODIFIER_CONTROL, nullptr, nullptr, nullptr, u"cmd_deleteWordBackward", nullptr}, + {NS_VK_BACK, 0, MODIFIER_ALT, nullptr, nullptr, nullptr, u"cmd_deleteToBeginningOfLine", nullptr}, + + // charCode Modifiers, Windows macOS Linux Android Emacs + {0, ' ', MODIFIER_NONE, u"cmd_scrollPageDown", u"cmd_scrollPageDown", u"cmd_scrollPageDown", u"cmd_scrollPageDown", u"cmd_scrollPageDown"}, + {0, ' ', MODIFIER_SHIFT, u"cmd_scrollPageUp", u"cmd_scrollPageUp", u"cmd_scrollPageUp", u"cmd_scrollPageUp", u"cmd_scrollPageUp"}, + {0, 'a', MODIFIER_ACCEL, u"cmd_selectAll", u"cmd_selectAll", u"cmd_selectAll", u"cmd_selectAll", u"cmd_selectAll"}, + {0, 'a', MODIFIER_ALT, nullptr, nullptr, nullptr, nullptr, u"cmd_selectAll"}, + {0, 'c', MODIFIER_ACCEL, u"cmd_copy", u"cmd_copy", u"cmd_copy", u"cmd_copy", u"cmd_copy"}, + {0, 'x', MODIFIER_ACCEL, u"cmd_cut", u"cmd_cut", u"cmd_cut", u"cmd_cut", u"cmd_cut"}, + {0, 'v', MODIFIER_ACCEL, u"cmd_paste", u"cmd_paste", u"cmd_paste", u"cmd_paste", u"cmd_paste"}, + {0, 'y', MODIFIER_ACCEL, u"cmd_redo", nullptr, nullptr, nullptr, nullptr}, + {0, 'z', MODIFIER_ACCEL, u"cmd_undo", u"cmd_undo", u"cmd_undo", u"cmd_undo", u"cmd_undo"}, + + // charCode Modifiers, Windows macOS Linux Android Emacs + {0, 'v', MODIFIER_SHIFT | MODIFIER_ACCEL, u"cmd_pasteNoFormatting", u"cmd_pasteNoFormatting", u"cmd_pasteNoFormatting", u"cmd_pasteNoFormatting", u"cmd_pasteNoFormatting"}, + + // charCode Modifiers, Windows macOS Linux Android Emacs + {0, 'v', MODIFIER_SHIFT | MODIFIER_ALT | MODIFIER_ACCEL, nullptr, u"cmd_pasteNoFormatting", nullptr, nullptr, nullptr}, + + // charCode Modifiers Windows macOS Linux Android Emacs + {0, 'z', MODIFIER_SHIFT | MODIFIER_ACCEL, u"cmd_redo", u"cmd_redo", u"cmd_redo", u"cmd_redo", u"cmd_redo"}, + }; + // clang-format on + + TestAllKeyCodes(ShortcutKeys::GetHandlers(HandlerType::eBrowser), + expectedMap); + + ShortcutKeys::Shutdown(); // Destroy the singleton instance. +} + +TEST(ShortcutKeyDefinitions, HTMLEditor) +{ + // clang-format off + const nsTArray expectedMap{ + // KeyCode Modifiers Windows macOS Linux Android Emacs + {NS_VK_LEFT, 0, MODIFIER_NONE, u"cmd_moveLeft", nullptr, u"cmd_moveLeft", u"cmd_moveLeft", u"cmd_moveLeft"}, + {NS_VK_RIGHT, 0, MODIFIER_NONE, u"cmd_moveRight", nullptr, u"cmd_moveRight", u"cmd_moveRight", u"cmd_moveRight"}, + {NS_VK_LEFT, 0, MODIFIER_SHIFT, u"cmd_selectLeft", nullptr, u"cmd_selectLeft", u"cmd_selectLeft", u"cmd_selectLeft"}, + {NS_VK_RIGHT, 0, MODIFIER_SHIFT, u"cmd_selectRight", nullptr, u"cmd_selectRight", u"cmd_selectRight", u"cmd_selectRight"}, + {NS_VK_LEFT, 0, MODIFIER_CONTROL, u"cmd_moveLeft2", nullptr, nullptr, u"cmd_wordPrevious", u"cmd_wordPrevious"}, + {NS_VK_RIGHT, 0, MODIFIER_CONTROL, u"cmd_moveRight2", nullptr, nullptr, u"cmd_wordNext", u"cmd_wordNext"}, + {NS_VK_LEFT, 0, MODIFIER_ALT, nullptr, nullptr, nullptr, u"cmd_beginLine", nullptr}, + {NS_VK_RIGHT, 0, MODIFIER_ALT, nullptr, nullptr, nullptr, u"cmd_endLine", nullptr}, + {NS_VK_UP, 0, MODIFIER_NONE, u"cmd_moveUp", nullptr, u"cmd_moveUp", u"cmd_moveUp", u"cmd_moveUp"}, + {NS_VK_DOWN, 0, MODIFIER_NONE, u"cmd_moveDown", nullptr, u"cmd_moveDown", u"cmd_moveDown", u"cmd_moveDown"}, + {NS_VK_UP, 0, MODIFIER_SHIFT, u"cmd_selectUp", nullptr, u"cmd_selectUp", u"cmd_selectUp", u"cmd_selectUp"}, + {NS_VK_DOWN, 0, MODIFIER_SHIFT, u"cmd_selectDown", nullptr, u"cmd_selectDown", u"cmd_selectDown", u"cmd_selectDown"}, + {NS_VK_UP, 0, MODIFIER_CONTROL, u"cmd_moveUp2", nullptr, nullptr, nullptr, nullptr}, + {NS_VK_DOWN, 0, MODIFIER_CONTROL, u"cmd_moveDown2", nullptr, nullptr, nullptr, nullptr}, + {NS_VK_UP, 0, MODIFIER_ALT, nullptr, nullptr, nullptr, u"cmd_moveTop", nullptr}, + {NS_VK_DOWN, 0, MODIFIER_ALT, nullptr, nullptr, nullptr, u"cmd_moveBottom", nullptr}, + + // KeyCode Modifiers Windows macOS Linux Android Emacs + {NS_VK_LEFT, 0, MODIFIER_SHIFT | MODIFIER_CONTROL, u"cmd_selectLeft2", nullptr, nullptr, u"cmd_selectWordPrevious", u"cmd_selectWordPrevious"}, + {NS_VK_RIGHT, 0, MODIFIER_SHIFT | MODIFIER_CONTROL, u"cmd_selectRight2", nullptr, nullptr, u"cmd_selectWordNext", u"cmd_selectWordNext"}, + {NS_VK_LEFT, 0, MODIFIER_SHIFT | MODIFIER_ALT, nullptr, nullptr, nullptr, u"cmd_selectBeginLine", nullptr}, + {NS_VK_RIGHT, 0, MODIFIER_SHIFT | MODIFIER_ALT, nullptr, nullptr, nullptr, u"cmd_selectEndLine", nullptr}, + {NS_VK_UP, 0, MODIFIER_SHIFT | MODIFIER_CONTROL, u"cmd_selectUp2", nullptr, nullptr, nullptr, nullptr}, + {NS_VK_DOWN, 0, MODIFIER_SHIFT | MODIFIER_CONTROL, u"cmd_selectDown2", nullptr, nullptr, nullptr, nullptr}, + {NS_VK_UP, 0, MODIFIER_SHIFT | MODIFIER_ALT, nullptr, nullptr, nullptr, u"cmd_selectTop", nullptr}, + {NS_VK_DOWN, 0, MODIFIER_SHIFT | MODIFIER_ALT, nullptr, nullptr, nullptr, u"cmd_selectBottom", nullptr}, + + // KeyCode Modifiers Windows macOS Linux Android Emacs + {NS_VK_PAGE_UP, 0, MODIFIER_NONE, u"cmd_movePageUp", nullptr, nullptr, u"cmd_movePageUp", u"cmd_movePageUp"}, + {NS_VK_PAGE_DOWN, 0, MODIFIER_NONE, u"cmd_movePageDown", nullptr, nullptr, u"cmd_movePageDown", u"cmd_movePageDown"}, + {NS_VK_PAGE_UP, 0, MODIFIER_SHIFT, u"cmd_selectPageUp", nullptr, nullptr, u"cmd_selectPageUp", u"cmd_selectPageUp"}, + {NS_VK_PAGE_DOWN, 0, MODIFIER_SHIFT, u"cmd_selectPageDown", nullptr, nullptr, u"cmd_selectPageDown", u"cmd_selectPageDown"}, + {NS_VK_PAGE_UP, 0, MODIFIER_ALT, nullptr, nullptr, nullptr, u"cmd_moveTop", nullptr}, + {NS_VK_PAGE_DOWN, 0, MODIFIER_ALT, nullptr, nullptr, nullptr, u"cmd_moveBottom", nullptr}, + + // KeyCode Modifiers Windows macOS Linux Android Emacs + {NS_VK_PAGE_UP, 0, MODIFIER_SHIFT | MODIFIER_ALT, nullptr, nullptr, nullptr, u"cmd_selectTop", nullptr}, + {NS_VK_PAGE_DOWN, 0, MODIFIER_SHIFT | MODIFIER_ALT, nullptr, nullptr, nullptr, u"cmd_selectBottom", nullptr}, + + // KeyCode Modifiers Windows macOS Linux Android Emacs + {NS_VK_HOME, 0, MODIFIER_NONE, u"cmd_beginLine", nullptr, nullptr, u"cmd_beginLine", u"cmd_beginLine"}, + {NS_VK_END, 0, MODIFIER_NONE, u"cmd_endLine", nullptr, nullptr, u"cmd_endLine", u"cmd_endLine"}, + {NS_VK_HOME, 0, MODIFIER_SHIFT, u"cmd_selectBeginLine", nullptr, nullptr, u"cmd_selectBeginLine", u"cmd_selectBeginLine"}, + {NS_VK_END, 0, MODIFIER_SHIFT, u"cmd_selectEndLine", nullptr, nullptr, u"cmd_selectEndLine", u"cmd_selectEndLine"}, + {NS_VK_HOME, 0, MODIFIER_CONTROL, u"cmd_moveTop", nullptr, nullptr, u"cmd_moveTop", u"cmd_moveTop"}, + {NS_VK_END, 0, MODIFIER_CONTROL, u"cmd_moveBottom", nullptr, nullptr, u"cmd_moveBottom", u"cmd_moveBottom"}, + + // KeyCode Modifiers Windows macOS Linux Android Emacs + {NS_VK_HOME, 0, MODIFIER_SHIFT | MODIFIER_CONTROL, u"cmd_selectTop", nullptr, nullptr, u"cmd_selectTop", u"cmd_selectTop"}, + {NS_VK_END, 0, MODIFIER_SHIFT | MODIFIER_CONTROL, u"cmd_selectBottom", nullptr, nullptr, u"cmd_selectBottom", u"cmd_selectBottom"}, + + // KeyCode Modifiers Windows macOS Linux Android Emacs + {NS_VK_INSERT, 0, MODIFIER_SHIFT, u"cmd_paste", nullptr, nullptr, nullptr, u"cmd_paste"}, + {NS_VK_INSERT, 0, MODIFIER_CONTROL, u"cmd_copy", nullptr, nullptr, nullptr, u"cmd_copy"}, + {NS_VK_DELETE, 0, MODIFIER_SHIFT, u"cmd_cutOrDelete", nullptr, nullptr, nullptr, u"cmd_cutOrDelete"}, + {NS_VK_DELETE, 0, MODIFIER_CONTROL, u"cmd_deleteWordForward", nullptr, nullptr, u"cmd_deleteWordForward", u"cmd_copyOrDelete"}, + {NS_VK_DELETE, 0, MODIFIER_ALT, nullptr, nullptr, nullptr, u"cmd_deleteToEndOfLine", nullptr}, + {NS_VK_BACK, 0, MODIFIER_CONTROL, u"cmd_deleteWordBackward", nullptr, nullptr, u"cmd_deleteWordBackward", u"cmd_deleteWordBackward"}, + {NS_VK_BACK, 0, MODIFIER_ALT, u"cmd_undo", nullptr, nullptr, u"cmd_deleteToBeginningOfLine", nullptr}, + + // KeyCode Modifiers Windows macOS Linux Android Emacs + {NS_VK_BACK, 0, MODIFIER_SHIFT | MODIFIER_ALT, u"cmd_redo", nullptr, nullptr, nullptr, nullptr}, + + // charCode Modifiers, Windows macOS Linux Android Emacs + {0, ' ', MODIFIER_NONE, u"cmd_scrollPageDown", u"cmd_scrollPageDown", u"cmd_scrollPageDown", u"cmd_scrollPageDown", u"cmd_scrollPageDown"}, + {0, ' ', MODIFIER_SHIFT, u"cmd_scrollPageUp", u"cmd_scrollPageUp", u"cmd_scrollPageUp", u"cmd_scrollPageUp", u"cmd_scrollPageUp"}, + {0, 'a', MODIFIER_ACCEL, u"cmd_selectAll", u"cmd_selectAll", u"cmd_selectAll", u"cmd_selectAll", nullptr}, + {0, 'a', MODIFIER_ALT, nullptr, nullptr, nullptr, nullptr, u"cmd_selectAll"}, + {0, 'c', MODIFIER_ACCEL, u"cmd_copy", u"cmd_copy", u"cmd_copy", u"cmd_copy", u"cmd_copy"}, + {0, 'x', MODIFIER_ACCEL, u"cmd_cut", u"cmd_cut", u"cmd_cut", u"cmd_cut", u"cmd_cut"}, + {0, 'v', MODIFIER_ACCEL, u"cmd_paste", u"cmd_paste", u"cmd_paste", u"cmd_paste", u"cmd_paste"}, + {0, 'y', MODIFIER_ACCEL, u"cmd_redo", nullptr, u"cmd_redo", nullptr, u"cmd_redo"}, + {0, 'z', MODIFIER_ACCEL, u"cmd_undo", u"cmd_undo", u"cmd_undo", u"cmd_undo", u"cmd_undo"}, + + // charCode Modifiers Windows macOS Linux Android Emacs + {0, 'v', MODIFIER_SHIFT | MODIFIER_ACCEL, u"cmd_pasteNoFormatting", u"cmd_pasteNoFormatting", u"cmd_pasteNoFormatting", u"cmd_pasteNoFormatting", u"cmd_pasteNoFormatting"}, + {0, 'z', MODIFIER_SHIFT | MODIFIER_ACCEL, u"cmd_redo", u"cmd_redo", u"cmd_redo", u"cmd_redo", u"cmd_redo"}, + + // charCode Modifiers Windows macOS Linux Android Emacs + {0, 'v', MODIFIER_SHIFT | MODIFIER_ACCEL | MODIFIER_ALT, nullptr, u"cmd_pasteNoFormatting", nullptr, nullptr, nullptr}, + + // charCode Modifiers Windows macOS Linux Android Emacs + {0, 'a', MODIFIER_CONTROL, nullptr, nullptr, nullptr, nullptr, u"cmd_beginLine"}, + {0, 'b', MODIFIER_CONTROL, nullptr, nullptr, nullptr, nullptr, u"cmd_charPrevious"}, + {0, 'd', MODIFIER_CONTROL, nullptr, nullptr, nullptr, nullptr, u"cmd_deleteCharForward"}, + {0, 'e', MODIFIER_CONTROL, nullptr, nullptr, nullptr, nullptr, u"cmd_endLine"}, + {0, 'f', MODIFIER_CONTROL, nullptr, nullptr, nullptr, nullptr, u"cmd_charNext"}, + {0, 'h', MODIFIER_CONTROL, nullptr, nullptr, nullptr, nullptr, u"cmd_deleteCharBackward"}, + {0, 'k', MODIFIER_CONTROL, nullptr, nullptr, nullptr, nullptr, u"cmd_deleteToEndOfLine"}, + {0, 'n', MODIFIER_CONTROL, nullptr, nullptr, nullptr, nullptr, u"cmd_lineNext"}, + {0, 'p', MODIFIER_CONTROL, nullptr, nullptr, nullptr, nullptr, u"cmd_linePrevious"}, + {0, 'u', MODIFIER_CONTROL, nullptr, nullptr, nullptr, nullptr, u"cmd_deleteToBeginningOfLine"}, + {0, 'w', MODIFIER_CONTROL, nullptr, nullptr, nullptr, nullptr, u"cmd_deleteWordBackward"}, + }; + // clang-format on + + TestAllKeyCodes(ShortcutKeys::GetHandlers(HandlerType::eEditor), expectedMap); + + ShortcutKeys::Shutdown(); // Destroy the singleton instance. +} + +#undef MODIFIER_ACCEL +#undef GetCommandForPlatform + +} // namespace mozilla diff --git a/dom/events/test/gtest/moz.build b/dom/events/test/gtest/moz.build new file mode 100644 index 0000000000..d5c0ac6a9e --- /dev/null +++ b/dom/events/test/gtest/moz.build @@ -0,0 +1,18 @@ +# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*- +# vim: set filetype=python: +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + +with Files("**"): + BUG_COMPONENT = ("Core", "DOM: UI Events & Focus Handling") + +UNIFIED_SOURCES += [ + "TestShortcutKeyDefinitions.cpp", +] + +LOCAL_INCLUDES += ["/dom/events"] + +include("/ipc/chromium/chromium-config.mozbuild") + +FINAL_LIBRARY = "xul-gtest" diff --git a/dom/events/test/mochitest.ini b/dom/events/test/mochitest.ini new file mode 100644 index 0000000000..846fe12bda --- /dev/null +++ b/dom/events/test/mochitest.ini @@ -0,0 +1,333 @@ +[DEFAULT] +# Skip migration work in BG__migrateUI for browser_startup.js since it increases +# the occurrence of the leak reported in bug 1398563 with test_bug1327798.html. +# Run the font-loader eagerly to minimize the risk that font list finalization +# may disrupt the events received or result in a timeout. +tags = condprof +prefs = + browser.migration.version=9999999 + gfx.font_loader.delay=0 +support-files = + bug226361_iframe.xhtml + bug299673.js + bug322588-popup.html + bug426082.html + bug545268.html + bug574663.html + bug607464.html + bug656379-1.html + bug418986-3.js + error_event_worker.js + empty.js + event_leak_utils.js + window_bug493251.html + window_bug659071.html + window_wheel_default_action.html + !/gfx/layers/apz/test/mochitest/apz_test_utils.js + +[test_accel_virtual_modifier.html] +[test_accesskey.html] +[test_addEventListenerExtraArg.html] +[test_all_synthetic_events.html] +skip-if = + http3 +[test_bug1539497.html] +[test_bug1686716.html] +[test_bug226361.xhtml] +[test_bug238987.html] +[test_bug288392.html] +[test_bug299673-1.html] +[test_bug1037990.html] +[test_bug299673-2.html] +[test_bug322588.html] +[test_bug328885.html] +[test_bug336682_1.html] +support-files = test_bug336682.js +[test_bug367781.html] +[test_bug379120.html] +[test_bug402089.html] +[test_bug405632.html] +[test_bug409604.html] +skip-if = toolkit == 'android' # android: TIMED_OUT +[test_bug412567.html] +[test_bug418986-3.html] +[test_bug422132.html] +[test_bug426082.html] +skip-if = + http3 +[test_bug427537.html] +skip-if = + http3 +[test_bug428988.html] +[test_bug432698.html] +[test_bug443985.html] +skip-if = verify +[test_bug447736.html] +[test_bug448602.html] +[test_bug450876.html] +[test_bug456273.html] +[test_bug457672.html] +skip-if = toolkit == 'android' #CRASH_DUMP, RANDOM +[test_bug489671.html] +[test_bug493251.html] +[test_bug508479.html] +skip-if = toolkit == 'android' #CRASH_DUMP, RANDOM # drag event fails +[test_bug517851.html] +[test_bug534833.html] +skip-if = toolkit == 'android' #CRASH_DUMP, RANDOM +[test_bug545268.html] +skip-if = toolkit == 'android' #CRASH_DUMP, RANDOM +[test_bug547996-1.html] +skip-if = toolkit == 'android' #CRASH_DUMP, RANDOM +[test_bug547996-2.xhtml] +skip-if = toolkit == 'android' #CRASH_DUMP, RANDOM +[test_bug556493.html] +skip-if = toolkit == 'android' #CRASH_DUMP, RANDOM +[test_bug563329.html] +skip-if = true # Disabled due to timeouts. +[test_bug574663.html] +skip-if = toolkit == 'android' #CRASH_DUMP, RANDOM +[test_bug591815.html] +[test_bug593959.html] +[test_bug603008.html] +skip-if = toolkit == 'android' +[test_bug605242.html] +skip-if = toolkit == 'android' #CRASH_DUMP, RANDOM +[test_bug607464.html] +skip-if = toolkit == 'android' + e10s #CRASH_DUMP, RANDOM, bug 1400586 +[test_bug613634.html] +skip-if = toolkit == 'android' #CRASH_DUMP, RANDOM +[test_bug615597.html] +skip-if = toolkit == 'android' # failed +[test_bug624127.html] +skip-if = toolkit == 'android' #CRASH_DUMP, RANDOM +[test_bug635465.html] +skip-if = toolkit == 'android' #CRASH_DUMP, RANDOM +[test_bug641477.html] +[test_bug648573.html] +skip-if = toolkit == 'android' #CRASH_DUMP, RANDOM +[test_bug650493.html] +skip-if = toolkit == 'android' #CRASH_DUMP, RANDOM +[test_bug656379-1.html] +skip-if = toolkit == 'android' +[test_bug656379-2.html] +skip-if = toolkit == 'android' #CRASH_DUMP, RANDOM +[test_bug656954.html] +skip-if = toolkit == 'android' #CRASH_DUMP, RANDOM +[test_bug659071.html] +skip-if = + toolkit == 'android' # fail + http3 +[test_bug659350.html] +skip-if = toolkit == 'android' #CRASH_DUMP, RANDOM +[test_bug662678.html] +skip-if = toolkit == 'android' #CRASH_DUMP, RANDOM +[test_bug667612.html] +skip-if = toolkit == 'android' #CRASH_DUMP, RANDOM +[test_bug667919-1.html] +skip-if = toolkit == 'android' #CRASH_DUMP, RANDOM +[test_bug684208.html] +[test_bug689564.html] +skip-if = toolkit == 'android' #CRASH_DUMP, RANDOM +[test_bug698929.html] +skip-if = toolkit == 'android' #CRASH_DUMP, RANDOM +[test_bug704423.html] +[test_bug741666.html] +skip-if = + toolkit == 'android' # fail +[test_coalesce_mousewheel.html] +skip-if = + toolkit == 'android' # fail +[test_coalesce_touchmove.html] +support-files = + file_coalesce_touchmove_ipc.html + file_coalesce_touchmove_browserchild.html + file_coalesce_touchmove_browserchild2.html +skip-if = debug #In order to be able to test touchmoves, the test needs to synthesize touchstart in a way which asserts +[test_deviceSensor.html] +[test_bug812744.html] +skip-if = + http3 +[test_bug822898.html] +[test_bug855741.html] +[test_bug864040.html] +[test_bug924087.html] +[test_bug930374-content.html] +[test_bug944011.html] +[test_bug944847.html] +[test_bug946632.html] +skip-if = toolkit == 'android' # fail +[test_bug967796.html] +[test_bug985988.html] +[test_bug998809.html] +[test_bug1003432.html] +support-files = test_bug1003432.js +[test_bug1013412.html] +[test_bug1017086_enable.html] +support-files = bug1017086_inner.html +[test_bug1079236.html] +[test_bug1127588.html] +[test_bug1145910.html] +[test_bug1150308.html] +[test_bug1248459.html] +[test_bug1264380.html] +skip-if = toolkit == 'android' # some clipboard types and drag aren't supported +[test_bug1327798.html] +skip-if = headless +[test_bug1692052.html] +support-files = file_bug1692052.html +[test_click_on_reframed_generated_text.html] +[test_click_on_restyled_element.html] +[test_clickevent_on_input.html] +skip-if = toolkit == 'android' #CRASH_DUMP, RANDOM +[test_continuous_wheel_events.html] +skip-if = (verify && debug && (os == 'linux' || os == 'win')) + toolkit == 'android' # wheel event isn't supported +[test_dblclick_explicit_original_target.html] +[test_dom_activate_event.html] +[test_dom_keyboard_event.html] +skip-if = toolkit == 'android' #CRASH_DUMP, RANDOM +[test_dom_mouse_event.html] +skip-if = toolkit == 'android' #CRASH_DUMP, RANDOM +[test_dom_storage_event.html] +[test_dom_wheel_event.html] +skip-if = toolkit == 'android' # wheel scroll isn't supported +[test_draggableprop.html] +skip-if = toolkit == 'android' #CRASH_DUMP, RANDOM +[test_dragstart.html] +skip-if = toolkit == 'android' # not supported +[test_drag_coords.html] +skip-if = toolkit == 'android' # not supported +[test_drag_image_file.html] +skip-if = + toolkit == 'android' + xorigin # Bug 1802904 +support-files = + green.png +[test_error_events.html] +skip-if = toolkit == 'android' #TIMED_OUT +[test_event_handler_cc.html] +[test_eventctors.html] +skip-if = toolkit == 'android' #CRASH_DUMP, RANDOM +[test_eventctors_sensors.html] +[test_disabled_events.html] +[test_event_screenXY_in_cross_origin_iframe.html] +support-files = + file_event_screenXY.html + !/gfx/layers/apz/test/mochitest/apz_test_native_event_utils.js +skip-if = toolkit == 'android' # fail +[test_event_screenXY_with_zoom.html] +skip-if = toolkit == 'android' # Android doesn't have full zoom. +[test_eventhandler_scoping.html] +[test_eventTimeStamp.html] +[test_focus_abspos.html] +[test_legacy_event.html] +[test_legacy_non-primary_click.html] +[test_legacy_touch_api.html] +[test_messageEvent.html] +[test_messageEvent_init.html] +[test_mouse_enterleave_iframe.html] +support-files = + file_mouse_enterleave.html +skip-if = + toolkit == 'android' # timeout + http3 +[test_mouse_capture_iframe.html] +support-files = + file_empty.html +skip-if = + toolkit == 'android' # timeout + http3 +[test_moz_mouse_pixel_scroll_event.html] +[test_offsetxy.html] +[test_onerror_handler_args.html] +[test_passive_listeners.html] +[test_paste_image.html] +skip-if = headless # Bug 1405869 + toolkit == 'android' # Image type isn't supported +[test_moving_and_expanding_selection_per_page.html] +support-files = window_empty_document.html +[test_scroll_per_page.html] +support-files = window_empty_document.html +skip-if = toolkit == 'android' # fail +[test_text_event_in_content.html] +[test_use_conflated_keypress_event_model_on_newer_Office_Online_Server.html] +[test_use_split_keypress_event_model_on_old_Confluence.html] +skip-if = !debug # The mode change event is available only on debug build +[test_use_split_keypress_event_model_on_old_Office_Online_Server.html] +skip-if = !debug # The mode change event is available only on debug build +[test_wheel_default_action.html] +skip-if = os == 'linux' + toolkit == 'android' +[test_bug687787.html] +[test_bug1305458.html] +[test_bug1298970.html] +[test_bug1304044.html] +[test_bug1332699.html] +[test_bug1339758.html] +[test_bug1369072.html] +support-files = window_bug1369072.html +skip-if = toolkit == 'android' +[test_bug1429572.html] +support-files = window_bug1429572.html +skip-if = toolkit == 'android' # failed +[test_bug1446834.html] +support-files = file_bug1446834.html +[test_bug1447993.html] +support-files = window_bug1447993.html +skip-if = toolkit == 'android' +[test_bug1484371.html] +support-files = file_bug1484371.html +[test_bug1534562.html] +skip-if = toolkit == 'android' # Bug 1312791 +[test_bug1581192.html] +[test_bug1673434.html] +[test_bug1681800.html] +[test_deltaMode_lines_always_enabled.html] +[test_dnd_with_modifiers.html] +skip-if = toolkit == 'android' # Dnd isn't supported +[test_hover_mouseleave.html] +[test_marquee_events.html] +[test_slotted_mouse_event.html] +skip-if = toolkit == 'android' # timeout +[test_slotted_text_click.html] +[test_unbound_before_in_active_chain.html] +[test_submitevent_on_form.html] +[test_wheel_zoom_on_form_controls.html] +skip-if = verify + toolkit == 'android' # wheel isn't supported +[test_focus_blur_on_click_in_cross_origin_iframe.html] +support-files = + file_focus_blur_on_click_in_cross_origin_iframe.html +skip-if = toolkit == 'android' # Bug 1701546 +[test_focus_blur_on_click_in_deep_cross_origin_iframe.html] +support-files = + file_focus_blur_on_click_in_deep_cross_origin_iframe_inner.html + file_focus_blur_on_click_in_deep_cross_origin_iframe_middle.html +skip-if = toolkit == 'android' # Bug 1701546 + condprof && os == "win" # 1773806 +[test_bug1635018.html] +[test_bug1637259.html] +disabled = Enable this when the taskcluster Windows machine upgrades to RS5+ +run-if = toolkit == 'windows' # Only Windows supports pen input synthesis +support-files = + !/gfx/layers/apz/test/mochitest/apz_test_native_event_utils.js +[test_bug1692277.html] +disabled = Enable this when the taskcluster Windows machine upgrades to RS5+ +run-if = toolkit == 'windows' # Only Windows supports pen input synthesis +support-files = + !/gfx/layers/apz/test/mochitest/apz_test_native_event_utils.js + !/dom/base/test/Ahem.ttf +[test_bug1709832.html] +support-files = + !/dom/base/test/Ahem.ttf +[test_bug1710509.html] +disabled = Enable this when the taskcluster Windows machine upgrades to RS5+ +run-if = toolkit == 'windows' # Only Windows supports pen input synthesis +support-files = + !/gfx/layers/apz/test/mochitest/apz_test_native_event_utils.js +[test_bug1728171.html] +run-if = win10_2004 # Only Windows 1809+ supports pen input synthesis +support-files = + !/gfx/layers/apz/test/mochitest/apz_test_native_event_utils.js diff --git a/dom/events/test/pointerevents/bug1293174_implicit_pointer_capture_for_touch_1.html b/dom/events/test/pointerevents/bug1293174_implicit_pointer_capture_for_touch_1.html new file mode 100644 index 0000000000..55c4e3cad5 --- /dev/null +++ b/dom/events/test/pointerevents/bug1293174_implicit_pointer_capture_for_touch_1.html @@ -0,0 +1,63 @@ + + + + Pointer Events properties tests + + + + + + + + + +

Pointer Events tests

+
+
+
+

The following pointer types were detected: .

+

Refresh the page to run the tests again with a different pointer type.

+
+
+ + diff --git a/dom/events/test/pointerevents/bug1293174_implicit_pointer_capture_for_touch_2.html b/dom/events/test/pointerevents/bug1293174_implicit_pointer_capture_for_touch_2.html new file mode 100644 index 0000000000..a533429acb --- /dev/null +++ b/dom/events/test/pointerevents/bug1293174_implicit_pointer_capture_for_touch_2.html @@ -0,0 +1,64 @@ + + + + Pointer Events properties tests + + + + + + + + + +

Pointer Events tests

+
+
+
+

The following pointer types were detected: .

+

Refresh the page to run the tests again with a different pointer type.

+
+
+ + diff --git a/dom/events/test/pointerevents/bug968148_inner.html b/dom/events/test/pointerevents/bug968148_inner.html new file mode 100644 index 0000000000..464e2e5c38 --- /dev/null +++ b/dom/events/test/pointerevents/bug968148_inner.html @@ -0,0 +1,316 @@ + + + + + Test for Bug 968148 + + + + + +Mozilla Bug 968148 +

+ +
+
+
+
 

 
+
 

 
+

+
+
diff --git a/dom/events/test/pointerevents/bug968148_inner2.html b/dom/events/test/pointerevents/bug968148_inner2.html
new file mode 100644
index 0000000000..ffad5297bc
--- /dev/null
+++ b/dom/events/test/pointerevents/bug968148_inner2.html
@@ -0,0 +1,315 @@
+
+
+
+
+  Test for Bug 968148
+  
+  
+  
+
+
+Mozilla Bug 968148
+

+ +
+
+
+
 

 
+
 

 
+

+
+
diff --git a/dom/events/test/pointerevents/bug_1420589_iframe1.html b/dom/events/test/pointerevents/bug_1420589_iframe1.html
new file mode 100644
index 0000000000..b18d808b84
--- /dev/null
+++ b/dom/events/test/pointerevents/bug_1420589_iframe1.html
@@ -0,0 +1,17 @@
+
+	
+
diff --git a/dom/events/test/pointerevents/bug_1420589_iframe2.html b/dom/events/test/pointerevents/bug_1420589_iframe2.html
new file mode 100644
index 0000000000..75aea1d187
--- /dev/null
+++ b/dom/events/test/pointerevents/bug_1420589_iframe2.html
@@ -0,0 +1,17 @@
+
+	
+
diff --git a/dom/events/test/pointerevents/chrome.ini b/dom/events/test/pointerevents/chrome.ini
new file mode 100644
index 0000000000..d5dbf50ed5
--- /dev/null
+++ b/dom/events/test/pointerevents/chrome.ini
@@ -0,0 +1 @@
+[test_bug1697769.xhtml]
diff --git a/dom/events/test/pointerevents/file_pointercapture_xorigin_iframe.html b/dom/events/test/pointerevents/file_pointercapture_xorigin_iframe.html
new file mode 100644
index 0000000000..88690748e5
--- /dev/null
+++ b/dom/events/test/pointerevents/file_pointercapture_xorigin_iframe.html
@@ -0,0 +1,62 @@
+
+
+
+
+Bug 1671849
+
+
+
+
+
+
+
+Mozilla Bug 1671849
+
+ + +
+
+
+ + diff --git a/dom/events/test/pointerevents/file_pointercapture_xorigin_iframe_pointerlock.html b/dom/events/test/pointerevents/file_pointercapture_xorigin_iframe_pointerlock.html new file mode 100644 index 0000000000..12174da197 --- /dev/null +++ b/dom/events/test/pointerevents/file_pointercapture_xorigin_iframe_pointerlock.html @@ -0,0 +1,111 @@ + + + + +Bug 1671849 + + + + + + + +Mozilla Bug 1671849 +
+ + +
+
+
+ + diff --git a/dom/events/test/pointerevents/file_pointercapture_xorigin_iframe_touch.html b/dom/events/test/pointerevents/file_pointercapture_xorigin_iframe_touch.html new file mode 100644 index 0000000000..f34605349f --- /dev/null +++ b/dom/events/test/pointerevents/file_pointercapture_xorigin_iframe_touch.html @@ -0,0 +1,69 @@ + + + + +Bug 1671849 - Touch + + + + + + + + + +Mozilla Bug 1671849 +
+ + +
+
+
+ + diff --git a/dom/events/test/pointerevents/file_test_trigger_fullscreen.html b/dom/events/test/pointerevents/file_test_trigger_fullscreen.html new file mode 100644 index 0000000000..2d6549ede7 --- /dev/null +++ b/dom/events/test/pointerevents/file_test_trigger_fullscreen.html @@ -0,0 +1 @@ +
diff --git a/dom/events/test/pointerevents/iframe.html b/dom/events/test/pointerevents/iframe.html new file mode 100644 index 0000000000..0e3eac19b9 --- /dev/null +++ b/dom/events/test/pointerevents/iframe.html @@ -0,0 +1,7 @@ + + + + +
+ + diff --git a/dom/events/test/pointerevents/mochitest.ini b/dom/events/test/pointerevents/mochitest.ini new file mode 100644 index 0000000000..6940c03b36 --- /dev/null +++ b/dom/events/test/pointerevents/mochitest.ini @@ -0,0 +1,168 @@ +[DEFAULT] +prefs = + gfx.font_loader.delay=0 +support-files = + iframe.html + mochitest_support_external.js + mochitest_support_internal.js + wpt/pointerevent_styles.css + wpt/pointerevent_support.js + pointerevent_utils.js + !/gfx/layers/apz/test/mochitest/apz_test_utils.js + +[test_bug968148.html] +support-files = + bug968148_inner.html + bug968148_inner2.html +[test_bug1285128.html] +[test_bug1293174_implicit_pointer_capture_for_touch_1.html] +support-files = bug1293174_implicit_pointer_capture_for_touch_1.html +skip-if = + http3 +[test_bug1293174_implicit_pointer_capture_for_touch_2.html] +support-files = bug1293174_implicit_pointer_capture_for_touch_2.html +skip-if = + http3 +[test_bug1303704.html] +[test_bug1315862.html] +[test_bug1323158.html] +[test_bug1403055.html] +[test_bug1420589_1.html] +support-files = + bug_1420589_iframe1.html + bug_1420589_iframe2.html +[test_bug1420589_2.html] +support-files = + bug_1420589_iframe1.html +[test_bug1420589_3.html] +support-files = + bug_1420589_iframe1.html +[test_bug1725416.html] +skip-if = + os == 'android' # Bug 1312791 +support-files = + !/gfx/layers/apz/test/mochitest/apz_test_native_event_utils.js +[test_multiple_touches.html] +[test_wpt_pointerevent_attributes_hoverable_pointers-manual.html] +support-files = + wpt/pointerevent_attributes_hoverable_pointers-manual.html + wpt/resources/pointerevent_attributes_hoverable_pointers-iframe.html +skip-if = + http3 +[test_wpt_pointerevent_attributes_nohover_pointers-manual.html] +support-files = + wpt/pointerevent_attributes_nohover_pointers-manual.html + wpt/resources/pointerevent_attributes_hoverable_pointers-iframe.html +skip-if = + http3 +[test_wpt_pointerevent_boundary_events_in_capturing-manual.html] +support-files = wpt/pointerevent_boundary_events_in_capturing-manual.html +skip-if = + http3 +[test_wpt_pointerevent_change-touch-action-onpointerdown_touch-manual.html] +support-files = wpt/pointerevent_change-touch-action-onpointerdown_touch-manual.html +disabled = disabled +[test_wpt_pointerevent_constructor.html] +support-files = wpt/pointerevent_constructor.html +skip-if = + http3 +[test_wpt_pointerevent_multiple_primary_pointers_boundary_events-manual.html] +support-files = wpt/pointerevent_multiple_primary_pointers_boundary_events-manual.html +disabled = should be investigated +[test_wpt_pointerevent_pointercancel_touch-manual.html] +support-files = wpt/pointerevent_pointercancel_touch-manual.html +skip-if = + http3 +[test_wpt_pointerevent_pointerId_scope-manual.html] +support-files = wpt/resources/pointerevent_pointerId_scope-iframe.html +disabled = should be investigated +[test_wpt_pointerevent_pointerleave_after_pointercancel_touch-manual.html] +support-files = wpt/pointerevent_pointerleave_after_pointercancel_touch-manual.html +skip-if = + http3 +[test_wpt_pointerevent_pointerleave_pen-manual.html] +support-files = wpt/pointerevent_pointerleave_pen-manual.html +skip-if = + http3 +[test_wpt_pointerevent_pointerout_after_pointercancel_touch-manual.html] +support-files = wpt/pointerevent_pointerout_after_pointercancel_touch-manual.html +skip-if = + http3 +[test_wpt_pointerevent_pointerout_pen-manual.html] +support-files = wpt/pointerevent_pointerout_pen-manual.html +skip-if = + http3 +[test_wpt_pointerevent_releasepointercapture_events_to_original_target-manual.html] +support-files = wpt/pointerevent_releasepointercapture_events_to_original_target-manual.html +skip-if = + http3 +[test_wpt_pointerevent_releasepointercapture_onpointercancel_touch-manual.html] +support-files = wpt/pointerevent_releasepointercapture_onpointercancel_touch-manual.html +skip-if = + http3 +[test_wpt_pointerevent_sequence_at_implicit_release_on_drag-manual.html] +support-files = wpt/pointerevent_sequence_at_implicit_release_on_drag-manual.html +skip-if = + http3 +[test_wpt_pointerevent_drag_interaction-manual.html] +support-files = wpt/html/pointerevent_drag_interaction-manual.html +skip-if = + http3 +[test_wpt_touch_action.html] +skip-if = + os == 'android' # Bug 1312791 + os == 'linux' && headless # Bug 1722906 +support-files = + ../../../../gfx/layers/apz/test/mochitest/apz_test_utils.js + ../../../../gfx/layers/apz/test/mochitest/apz_test_native_event_utils.js + touch_action_helpers.js + wpt/pointerevent_touch-action-auto-css_touch-manual.html + wpt/pointerevent_touch-action-button-test_touch-manual.html + wpt/pointerevent_touch-action-inherit_child-auto-child-none_touch-manual.html + wpt/pointerevent_touch-action-inherit_child-none_touch-manual.html + wpt/pointerevent_touch-action-inherit_child-pan-x-child-pan-x_touch-manual.html + wpt/pointerevent_touch-action-inherit_child-pan-x-child-pan-y_touch-manual.html + wpt/pointerevent_touch-action-inherit_highest-parent-none_touch-manual.html + wpt/pointerevent_touch-action-inherit_parent-none_touch-manual.html + wpt/pointerevent_touch-action-none-css_touch-manual.html + wpt/pointerevent_touch-action-pan-x-css_touch-manual.html + wpt/pointerevent_touch-action-pan-x-pan-y-pan-y_touch-manual.html + wpt/pointerevent_touch-action-pan-x-pan-y_touch-manual.html + wpt/pointerevent_touch-action-pan-y-css_touch-manual.html + wpt/pointerevent_touch-action-span-test_touch-manual.html + wpt/pointerevent_touch-action-svg-test_touch-manual.html + wpt/pointerevent_touch-action-table-test_touch-manual.html + wpt/pointerevent_touch-action-pan-down-css_touch-manual.html + wpt/pointerevent_touch-action-pan-left-css_touch-manual.html + wpt/pointerevent_touch-action-pan-right-css_touch-manual.html + wpt/pointerevent_touch-action-pan-up-css_touch-manual.html +[test_wpt_pointerevent_movementxy-manual.html] +support-files = + wpt/pointerlock/pointerevent_movementxy-manual.html + wpt/pointerlock/resources/pointerevent_movementxy-iframe.html +skip-if = + http3 +[test_trigger_fullscreen_by_pointer_events.html] +support-files = + file_test_trigger_fullscreen.html +[test_remove_frame_when_got_pointer_capture.html] +[test_getCoalescedEvents.html] +skip-if = + os == 'android' # Bug 1312791 + verify && os == 'win' # Bug 1659744 +[test_getCoalescedEvents_touch.html] +skip-if = + os == 'android' # Bug 1312791 + verify && os == 'win' # Bug 1659744 + win11_2009 # Bug 1781388 +support-files = + !/gfx/layers/apz/test/mochitest/apz_test_native_event_utils.js +[test_pointercapture_xorigin_iframe.html] +support-files = + file_pointercapture_xorigin_iframe.html + file_pointercapture_xorigin_iframe_pointerlock.html + file_pointercapture_xorigin_iframe_touch.html +[test_pointercapture_remove_iframe.html] +[test_pointermove_drag_scrollbar.html] +skip-if = os == 'android' # scrollbar not showed on mobile +[test_synthesized_touch.html] diff --git a/dom/events/test/pointerevents/mochitest_support_external.js b/dom/events/test/pointerevents/mochitest_support_external.js new file mode 100644 index 0000000000..8f190e2c84 --- /dev/null +++ b/dom/events/test/pointerevents/mochitest_support_external.js @@ -0,0 +1,270 @@ +// This file supports translating W3C tests +// to tests on auto MochiTest system with minimum changes. +// Author: Maksim Lebedev + +// Function allows to prepare our tests after load document +addEventListener( + "load", + function (event) { + console.log("OnLoad external document"); + prepareTest(); + }, + false +); + +// Function allows to initialize prerequisites before testing +function prepareTest() { + SimpleTest.waitForExplicitFinish(); + SimpleTest.requestCompleteLog(); + startTest(); +} + +function setImplicitPointerCapture(capture, callback) { + console.log("SET dom.w3c_pointer_events.implicit_capture as " + capture); + SpecialPowers.pushPrefEnv( + { + set: [["dom.w3c_pointer_events.implicit_capture", capture]], + }, + callback + ); +} + +var utils = SpecialPowers.Ci.nsIDOMWindowUtils; + +// Mouse Event Helper Object +var MouseEventHelper = (function () { + return { + MOUSE_ID: utils.DEFAULT_MOUSE_POINTER_ID, + PEN_ID: utils.DEFAULT_PEN_POINTER_ID, + // State + // TODO: Separate this to support mouse and pen simultaneously. + BUTTONS_STATE: utils.MOUSE_BUTTONS_NO_BUTTON, + + // Button + BUTTON_NONE: -1, // Used by test framework only. (replaced before sending) + BUTTON_LEFT: utils.MOUSE_BUTTON_LEFT_BUTTON, + BUTTON_MIDDLE: utils.MOUSE_BUTTON_MIDDLE_BUTTON, + BUTTON_RIGHT: utils.MOUSE_BUTTON_RIGHT_BUTTON, + + // Buttons + BUTTONS_NONE: utils.MOUSE_BUTTONS_NO_BUTTON, + BUTTONS_LEFT: utils.MOUSE_BUTTONS_LEFT_BUTTON, + BUTTONS_MIDDLE: utils.MOUSE_BUTTONS_MIDDLE_BUTTON, + BUTTONS_RIGHT: utils.MOUSE_BUTTONS_RIGHT_BUTTON, + BUTTONS_4TH: utils.MOUSE_BUTTONS_4TH_BUTTON, + BUTTONS_5TH: utils.MOUSE_BUTTONS_5TH_BUTTON, + + // Utils + computeButtonsMaskFromButton(aButton) { + // Since the range of button values is 0 ~ 2 (see nsIDOMWindowUtils.idl), + // we can use an array to find out the desired mask. + var mask = [ + this.BUTTONS_NONE, // -1 (MouseEventHelper.BUTTON_NONE) + this.BUTTONS_LEFT, // 0 + this.BUTTONS_MIDDLE, // 1 + this.BUTTONS_RIGHT, // 2 + ][aButton + 1]; + + ok(mask !== undefined, "Unrecognized button value caught!"); + return mask; + }, + + checkExitState() { + ok(!this.BUTTONS_STATE, "Mismatched mousedown/mouseup caught."); + }, + }; +})(); + +function createMouseEvent(aEventType, aParams) { + var eventObj = { type: aEventType }; + + // Default to mouse. + eventObj.inputSource = + aParams && "inputSource" in aParams + ? aParams.inputSource + : MouseEvent.MOZ_SOURCE_MOUSE; + // Compute pointerId + eventObj.id = + eventObj.inputSource === MouseEvent.MOZ_SOURCE_MOUSE + ? MouseEventHelper.MOUSE_ID + : MouseEventHelper.PEN_ID; + // Check or generate a |button| value. + var isButtonEvent = aEventType === "mouseup" || aEventType === "mousedown"; + + // Set |button| to the default value first. + eventObj.button = isButtonEvent + ? MouseEventHelper.BUTTON_LEFT + : MouseEventHelper.BUTTON_NONE; + + // |button| is passed, use and check it. + if (aParams && "button" in aParams) { + var hasButtonValue = aParams.button !== MouseEventHelper.BUTTON_NONE; + ok( + !isButtonEvent || hasButtonValue, + "Inappropriate |button| value caught." + ); + eventObj.button = aParams.button; + } + + // Generate a |buttons| value and update buttons state + var buttonsMask = MouseEventHelper.computeButtonsMaskFromButton( + eventObj.button + ); + switch (aEventType) { + case "mousedown": + MouseEventHelper.BUTTONS_STATE |= buttonsMask; // Set button flag. + break; + case "mouseup": + MouseEventHelper.BUTTONS_STATE &= ~buttonsMask; // Clear button flag. + break; + } + eventObj.buttons = MouseEventHelper.BUTTONS_STATE; + + // Replace the button value for mousemove events. + // Since in widget level design, even when no button is pressed at all, the + // value of WidgetMouseEvent.button is still 0, which is the same value as + // the one for mouse left button. + if (aEventType === "mousemove") { + eventObj.button = MouseEventHelper.BUTTON_LEFT; + } + return eventObj; +} + +// Helper function to send MouseEvent with different parameters +function sendMouseEvent(int_win, elemId, mouseEventType, params) { + var elem = int_win.document.getElementById(elemId); + if (elem) { + var rect = elem.getBoundingClientRect(); + var eventObj = createMouseEvent(mouseEventType, params); + + // Default to the center of the target element but we can still send to a + // position outside of the target element. + var offsetX = + params && "offsetX" in params ? params.offsetX : rect.width / 2; + var offsetY = + params && "offsetY" in params ? params.offsetY : rect.height / 2; + + console.log(elemId, eventObj); + synthesizeMouse(elem, offsetX, offsetY, eventObj, int_win); + } else { + is(!!elem, true, "Document should have element with id: " + elemId); + } +} + +// Helper function to send MouseEvent with position +function sendMouseEventAtPoint(aWindow, aLeft, aTop, aMouseEventType, aParams) { + var eventObj = createMouseEvent(aMouseEventType, aParams); + console.log(eventObj); + synthesizeMouseAtPoint(aLeft, aTop, eventObj, aWindow); +} + +// Touch Event Helper Object +var TouchEventHelper = { + // State + TOUCH_ID: utils.DEFAULT_TOUCH_POINTER_ID, + TOUCH_STATE: false, + + // Utils + checkExitState() { + ok(!this.TOUCH_STATE, "Mismatched touchstart/touchend caught."); + }, +}; + +// Helper function to send TouchEvent with different parameters +// TODO: Support multiple touch points to test more features such as +// PointerEvent.isPrimary and pinch-zoom. +function sendTouchEvent(int_win, elemId, touchEventType, params) { + var elem = int_win.document.getElementById(elemId); + if (elem) { + var rect = elem.getBoundingClientRect(); + var eventObj = { + type: touchEventType, + id: TouchEventHelper.TOUCH_ID, + }; + + // Update touch state + switch (touchEventType) { + case "touchstart": + TouchEventHelper.TOUCH_STATE = true; // Set touch flag. + break; + case "touchend": + case "touchcancel": + TouchEventHelper.TOUCH_STATE = false; // Clear touch flag. + break; + } + + // Default to the center of the target element but we can still send to a + // position outside of the target element. + var offsetX = + params && "offsetX" in params ? params.offsetX : rect.width / 2; + var offsetY = + params && "offsetY" in params ? params.offsetY : rect.height / 2; + + console.log(elemId, eventObj); + synthesizeTouch(elem, offsetX, offsetY, eventObj, int_win); + } else { + is(!!elem, true, "Document should have element with id: " + elemId); + } +} + +// Helper function to trigger drag and drop. +async function doDragAndDrop(int_win, srcElemId, destElemId, params = {}) { + params.srcElement = int_win.document.getElementById(srcElemId); + params.destElement = int_win.document.getElementById(destElemId); + params.srcWindow = int_win; + params.destWindow = int_win; + params.id = MouseEventHelper.MOUSE_ID; + // This is basically for android which has a larger drag threshold. + params.stepY = params.stepY || 25; + await synthesizePlainDragAndDrop(params); +} + +// Helper function to run Point Event test in a new tab. +function runTestInNewWindow(aFile) { + var testURL = + location.href.substring(0, location.href.lastIndexOf("/") + 1) + aFile; + var testWindow = window.open(testURL, "_blank"); + var testDone = false; + + // We start testing when receiving load event. Inject the mochitest helper js + // to the test case after DOM elements are constructed and before the load + // event is fired. + testWindow.addEventListener( + "DOMContentLoaded", + function () { + var e = testWindow.document.createElement("script"); + e.type = "text/javascript"; + e.src = + "../".repeat(aFile.split("/").length - 1) + + "mochitest_support_internal.js"; + testWindow.document.getElementsByTagName("head")[0].appendChild(e); + }, + { once: true } + ); + + window.addEventListener("message", function (aEvent) { + switch (aEvent.data.type) { + case "START": + // Update constants + MouseEventHelper.MOUSE_ID = aEvent.data.message.mouseId; + MouseEventHelper.PEN_ID = aEvent.data.message.penId; + TouchEventHelper.TOUCH_ID = aEvent.data.message.touchId; + + executeTest(testWindow); + return; + case "RESULT": + // Should not perform checking after SimpleTest.finish(). + if (!testDone) { + ok(aEvent.data.result, aEvent.data.message); + } + return; + case "FIN": + testDone = true; + MouseEventHelper.checkExitState(); + TouchEventHelper.checkExitState(); + testWindow.close(); + SimpleTest.finish(); + return; + } + }); +} diff --git a/dom/events/test/pointerevents/mochitest_support_internal.js b/dom/events/test/pointerevents/mochitest_support_internal.js new file mode 100644 index 0000000000..d46dd14f32 --- /dev/null +++ b/dom/events/test/pointerevents/mochitest_support_internal.js @@ -0,0 +1,125 @@ +// This file supports translating W3C tests +// to tests on auto MochiTest system with minimum changes. +// Author: Maksim Lebedev + +const PARENT_ORIGIN = "http://mochi.test:8888/"; + +// Since web platform tests don't check pointerId, we have to use some heuristic +// to test them. and thus pointerIds are send to mochitest_support_external.js +// before we start sending synthesized widget events. Here, we avoid using +// default values used in Gecko to insure everything works as expected. +const POINTER_MOUSE_ID = 7; +const POINTER_PEN_ID = 8; +const POINTER_TOUCH_ID = 9; // Extend for multiple touch points if needed. + +// Setup environment. +addListeners(document.getElementById("target0")); +addListeners(document.getElementById("target1")); + +// Setup communication between mochitest_support_external.js. +// Function allows to initialize prerequisites before testing +// and adds some callbacks to support mochitest system. +function resultCallback(aTestObj) { + var message = aTestObj.name + " ("; + message += "Get: " + JSON.stringify(aTestObj.status) + ", "; + message += "Expect: " + JSON.stringify(aTestObj.PASS) + ")"; + window.opener.postMessage( + { + type: "RESULT", + message, + result: aTestObj.status === aTestObj.PASS, + }, + PARENT_ORIGIN + ); +} + +add_result_callback(resultCallback); +add_completion_callback(() => { + window.opener.postMessage({ type: "FIN" }, PARENT_ORIGIN); +}); + +window.addEventListener("load", () => { + // Start testing. + var startMessage = { + type: "START", + message: { + mouseId: POINTER_MOUSE_ID, + penId: POINTER_PEN_ID, + touchId: POINTER_TOUCH_ID, + }, + }; + window.opener.postMessage(startMessage, PARENT_ORIGIN); +}); + +function addListeners(elem) { + if (!elem) { + return; + } + var All_Events = [ + "pointerdown", + "pointerup", + "pointercancel", + "pointermove", + "pointerover", + "pointerout", + "pointerenter", + "pointerleave", + "gotpointercapture", + "lostpointercapture", + ]; + All_Events.forEach(function (name) { + elem.addEventListener(name, function (event) { + console.log("(" + event.type + ")-(" + event.pointerType + ")"); + + // Perform checks only for trusted events. + if (!event.isTrusted) { + return; + } + + // Compute the desired event.pointerId from event.pointerType. + var pointerId = { + mouse: POINTER_MOUSE_ID, + pen: POINTER_PEN_ID, + touch: POINTER_TOUCH_ID, + }[event.pointerType]; + + // Compare the pointerId. + resultCallback({ + name: "Mismatched event.pointerId recieved.", + status: event.pointerId, + PASS: pointerId, + }); + }); + }); +} + +// mock the touchScrollInTarget to make the test work. +function touchScrollInTarget() { + return Promise.resolve(); +} + +// mock test_driver to make the test work. +function Actions() {} +Actions.prototype = { + addPointer() { + return this; + }, + pointerMove() { + return this; + }, + pointerDown() { + return this; + }, + pause() { + return this; + }, + pointerUp() { + return this; + }, + send() { + return Promise.resolve(); + }, +}; +const test_driver = { + Actions, +}; diff --git a/dom/events/test/pointerevents/pointerevent_utils.js b/dom/events/test/pointerevents/pointerevent_utils.js new file mode 100644 index 0000000000..ac5eaf61a1 --- /dev/null +++ b/dom/events/test/pointerevents/pointerevent_utils.js @@ -0,0 +1,60 @@ +// Get test filename for page being run in popup so errors are more useful +var testName = location.pathname.split("/").pop(); + +// Wrap test functions and pass to parent window +window.ok = function (a, msg) { + opener.ok(a, testName + ": " + msg); +}; + +window.is = function (a, b, msg) { + opener.is(a, b, testName + ": " + msg); +}; + +window.isnot = function (a, b, msg) { + opener.isnot(a, b, testName + ": " + msg); +}; + +window.todo = function (a, msg) { + opener.todo(a, testName + ": " + msg); +}; + +window.todo_is = function (a, b, msg) { + opener.todo_is(a, b, testName + ": " + msg); +}; + +window.todo_isnot = function (a, b, msg) { + opener.todo_isnot(a, b, testName + ": " + msg); +}; + +window.info = function (msg) { + opener.info(testName + ": " + msg); +}; + +// Override bits of SimpleTest so test files work stand-alone +var SimpleTest = SimpleTest || {}; + +SimpleTest.waitForExplicitFinish = function () { + dump("[POINTEREVENT] Starting " + testName + "\n"); +}; + +SimpleTest.finish = function () { + dump("[POINTEREVENT] Finishing " + testName + "\n"); + opener.nextTest(); +}; + +// Utility functions +function waitForEvent(aTarget, aEvent, aCallback) { + return new Promise(aResolve => { + aTarget.addEventListener( + aEvent, + e => { + ok(true, `got ${e.type} event on ${e.target.id}`); + if (aCallback) { + aCallback(e); + } + aResolve(); + }, + { once: true } + ); + }); +} diff --git a/dom/events/test/pointerevents/readme.md b/dom/events/test/pointerevents/readme.md new file mode 100644 index 0000000000..0cc0190979 --- /dev/null +++ b/dom/events/test/pointerevents/readme.md @@ -0,0 +1,9 @@ +Directory for Pointer Events Tests + +Latest Editor's Draft: https://w3c.github.io/pointerevents/ + +Latest W3C Technical Report: http://www.w3.org/TR/pointerevents/ + +Discussion forum for tests: http://lists.w3.org/Archives/Public/public-test-infra/ + +Test Assertion table: https://www.w3.org/wiki/PointerEvents/TestAssertions diff --git a/dom/events/test/pointerevents/test_bug1285128.html b/dom/events/test/pointerevents/test_bug1285128.html new file mode 100644 index 0000000000..534e265047 --- /dev/null +++ b/dom/events/test/pointerevents/test_bug1285128.html @@ -0,0 +1,51 @@ + + + + + + Test for Bug 1285128 + + + + + +Mozilla Bug 1285128 +

+
+
+ + + diff --git a/dom/events/test/pointerevents/test_bug1293174_implicit_pointer_capture_for_touch_1.html b/dom/events/test/pointerevents/test_bug1293174_implicit_pointer_capture_for_touch_1.html new file mode 100644 index 0000000000..a02432f3b3 --- /dev/null +++ b/dom/events/test/pointerevents/test_bug1293174_implicit_pointer_capture_for_touch_1.html @@ -0,0 +1,30 @@ + + + + + Test for Bug 1293174 + + + + + + + + + + diff --git a/dom/events/test/pointerevents/test_bug1293174_implicit_pointer_capture_for_touch_2.html b/dom/events/test/pointerevents/test_bug1293174_implicit_pointer_capture_for_touch_2.html new file mode 100644 index 0000000000..2e5aaccccc --- /dev/null +++ b/dom/events/test/pointerevents/test_bug1293174_implicit_pointer_capture_for_touch_2.html @@ -0,0 +1,30 @@ + + + + + Test for Bug 1293174 + + + + + + + + + + diff --git a/dom/events/test/pointerevents/test_bug1303704.html b/dom/events/test/pointerevents/test_bug1303704.html new file mode 100644 index 0000000000..ed8842997c --- /dev/null +++ b/dom/events/test/pointerevents/test_bug1303704.html @@ -0,0 +1,135 @@ + + + + + + Test for Bug 1303704 + + + + + + + +Mozilla Bug 1303704 +

+Link 1 +
+
+scroll
+scroll
+scroll
+scroll
+scroll
+scroll
+scroll
+scroll
+scroll
+scroll
+scroll
+scroll
+scroll
+scroll
+scroll
+scroll
+scroll
+scroll
+scroll
+scroll
+
+
+ + + diff --git a/dom/events/test/pointerevents/test_bug1315862.html b/dom/events/test/pointerevents/test_bug1315862.html new file mode 100644 index 0000000000..92d61a518f --- /dev/null +++ b/dom/events/test/pointerevents/test_bug1315862.html @@ -0,0 +1,66 @@ + + + + + + Test for Bug 1315862 + + + + + +

+ This is a test to check if pointer events are dispatched in the system group +

+ + + diff --git a/dom/events/test/pointerevents/test_bug1323158.html b/dom/events/test/pointerevents/test_bug1323158.html new file mode 100644 index 0000000000..96fd2de12e --- /dev/null +++ b/dom/events/test/pointerevents/test_bug1323158.html @@ -0,0 +1,91 @@ + + + + + + This is a test to check if target and relatedTarget of mouse events are the same as pointer events + + + + + +

+ + + diff --git a/dom/events/test/pointerevents/test_bug1403055.html b/dom/events/test/pointerevents/test_bug1403055.html new file mode 100644 index 0000000000..8327fd147d --- /dev/null +++ b/dom/events/test/pointerevents/test_bug1403055.html @@ -0,0 +1,90 @@ + + + + + + Test for Bug 1403055 + + + + + +Mozilla Bug 1403055 +

+
+
+
+ + + diff --git a/dom/events/test/pointerevents/test_bug1420589_1.html b/dom/events/test/pointerevents/test_bug1420589_1.html new file mode 100644 index 0000000000..8ecea7a28b --- /dev/null +++ b/dom/events/test/pointerevents/test_bug1420589_1.html @@ -0,0 +1,105 @@ + + + + + + Test for Bug 1420589 + + + + + +Mozilla Bug 1420589 +

+ + + + + diff --git a/dom/events/test/pointerevents/test_bug1420589_2.html b/dom/events/test/pointerevents/test_bug1420589_2.html new file mode 100644 index 0000000000..2bfac2cdfc --- /dev/null +++ b/dom/events/test/pointerevents/test_bug1420589_2.html @@ -0,0 +1,122 @@ + + + + + + Test for Bug 1420589 + + + + + +Mozilla Bug 1420589 +

+
+ + + + diff --git a/dom/events/test/pointerevents/test_bug1420589_3.html b/dom/events/test/pointerevents/test_bug1420589_3.html new file mode 100644 index 0000000000..9942591f64 --- /dev/null +++ b/dom/events/test/pointerevents/test_bug1420589_3.html @@ -0,0 +1,115 @@ + + + + + + Test for Bug 1420589 + + + + + +Mozilla Bug 1420589 +

+
+ + + + diff --git a/dom/events/test/pointerevents/test_bug1697769.xhtml b/dom/events/test/pointerevents/test_bug1697769.xhtml new file mode 100644 index 0000000000..09efdb9826 --- /dev/null +++ b/dom/events/test/pointerevents/test_bug1697769.xhtml @@ -0,0 +1,74 @@ + + + + + + + + + + + + + + + +Mozilla Bug 1697769 +

+

+
+
+
+
diff --git a/dom/events/test/pointerevents/test_bug1725416.html b/dom/events/test/pointerevents/test_bug1725416.html new file mode 100644 index 0000000000..3cc4a6316f --- /dev/null +++ b/dom/events/test/pointerevents/test_bug1725416.html @@ -0,0 +1,37 @@ + + +Bug 1725416 + + + + + + + + +
+ + diff --git a/dom/events/test/pointerevents/test_bug968148.html b/dom/events/test/pointerevents/test_bug968148.html new file mode 100644 index 0000000000..e62d819934 --- /dev/null +++ b/dom/events/test/pointerevents/test_bug968148.html @@ -0,0 +1,46 @@ + + + + + Test for Bug 968148 + + + + + + + + diff --git a/dom/events/test/pointerevents/test_getCoalescedEvents.html b/dom/events/test/pointerevents/test_getCoalescedEvents.html new file mode 100644 index 0000000000..69eeac6919 --- /dev/null +++ b/dom/events/test/pointerevents/test_getCoalescedEvents.html @@ -0,0 +1,88 @@ + + + + + + Test for Bug 1303957 + + + + + +Mozilla Bug 1303957 +

+
+ + + diff --git a/dom/events/test/pointerevents/test_getCoalescedEvents_touch.html b/dom/events/test/pointerevents/test_getCoalescedEvents_touch.html new file mode 100644 index 0000000000..0df34efb30 --- /dev/null +++ b/dom/events/test/pointerevents/test_getCoalescedEvents_touch.html @@ -0,0 +1,111 @@ + + + + + + Test for Bug 1511231 + + + + + + +Mozilla Bug 1511231 +

+
+ + + diff --git a/dom/events/test/pointerevents/test_multiple_touches.html b/dom/events/test/pointerevents/test_multiple_touches.html new file mode 100644 index 0000000000..15202c3636 --- /dev/null +++ b/dom/events/test/pointerevents/test_multiple_touches.html @@ -0,0 +1,196 @@ + + + + + Test for Multiple Touches + + + + + +

+
+
+ + + diff --git a/dom/events/test/pointerevents/test_pointercapture_remove_iframe.html b/dom/events/test/pointerevents/test_pointercapture_remove_iframe.html new file mode 100644 index 0000000000..fca3a440bf --- /dev/null +++ b/dom/events/test/pointerevents/test_pointercapture_remove_iframe.html @@ -0,0 +1,80 @@ + + + + +Bug 1686037 + + + + + + +Mozilla Bug 1686037 +
+ + +
+
+
+ + diff --git a/dom/events/test/pointerevents/test_pointercapture_xorigin_iframe.html b/dom/events/test/pointerevents/test_pointercapture_xorigin_iframe.html new file mode 100644 index 0000000000..2bfb0e8ac1 --- /dev/null +++ b/dom/events/test/pointerevents/test_pointercapture_xorigin_iframe.html @@ -0,0 +1,55 @@ + + + +Test for pointer capture + + + + + +Test for pointer capture +
+
+
+
+ + diff --git a/dom/events/test/pointerevents/test_pointermove_drag_scrollbar.html b/dom/events/test/pointerevents/test_pointermove_drag_scrollbar.html new file mode 100644 index 0000000000..27ef2829ef --- /dev/null +++ b/dom/events/test/pointerevents/test_pointermove_drag_scrollbar.html @@ -0,0 +1,77 @@ + + + + + +Test for Bug 1509710 + + + + + + +Mozilla Bug 1509710 +

+
+
+
+ + + diff --git a/dom/events/test/pointerevents/test_remove_frame_when_got_pointer_capture.html b/dom/events/test/pointerevents/test_remove_frame_when_got_pointer_capture.html new file mode 100644 index 0000000000..790f2cdd55 --- /dev/null +++ b/dom/events/test/pointerevents/test_remove_frame_when_got_pointer_capture.html @@ -0,0 +1,166 @@ + + + + + Test for triggering popup by pointer events + + + + + +

+

+ + + diff --git a/dom/events/test/pointerevents/test_synthesized_touch.html b/dom/events/test/pointerevents/test_synthesized_touch.html new file mode 100644 index 0000000000..8a79303e74 --- /dev/null +++ b/dom/events/test/pointerevents/test_synthesized_touch.html @@ -0,0 +1,47 @@ + + +Test synthesized touch input + + + + + + +
+ + diff --git a/dom/events/test/pointerevents/test_trigger_fullscreen_by_pointer_events.html b/dom/events/test/pointerevents/test_trigger_fullscreen_by_pointer_events.html new file mode 100644 index 0000000000..abdf92831a --- /dev/null +++ b/dom/events/test/pointerevents/test_trigger_fullscreen_by_pointer_events.html @@ -0,0 +1,54 @@ + + + + + Test for triggering Fullscreen by pointer events + + + + + + + + diff --git a/dom/events/test/pointerevents/test_wpt_pointerevent_attributes_hoverable_pointers-manual.html b/dom/events/test/pointerevents/test_wpt_pointerevent_attributes_hoverable_pointers-manual.html new file mode 100644 index 0000000000..557ee80c4f --- /dev/null +++ b/dom/events/test/pointerevents/test_wpt_pointerevent_attributes_hoverable_pointers-manual.html @@ -0,0 +1,53 @@ + + + + + Test pointerevent attributes for hoverable pointers + + + + + + + + + diff --git a/dom/events/test/pointerevents/test_wpt_pointerevent_attributes_nohover_pointers-manual.html b/dom/events/test/pointerevents/test_wpt_pointerevent_attributes_nohover_pointers-manual.html new file mode 100644 index 0000000000..f9fde4f92f --- /dev/null +++ b/dom/events/test/pointerevents/test_wpt_pointerevent_attributes_nohover_pointers-manual.html @@ -0,0 +1,26 @@ + + + + + Test pointerevent attributes for non-hoverable pointers + + + + + + + + + diff --git a/dom/events/test/pointerevents/test_wpt_pointerevent_boundary_events_in_capturing-manual.html b/dom/events/test/pointerevents/test_wpt_pointerevent_boundary_events_in_capturing-manual.html new file mode 100644 index 0000000000..24aeb6d9a6 --- /dev/null +++ b/dom/events/test/pointerevents/test_wpt_pointerevent_boundary_events_in_capturing-manual.html @@ -0,0 +1,46 @@ + + + + + W3C pointerevent_boundary_events_in_capturing-manual.html in Mochitest form + + + + + + + + + diff --git a/dom/events/test/pointerevents/test_wpt_pointerevent_change-touch-action-onpointerdown_touch-manual.html b/dom/events/test/pointerevents/test_wpt_pointerevent_change-touch-action-onpointerdown_touch-manual.html new file mode 100644 index 0000000000..f95b16c850 --- /dev/null +++ b/dom/events/test/pointerevents/test_wpt_pointerevent_change-touch-action-onpointerdown_touch-manual.html @@ -0,0 +1,39 @@ + + + + + + Test for Bug 1000870 + + + + + + + + + + diff --git a/dom/events/test/pointerevents/test_wpt_pointerevent_constructor.html b/dom/events/test/pointerevents/test_wpt_pointerevent_constructor.html new file mode 100644 index 0000000000..058e32a967 --- /dev/null +++ b/dom/events/test/pointerevents/test_wpt_pointerevent_constructor.html @@ -0,0 +1,26 @@ + + + + + + Test for Bug 1000870 + + + + + + + + + + diff --git a/dom/events/test/pointerevents/test_wpt_pointerevent_drag_interaction-manual.html b/dom/events/test/pointerevents/test_wpt_pointerevent_drag_interaction-manual.html new file mode 100644 index 0000000000..a05ee9557a --- /dev/null +++ b/dom/events/test/pointerevents/test_wpt_pointerevent_drag_interaction-manual.html @@ -0,0 +1,38 @@ + + + + + + Test for Bug 1669673 + + + + + + + + + + diff --git a/dom/events/test/pointerevents/test_wpt_pointerevent_movementxy-manual.html b/dom/events/test/pointerevents/test_wpt_pointerevent_movementxy-manual.html new file mode 100644 index 0000000000..3059f868b7 --- /dev/null +++ b/dom/events/test/pointerevents/test_wpt_pointerevent_movementxy-manual.html @@ -0,0 +1,53 @@ + + + + + + Test for Bug 1399740 + + + + + + + + + diff --git a/dom/events/test/pointerevents/test_wpt_pointerevent_multiple_primary_pointers_boundary_events-manual.html b/dom/events/test/pointerevents/test_wpt_pointerevent_multiple_primary_pointers_boundary_events-manual.html new file mode 100644 index 0000000000..825e23857f --- /dev/null +++ b/dom/events/test/pointerevents/test_wpt_pointerevent_multiple_primary_pointers_boundary_events-manual.html @@ -0,0 +1,31 @@ + + + + + + Test for Bug 1000870 + + + + + + + + + + diff --git a/dom/events/test/pointerevents/test_wpt_pointerevent_pointerId_scope-manual.html b/dom/events/test/pointerevents/test_wpt_pointerevent_pointerId_scope-manual.html new file mode 100644 index 0000000000..f52bf7fc20 --- /dev/null +++ b/dom/events/test/pointerevents/test_wpt_pointerevent_pointerId_scope-manual.html @@ -0,0 +1,27 @@ + + + + + + Test for Bug 1000870 + + + + + + + + + + diff --git a/dom/events/test/pointerevents/test_wpt_pointerevent_pointercancel_touch-manual.html b/dom/events/test/pointerevents/test_wpt_pointerevent_pointercancel_touch-manual.html new file mode 100644 index 0000000000..0adba4f756 --- /dev/null +++ b/dom/events/test/pointerevents/test_wpt_pointerevent_pointercancel_touch-manual.html @@ -0,0 +1,30 @@ + + + + + + Test for Bug 1000870 + + + + + + + + + + diff --git a/dom/events/test/pointerevents/test_wpt_pointerevent_pointerleave_after_pointercancel_touch-manual.html b/dom/events/test/pointerevents/test_wpt_pointerevent_pointerleave_after_pointercancel_touch-manual.html new file mode 100644 index 0000000000..53c897bcd0 --- /dev/null +++ b/dom/events/test/pointerevents/test_wpt_pointerevent_pointerleave_after_pointercancel_touch-manual.html @@ -0,0 +1,30 @@ + + + + + + Test for Bug 1000870 + + + + + + + + + + diff --git a/dom/events/test/pointerevents/test_wpt_pointerevent_pointerleave_pen-manual.html b/dom/events/test/pointerevents/test_wpt_pointerevent_pointerleave_pen-manual.html new file mode 100644 index 0000000000..e4904780f6 --- /dev/null +++ b/dom/events/test/pointerevents/test_wpt_pointerevent_pointerleave_pen-manual.html @@ -0,0 +1,28 @@ + + + + + + Test for Bug 1000870 + + + + + + + + + + diff --git a/dom/events/test/pointerevents/test_wpt_pointerevent_pointerout_after_pointercancel_touch-manual.html b/dom/events/test/pointerevents/test_wpt_pointerevent_pointerout_after_pointercancel_touch-manual.html new file mode 100644 index 0000000000..53cf765fb6 --- /dev/null +++ b/dom/events/test/pointerevents/test_wpt_pointerevent_pointerout_after_pointercancel_touch-manual.html @@ -0,0 +1,30 @@ + + + + + + Test for Bug 1000870 + + + + + + + + + + diff --git a/dom/events/test/pointerevents/test_wpt_pointerevent_pointerout_pen-manual.html b/dom/events/test/pointerevents/test_wpt_pointerevent_pointerout_pen-manual.html new file mode 100644 index 0000000000..6b41f6492b --- /dev/null +++ b/dom/events/test/pointerevents/test_wpt_pointerevent_pointerout_pen-manual.html @@ -0,0 +1,28 @@ + + + + + + Test for Bug 1000870 + + + + + + + + + + diff --git a/dom/events/test/pointerevents/test_wpt_pointerevent_releasepointercapture_events_to_original_target-manual.html b/dom/events/test/pointerevents/test_wpt_pointerevent_releasepointercapture_events_to_original_target-manual.html new file mode 100644 index 0000000000..049c41467f --- /dev/null +++ b/dom/events/test/pointerevents/test_wpt_pointerevent_releasepointercapture_events_to_original_target-manual.html @@ -0,0 +1,49 @@ + + + + + + Test for Bug 1000870 + + + + + + + + + + diff --git a/dom/events/test/pointerevents/test_wpt_pointerevent_releasepointercapture_onpointercancel_touch-manual.html b/dom/events/test/pointerevents/test_wpt_pointerevent_releasepointercapture_onpointercancel_touch-manual.html new file mode 100644 index 0000000000..eb39b0bee3 --- /dev/null +++ b/dom/events/test/pointerevents/test_wpt_pointerevent_releasepointercapture_onpointercancel_touch-manual.html @@ -0,0 +1,30 @@ + + + + + + Test for Bug 1000870 + + + + + + + + + + diff --git a/dom/events/test/pointerevents/test_wpt_pointerevent_sequence_at_implicit_release_on_drag-manual.html b/dom/events/test/pointerevents/test_wpt_pointerevent_sequence_at_implicit_release_on_drag-manual.html new file mode 100644 index 0000000000..40a6be2e71 --- /dev/null +++ b/dom/events/test/pointerevents/test_wpt_pointerevent_sequence_at_implicit_release_on_drag-manual.html @@ -0,0 +1,27 @@ + + + + + W3C pointerevent_sequence_at_implicit_release_on_drag-manual.html in Mochitest form + + + + + + + + + diff --git a/dom/events/test/pointerevents/test_wpt_touch_action.html b/dom/events/test/pointerevents/test_wpt_touch_action.html new file mode 100644 index 0000000000..f2edbfb061 --- /dev/null +++ b/dom/events/test/pointerevents/test_wpt_touch_action.html @@ -0,0 +1,98 @@ + + + + + W3C pointerevents/*touch-action*.html tests in Mochitest form + + + + + + + + + diff --git a/dom/events/test/pointerevents/touch_action_helpers.js b/dom/events/test/pointerevents/touch_action_helpers.js new file mode 100644 index 0000000000..12bb25b8fa --- /dev/null +++ b/dom/events/test/pointerevents/touch_action_helpers.js @@ -0,0 +1,242 @@ +// Some common helpers + +function promiseTimeout(delay) { + return new Promise(resolve => { + setTimeout(resolve, delay); + }); +} + +function promiseTouchStart(element) { + return new Promise(resolve => { + element.addEventListener("touchstart", resolve, { + passive: true, + once: true, + }); + }); +} + +async function touchScrollRight(aSelector = "#target0", aX = 20, aY = 20) { + const target = document.querySelector(aSelector); + const touchStartPromise = promiseTouchStart(document.body); + const touchEndPromise = promiseTouchEnd(document.body); + dump("Synthesizing horizontal drag\n"); + await promiseNativePointerDrag(target, "touch", aX + 40, aY, -40, 0); + await touchStartPromise; + dump("Got touchstart from the horizontal drag\n"); + await touchEndPromise; + dump("Got touchend from the horizontal drag\n"); +} + +async function touchScrollDown(aSelector = "#target0", aX = 20, aY = 20) { + const target = document.querySelector(aSelector); + const touchStartPromise = promiseTouchStart(document.body); + const touchEndPromise = promiseTouchEnd(document.body); + dump("Synthesizing vertical drag\n"); + await promiseNativePointerDrag(target, "touch", aX, aY + 40, 0, -40); + await touchStartPromise; + dump("Got touchstart from the vertical drag\n"); + await touchEndPromise; + dump("Got touchend from the vertical drag\n"); +} + +async function tapCompleteAndWaitTestDone() { + let testDone = new Promise(resolve => { + add_completion_callback(resolve); + }); + + var button = document.getElementById("btnComplete"); + button.click(); + await testDone; +} + +function promiseResetScrollLeft(aSelector = "#target0") { + var target = document.querySelector(aSelector); + return new Promise(resolve => { + target.addEventListener("scroll", function onScroll() { + if (target.scrollLeft == 0) { + target.removeEventListener("scroll", onScroll); + resolve(); + } + }); + }); +} + +// The main body functions to simulate the input events required for the named test + +async function pointerevent_touch_action_auto_css_touch_manual() { + let testDone = new Promise(resolve => { + add_completion_callback(resolve); + }); + + await touchScrollRight(); + await promiseApzFlushedRepaints(); + await touchScrollDown(); + await testDone; +} + +async function pointerevent_touch_action_button_test_touch_manual() { + await touchScrollDown(); + await promiseApzFlushedRepaints(); + await promiseTimeout(2 * scrollReturnInterval); + await touchScrollRight(); + let resetScrollLeftPromise = promiseResetScrollLeft(); + await promiseApzFlushedRepaints(); + await promiseTimeout(2 * scrollReturnInterval); + // Wait for resetting target0's scrollLeft to avoid the reset break the + // following scroll behaviors. + await resetScrollLeftPromise; + await touchScrollDown("#target0 > button"); + await promiseApzFlushedRepaints(); + await touchScrollRight("#target0 > button"); + await promiseApzFlushedRepaints(); + await tapCompleteAndWaitTestDone(); +} + +async function pointerevent_touch_action_inherit_child_auto_child_none_touch_manual() { + await touchScrollDown("#target0 > div div"); + await promiseApzFlushedRepaints(); + await touchScrollRight("#target0 > div div"); + await promiseApzFlushedRepaints(); + await tapCompleteAndWaitTestDone(); +} + +async function pointerevent_touch_action_inherit_child_none_touch_manual() { + await touchScrollDown("#target0 > div"); + await promiseApzFlushedRepaints(); + await touchScrollRight("#target0 > div"); + await promiseApzFlushedRepaints(); + await tapCompleteAndWaitTestDone(); +} + +async function pointerevent_touch_action_inherit_child_pan_x_child_pan_x_touch_manual() { + await touchScrollDown("#target0 > div div"); + await promiseApzFlushedRepaints(); + await touchScrollRight("#target0 > div div"); + await promiseApzFlushedRepaints(); + await tapCompleteAndWaitTestDone(); +} + +async function pointerevent_touch_action_inherit_child_pan_x_child_pan_y_touch_manual() { + await touchScrollDown("#target0 > div div"); + await promiseApzFlushedRepaints(); + await touchScrollRight("#target0 > div div"); + await promiseApzFlushedRepaints(); + await tapCompleteAndWaitTestDone(); +} + +async function pointerevent_touch_action_inherit_highest_parent_none_touch_manual() { + let testDone = new Promise(resolve => { + add_completion_callback(resolve); + }); + + await touchScrollDown("#target0 > div"); + await promiseApzFlushedRepaints(); + await touchScrollRight("#target0 > div"); + await testDone; +} + +async function pointerevent_touch_action_inherit_parent_none_touch_manual() { + await touchScrollDown(); + await promiseApzFlushedRepaints(); + await touchScrollRight(); + await promiseApzFlushedRepaints(); + await tapCompleteAndWaitTestDone(); +} + +async function pointerevent_touch_action_none_css_touch_manual() { + await touchScrollDown(); + await promiseApzFlushedRepaints(); + await touchScrollRight(); + await promiseApzFlushedRepaints(); + await tapCompleteAndWaitTestDone(); +} + +async function pointerevent_touch_action_pan_x_css_touch_manual() { + await touchScrollDown(); + await promiseApzFlushedRepaints(); + await touchScrollRight(); + await promiseApzFlushedRepaints(); + await tapCompleteAndWaitTestDone(); +} + +async function pointerevent_touch_action_pan_x_pan_y_pan_y_touch_manual() { + await touchScrollDown("#target0 > div div"); + await promiseApzFlushedRepaints(); + await touchScrollRight("#target0 > div div"); + await promiseApzFlushedRepaints(); + await tapCompleteAndWaitTestDone(); +} + +async function pointerevent_touch_action_pan_x_pan_y_touch_manual() { + let testDone = new Promise(resolve => { + add_completion_callback(resolve); + }); + + await touchScrollDown(); + await promiseApzFlushedRepaints(); + await touchScrollRight(); + await testDone; +} + +async function pointerevent_touch_action_pan_y_css_touch_manual() { + await touchScrollDown(); + await promiseApzFlushedRepaints(); + await touchScrollRight(); + await promiseApzFlushedRepaints(); + await tapCompleteAndWaitTestDone(); +} + +async function pointerevent_touch_action_span_test_touch_manual() { + await touchScrollDown(); + await promiseApzFlushedRepaints(); + await promiseTimeout(2 * scrollReturnInterval); + await touchScrollRight(); + let resetScrollLeftPromise = promiseResetScrollLeft(); + await promiseApzFlushedRepaints(); + await promiseTimeout(2 * scrollReturnInterval); + // Wait for resetting target0's scrollLeft to avoid the reset break the + // following scroll behaviors. + await resetScrollLeftPromise; + await touchScrollDown("#testspan"); + await promiseApzFlushedRepaints(); + await touchScrollRight("#testspan"); + await promiseApzFlushedRepaints(); + await tapCompleteAndWaitTestDone(); +} + +async function pointerevent_touch_action_svg_test_touch_manual() { + await touchScrollDown(); + await promiseApzFlushedRepaints(); + await promiseTimeout(2 * scrollReturnInterval); + await touchScrollRight(); + await promiseApzFlushedRepaints(); + await promiseTimeout(2 * scrollReturnInterval); + await touchScrollDown("#target0", 250, 250); + await promiseApzFlushedRepaints(); + await touchScrollRight("#target0", 250, 250); + await promiseApzFlushedRepaints(); + await tapCompleteAndWaitTestDone(); +} + +async function pointerevent_touch_action_table_test_touch_manual() { + await touchScrollDown("#row1"); + await promiseApzFlushedRepaints(); + await promiseTimeout(2 * scrollReturnInterval); + await touchScrollRight("#row1"); + let resetScrollLeftPromise = promiseResetScrollLeft(); + await promiseApzFlushedRepaints(); + await promiseTimeout(2 * scrollReturnInterval); + // Wait for resetting target0's scrollLeft to avoid the reset break the + // following scroll behaviors. + await resetScrollLeftPromise; + await touchScrollDown("#cell3"); + await promiseApzFlushedRepaints(); + await touchScrollRight("#cell3"); + await promiseApzFlushedRepaints(); + await tapCompleteAndWaitTestDone(); +} + +// This the stuff that runs the appropriate body function above + +var test = eval(_ACTIVE_TEST_NAME.replace(/-/g, "_")); +waitUntilApzStable().then(test).then(subtestDone, subtestFailed); diff --git a/dom/events/test/pointerevents/wpt/compat/pointerevent_touch-action_two-finger_interaction-manual.html b/dom/events/test/pointerevents/wpt/compat/pointerevent_touch-action_two-finger_interaction-manual.html new file mode 100644 index 0000000000..3537e0e1e9 --- /dev/null +++ b/dom/events/test/pointerevents/wpt/compat/pointerevent_touch-action_two-finger_interaction-manual.html @@ -0,0 +1,102 @@ + + + + Pointer Event: touch-action test for two-finger interaction + + + + + + + + + + + + +

Pointer Event: touch-action test for two-finger interaction

+

+

+ Tests that a two-finger pan gesture is cancelled in 'touch-action: pan-x pan-y' but is allowed in 'touch-action: pinch-zoom' +

+
    +
  1. Touch on Black with two fingers and drag both fingers down at same speed.
  2. +
  3. Tap on Done.
  4. +
  5. Touch on Grey with two fingers and drag both fingers down at same speed.
  6. +
  7. Tap on Done.
  8. +
+
+ +
+
+ + diff --git a/dom/events/test/pointerevents/wpt/html/pointerevent_drag_interaction-manual.html b/dom/events/test/pointerevents/wpt/html/pointerevent_drag_interaction-manual.html new file mode 100644 index 0000000000..1a80d239b8 --- /dev/null +++ b/dom/events/test/pointerevents/wpt/html/pointerevent_drag_interaction-manual.html @@ -0,0 +1,103 @@ + + + Pointer Events interaction with drag and drop + + + + + + + + + +

Pointer Events interaction with drag and drop

+

+

+ Test Description: This test checks that the pointercancel (and if needed lostpointercapture) is dispatched when drag starts. +
    +
  1. Press down on the black square.
  2. +
  3. Move your pointer to purple square and release.
  4. +
  5. Repeat the first two steps.
  6. +
  7. Repeat the first two steps once again.
  8. +
  9. Repeat the first two steps once again.
  10. +
+ Test passes if the proper behavior of the events is observed. +

+
+
+
+
+ + diff --git a/dom/events/test/pointerevents/wpt/idlharness.html b/dom/events/test/pointerevents/wpt/idlharness.html new file mode 100644 index 0000000000..a4ba4c35f5 --- /dev/null +++ b/dom/events/test/pointerevents/wpt/idlharness.html @@ -0,0 +1,104 @@ + + +idlharness test + + + + + + + +
+dictionary PointerEventInit : MouseEventInit {
+    long      pointerId = 0;
+    double    width = 1;
+    double    height = 1;
+    float     pressure = 0;
+    float     tangentialPressure = 0;
+    long      tiltX = 0;
+    long      tiltY = 0;
+    long      twist = 0;
+    DOMString pointerType = "";
+    boolean   isPrimary = false;
+};
+
+[Constructor(DOMString type, optional PointerEventInit eventInitDict)]
+interface PointerEvent : MouseEvent {
+    readonly attribute long      pointerId;
+    readonly attribute double    width;
+    readonly attribute double    height;
+    readonly attribute float     pressure;
+    readonly attribute float     tangentialPressure;
+    readonly attribute long      tiltX;
+    readonly attribute long      tiltY;
+    readonly attribute long      twist;
+    readonly attribute DOMString pointerType;
+    readonly attribute boolean   isPrimary;
+};
+
+partial interface Element {
+    void    setPointerCapture(long pointerId);
+    void    releasePointerCapture(long pointerId);
+    boolean hasPointerCapture(long pointerId);
+};
+
+partial interface GlobalEventHandlers {
+    attribute EventHandler ongotpointercapture;
+    attribute EventHandler onlostpointercapture;
+    attribute EventHandler onpointerdown;
+    attribute EventHandler onpointermove;
+    attribute EventHandler onpointerup;
+    attribute EventHandler onpointercancel;
+    attribute EventHandler onpointerover;
+    attribute EventHandler onpointerout;
+    attribute EventHandler onpointerenter;
+    attribute EventHandler onpointerleave;
+};
+
+partial interface Navigator {
+    readonly attribute long maxTouchPoints;
+};
+
+ diff --git a/dom/events/test/pointerevents/wpt/pointerevent_attributes_hoverable_pointers-manual.html b/dom/events/test/pointerevents/wpt/pointerevent_attributes_hoverable_pointers-manual.html new file mode 100644 index 0000000000..0922ae7448 --- /dev/null +++ b/dom/events/test/pointerevents/wpt/pointerevent_attributes_hoverable_pointers-manual.html @@ -0,0 +1,143 @@ + + + + Pointer Events properties tests + + + + + + + + + +

Pointer Events hoverable pointer attributes test

+

+

+ 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. +
    +
  1. Move your pointer over the black square and click on it.
  2. +
  3. Then move it off the black square so that it disappears.
  4. +
  5. When red square appears move your pointer over the red square and click on it.
  6. +
  7. Then move it off the red square.
  8. +
+ + Test passes if the proper behavior of the events is observed. +

+
+ +
+
+

The following pointer types were detected: .

+

Refresh the page to run the tests again with a different pointer type.

+
+
+ + + diff --git a/dom/events/test/pointerevents/wpt/pointerevent_attributes_nohover_pointers-manual.html b/dom/events/test/pointerevents/wpt/pointerevent_attributes_nohover_pointers-manual.html new file mode 100644 index 0000000000..0fd7904ef0 --- /dev/null +++ b/dom/events/test/pointerevents/wpt/pointerevent_attributes_nohover_pointers-manual.html @@ -0,0 +1,126 @@ + + + + Pointer Events properties tests + + + + + + + + + +

Pointer Events no-hover pointer attributes test

+

+

+ Test Description: This test checks the properties of pointer events that do not support hover. +
    +
  1. Tap the black square.
  2. +
  3. Then move it off the black square so that it disappears.
  4. +
  5. When the red square appears tap on that as well.
  6. +
+ + Test passes if the proper behavior of the events is observed. +

+
+ +
+
+

The following pointer types were detected: .

+

Refresh the page to run the tests again with a different pointer type.

+
+
+ + + diff --git a/dom/events/test/pointerevents/wpt/pointerevent_boundary_events_in_capturing-manual.html b/dom/events/test/pointerevents/wpt/pointerevent_boundary_events_in_capturing-manual.html new file mode 100644 index 0000000000..0de4d55ed1 --- /dev/null +++ b/dom/events/test/pointerevents/wpt/pointerevent_boundary_events_in_capturing-manual.html @@ -0,0 +1,97 @@ + + + + Pointer Events boundary events in capturing tests + + + + + + + + + +

Pointer Events boundary events in capturing

+

+

+ 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. +
    +
  1. Move your pointer over the black square
  2. +
  3. Press down the pointer (i.e. press left button with mouse or touch the screen with finger or pen).
  4. +
  5. Drag the pointer within the black square.
  6. +
  7. Release the pointer.
  8. +
+ + Test passes if the proper behavior of the events is observed. +

+
+
+
Do not hover over or touch this element.
+
+

The following pointer types were detected: .

+

Refresh the page to run the tests again with a different pointer type.

+
+
+ + + diff --git a/dom/events/test/pointerevents/wpt/pointerevent_change-touch-action-onpointerdown_touch-manual.html b/dom/events/test/pointerevents/wpt/pointerevent_change-touch-action-onpointerdown_touch-manual.html new file mode 100644 index 0000000000..04d56cb7a5 --- /dev/null +++ b/dom/events/test/pointerevents/wpt/pointerevent_change-touch-action-onpointerdown_touch-manual.html @@ -0,0 +1,135 @@ + + + + Change touch-action on pointerdown + + + + + + + + +

Pointer Events touch-action attribute support

+

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. +

+

Note: this test is for touch-devices only

+
+

+ 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. +

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

+ 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. +

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

+ 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. +

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

+ 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. +

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+
+ +

touch-action: auto to none

+
+

The following pointer types were detected: .

+
+
+ + \ No newline at end of file diff --git a/dom/events/test/pointerevents/wpt/pointerevent_constructor.html b/dom/events/test/pointerevents/wpt/pointerevent_constructor.html new file mode 100644 index 0000000000..b2a779d1f7 --- /dev/null +++ b/dom/events/test/pointerevents/wpt/pointerevent_constructor.html @@ -0,0 +1,106 @@ + + + + PointerEvent: Constructor test + + + + + + + + +

PointerEvent: Dispatch custom event

+

Test Description: This test checks if PointerEvent constructor works properly using synthetic pointerover and pointerout events. For valid results, this test must be run without generating real (trusted) pointerover or pointerout events on the black rectangle below.

+
+ +
+

The following pointer types were detected: .

+
+
+ + diff --git a/dom/events/test/pointerevents/wpt/pointerevent_multiple_primary_pointers_boundary_events-manual.html b/dom/events/test/pointerevents/wpt/pointerevent_multiple_primary_pointers_boundary_events-manual.html new file mode 100644 index 0000000000..eb758c7073 --- /dev/null +++ b/dom/events/test/pointerevents/wpt/pointerevent_multiple_primary_pointers_boundary_events-manual.html @@ -0,0 +1,145 @@ + + + + Pointer Event: Boundary compatibility events for multiple primary pointers + + + + + + + + + + + +

Pointer Event: Boundary compatibility events for multiple primary pointers

+

+ 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. +

+ Instruction: +
    +
  1. Move the mouse directly into Target0 (without going through Target1), and then leave the mouse there unmoved.
  2. +
  3. Tap directly on Target1 with a finger or a stylus, and then lift the finger/stylus off the screen/digitizer without crossing Target1 boundary.
  4. +
  5. Move the mouse into Target0 (if not there already) and move inside it.
  6. +
  7. Click Done (without passing over Target1).
  8. +
+
+ Done +
+
+ Target0 +
+
+ Target1 +
+
+

The following pointer types were detected: .

+

The following events were logged: .

+
+
+ + diff --git a/dom/events/test/pointerevents/wpt/pointerevent_pointerId_scope-manual.html b/dom/events/test/pointerevents/wpt/pointerevent_pointerId_scope-manual.html new file mode 100644 index 0000000000..3640cb6f6b --- /dev/null +++ b/dom/events/test/pointerevents/wpt/pointerevent_pointerId_scope-manual.html @@ -0,0 +1,82 @@ + + + + + Pointer Events pointerdown tests + + + + + + + + + +

Pointer Events pointerdown tests

+ Complete the following actions: +
    +
  1. 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. +
  2. 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. +
+
+
+ +
+

The following pointer types were detected: .

+

Refresh the page to run the tests again with a different pointer type.

+
+
+ + diff --git a/dom/events/test/pointerevents/wpt/pointerevent_pointercancel_touch-manual.html b/dom/events/test/pointerevents/wpt/pointerevent_pointercancel_touch-manual.html new file mode 100644 index 0000000000..70a65eeb5c --- /dev/null +++ b/dom/events/test/pointerevents/wpt/pointerevent_pointercancel_touch-manual.html @@ -0,0 +1,77 @@ + + + + PointerCancel - touch + + + + + + + + +

pointercancel test

+

Warning: this test works properly only for devices that have touchscreen

+

+ Test Description: This test checks if pointercancel event triggers. +

Start touch over the black rectangle and then move your finger to scroll the page.

+

+

+

+ +

Pointer Events pointercancel Tests

+
+

The following pointer types were detected: .

+
+
+ + diff --git a/dom/events/test/pointerevents/wpt/pointerevent_pointerleave_after_pointercancel_touch-manual.html b/dom/events/test/pointerevents/wpt/pointerevent_pointerleave_after_pointercancel_touch-manual.html new file mode 100644 index 0000000000..56be26549f --- /dev/null +++ b/dom/events/test/pointerevents/wpt/pointerevent_pointerleave_after_pointercancel_touch-manual.html @@ -0,0 +1,66 @@ + + + + pointerleave after pointercancel + + + + + + + + +

pointerleave after pointercancel

+

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.

+

Note: this test is for touch devices only

+
+ +

Pointer Events pointerleave tests

+
+

The following pointer types were detected: .

+
+
+ + diff --git a/dom/events/test/pointerevents/wpt/pointerevent_pointerleave_pen-manual.html b/dom/events/test/pointerevents/wpt/pointerevent_pointerleave_pen-manual.html new file mode 100644 index 0000000000..38a2f69792 --- /dev/null +++ b/dom/events/test/pointerevents/wpt/pointerevent_pointerleave_pen-manual.html @@ -0,0 +1,58 @@ + + + + Pointer Event: Dispatch pointerleave (pen). + + + + + + + + + + + + +

Pointer Event: Dispatch pointerleave (pen)

+

+ 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. +

+
+
+ Use a pen to hover over then lift up away from this element. +
+
+

Test complete: Scroll to Summary to view Pass/Fail Results.

+

The following pointer types were detected: .

+
+
+ + \ No newline at end of file diff --git a/dom/events/test/pointerevents/wpt/pointerevent_pointerout_after_pointercancel_touch-manual.html b/dom/events/test/pointerevents/wpt/pointerevent_pointerout_after_pointercancel_touch-manual.html new file mode 100644 index 0000000000..1888591a7c --- /dev/null +++ b/dom/events/test/pointerevents/wpt/pointerevent_pointerout_after_pointercancel_touch-manual.html @@ -0,0 +1,67 @@ + + + + pointerout + + + + + + + + +

pointerout

+

Test Description: This test checks if pointerout event triggers after pointercancel. Start touch on the black rectangle and move your touch to scroll in any direction.

+

Note: this test is for touch devices only

+
+ +

Pointer Events pointerout tests

+
+

The following pointer types were detected: .

+
+
+ + diff --git a/dom/events/test/pointerevents/wpt/pointerevent_pointerout_pen-manual.html b/dom/events/test/pointerevents/wpt/pointerevent_pointerout_pen-manual.html new file mode 100644 index 0000000000..3973948c16 --- /dev/null +++ b/dom/events/test/pointerevents/wpt/pointerevent_pointerout_pen-manual.html @@ -0,0 +1,57 @@ + + + + pointerout + + + + + + + + +

pointerout

+

Test Description: This test checks if pointerout event triggers for pen. Place your pen over the black rectangle and then pull the pen out of the digitizer's detectable range.

+

Note: this test is for devices that support hover - for pen only

+
+ +

Pointer Events pointerout tests

+
+

The following pointer types were detected: .

+
+
+ + \ No newline at end of file diff --git a/dom/events/test/pointerevents/wpt/pointerevent_releasepointercapture_events_to_original_target-manual.html b/dom/events/test/pointerevents/wpt/pointerevent_releasepointercapture_events_to_original_target-manual.html new file mode 100644 index 0000000000..3386fafb5a --- /dev/null +++ b/dom/events/test/pointerevents/wpt/pointerevent_releasepointercapture_events_to_original_target-manual.html @@ -0,0 +1,137 @@ + + + + Pointer Event: releasePointerCapture() - subsequent events follow normal hitting testing mechanisms + + + + + + + + + + + +

+
+

Pointer Event: releasePointerCapture() - subsequent events follow normal hitting testing mechanisms

+

+ Test Description: + Use your pointer and press down in the black box. Then move around in the box and release your pointer. + After invoking the releasePointerCapture method on an element, subsequent events for the specified + pointer must follow normal hit testing mechanisms for determining the event target. +

+
+
+
+
+

Test complete: Scroll to Summary to view Pass/Fail Results.

+

The following pointer types were detected: .

+

Refresh the page to run the tests again with a different pointer type.

+
+
+ + diff --git a/dom/events/test/pointerevents/wpt/pointerevent_releasepointercapture_onpointercancel_touch-manual.html b/dom/events/test/pointerevents/wpt/pointerevent_releasepointercapture_onpointercancel_touch-manual.html new file mode 100644 index 0000000000..105e3b5a97 --- /dev/null +++ b/dom/events/test/pointerevents/wpt/pointerevent_releasepointercapture_onpointercancel_touch-manual.html @@ -0,0 +1,71 @@ + + + + Release capture on pointercancel + + + + + + + +

Pointer Events Capture Test - release capture on pointercancel

+

+ Test Description: This test checks if setCapture/releaseCapture functions works properly. Complete the following actions: +
    +
  1. Touch black rectangle and do not release your touch +
  2. Move your touch to scroll the page. "lostpointercapture" should be logged inside of the black rectangle immediately after "pointercancel" +
+

+ Test passes if the proper behavior of the events is observed. +
+ + +

Pointer Events Capture Test

+
+

Test complete: Scroll to Summary to view Pass/Fail Results.

+

The following pointer types were detected: .

+
+
+ + diff --git a/dom/events/test/pointerevents/wpt/pointerevent_sequence_at_implicit_release_on_click-manual.html b/dom/events/test/pointerevents/wpt/pointerevent_sequence_at_implicit_release_on_click-manual.html new file mode 100644 index 0000000000..274f9a435b --- /dev/null +++ b/dom/events/test/pointerevents/wpt/pointerevent_sequence_at_implicit_release_on_click-manual.html @@ -0,0 +1,83 @@ + + + + Pointer Event: Event sequence at implicit release on click + + + + + + + + + + + +

Pointer Event: Event sequence at implicit release on click

+

+

+ When a captured pointer is implicitly released after a click, the boundary events should follow the lostpointercapture event. +

+
    +
  1. Click or tap on Black.
  2. +
  3. Click or tap on Green.
  4. +
+
+
+
+

The following pointer types were detected: .

+

The following events were logged: .

+
+
+ + diff --git a/dom/events/test/pointerevents/wpt/pointerevent_sequence_at_implicit_release_on_drag-manual.html b/dom/events/test/pointerevents/wpt/pointerevent_sequence_at_implicit_release_on_drag-manual.html new file mode 100644 index 0000000000..7b8e39b94d --- /dev/null +++ b/dom/events/test/pointerevents/wpt/pointerevent_sequence_at_implicit_release_on_drag-manual.html @@ -0,0 +1,84 @@ + + + + Pointer Event: Event sequence at implicit release on drag + + + + + + + + + + + +

Pointer Event: Event sequence at implicit release on drag

+

+

+ When a captured pointer is implicitly released after a drag, the boundary events should follow the lostpointercapture event. +

+
    +
  1. Drag quickly down starting on Black.
  2. +
  3. Click or tap on Green.
  4. +
+
+
+
+

The following pointer types were detected: .

+

The following events were logged: .

+
+
+ + diff --git a/dom/events/test/pointerevents/wpt/pointerevent_styles.css b/dom/events/test/pointerevents/wpt/pointerevent_styles.css new file mode 100644 index 0000000000..1ee3b0b396 --- /dev/null +++ b/dom/events/test/pointerevents/wpt/pointerevent_styles.css @@ -0,0 +1,112 @@ +#innerFrame { +position: absolute; +top: 300px; +left: 200px; +height: 100px; +width: 100px; +} + +.spacer { +height: 100px; +} + +#square1 { +top: 330px; +left: 150px; +background: black; +} + +#square2 { +top: 50px; +left: 30px; +visibility: hidden; +background: red; +} + +.square { +height: 20px; +width: 20px; +position: absolute; +padding: 0px; +} + +#target0 { +background: black; +color: white; +white-space: nowrap; +overflow-y: auto; +overflow-x: auto; +} + +#target1 { +background: purple; +color: white; +white-space: nowrap; +overflow-y: auto; +overflow-x: auto; +} + +#scrollTarget { + background: darkblue; +} + +.touchActionNone { +touch-action: none; +} + +#innerframe { +width: 90%; +margin: 10px; +margin-left: 10%; +height: 200px; +} + +.scroller { +width: 700px; +height: 430px; +margin: 20px; +overflow: auto; +background: black; +} + +.scroller > div { +height: 1000px; +width: 1000px; +color: white; +} + +.scroller > div div { +height: 100%; +width: 100%; +color: white; +} + +div { +margin: 0em; +padding: 2em; +} + +#complete-notice { +background: #afa; +border: 1px solid #0a0; +display: none; +} + +#pointertype-log { +font-weight: bold; +} + +#event-log { +font-weight: bold; +} + +#listener { +background: orange; +border: 1px solid orange; +position: absolute; +top: -100px; +} + +body.scrollable { +min-height: 5000px; +} diff --git a/dom/events/test/pointerevents/wpt/pointerevent_support.js b/dom/events/test/pointerevents/wpt/pointerevent_support.js new file mode 100644 index 0000000000..cd3c799f73 --- /dev/null +++ b/dom/events/test/pointerevents/wpt/pointerevent_support.js @@ -0,0 +1,333 @@ +var All_Pointer_Events = [ + "pointerdown", + "pointerup", + "pointercancel", + "pointermove", + "pointerover", + "pointerout", + "pointerenter", + "pointerleave", + "gotpointercapture", + "lostpointercapture", +]; + +// Check for conformance to PointerEvent interface +// TA: 1.1, 1.2, 1.6, 1.7, 1.8, 1.9, 1.10, 1.11, 1.12, 1.13 +function check_PointerEvent(event, testNamePrefix) { + if (testNamePrefix === undefined) { + testNamePrefix = ""; + } + + // Use expectedPointerType if set otherwise just use the incoming event pointerType in the test name. + var pointerTestName = + testNamePrefix + + " " + + (expectedPointerType == null ? event.pointerType : expectedPointerType) + + " " + + event.type; + + if (expectedPointerType != null) { + test(function () { + assert_equals( + event.pointerType, + expectedPointerType, + "pointerType should be the one specified in the test page." + ); + }, pointerTestName + " event pointerType is correct."); + } + + test(function () { + assert_true( + event instanceof event.target.ownerDocument.defaultView.PointerEvent, + "event is a PointerEvent event" + ); + }, pointerTestName + " event is a PointerEvent event"); + + // Check attributes for conformance to WebIDL: + // * attribute exists + // * has proper type + // * if the attribute is "readonly", it cannot be changed + // TA: 1.1, 1.2 + var idl_type_check = { + long(v) { + return typeof v === "number" && Math.round(v) === v; + }, + float(v) { + return typeof v === "number"; + }, + string(v) { + return typeof v === "string"; + }, + boolean(v) { + return typeof v === "boolean"; + }, + }; + [ + ["readonly", "long", "pointerId"], + ["readonly", "float", "width"], + ["readonly", "float", "height"], + ["readonly", "float", "pressure"], + ["readonly", "long", "tiltX"], + ["readonly", "long", "tiltY"], + ["readonly", "string", "pointerType"], + ["readonly", "boolean", "isPrimary"], + ["readonly", "long", "detail", 0], + ].forEach(function (attr) { + var readonly = attr[0]; + var type = attr[1]; + var name = attr[2]; + var value = attr[3]; + + // existence check + test(function () { + assert_true( + name in event, + name + " attribute in " + event.type + " event" + ); + }, pointerTestName + "." + name + " attribute exists"); + + // readonly check + if (readonly === "readonly") { + test(function () { + assert_readonly( + event.type, + name, + event.type + "." + name + " cannot be changed" + ); + }, pointerTestName + "." + name + " is readonly"); + } + + // type check + test(function () { + assert_true( + idl_type_check[type](event[name]), + name + " attribute of type " + type + ); + }, pointerTestName + + "." + + name + + " IDL type " + + type + + " (JS type was " + + typeof event[name] + + ")"); + + // value check if defined + if (value != undefined) { + test(function () { + assert_equals(event[name], value, name + " attribute value"); + }, pointerTestName + "." + name + " value is " + value + "."); + } + }); + + // Check the pressure value + // TA: 1.6, 1.7, 1.8 + test(function () { + // TA: 1.6 + assert_greater_than_equal( + event.pressure, + 0, + "pressure is greater than or equal to 0" + ); + assert_less_than_equal( + event.pressure, + 1, + "pressure is less than or equal to 1" + ); + + if (event.type === "pointerup") { + assert_equals(event.pressure, 0, "pressure is 0 during pointerup"); + } + + // TA: 1.7, 1.8 + if (event.pointerType === "mouse") { + if (event.buttons === 0) { + assert_equals( + event.pressure, + 0, + "pressure is 0 for mouse with no buttons pressed" + ); + } else { + assert_equals( + event.pressure, + 0.5, + "pressure is 0.5 for mouse with a button pressed" + ); + } + } + }, pointerTestName + ".pressure value is valid"); + + // Check mouse-specific properties + if (event.pointerType === "mouse") { + // TA: 1.9, 1.10, 1.13 + test(function () { + assert_equals(event.width, 1, "width of mouse should be 1"); + assert_equals(event.height, 1, "height of mouse should be 1"); + assert_equals(event.tiltX, 0, event.type + ".tiltX is 0 for mouse"); + assert_equals(event.tiltY, 0, event.type + ".tiltY is 0 for mouse"); + assert_true(event.isPrimary, event.type + ".isPrimary is true for mouse"); + }, pointerTestName + " properties for pointerType = mouse"); + // Check properties for pointers other than mouse + } +} + +function showPointerTypes() { + var complete_notice = document.getElementById("complete-notice"); + var pointertype_log = document.getElementById("pointertype-log"); + var pointertypes = Object.keys(detected_pointertypes); + pointertype_log.innerHTML = pointertypes.length + ? pointertypes.join(",") + : "(none)"; + complete_notice.style.display = "block"; +} + +function showLoggedEvents() { + var event_log_elem = document.getElementById("event-log"); + event_log_elem.innerHTML = event_log.length ? event_log.join(", ") : "(none)"; + + var complete_notice = document.getElementById("complete-notice"); + complete_notice.style.display = "block"; +} + +function log(msg, el) { + if (++count > 10) { + count = 0; + el.innerHTML = " "; + } + el.innerHTML = msg + "; " + el.innerHTML; +} + +function failOnScroll() { + assert_true(false, "scroll received while shouldn't"); +} + +function updateDescriptionNextStep() { + document.getElementById("desc").innerHTML = + "Test Description: Try to scroll text RIGHT."; +} + +function updateDescriptionComplete() { + document.getElementById("desc").innerHTML = "Test Description: Test complete"; +} + +function updateDescriptionSecondStepTouchActionElement( + target, + scrollReturnInterval +) { + window.setTimeout(function () { + objectScroller(target, "up", 0); + }, scrollReturnInterval); + document.getElementById("desc").innerHTML = + "Test Description: Try to scroll element RIGHT moving your outside of the red border"; +} + +function updateDescriptionThirdStepTouchActionElement( + target, + scrollReturnInterval, + callback = null +) { + window.setTimeout(function () { + objectScroller(target, "left", 0); + if (callback) { + callback(); + } + }, scrollReturnInterval); + document.getElementById("desc").innerHTML = + "Test Description: Try to scroll element DOWN then RIGHT starting your touch inside of the element. Then tap complete button"; +} + +function updateDescriptionFourthStepTouchActionElement( + target, + scrollReturnInterval +) { + document.getElementById("desc").innerHTML = + "Test Description: Try to scroll element RIGHT starting your touch inside of the element"; +} + +function objectScroller(target, direction, value) { + if (direction == "up") { + target.scrollTop = 0; + } else if (direction == "left") { + target.scrollLeft = 0; + } +} + +function sPointerCapture(e) { + try { + target0.setPointerCapture(e.pointerId); + } catch (ex) {} +} + +function rPointerCapture(e) { + try { + captureButton.value = "Set Capture"; + target0.releasePointerCapture(e.pointerId); + } catch (ex) {} +} + +var globalPointerEventTest = null; +var expectedPointerType = null; +const ALL_POINTERS = ["mouse", "touch", "pen"]; +const HOVERABLE_POINTERS = ["mouse", "pen"]; +const NOHOVER_POINTERS = ["touch"]; + +function MultiPointerTypeTest(testName, types) { + this.testName = testName; + this.types = types; + this.currentTypeIndex = 0; + this.currentTest = null; + this.createNextTest(); +} + +MultiPointerTypeTest.prototype.skip = function () { + var prevTest = this.currentTest; + this.createNextTest(); + prevTest.timeout(); +}; + +MultiPointerTypeTest.prototype.done = function () { + var prevTest = this.currentTest; + this.createNextTest(); + if (prevTest != null) { + prevTest.done(); + } +}; + +MultiPointerTypeTest.prototype.step = function (stepFunction) { + this.currentTest.step(stepFunction); +}; + +MultiPointerTypeTest.prototype.createNextTest = function () { + if (this.currentTypeIndex < this.types.length) { + var pointerTypeDescription = document.getElementById( + "pointerTypeDescription" + ); + document.getElementById("pointerTypeDescription").innerHTML = + "Follow the test instructions with " + + this.types[this.currentTypeIndex] + + ". If you don't have the device skip it."; + this.currentTest = async_test( + this.types[this.currentTypeIndex] + " " + this.testName + ); + expectedPointerType = this.types[this.currentTypeIndex]; + this.currentTypeIndex++; + } else { + document.getElementById("pointerTypeDescription").innerHTML = ""; + } + resetTestState(); +}; + +function setup_pointerevent_test(testName, supportedPointerTypes) { + return (globalPointerEventTest = new MultiPointerTypeTest( + testName, + supportedPointerTypes + )); +} + +function checkPointerEventType(event) { + assert_equals( + event.pointerType, + expectedPointerType, + "pointerType should be the same as the requested device." + ); +} diff --git a/dom/events/test/pointerevents/wpt/pointerevent_touch-action-auto-css_touch-manual.html b/dom/events/test/pointerevents/wpt/pointerevent_touch-action-auto-css_touch-manual.html new file mode 100644 index 0000000000..f5e9d12c35 --- /dev/null +++ b/dom/events/test/pointerevents/wpt/pointerevent_touch-action-auto-css_touch-manual.html @@ -0,0 +1,129 @@ + + + + touch-action: auto + + + + + + + + +

Pointer Events touch-action attribute support

+

Test Description: Try to scroll text DOWN. Wait for description update. Expected: pan enabled

+

Note: this test is for touch-devices only

+
+

+ 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. +

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

+ 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. +

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

+ 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. +

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

+ 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. +

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+
+ +

touch-action: auto

+
+

The following pointer types were detected: .

+
+
+ + \ No newline at end of file diff --git a/dom/events/test/pointerevents/wpt/pointerevent_touch-action-button-test_touch-manual.html b/dom/events/test/pointerevents/wpt/pointerevent_touch-action-button-test_touch-manual.html new file mode 100644 index 0000000000..c7c5d9a440 --- /dev/null +++ b/dom/events/test/pointerevents/wpt/pointerevent_touch-action-button-test_touch-manual.html @@ -0,0 +1,110 @@ + + + + Button touch-action test + + + + + + + + + +

Pointer Events touch-action attribute support

+

Test Description: Try to scroll black element DOWN moving your touch outside of the red border. Wait for description update.

+

Note: this test is for touch only

+
+ +
+
+ + + +

touch-action: none

+
+

The following pointer types were detected: .

+
+
+ + diff --git a/dom/events/test/pointerevents/wpt/pointerevent_touch-action-illegal.html b/dom/events/test/pointerevents/wpt/pointerevent_touch-action-illegal.html new file mode 100644 index 0000000000..5fe6179840 --- /dev/null +++ b/dom/events/test/pointerevents/wpt/pointerevent_touch-action-illegal.html @@ -0,0 +1,67 @@ + + + + touch-action: illegal + + + + + + + + +

Pointer Events touch-action attribute support

+

Test Description: Test will automatically check behaviour of following combinations: 'pan-x none', 'pan-y none', 'auto none'

+
+
+
+ +

touch-action: none

+
+

The following pointer types were detected: .

+
+
+ + \ No newline at end of file diff --git a/dom/events/test/pointerevents/wpt/pointerevent_touch-action-inherit_child-auto-child-none_touch-manual.html b/dom/events/test/pointerevents/wpt/pointerevent_touch-action-inherit_child-auto-child-none_touch-manual.html new file mode 100644 index 0000000000..dcea283750 --- /dev/null +++ b/dom/events/test/pointerevents/wpt/pointerevent_touch-action-inherit_child-auto-child-none_touch-manual.html @@ -0,0 +1,117 @@ + + + + touch-action: parent > child: auto > child: none + + + + + + + + + +

Pointer Events touch-action attribute support

+

Test Description: Try to scroll element DOWN then RIGHT inside blue rectangle. Tap Complete button under the rectangle when done. Expected: no panning.

+

Note: this test is for touch-devices only

+
+
+
+

+ 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. +

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

+ 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. +

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

+ 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. +

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

+ 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. +

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+
+
+
+ + +

behaviour: none

+
+

The following pointer types were detected: .

+
+
+ + \ No newline at end of file diff --git a/dom/events/test/pointerevents/wpt/pointerevent_touch-action-inherit_child-none_touch-manual.html b/dom/events/test/pointerevents/wpt/pointerevent_touch-action-inherit_child-none_touch-manual.html new file mode 100644 index 0000000000..16e42954e5 --- /dev/null +++ b/dom/events/test/pointerevents/wpt/pointerevent_touch-action-inherit_child-none_touch-manual.html @@ -0,0 +1,112 @@ + + + + touch-action: child: none + + + + + + + + + +

Pointer Events touch-action attribute support

+

Test Description: Try to scroll element DOWN then RIGHT inside blue rectangle. Tap Complete button under the rectangle when done. Expected: no panning

+

Note: this test is for touch-devices only

+
+
+

+ 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. +

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

+ 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. +

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

+ 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. +

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

+ 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. +

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+
+
+ + +

behaviour: none

+
+

The following pointer types were detected: .

+
+
+ + \ No newline at end of file diff --git a/dom/events/test/pointerevents/wpt/pointerevent_touch-action-inherit_child-pan-x-child-pan-x_touch-manual.html b/dom/events/test/pointerevents/wpt/pointerevent_touch-action-inherit_child-pan-x-child-pan-x_touch-manual.html new file mode 100644 index 0000000000..c75d067e44 --- /dev/null +++ b/dom/events/test/pointerevents/wpt/pointerevent_touch-action-inherit_child-pan-x-child-pan-x_touch-manual.html @@ -0,0 +1,112 @@ + + + + touch-action: parent > child: pan-x > child: pan-x + + + + + + + + + +

Pointer Events touch-action attribute support

+

Test Description: Try to scroll element DOWN then RIGHT inside blue rectangle. Tap Complete button under the rectangle when done. Expected: only pans in x direction.

+

Note: this test is for touch-devices only

+
+
+
+

+ 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. +

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

+ 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. +

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

+ 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. +

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

+ 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. +

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+
+
+
+ + +

behaviour: pan-x

+
+

The following pointer types were detected: .

+
+
+ + \ No newline at end of file diff --git a/dom/events/test/pointerevents/wpt/pointerevent_touch-action-inherit_child-pan-x-child-pan-y_touch-manual.html b/dom/events/test/pointerevents/wpt/pointerevent_touch-action-inherit_child-pan-x-child-pan-y_touch-manual.html new file mode 100644 index 0000000000..d420cc56c7 --- /dev/null +++ b/dom/events/test/pointerevents/wpt/pointerevent_touch-action-inherit_child-pan-x-child-pan-y_touch-manual.html @@ -0,0 +1,117 @@ + + + + touch-action: parent > child: pan-x > child: pan-y + + + + + + + + + +

Pointer Events touch-action attribute support

+

Test Description: Try to scroll element DOWN then RIGHT inside blue rectangle. Tap Complete button under the rectangle when done. Expected: no panning/zooming/etc.

+

Note: this test is for touch-devices only

+
+
+
+

+ 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. +

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

+ 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. +

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

+ 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. +

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

+ 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. +

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+
+
+
+ + +

behaviour: none

+
+

The following pointer types were detected: .

+
+
+ + \ No newline at end of file diff --git a/dom/events/test/pointerevents/wpt/pointerevent_touch-action-inherit_highest-parent-none_touch-manual.html b/dom/events/test/pointerevents/wpt/pointerevent_touch-action-inherit_highest-parent-none_touch-manual.html new file mode 100644 index 0000000000..d87d2b3a34 --- /dev/null +++ b/dom/events/test/pointerevents/wpt/pointerevent_touch-action-inherit_highest-parent-none_touch-manual.html @@ -0,0 +1,133 @@ + + + + touch-action: parent: none + two embedded children + + + + + + + + +

Pointer Events touch-action attribute support

+

Test Description: Try to scroll text DOWN inside blue rectangle. Wait for description update. Expected: pan enabled

+

Note: this test is for touch-devices only

+
+
+
+

+ 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. +

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

+ 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. +

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

+ 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. +

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

+ 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. +

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+
+
+
+ +

behaviour: auto

+
+

The following pointer types were detected: .

+
+
+ + \ No newline at end of file diff --git a/dom/events/test/pointerevents/wpt/pointerevent_touch-action-inherit_parent-none_touch-manual.html b/dom/events/test/pointerevents/wpt/pointerevent_touch-action-inherit_parent-none_touch-manual.html new file mode 100644 index 0000000000..5e674a14da --- /dev/null +++ b/dom/events/test/pointerevents/wpt/pointerevent_touch-action-inherit_parent-none_touch-manual.html @@ -0,0 +1,112 @@ + + + + touch-action: inherit from parent: none + + + + + + + + + +

Pointer Events touch-action attribute support

+

Test Description: Try to scroll element DOWN then RIGHT inside blue rectangle. Tap Complete button under the rectangle when done. Expected: no panning

+

Note: this test is for touch-devices only

+
+
+

+ 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. +

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

+ 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. +

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

+ 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. +

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

+ 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. +

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+
+
+ + +

behaviour: none

+
+

The following pointer types were detected: .

+
+
+ + \ No newline at end of file diff --git a/dom/events/test/pointerevents/wpt/pointerevent_touch-action-keyboard-manual.html b/dom/events/test/pointerevents/wpt/pointerevent_touch-action-keyboard-manual.html new file mode 100644 index 0000000000..3fef3f646f --- /dev/null +++ b/dom/events/test/pointerevents/wpt/pointerevent_touch-action-keyboard-manual.html @@ -0,0 +1,124 @@ + + + + touch-action: keyboard + + + + + + + + +

Pointer Events touch-action attribute support

+

Test Description: Press DOWN ARROW key. Wait for description update. Expected: pan enabled

+

Note: this test is for keyboard only

+
+

+ 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. +

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

+ 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. +

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

+ 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. +

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

+ 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. +

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+
+ +

touch-action: none

+
+
+
+ + \ No newline at end of file diff --git a/dom/events/test/pointerevents/wpt/pointerevent_touch-action-mouse-manual.html b/dom/events/test/pointerevents/wpt/pointerevent_touch-action-mouse-manual.html new file mode 100644 index 0000000000..fcc8584515 --- /dev/null +++ b/dom/events/test/pointerevents/wpt/pointerevent_touch-action-mouse-manual.html @@ -0,0 +1,130 @@ + + + + touch-action: mouse + + + + + + + + +

Pointer Events touch-action attribute support

+

Test Description: Try to scroll text down using mouse (use mouse wheel or click on the scrollbar). Wait for description update.

+

Note: this test is for mouse only

+
+

+ 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. +

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

+ 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. +

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

+ 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. +

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

+ 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. +

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+
+ +

touch-action: none

+
+

The following pointer types were detected: .

+
+
+ + \ No newline at end of file diff --git a/dom/events/test/pointerevents/wpt/pointerevent_touch-action-none-css_touch-manual.html b/dom/events/test/pointerevents/wpt/pointerevent_touch-action-none-css_touch-manual.html new file mode 100644 index 0000000000..dec694f3ec --- /dev/null +++ b/dom/events/test/pointerevents/wpt/pointerevent_touch-action-none-css_touch-manual.html @@ -0,0 +1,111 @@ + + + + touch-action: none + + + + + + + + + +

Pointer Events touch-action attribute support

+

Test Description: Try to scroll element DOWN then RIGHT. Tap Complete button under the rectangle when done. Expected: no panning/zooming/etc.

+

Note: this test is for touch-devices only

+
+

+ 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. +

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

+ 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. +

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

+ 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. +

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

+ 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. +

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+
+ + +

touch-action: none

+
+

The following pointer types were detected: .

+
+
+ + \ No newline at end of file diff --git a/dom/events/test/pointerevents/wpt/pointerevent_touch-action-pan-down-css_touch-manual.html b/dom/events/test/pointerevents/wpt/pointerevent_touch-action-pan-down-css_touch-manual.html new file mode 100644 index 0000000000..16e1cb2fab --- /dev/null +++ b/dom/events/test/pointerevents/wpt/pointerevent_touch-action-pan-down-css_touch-manual.html @@ -0,0 +1,114 @@ + + + + touch-action: pan-down + + + + + + + + + +

Pointer Events touch-action attribute support

+

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.

+

Note: this test is for touch-devices only

+
+

+ 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. +

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

+ 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. +

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

+ 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. +

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

+ 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. +

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+
+ + +

touch-action: pan-down

+
+

The following pointer types were detected: .

+
+
+ + diff --git a/dom/events/test/pointerevents/wpt/pointerevent_touch-action-pan-left-css_touch-manual.html b/dom/events/test/pointerevents/wpt/pointerevent_touch-action-pan-left-css_touch-manual.html new file mode 100644 index 0000000000..53fd2de138 --- /dev/null +++ b/dom/events/test/pointerevents/wpt/pointerevent_touch-action-pan-left-css_touch-manual.html @@ -0,0 +1,114 @@ + + + + touch-action: pan-left + + + + + + + + + +

Pointer Events touch-action attribute support

+

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.

+

Note: this test is for touch-devices only

+
+

+ 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. +

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

+ 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. +

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

+ 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. +

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

+ 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. +

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+
+ + +

touch-action: pan-left

+
+

The following pointer types were detected: .

+
+
+ + diff --git a/dom/events/test/pointerevents/wpt/pointerevent_touch-action-pan-right-css_touch-manual.html b/dom/events/test/pointerevents/wpt/pointerevent_touch-action-pan-right-css_touch-manual.html new file mode 100644 index 0000000000..53bbac65ec --- /dev/null +++ b/dom/events/test/pointerevents/wpt/pointerevent_touch-action-pan-right-css_touch-manual.html @@ -0,0 +1,114 @@ + + + + touch-action: pan-right + + + + + + + + + +

Pointer Events touch-action attribute support

+

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.

+

Note: this test is for touch-devices only

+
+

+ 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. +

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

+ 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. +

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

+ 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. +

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

+ 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. +

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+
+ + +

touch-action: pan-right

+
+

The following pointer types were detected: .

+
+
+ + diff --git a/dom/events/test/pointerevents/wpt/pointerevent_touch-action-pan-up-css_touch-manual.html b/dom/events/test/pointerevents/wpt/pointerevent_touch-action-pan-up-css_touch-manual.html new file mode 100644 index 0000000000..0902700d2d --- /dev/null +++ b/dom/events/test/pointerevents/wpt/pointerevent_touch-action-pan-up-css_touch-manual.html @@ -0,0 +1,114 @@ + + + + touch-action: pan-up + + + + + + + + + +

Pointer Events touch-action attribute support

+

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.

+

Note: this test is for touch-devices only

+
+

+ 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. +

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

+ 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. +

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

+ 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. +

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

+ 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. +

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+
+ + +

touch-action: pan-up

+
+

The following pointer types were detected: .

+
+
+ + diff --git a/dom/events/test/pointerevents/wpt/pointerevent_touch-action-pan-x-css_touch-manual.html b/dom/events/test/pointerevents/wpt/pointerevent_touch-action-pan-x-css_touch-manual.html new file mode 100644 index 0000000000..e757baec6b --- /dev/null +++ b/dom/events/test/pointerevents/wpt/pointerevent_touch-action-pan-x-css_touch-manual.html @@ -0,0 +1,106 @@ + + + + touch-action: pan-x + + + + + + + + + +

Pointer Events touch-action attribute support

+

Test Description: Try to scroll element DOWN then RIGHT. Tap Complete button under the rectangle when done. Expected: only pans in x direction.

+

Note: this test is for touch-devices only

+
+

+ 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. +

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

+ 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. +

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

+ 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. +

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

+ 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. +

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+
+ + +

touch-action: pan-x

+
+

The following pointer types were detected: .

+
+
+ + \ No newline at end of file diff --git a/dom/events/test/pointerevents/wpt/pointerevent_touch-action-pan-x-pan-y-pan-y_touch-manual.html b/dom/events/test/pointerevents/wpt/pointerevent_touch-action-pan-x-pan-y-pan-y_touch-manual.html new file mode 100644 index 0000000000..e2a4386b27 --- /dev/null +++ b/dom/events/test/pointerevents/wpt/pointerevent_touch-action-pan-x-pan-y-pan-y_touch-manual.html @@ -0,0 +1,111 @@ + + + + touch-action: parent > child: pan-x pan-y > child: pan-y + + + + + + + + + +

Pointer Events touch-action attribute support

+

Test Description: Try to scroll element DOWN then RIGHT inside blue rectangle. Tap Complete button under the rectangle when done. Expected: only pans in y direction.

+

Note: this test is for touch-devices only

+
+
+
+ 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. +

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

+ 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. +

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

+ 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. +

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

+ 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. +

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+
+
+
+ + +

behaviour: pan-y

+
+

The following pointer types were detected: .

+
+
+ + \ No newline at end of file diff --git a/dom/events/test/pointerevents/wpt/pointerevent_touch-action-pan-x-pan-y_touch-manual.html b/dom/events/test/pointerevents/wpt/pointerevent_touch-action-pan-x-pan-y_touch-manual.html new file mode 100644 index 0000000000..0c900ff740 --- /dev/null +++ b/dom/events/test/pointerevents/wpt/pointerevent_touch-action-pan-x-pan-y_touch-manual.html @@ -0,0 +1,126 @@ + + + + touch-action: pan-x pan-y + + + + + + + + +

Pointer Events touch-action attribute support

+

Test Description: Try to scroll text DOWN. Wait for description update. Expected: pan enabled

+

Note: this test is for touch-devices only

+
+

+ 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. +

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

+ 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. +

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

+ 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. +

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

+ 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. +

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+
+ +

touch-action: pan-x pan-y

+
+

The following pointer types were detected: .

+
+
+ + \ No newline at end of file diff --git a/dom/events/test/pointerevents/wpt/pointerevent_touch-action-pan-y-css_touch-manual.html b/dom/events/test/pointerevents/wpt/pointerevent_touch-action-pan-y-css_touch-manual.html new file mode 100644 index 0000000000..4ad39ecc83 --- /dev/null +++ b/dom/events/test/pointerevents/wpt/pointerevent_touch-action-pan-y-css_touch-manual.html @@ -0,0 +1,106 @@ + + + + touch-action: pan-y + + + + + + + + + +

Pointer Events touch-action attribute support

+

Test Description: Try to scroll element DOWN then RIGHT. Tap Complete button under the rectangle when done. Expected: only pans in y direction.

+

Note: this test is for touch-devices only

+
+

+ 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. +

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

+ 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. +

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

+ 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. +

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

+ 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. +

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+

Lorem ipsum dolor sit amet...

+
+ + +

touch-action: pan-y

+
+

The following pointer types were detected: .

+
+
+ + \ No newline at end of file diff --git a/dom/events/test/pointerevents/wpt/pointerevent_touch-action-span-test_touch-manual.html b/dom/events/test/pointerevents/wpt/pointerevent_touch-action-span-test_touch-manual.html new file mode 100644 index 0000000000..61f0e8d329 --- /dev/null +++ b/dom/events/test/pointerevents/wpt/pointerevent_touch-action-span-test_touch-manual.html @@ -0,0 +1,114 @@ + + + + Span touch-action test + + + + + + + + +

Pointer Events touch-action attribute support

+

Test Description: Try to scroll black element DOWN moving your touch outside of the red border. Wait for description update.

+

Note: this test is for touch only

+
+ + Test span + +
+ + + +

touch-action: none

+
+

The following pointer types were detected: .

+
+
+ + \ No newline at end of file diff --git a/dom/events/test/pointerevents/wpt/pointerevent_touch-action-svg-test_touch-manual.html b/dom/events/test/pointerevents/wpt/pointerevent_touch-action-svg-test_touch-manual.html new file mode 100644 index 0000000000..e9dc9d78ee --- /dev/null +++ b/dom/events/test/pointerevents/wpt/pointerevent_touch-action-svg-test_touch-manual.html @@ -0,0 +1,122 @@ + + + + SVG test + + + + + + + + +

Pointer Events touch-action attribute support

+

Test Description: Try to scroll black element DOWN moving your touch outside of the red border. Wait for description update.

+

Note: this test is for touch only

+
+ + + Sorry, your browser does not support inline SVG. + +
+
+ + +

touch-action: none

+
+

The following pointer types were detected: .

+
+
+ + diff --git a/dom/events/test/pointerevents/wpt/pointerevent_touch-action-table-test_touch-manual.html b/dom/events/test/pointerevents/wpt/pointerevent_touch-action-table-test_touch-manual.html new file mode 100644 index 0000000000..17d5a29575 --- /dev/null +++ b/dom/events/test/pointerevents/wpt/pointerevent_touch-action-table-test_touch-manual.html @@ -0,0 +1,145 @@ + + + + Table touch-action test + + + + + + + + + +

Pointer Events touch-action attribute support

+

Test Description: Try to scroll element DOWN starting your touch over the 1st Row. Wait for description update.

+

Note: this test is for touch only

+
+ + + + + +
The caption, first row element, and cell 3 have touch-action: none.
Header 1 Cell 1 Cell 2
Header 2 Cell 3 Cell 4
Header 3 Cell 5 Cell 6
+
+
+ + + +

touch-action: none

+
+

The following pointer types were detected: .

+
+
+ + diff --git a/dom/events/test/pointerevents/wpt/pointerevent_touch-action-verification.html b/dom/events/test/pointerevents/wpt/pointerevent_touch-action-verification.html new file mode 100644 index 0000000000..7800f2c9da --- /dev/null +++ b/dom/events/test/pointerevents/wpt/pointerevent_touch-action-verification.html @@ -0,0 +1,91 @@ + + + + touch-action: basic verification + + + + + + + + + +

Pointer Events touch-action attribute support

+

Test Description: Test will automatically check parsing behaviour of various touch-action combinations.

+ +

touch-action: basic verification

+
+

The following pointer types were detected: .

+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ + diff --git a/dom/events/test/pointerevents/wpt/pointerlock/pointerevent_movementxy-manual.html b/dom/events/test/pointerevents/wpt/pointerlock/pointerevent_movementxy-manual.html new file mode 100644 index 0000000000..5b0edd3c61 --- /dev/null +++ b/dom/events/test/pointerevents/wpt/pointerlock/pointerevent_movementxy-manual.html @@ -0,0 +1,99 @@ + + + + Pointer Events properties tests + + + + + + + + + + +

Pointer Events movementX/Y attribute test

+

+

+ Test Description: This test checks the properties of pointer events that do not support hover. +
    +
  1. Press down on the black square.
  2. +
  3. Move your pointer slowly along a straight line to the red square.
  4. +
  5. Release the pointer when you are over the red square.
  6. +
+ + Test passes if the proper behavior of the events is observed. +

+
+
+
+ +
+
+ + + diff --git a/dom/events/test/pointerevents/wpt/pointerlock/resources/pointerevent_movementxy-iframe.html b/dom/events/test/pointerevents/wpt/pointerlock/resources/pointerevent_movementxy-iframe.html new file mode 100644 index 0000000000..627af3b61c --- /dev/null +++ b/dom/events/test/pointerevents/wpt/pointerlock/resources/pointerevent_movementxy-iframe.html @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/dom/events/test/pointerevents/wpt/resources/pointerevent_attributes_hoverable_pointers-iframe.html b/dom/events/test/pointerevents/wpt/resources/pointerevent_attributes_hoverable_pointers-iframe.html new file mode 100644 index 0000000000..5e55868282 --- /dev/null +++ b/dom/events/test/pointerevents/wpt/resources/pointerevent_attributes_hoverable_pointers-iframe.html @@ -0,0 +1,10 @@ + + + + + + + +
+ + diff --git a/dom/events/test/pointerevents/wpt/resources/pointerevent_pointerId_scope-iframe.html b/dom/events/test/pointerevents/wpt/resources/pointerevent_pointerId_scope-iframe.html new file mode 100644 index 0000000000..ab33560b35 --- /dev/null +++ b/dom/events/test/pointerevents/wpt/resources/pointerevent_pointerId_scope-iframe.html @@ -0,0 +1,35 @@ + + + + + Pointer Events pointerdown tests + + + + + +
+
+ + diff --git a/dom/events/test/test_DataTransferItemList.html b/dom/events/test/test_DataTransferItemList.html new file mode 100644 index 0000000000..1d093c8cf7 --- /dev/null +++ b/dom/events/test/test_DataTransferItemList.html @@ -0,0 +1,233 @@ + + + Tests for the DataTransferItemList object + + + + + +

+ +
+ drag over here +
+ + + + + diff --git a/dom/events/test/test_accel_virtual_modifier.html b/dom/events/test/test_accel_virtual_modifier.html new file mode 100644 index 0000000000..6d98053fa2 --- /dev/null +++ b/dom/events/test/test_accel_virtual_modifier.html @@ -0,0 +1,90 @@ + + + + Test for DOM "Accel" virtual modifier + + + + +

+ +
+
+
+ + diff --git a/dom/events/test/test_accesskey.html b/dom/events/test/test_accesskey.html new file mode 100644 index 0000000000..cdfff54a28 --- /dev/null +++ b/dom/events/test/test_accesskey.html @@ -0,0 +1,160 @@ + + + + +Test for Accesskey + + + + + +

+ + +
+Checkbox 2
+Checkbox 3
+ +
+
+
+
+ +
+Legend 1 +
+
+
+
+ +
+Legend 2 +
+
+
+ + + + + + + + + diff --git a/dom/events/test/test_addEventListenerExtraArg.html b/dom/events/test/test_addEventListenerExtraArg.html new file mode 100644 index 0000000000..58b18545de --- /dev/null +++ b/dom/events/test/test_addEventListenerExtraArg.html @@ -0,0 +1,31 @@ + + + + + + Test for Bug 828554 + + + + + +Mozilla Bug 828554 +

+ +
+
+ + diff --git a/dom/events/test/test_all_synthetic_events.html b/dom/events/test/test_all_synthetic_events.html new file mode 100644 index 0000000000..cd9eab3e33 --- /dev/null +++ b/dom/events/test/test_all_synthetic_events.html @@ -0,0 +1,479 @@ + + + + Test all synthetic events + + + + + +

+ +
+
+
+ + diff --git a/dom/events/test/test_bug1003432.html b/dom/events/test/test_bug1003432.html new file mode 100644 index 0000000000..d74aefb886 --- /dev/null +++ b/dom/events/test/test_bug1003432.html @@ -0,0 +1,45 @@ + + + + + Test for Bug 1003432 + + + + +Mozilla Bug 1003432 +

+ +
+
+
+ + diff --git a/dom/events/test/test_bug1003432.js b/dom/events/test/test_bug1003432.js new file mode 100644 index 0000000000..2f92ebf8da --- /dev/null +++ b/dom/events/test/test_bug1003432.js @@ -0,0 +1,31 @@ +addEventListener( + "foobar", + function (evt) { + postMessage({ + type: evt.type, + bubbles: evt.bubbles, + cancelable: evt.cancelable, + detail: evt.detail, + }); + }, + true +); + +addEventListener( + "message", + function (evt) { + // Test the constructor of CustomEvent + var e = new CustomEvent("foobar", { + bubbles: true, + cancelable: true, + detail: "test", + }); + dispatchEvent(e); + + // Test initCustomEvent + e = new CustomEvent("foobar"); + e.initCustomEvent("foobar", true, true, "test"); + dispatchEvent(e); + }, + true +); diff --git a/dom/events/test/test_bug1013412.html b/dom/events/test/test_bug1013412.html new file mode 100644 index 0000000000..03730b09b4 --- /dev/null +++ b/dom/events/test/test_bug1013412.html @@ -0,0 +1,116 @@ + + + + + Test for Bug 1013412 and 1168182 + + + + + + + +Mozilla Bug 1013412 +Mozilla Bug 1168182 +

+
+

Scrolling the page should be async and scrolling over the dark circle should scroll the page and avoid rotating the white ball.

+
+
+
+
+
+
+
+
+
+ + + diff --git a/dom/events/test/test_bug1017086_enable.html b/dom/events/test/test_bug1017086_enable.html new file mode 100644 index 0000000000..e7e6097c63 --- /dev/null +++ b/dom/events/test/test_bug1017086_enable.html @@ -0,0 +1,35 @@ + + + + + + Test for Bug 1017086 + + + + + + + + + diff --git a/dom/events/test/test_bug1037990.html b/dom/events/test/test_bug1037990.html new file mode 100644 index 0000000000..c148debcf7 --- /dev/null +++ b/dom/events/test/test_bug1037990.html @@ -0,0 +1,61 @@ + + + + + + Test for Bug 1037990 + + + + +Mozilla Bug 1037990 +

+ +
+
+ + + diff --git a/dom/events/test/test_bug1079236.html b/dom/events/test/test_bug1079236.html new file mode 100644 index 0000000000..4c89101574 --- /dev/null +++ b/dom/events/test/test_bug1079236.html @@ -0,0 +1,66 @@ + + + + + + Test for Bug 1079236 + + + + + + +Mozilla Bug 1079236 +

+
+ +
+
+
+ + diff --git a/dom/events/test/test_bug1127588.html b/dom/events/test/test_bug1127588.html new file mode 100644 index 0000000000..7d00a68eee --- /dev/null +++ b/dom/events/test/test_bug1127588.html @@ -0,0 +1,61 @@ + + + + + + + + +Mozilla Bug 1127588 +

+