From 43a97878ce14b72f0981164f87f2e35e14151312 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 11:22:09 +0200 Subject: Adding upstream version 110.0.1. Signed-off-by: Daniel Baumann --- .../tests/uievents/mouse/attributes.html | 61 +++++++ .../mouse/cancel-mousedown-in-subframe.html | 64 +++++++ .../mouse/layout_change_should_fire_mouseover.html | 97 +++++++++++ .../uievents/mouse/mouse_buttons_back_forward.html | 56 ++++++ .../mouse/mouseenter-mouseleave-on-drag.html | 187 +++++++++++++++++++++ .../uievents/mouse/mouseevent_move_button.html | 102 +++++++++++ ...mousemove_prevent_default_action.tentative.html | 93 ++++++++++ .../resources/mouse-event-reporter-subframe.html | 37 ++++ .../tests/uievents/mouse/resources/utils.js | 27 +++ 9 files changed, 724 insertions(+) create mode 100644 testing/web-platform/tests/uievents/mouse/attributes.html create mode 100644 testing/web-platform/tests/uievents/mouse/cancel-mousedown-in-subframe.html create mode 100644 testing/web-platform/tests/uievents/mouse/layout_change_should_fire_mouseover.html create mode 100644 testing/web-platform/tests/uievents/mouse/mouse_buttons_back_forward.html create mode 100644 testing/web-platform/tests/uievents/mouse/mouseenter-mouseleave-on-drag.html create mode 100644 testing/web-platform/tests/uievents/mouse/mouseevent_move_button.html create mode 100644 testing/web-platform/tests/uievents/mouse/mousemove_prevent_default_action.tentative.html create mode 100644 testing/web-platform/tests/uievents/mouse/resources/mouse-event-reporter-subframe.html create mode 100644 testing/web-platform/tests/uievents/mouse/resources/utils.js (limited to 'testing/web-platform/tests/uievents/mouse') diff --git a/testing/web-platform/tests/uievents/mouse/attributes.html b/testing/web-platform/tests/uievents/mouse/attributes.html new file mode 100644 index 0000000000..bbc388445c --- /dev/null +++ b/testing/web-platform/tests/uievents/mouse/attributes.html @@ -0,0 +1,61 @@ + +MouseEvent attributes + + + + + + + +Left Right + + diff --git a/testing/web-platform/tests/uievents/mouse/cancel-mousedown-in-subframe.html b/testing/web-platform/tests/uievents/mouse/cancel-mousedown-in-subframe.html new file mode 100644 index 0000000000..0735037735 --- /dev/null +++ b/testing/web-platform/tests/uievents/mouse/cancel-mousedown-in-subframe.html @@ -0,0 +1,64 @@ + + + + + + + + +
+ Dragging the mouse from child frame to parent frame causes both mousedown and + mouseup events being dispatched to child frame, regardless of whether the + mousedown event is canceled or not. +
+ + + diff --git a/testing/web-platform/tests/uievents/mouse/layout_change_should_fire_mouseover.html b/testing/web-platform/tests/uievents/mouse/layout_change_should_fire_mouseover.html new file mode 100644 index 0000000000..49257ae60d --- /dev/null +++ b/testing/web-platform/tests/uievents/mouse/layout_change_should_fire_mouseover.html @@ -0,0 +1,97 @@ + + + + Mouseover/enter is sent on layout change + + + + + + + + + +
+
+

Test Description: Tests that the mouseover event is fired and the element has a hover effect when the element underneath the mouse cursor is changed. +
    +
  1. Put your mouse over the red rectangle
  2. +
  3. Click the primary mouse button
  4. +
+

+ + + diff --git a/testing/web-platform/tests/uievents/mouse/mouse_buttons_back_forward.html b/testing/web-platform/tests/uievents/mouse/mouse_buttons_back_forward.html new file mode 100644 index 0000000000..2323bc1026 --- /dev/null +++ b/testing/web-platform/tests/uievents/mouse/mouse_buttons_back_forward.html @@ -0,0 +1,56 @@ + + + + + Mouse Button Back/Forward + + + + + + + + + + +

Test Description: Tests that the mouseup event is prevented. +
    +
  1. Click the back mouse button
  2. +
  3. Click the back mouse forward
  4. +
+

+ + diff --git a/testing/web-platform/tests/uievents/mouse/mouseenter-mouseleave-on-drag.html b/testing/web-platform/tests/uievents/mouse/mouseenter-mouseleave-on-drag.html new file mode 100644 index 0000000000..c36a1501c0 --- /dev/null +++ b/testing/web-platform/tests/uievents/mouse/mouseenter-mouseleave-on-drag.html @@ -0,0 +1,187 @@ + + + + Test for redundant mouseenter or mouseleave events + + + + + + + + + + +
+
+
+ + + diff --git a/testing/web-platform/tests/uievents/mouse/mouseevent_move_button.html b/testing/web-platform/tests/uievents/mouse/mouseevent_move_button.html new file mode 100644 index 0000000000..edde11d022 --- /dev/null +++ b/testing/web-platform/tests/uievents/mouse/mouseevent_move_button.html @@ -0,0 +1,102 @@ + + + + Mouse Events with button depressed + + + + + + + + + + +

Mouse Events

+

Test Description: This test checks if mouse events set button property correctly +
    +
  1. Put your mouse over the green rectangle
  2. +
  3. Press a non-primary button and hold it
  4. +
  5. Drag mouse to blue rectangle
  6. +
  7. Release mouse button
  8. +
+

+
+
+
+
+ + + diff --git a/testing/web-platform/tests/uievents/mouse/mousemove_prevent_default_action.tentative.html b/testing/web-platform/tests/uievents/mouse/mousemove_prevent_default_action.tentative.html new file mode 100644 index 0000000000..376a110fa5 --- /dev/null +++ b/testing/web-platform/tests/uievents/mouse/mousemove_prevent_default_action.tentative.html @@ -0,0 +1,93 @@ + + +mousemove event: preventDefault() + + + + + + + + + + +
div a
+
div b
+
div c
+ + + diff --git a/testing/web-platform/tests/uievents/mouse/resources/mouse-event-reporter-subframe.html b/testing/web-platform/tests/uievents/mouse/resources/mouse-event-reporter-subframe.html new file mode 100644 index 0000000000..f12f429491 --- /dev/null +++ b/testing/web-platform/tests/uievents/mouse/resources/mouse-event-reporter-subframe.html @@ -0,0 +1,37 @@ + + + + +
Child frame
+ + diff --git a/testing/web-platform/tests/uievents/mouse/resources/utils.js b/testing/web-platform/tests/uievents/mouse/resources/utils.js new file mode 100644 index 0000000000..669a2e2edd --- /dev/null +++ b/testing/web-platform/tests/uievents/mouse/resources/utils.js @@ -0,0 +1,27 @@ +// Sends to Window |w| the object |{type, param}|. +function sendMessage(w, type, param) { + w.postMessage({"type": type, "param": param}, "*"); +} + +// Returns a |Promise| that gets resolved with the event object when |target| +// receives an event of type |event_type|. +function getEvent(event_type, target) { + return new Promise(resolve => { + target.addEventListener(event_type, e => resolve(e), {once: true}); + }); +} + +// Returns a |Promise| that gets resolved with |event.data| when |window| +// receives from |source| a "message" event whose |event.data.type| matches the string +// |message_data_type|. +function getMessageData(message_data_type, source) { + return new Promise(resolve => { + function waitAndRemove(e) { + if (e.source != source || !e.data || e.data.type != message_data_type) + return; + window.removeEventListener("message", waitAndRemove); + resolve(e.data); + } + window.addEventListener("message", waitAndRemove); + }); +} -- cgit v1.2.3