diff --git a/Tests/LibWeb/Text/expected/wpt-import/dom/events/Body-FrameSet-Event-Handlers.txt b/Tests/LibWeb/Text/expected/wpt-import/dom/events/Body-FrameSet-Event-Handlers.txt new file mode 100644 index 00000000000..d7adb986fd3 --- /dev/null +++ b/Tests/LibWeb/Text/expected/wpt-import/dom/events/Body-FrameSet-Event-Handlers.txt @@ -0,0 +1,58 @@ +Summary + +Harness status: OK + +Rerun + +Found 48 tests + +48 Pass +Details +Result Test Name MessagePass Set HTMLBodyElement.onblur +Pass Enumerate HTMLBodyElement.onblur +Pass Reflect HTMLBodyElement.onblur +Pass Forward HTMLBodyElement.onblur to Window +Pass Set HTMLFrameSetElement.onblur +Pass Enumerate HTMLFrameSetElement.onblur +Pass Reflect HTMLFrameSetElement.onblur +Pass Forward HTMLFrameSetElement.onblur to Window +Pass Set HTMLBodyElement.onerror +Pass Enumerate HTMLBodyElement.onerror +Pass Reflect HTMLBodyElement.onerror +Pass Forward HTMLBodyElement.onerror to Window +Pass Set HTMLFrameSetElement.onerror +Pass Enumerate HTMLFrameSetElement.onerror +Pass Reflect HTMLFrameSetElement.onerror +Pass Forward HTMLFrameSetElement.onerror to Window +Pass Set HTMLBodyElement.onfocus +Pass Enumerate HTMLBodyElement.onfocus +Pass Reflect HTMLBodyElement.onfocus +Pass Forward HTMLBodyElement.onfocus to Window +Pass Set HTMLFrameSetElement.onfocus +Pass Enumerate HTMLFrameSetElement.onfocus +Pass Reflect HTMLFrameSetElement.onfocus +Pass Forward HTMLFrameSetElement.onfocus to Window +Pass Set HTMLBodyElement.onload +Pass Enumerate HTMLBodyElement.onload +Pass Reflect HTMLBodyElement.onload +Pass Forward HTMLBodyElement.onload to Window +Pass Set HTMLFrameSetElement.onload +Pass Enumerate HTMLFrameSetElement.onload +Pass Reflect HTMLFrameSetElement.onload +Pass Forward HTMLFrameSetElement.onload to Window +Pass Set HTMLBodyElement.onscroll +Pass Enumerate HTMLBodyElement.onscroll +Pass Reflect HTMLBodyElement.onscroll +Pass Forward HTMLBodyElement.onscroll to Window +Pass Set HTMLFrameSetElement.onscroll +Pass Enumerate HTMLFrameSetElement.onscroll +Pass Reflect HTMLFrameSetElement.onscroll +Pass Forward HTMLFrameSetElement.onscroll to Window +Pass Set HTMLBodyElement.onresize +Pass Enumerate HTMLBodyElement.onresize +Pass Reflect HTMLBodyElement.onresize +Pass Forward HTMLBodyElement.onresize to Window +Pass Set HTMLFrameSetElement.onresize +Pass Enumerate HTMLFrameSetElement.onresize +Pass Reflect HTMLFrameSetElement.onresize +Pass Forward HTMLFrameSetElement.onresize to Window \ No newline at end of file diff --git a/Tests/LibWeb/Text/expected/wpt-import/dom/events/CustomEvent.txt b/Tests/LibWeb/Text/expected/wpt-import/dom/events/CustomEvent.txt new file mode 100644 index 00000000000..286dda1f046 --- /dev/null +++ b/Tests/LibWeb/Text/expected/wpt-import/dom/events/CustomEvent.txt @@ -0,0 +1,13 @@ +Summary + +Harness status: OK + +Rerun + +Found 3 tests + +3 Pass +Details +Result Test Name MessagePass CustomEvent dispatching. +Pass First parameter to initCustomEvent should be mandatory. +Pass initCustomEvent's default parameter values. \ No newline at end of file diff --git a/Tests/LibWeb/Text/expected/wpt-import/dom/events/Event-cancelBubble.txt b/Tests/LibWeb/Text/expected/wpt-import/dom/events/Event-cancelBubble.txt new file mode 100644 index 00000000000..32f7457c193 --- /dev/null +++ b/Tests/LibWeb/Text/expected/wpt-import/dom/events/Event-cancelBubble.txt @@ -0,0 +1,18 @@ +Summary + +Harness status: OK + +Rerun + +Found 8 tests + +8 Pass +Details +Result Test Name MessagePass cancelBubble must be false when an event is initially created. +Pass Initializing an event must set cancelBubble to false. +Pass stopPropagation() must set cancelBubble to true. +Pass stopImmediatePropagation() must set cancelBubble to true. +Pass Event.cancelBubble=false must have no effect. +Pass Event.cancelBubble=false must have no effect during event propagation. +Pass cancelBubble must be false after an event has been dispatched. +Pass Event.cancelBubble=true must set the stop propagation flag. \ No newline at end of file diff --git a/Tests/LibWeb/Text/expected/wpt-import/dom/events/Event-constants.txt b/Tests/LibWeb/Text/expected/wpt-import/dom/events/Event-constants.txt new file mode 100644 index 00000000000..f0d0f537f3e --- /dev/null +++ b/Tests/LibWeb/Text/expected/wpt-import/dom/events/Event-constants.txt @@ -0,0 +1,10 @@ +Summary + +Harness status: Error + +Rerun + +Found tests + +Details +Result Test Name Message \ No newline at end of file diff --git a/Tests/LibWeb/Text/expected/wpt-import/dom/events/Event-defaultPrevented-after-dispatch.txt b/Tests/LibWeb/Text/expected/wpt-import/dom/events/Event-defaultPrevented-after-dispatch.txt new file mode 100644 index 00000000000..303624cccd3 --- /dev/null +++ b/Tests/LibWeb/Text/expected/wpt-import/dom/events/Event-defaultPrevented-after-dispatch.txt @@ -0,0 +1,12 @@ +Summary + +Harness status: OK + +Rerun + +Found 2 tests + +2 Pass +Details +Result Test Name MessagePass Default prevention via preventDefault +Pass Default prevention via returnValue \ No newline at end of file diff --git a/Tests/LibWeb/Text/expected/wpt-import/dom/events/Event-defaultPrevented.txt b/Tests/LibWeb/Text/expected/wpt-import/dom/events/Event-defaultPrevented.txt new file mode 100644 index 00000000000..d960b4a9b24 --- /dev/null +++ b/Tests/LibWeb/Text/expected/wpt-import/dom/events/Event-defaultPrevented.txt @@ -0,0 +1,18 @@ +Summary + +Harness status: OK + +Rerun + +Found 8 tests + +8 Pass +Details +Result Test Name MessagePass When an event is created, defaultPrevented should be initialized to false. +Pass initEvent should work correctly (not cancelable). +Pass preventDefault() should not change defaultPrevented if cancelable is false. +Pass returnValue should not change defaultPrevented if cancelable is false. +Pass initEvent should work correctly (cancelable). +Pass preventDefault() should change defaultPrevented if cancelable is true. +Pass returnValue should change defaultPrevented if cancelable is true. +Pass initEvent should unset defaultPrevented. \ No newline at end of file diff --git a/Tests/LibWeb/Text/expected/wpt-import/dom/events/Event-dispatch-bubble-canceled.txt b/Tests/LibWeb/Text/expected/wpt-import/dom/events/Event-dispatch-bubble-canceled.txt new file mode 100644 index 00000000000..d3c17e4dc7c --- /dev/null +++ b/Tests/LibWeb/Text/expected/wpt-import/dom/events/Event-dispatch-bubble-canceled.txt @@ -0,0 +1,11 @@ +Summary + +Harness status: OK + +Rerun + +Found 1 tests + +1 Pass +Details +Result Test Name MessagePass Setting cancelBubble=true prior to dispatchEvent() \ No newline at end of file diff --git a/Tests/LibWeb/Text/expected/wpt-import/dom/events/Event-dispatch-bubbles-false.txt b/Tests/LibWeb/Text/expected/wpt-import/dom/events/Event-dispatch-bubbles-false.txt new file mode 100644 index 00000000000..676ad687428 --- /dev/null +++ b/Tests/LibWeb/Text/expected/wpt-import/dom/events/Event-dispatch-bubbles-false.txt @@ -0,0 +1,16 @@ +Summary + +Harness status: OK + +Rerun + +Found 5 tests + +4 Pass +1 Fail +Details +Result Test Name MessageFail In window.document with click event +Pass In window.document with load event +Pass In window.document.cloneNode(true) +Pass In new Document() +Pass In DOMImplementation.createHTMLDocument() \ No newline at end of file diff --git a/Tests/LibWeb/Text/expected/wpt-import/dom/events/Event-dispatch-bubbles-true.txt b/Tests/LibWeb/Text/expected/wpt-import/dom/events/Event-dispatch-bubbles-true.txt new file mode 100644 index 00000000000..676ad687428 --- /dev/null +++ b/Tests/LibWeb/Text/expected/wpt-import/dom/events/Event-dispatch-bubbles-true.txt @@ -0,0 +1,16 @@ +Summary + +Harness status: OK + +Rerun + +Found 5 tests + +4 Pass +1 Fail +Details +Result Test Name MessageFail In window.document with click event +Pass In window.document with load event +Pass In window.document.cloneNode(true) +Pass In new Document() +Pass In DOMImplementation.createHTMLDocument() \ No newline at end of file diff --git a/Tests/LibWeb/Text/expected/wpt-import/dom/events/Event-dispatch-click.tentative.txt b/Tests/LibWeb/Text/expected/wpt-import/dom/events/Event-dispatch-click.tentative.txt new file mode 100644 index 00000000000..3a58de89e5c --- /dev/null +++ b/Tests/LibWeb/Text/expected/wpt-import/dom/events/Event-dispatch-click.tentative.txt @@ -0,0 +1,17 @@ +Summary + +Harness status: OK + +Rerun + +Found 6 tests + +4 Pass +2 Fail +Details +Result Test Name MessagePass disabled checkbox should not be checked from label click +Pass disabled radio should not be checked from label click +Pass disabled checkbox should not be checked from label click by dispatchEvent +Pass disabled radio should not be checked from label click by dispatchEvent +Fail checkbox morphed into another type should not mutate checked state +Fail radio morphed into another type should not steal the existing checked state \ No newline at end of file diff --git a/Tests/LibWeb/Text/expected/wpt-import/dom/events/Event-dispatch-click.txt b/Tests/LibWeb/Text/expected/wpt-import/dom/events/Event-dispatch-click.txt new file mode 100644 index 00000000000..139017ea7d9 --- /dev/null +++ b/Tests/LibWeb/Text/expected/wpt-import/dom/events/Event-dispatch-click.txt @@ -0,0 +1,44 @@ +Summary + +Harness status: OK + +Rerun + +Found 33 tests + +30 Pass +3 Fail +Details +Result Test Name MessagePass basic with click() +Pass basic with dispatchEvent() +Pass basic with wrong event class +Pass look at parents only when event bubbles +Pass look at parents when event bubbles +Pass pick the first with activation behavior +Pass pick the first with activation behavior +Pass pick the first with activation behavior +Pass event state during post-click handling +Pass redispatch during post-click handling +Pass disabled checkbox still has activation behavior +Pass disabled checkbox still has activation behavior, part 2 +Pass disabled radio still has activation behavior +Pass disconnected checkbox should be checked +Pass disconnected radio should be checked +Pass disconnected checkbox should be checked from dispatchEvent(new MouseEvent('click')) +Pass disconnected radio should be checked from dispatchEvent(new MouseEvent('click')) +Pass disabled checkbox should be checked from dispatchEvent(new MouseEvent("click")) +Pass disabled radio should be checked from dispatchEvent(new MouseEvent("click")) +Pass disabled checkbox should fire onclick +Pass disabled radio should fire onclick +Pass disabled checkbox should get legacy-canceled-activation behavior +Pass disabled radio should get legacy-canceled-activation behavior +Pass disabled checkbox should get legacy-canceled-activation behavior 2 +Pass disabled radio should get legacy-canceled-activation behavior 2 +Pass disabling checkbox in onclick listener shouldn't suppress oninput +Pass disabling checkbox in onclick listener shouldn't suppress onchange +Pass disabling radio in onclick listener shouldn't suppress oninput +Pass disabling radio in onclick listener shouldn't suppress onchange +Pass disconnected form should not submit +Fail disabled submit button should not activate +Fail submit button should not activate if the event listener disables it +Fail submit button that morphed from checkbox should not activate \ No newline at end of file diff --git a/Tests/LibWeb/Text/expected/wpt-import/dom/events/Event-dispatch-detached-click.txt b/Tests/LibWeb/Text/expected/wpt-import/dom/events/Event-dispatch-detached-click.txt new file mode 100644 index 00000000000..3b3d92454b6 --- /dev/null +++ b/Tests/LibWeb/Text/expected/wpt-import/dom/events/Event-dispatch-detached-click.txt @@ -0,0 +1,12 @@ +Summary + +Harness status: OK + +Rerun + +Found 2 tests + +2 Pass +Details +Result Test Name MessagePass Click event on an element not in the document +Pass Click event can be dispatched to an element that is not in the document. \ No newline at end of file diff --git a/Tests/LibWeb/Text/expected/wpt-import/dom/events/Event-dispatch-detached-input-and-change.txt b/Tests/LibWeb/Text/expected/wpt-import/dom/events/Event-dispatch-detached-input-and-change.txt new file mode 100644 index 00000000000..31be4064990 --- /dev/null +++ b/Tests/LibWeb/Text/expected/wpt-import/dom/events/Event-dispatch-detached-input-and-change.txt @@ -0,0 +1,22 @@ +Summary + +Harness status: OK + +Rerun + +Found 12 tests + +12 Pass +Details +Result Test Name MessagePass detached checkbox should not emit input or change events on click(). +Pass detached radio should not emit input or change events on click(). +Pass detached checkbox should not emit input or change events on dispatchEvent(new MouseEvent('click')). +Pass detached radio should not emit input or change events on dispatchEvent(new MouseEvent('click')). +Pass attached checkbox should emit input and change events on click(). +Pass attached radio should emit input and change events on click(). +Pass attached checkbox should emit input and change events on dispatchEvent(new MouseEvent('click')). +Pass attached radio should emit input and change events on dispatchEvent(new MouseEvent('click')). +Pass attached to shadow dom checkbox should emit input and change events on click(). +Pass attached to shadow dom radio should emit input and change events on click(). +Pass attached to shadow dom checkbox should emit input and change events on dispatchEvent(new MouseEvent('click')). +Pass attached to shadow dom radio should emit input and change events on dispatchEvent(new MouseEvent('click')). \ No newline at end of file diff --git a/Tests/LibWeb/Text/expected/wpt-import/dom/events/Event-dispatch-handlers-changed.txt b/Tests/LibWeb/Text/expected/wpt-import/dom/events/Event-dispatch-handlers-changed.txt new file mode 100644 index 00000000000..4c03eebba28 --- /dev/null +++ b/Tests/LibWeb/Text/expected/wpt-import/dom/events/Event-dispatch-handlers-changed.txt @@ -0,0 +1,11 @@ +Summary + +Harness status: OK + +Rerun + +Found 1 tests + +1 Fail +Details +Result Test Name MessageFail Dispatch additional events inside an event listener \ No newline at end of file diff --git a/Tests/LibWeb/Text/expected/wpt-import/dom/events/Event-dispatch-multiple-cancelBubble.txt b/Tests/LibWeb/Text/expected/wpt-import/dom/events/Event-dispatch-multiple-cancelBubble.txt new file mode 100644 index 00000000000..5f7befc23eb --- /dev/null +++ b/Tests/LibWeb/Text/expected/wpt-import/dom/events/Event-dispatch-multiple-cancelBubble.txt @@ -0,0 +1,11 @@ +Summary + +Harness status: OK + +Rerun + +Found 1 tests + +1 Fail +Details +Result Test Name MessageFail Multiple dispatchEvent() and cancelBubble \ No newline at end of file diff --git a/Tests/LibWeb/Text/expected/wpt-import/dom/events/Event-dispatch-multiple-stopPropagation.txt b/Tests/LibWeb/Text/expected/wpt-import/dom/events/Event-dispatch-multiple-stopPropagation.txt new file mode 100644 index 00000000000..a5da83a1d99 --- /dev/null +++ b/Tests/LibWeb/Text/expected/wpt-import/dom/events/Event-dispatch-multiple-stopPropagation.txt @@ -0,0 +1,11 @@ +Summary + +Harness status: OK + +Rerun + +Found 1 tests + +1 Fail +Details +Result Test Name MessageFail Multiple dispatchEvent() and stopPropagation() \ No newline at end of file diff --git a/Tests/LibWeb/Text/expected/wpt-import/dom/events/Event-dispatch-omitted-capture.txt b/Tests/LibWeb/Text/expected/wpt-import/dom/events/Event-dispatch-omitted-capture.txt new file mode 100644 index 00000000000..60d3604c9f2 --- /dev/null +++ b/Tests/LibWeb/Text/expected/wpt-import/dom/events/Event-dispatch-omitted-capture.txt @@ -0,0 +1,11 @@ +Summary + +Harness status: OK + +Rerun + +Found 1 tests + +1 Fail +Details +Result Test Name MessageFail EventTarget.addEventListener with the capture argument omitted \ No newline at end of file diff --git a/Tests/LibWeb/Text/expected/wpt-import/dom/events/Event-dispatch-order-at-target.txt b/Tests/LibWeb/Text/expected/wpt-import/dom/events/Event-dispatch-order-at-target.txt new file mode 100644 index 00000000000..d6c382fa445 --- /dev/null +++ b/Tests/LibWeb/Text/expected/wpt-import/dom/events/Event-dispatch-order-at-target.txt @@ -0,0 +1,11 @@ +Summary + +Harness status: OK + +Rerun + +Found 1 tests + +1 Pass +Details +Result Test Name MessagePass Listeners are invoked in correct order (AT_TARGET phase) \ No newline at end of file diff --git a/Tests/LibWeb/Text/expected/wpt-import/dom/events/Event-dispatch-order.txt b/Tests/LibWeb/Text/expected/wpt-import/dom/events/Event-dispatch-order.txt new file mode 100644 index 00000000000..1888be933da --- /dev/null +++ b/Tests/LibWeb/Text/expected/wpt-import/dom/events/Event-dispatch-order.txt @@ -0,0 +1,11 @@ +Summary + +Harness status: OK + +Rerun + +Found 1 tests + +1 Pass +Details +Result Test Name MessagePass Event phases order \ No newline at end of file diff --git a/Tests/LibWeb/Text/expected/wpt-import/dom/events/Event-dispatch-other-document.txt b/Tests/LibWeb/Text/expected/wpt-import/dom/events/Event-dispatch-other-document.txt new file mode 100644 index 00000000000..692717b1b0c --- /dev/null +++ b/Tests/LibWeb/Text/expected/wpt-import/dom/events/Event-dispatch-other-document.txt @@ -0,0 +1,11 @@ +Summary + +Harness status: OK + +Rerun + +Found 1 tests + +1 Pass +Details +Result Test Name MessagePass Custom event on an element in another document \ No newline at end of file diff --git a/Tests/LibWeb/Text/expected/wpt-import/dom/events/Event-dispatch-propagation-stopped.txt b/Tests/LibWeb/Text/expected/wpt-import/dom/events/Event-dispatch-propagation-stopped.txt new file mode 100644 index 00000000000..a6b3a73ae0f --- /dev/null +++ b/Tests/LibWeb/Text/expected/wpt-import/dom/events/Event-dispatch-propagation-stopped.txt @@ -0,0 +1,11 @@ +Summary + +Harness status: OK + +Rerun + +Found 1 tests + +1 Pass +Details +Result Test Name MessagePass Calling stopPropagation() prior to dispatchEvent() \ No newline at end of file diff --git a/Tests/LibWeb/Text/expected/wpt-import/dom/events/Event-dispatch-reenter.txt b/Tests/LibWeb/Text/expected/wpt-import/dom/events/Event-dispatch-reenter.txt new file mode 100644 index 00000000000..4c03eebba28 --- /dev/null +++ b/Tests/LibWeb/Text/expected/wpt-import/dom/events/Event-dispatch-reenter.txt @@ -0,0 +1,11 @@ +Summary + +Harness status: OK + +Rerun + +Found 1 tests + +1 Fail +Details +Result Test Name MessageFail Dispatch additional events inside an event listener \ No newline at end of file diff --git a/Tests/LibWeb/Text/expected/wpt-import/dom/events/Event-dispatch-single-activation-behavior.txt b/Tests/LibWeb/Text/expected/wpt-import/dom/events/Event-dispatch-single-activation-behavior.txt new file mode 100644 index 00000000000..1e9f794ed71 --- /dev/null +++ b/Tests/LibWeb/Text/expected/wpt-import/dom/events/Event-dispatch-single-activation-behavior.txt @@ -0,0 +1,143 @@ +Summary + +Harness status: OK + +Rerun + +Found 132 tests + +103 Pass +29 Fail +Details +Result Test Name MessagePass When clicking child of parent , only child should be activated. +Pass When clicking child of parent
, only child should be activated. +Pass When clicking child of parent
, only child should be activated. +Pass When clicking child of parent
, only child should be activated. +Pass When clicking child of parent
, only child should be activated. +Pass When clicking child of parent
, only child should be activated. +Pass When clicking child of parent
, only child should be activated. +Pass When clicking child of parent , only child should be activated. +Pass When clicking child of parent
, only child should be activated. +Pass When clicking child of parent , only child should be activated. +Pass When clicking child of parent , only child should be activated. +Pass When clicking child of parent , only child should be activated. +Pass When clicking child of parent
, only child should be activated. +Pass When clicking child of parent
, only child should be activated. +Pass When clicking child of parent
, only child should be activated. +Pass When clicking child of parent
, only child should be activated. +Pass When clicking child of parent
, only child should be activated. +Pass When clicking child of parent , only child should be activated. +Pass When clicking child of parent , only child should be activated. +Pass When clicking child of parent
, only child should be activated. +Pass When clicking child of parent , only child should be activated. +Pass When clicking child of parent , only child should be activated. +Pass When clicking child
of parent , only child should be activated. +Pass When clicking child
of parent , only child should be activated. +Fail When clicking child
of parent
, only child should be activated. +Pass When clicking child
of parent
, only child should be activated. +Fail When clicking child
of parent
, only child should be activated. +Pass When clicking child
of parent
, only child should be activated. +Pass When clicking child
of parent , only child should be activated. +Pass When clicking child
of parent , only child should be activated. +Pass When clicking child
of parent
, only child should be activated. +Pass When clicking child
of parent , only child should be activated. +Pass When clicking child
of parent , only child should be activated. +Pass When clicking child
of parent , only child should be activated. +Pass When clicking child
of parent , only child should be activated. +Fail When clicking child
of parent
, only child should be activated. +Pass When clicking child
of parent
, only child should be activated. +Fail When clicking child
of parent
, only child should be activated. +Pass When clicking child
of parent
, only child should be activated. +Pass When clicking child
of parent , only child should be activated. +Pass When clicking child
of parent , only child should be activated. +Pass When clicking child
of parent
, only child should be activated. +Pass When clicking child
of parent , only child should be activated. +Pass When clicking child
of parent , only child should be activated. +Pass When clicking child
of parent , only child should be activated. +Pass When clicking child
of parent , only child should be activated. +Pass When clicking child
of parent
, only child should be activated. +Pass When clicking child
of parent
, only child should be activated. +Pass When clicking child
of parent
, only child should be activated. +Fail When clicking child
of parent
, only child should be activated. +Pass When clicking child
of parent , only child should be activated. +Pass When clicking child
of parent , only child should be activated. +Pass When clicking child
of parent
, only child should be activated. +Pass When clicking child
of parent , only child should be activated. +Pass When clicking child
of parent , only child should be activated. +Pass When clicking child
of parent , only child should be activated. +Pass When clicking child
of parent , only child should be activated. +Fail When clicking child
of parent
, only child should be activated. +Fail When clicking child
of parent
, only child should be activated. +Pass When clicking child
of parent
, only child should be activated. +Pass When clicking child
of parent
, only child should be activated. +Pass When clicking child
of parent , only child should be activated. +Pass When clicking child
of parent , only child should be activated. +Pass When clicking child
of parent
, only child should be activated. +Pass When clicking child
of parent , only child should be activated. +Pass When clicking child
of parent , only child should be activated. +Pass When clicking child
of parent , only child should be activated. +Pass When clicking child
of parent , only child should be activated. +Pass When clicking child
of parent
, only child should be activated. +Pass When clicking child
of parent
, only child should be activated. +Fail When clicking child
of parent
, only child should be activated. +Pass When clicking child
of parent
, only child should be activated. +Pass When clicking child
of parent , only child should be activated. +Pass When clicking child
of parent , only child should be activated. +Pass When clicking child
of parent
, only child should be activated. +Pass When clicking child
of parent , only child should be activated. +Pass When clicking child
of parent , only child should be activated. +Pass When clicking child of parent , only child should be activated. +Pass When clicking child of parent , only child should be activated. +Pass When clicking child of parent
, only child should be activated. +Pass When clicking child of parent
, only child should be activated. +Pass When clicking child of parent
, only child should be activated. +Pass When clicking child of parent
, only child should be activated. +Pass When clicking child of parent
, only child should be activated. +Pass When clicking child of parent , only child should be activated. +Pass When clicking child of parent
, only child should be activated. +Pass When clicking child of parent , only child should be activated. +Pass When clicking child of parent , only child should be activated. +Fail When clicking child of parent , only child should be activated. +Fail When clicking child of parent , only child should be activated. +Fail When clicking child of parent
, only child should be activated. +Fail When clicking child of parent
, only child should be activated. +Fail When clicking child of parent
, only child should be activated. +Fail When clicking child of parent
, only child should be activated. +Fail When clicking child of parent
, only child should be activated. +Pass When clicking child of parent , only child should be activated. +Fail When clicking child of parent
, only child should be activated. +Fail When clicking child of parent , only child should be activated. +Fail When clicking child of parent , only child should be activated. +Pass When clicking child
of parent , only child should be activated. +Pass When clicking child
of parent , only child should be activated. +Pass When clicking child
of parent
, only child should be activated. +Pass When clicking child
of parent
, only child should be activated. +Pass When clicking child
of parent
, only child should be activated. +Pass When clicking child
of parent
, only child should be activated. +Pass When clicking child
of parent
, only child should be activated. +Pass When clicking child
of parent , only child should be activated. +Pass When clicking child
of parent , only child should be activated. +Pass When clicking child
of parent , only child should be activated. +Pass When clicking child
of parent , only child should be activated. +Fail When clicking child of parent , only child should be activated. +Fail When clicking child of parent , only child should be activated. +Fail When clicking child of parent
, only child should be activated. +Fail When clicking child of parent
, only child should be activated. +Fail When clicking child of parent
, only child should be activated. +Fail When clicking child of parent
, only child should be activated. +Fail When clicking child of parent
, only child should be activated. +Fail When clicking child of parent , only child should be activated. +Fail When clicking child of parent , only child should be activated. +Fail When clicking child of parent
, only child should be activated. +Fail When clicking child of parent , only child should be activated. +Pass When clicking child of parent , only child should be activated. +Pass When clicking child of parent , only child should be activated. +Pass When clicking child of parent
, only child should be activated. +Pass When clicking child of parent
, only child should be activated. +Pass When clicking child of parent
, only child should be activated. +Pass When clicking child of parent
, only child should be activated. +Pass When clicking child of parent
, only child should be activated. +Pass When clicking child of parent , only child should be activated. +Pass When clicking child of parent , only child should be activated. +Pass When clicking child of parent
, only child should be activated. +Pass When clicking child of parent , only child should be activated. \ No newline at end of file diff --git a/Tests/LibWeb/Text/expected/wpt-import/dom/events/Event-dispatch-target-moved.txt b/Tests/LibWeb/Text/expected/wpt-import/dom/events/Event-dispatch-target-moved.txt new file mode 100644 index 00000000000..cceb9dc7198 --- /dev/null +++ b/Tests/LibWeb/Text/expected/wpt-import/dom/events/Event-dispatch-target-moved.txt @@ -0,0 +1,11 @@ +Summary + +Harness status: OK + +Rerun + +Found 1 tests + +1 Fail +Details +Result Test Name MessageFail Event propagation path when an element in it is moved within the DOM \ No newline at end of file diff --git a/Tests/LibWeb/Text/expected/wpt-import/dom/events/Event-dispatch-target-removed.txt b/Tests/LibWeb/Text/expected/wpt-import/dom/events/Event-dispatch-target-removed.txt new file mode 100644 index 00000000000..f18dda177e6 --- /dev/null +++ b/Tests/LibWeb/Text/expected/wpt-import/dom/events/Event-dispatch-target-removed.txt @@ -0,0 +1,11 @@ +Summary + +Harness status: OK + +Rerun + +Found 1 tests + +1 Fail +Details +Result Test Name MessageFail Event propagation path when an element in it is removed from the DOM \ No newline at end of file diff --git a/Tests/LibWeb/Text/expected/wpt-import/dom/events/Event-dispatch-throwing-multiple-globals.txt b/Tests/LibWeb/Text/expected/wpt-import/dom/events/Event-dispatch-throwing-multiple-globals.txt new file mode 100644 index 00000000000..a4f93ed089c --- /dev/null +++ b/Tests/LibWeb/Text/expected/wpt-import/dom/events/Event-dispatch-throwing-multiple-globals.txt @@ -0,0 +1,12 @@ +Summary + +Harness status: OK + +Rerun + +Found 2 tests + +2 Fail +Details +Result Test Name MessageFail exception thrown in event listener function should result in error event on listener's global +Fail exception thrown in event listener interface object should result in error event on listener's global \ No newline at end of file diff --git a/Tests/LibWeb/Text/expected/wpt-import/dom/events/Event-dispatch-throwing.txt b/Tests/LibWeb/Text/expected/wpt-import/dom/events/Event-dispatch-throwing.txt new file mode 100644 index 00000000000..a6bbba7e660 --- /dev/null +++ b/Tests/LibWeb/Text/expected/wpt-import/dom/events/Event-dispatch-throwing.txt @@ -0,0 +1,12 @@ +Summary + +Harness status: OK + +Rerun + +Found 2 tests + +2 Pass +Details +Result Test Name MessagePass Throwing in event listener with a single listeners +Pass Throwing in event listener with multiple listeners \ No newline at end of file diff --git a/Tests/LibWeb/Text/expected/wpt-import/dom/events/Event-init-while-dispatching.txt b/Tests/LibWeb/Text/expected/wpt-import/dom/events/Event-init-while-dispatching.txt new file mode 100644 index 00000000000..4157cb77678 --- /dev/null +++ b/Tests/LibWeb/Text/expected/wpt-import/dom/events/Event-init-while-dispatching.txt @@ -0,0 +1,16 @@ +Summary + +Harness status: OK + +Rerun + +Found 5 tests + +4 Pass +1 Fail +Details +Result Test Name MessagePass Calling initKeyboardEvent while dispatching. +Pass Calling initMouseEvent while dispatching. +Pass Calling initCustomEvent while dispatching. +Fail Calling initUIEvent while dispatching. Not an object of type Window +Pass Calling initEvent while dispatching. \ No newline at end of file diff --git a/Tests/LibWeb/Text/expected/wpt-import/dom/events/Event-initEvent.txt b/Tests/LibWeb/Text/expected/wpt-import/dom/events/Event-initEvent.txt new file mode 100644 index 00000000000..bcf06522919 --- /dev/null +++ b/Tests/LibWeb/Text/expected/wpt-import/dom/events/Event-initEvent.txt @@ -0,0 +1,22 @@ +Summary + +Harness status: OK + +Rerun + +Found 12 tests + +12 Pass +Details +Result Test Name MessagePass Properties of initEvent(type, true, true) +Pass Properties of initEvent(type, true, false) +Pass Properties of initEvent(type, false, true) +Pass Properties of initEvent(type, false, false) +Pass Calling initEvent multiple times (getting type). +Pass Calling initEvent multiple times (not getting type). +Pass Calling initEvent must not have an effect during dispatching. +Pass Calling initEvent must unset the stop propagation flag. +Pass Calling initEvent must unset the stop immediate propagation flag. +Pass Calling initEvent during propagation. +Pass First parameter to initEvent should be mandatory. +Pass Tests initEvent's default parameter values. \ No newline at end of file diff --git a/Tests/LibWeb/Text/expected/wpt-import/dom/events/Event-propagation.txt b/Tests/LibWeb/Text/expected/wpt-import/dom/events/Event-propagation.txt new file mode 100644 index 00000000000..75d1379ad02 --- /dev/null +++ b/Tests/LibWeb/Text/expected/wpt-import/dom/events/Event-propagation.txt @@ -0,0 +1,17 @@ +Summary + +Harness status: OK + +Rerun + +Found 7 tests + +7 Pass +Details +Result Test Name MessagePass Newly-created Event +Pass After stopPropagation() +Pass Reinitialized after stopPropagation() +Pass After stopImmediatePropagation() +Pass Reinitialized after stopImmediatePropagation() +Pass After cancelBubble=true +Pass Reinitialized after cancelBubble=true \ No newline at end of file diff --git a/Tests/LibWeb/Text/expected/wpt-import/dom/events/Event-returnValue.txt b/Tests/LibWeb/Text/expected/wpt-import/dom/events/Event-returnValue.txt new file mode 100644 index 00000000000..f3b612ca034 --- /dev/null +++ b/Tests/LibWeb/Text/expected/wpt-import/dom/events/Event-returnValue.txt @@ -0,0 +1,17 @@ +Summary + +Harness status: OK + +Rerun + +Found 7 tests + +7 Pass +Details +Result Test Name MessagePass When an event is created, returnValue should be initialized to true. +Pass preventDefault() should not change returnValue if cancelable is false. +Pass returnValue=false should have no effect if cancelable is false. +Pass preventDefault() should change returnValue if cancelable is true. +Pass returnValue should change returnValue if cancelable is true. +Pass initEvent should unset returnValue. +Pass returnValue=true should have no effect once the canceled flag was set. \ No newline at end of file diff --git a/Tests/LibWeb/Text/expected/wpt-import/dom/events/Event-stopImmediatePropagation.txt b/Tests/LibWeb/Text/expected/wpt-import/dom/events/Event-stopImmediatePropagation.txt new file mode 100644 index 00000000000..2856f7b3c93 --- /dev/null +++ b/Tests/LibWeb/Text/expected/wpt-import/dom/events/Event-stopImmediatePropagation.txt @@ -0,0 +1,11 @@ +Summary + +Harness status: OK + +Rerun + +Found 1 tests + +1 Pass +Details +Result Test Name MessagePass Event's stopImmediatePropagation \ No newline at end of file diff --git a/Tests/LibWeb/Text/expected/wpt-import/dom/events/Event-stopPropagation-cancel-bubbling.txt b/Tests/LibWeb/Text/expected/wpt-import/dom/events/Event-stopPropagation-cancel-bubbling.txt new file mode 100644 index 00000000000..304976625fb --- /dev/null +++ b/Tests/LibWeb/Text/expected/wpt-import/dom/events/Event-stopPropagation-cancel-bubbling.txt @@ -0,0 +1,11 @@ +Summary + +Harness status: OK + +Rerun + +Found 1 tests + +1 Pass +Details +Result Test Name MessagePass Event-stopPropagation-cancel-bubbling \ No newline at end of file diff --git a/Tests/LibWeb/Text/expected/wpt-import/dom/events/Event-subclasses-constructors.txt b/Tests/LibWeb/Text/expected/wpt-import/dom/events/Event-subclasses-constructors.txt new file mode 100644 index 00000000000..fa23229c0ef --- /dev/null +++ b/Tests/LibWeb/Text/expected/wpt-import/dom/events/Event-subclasses-constructors.txt @@ -0,0 +1,60 @@ +Summary + +Harness status: OK + +Rerun + +Found 49 tests + +43 Pass +6 Fail +Details +Result Test Name MessagePass Event constructor (no argument) +Pass Event constructor (undefined argument) +Pass Event constructor (null argument) +Pass Event constructor (empty argument) +Pass Event constructor (argument with default values) +Pass Event constructor (argument with non-default values) +Pass UIEvent constructor (no argument) +Pass UIEvent constructor (undefined argument) +Pass UIEvent constructor (null argument) +Pass UIEvent constructor (empty argument) +Pass UIEvent constructor (argument with default values) +Fail UIEvent constructor (argument with non-default values) Not an object of type Window +Pass FocusEvent constructor (no argument) +Pass FocusEvent constructor (undefined argument) +Pass FocusEvent constructor (null argument) +Pass FocusEvent constructor (empty argument) +Pass FocusEvent constructor (argument with default values) +Fail FocusEvent constructor (argument with non-default values) Not an object of type Window +Pass MouseEvent constructor (no argument) +Pass MouseEvent constructor (undefined argument) +Pass MouseEvent constructor (null argument) +Pass MouseEvent constructor (empty argument) +Pass MouseEvent constructor (argument with default values) +Fail MouseEvent constructor (argument with non-default values) Not an object of type Window +Pass WheelEvent constructor (no argument) +Pass WheelEvent constructor (undefined argument) +Pass WheelEvent constructor (null argument) +Pass WheelEvent constructor (empty argument) +Pass WheelEvent constructor (argument with default values) +Fail WheelEvent constructor (argument with non-default values) Not an object of type Window +Pass KeyboardEvent constructor (no argument) +Pass KeyboardEvent constructor (undefined argument) +Pass KeyboardEvent constructor (null argument) +Pass KeyboardEvent constructor (empty argument) +Pass KeyboardEvent constructor (argument with default values) +Fail KeyboardEvent constructor (argument with non-default values) Not an object of type Window +Pass CompositionEvent constructor (no argument) +Pass CompositionEvent constructor (undefined argument) +Pass CompositionEvent constructor (null argument) +Pass CompositionEvent constructor (empty argument) +Pass CompositionEvent constructor (argument with default values) +Fail CompositionEvent constructor (argument with non-default values) Not an object of type Window +Pass SubclassedEvent constructor (no argument) +Pass SubclassedEvent constructor (undefined argument) +Pass SubclassedEvent constructor (null argument) +Pass SubclassedEvent constructor (empty argument) +Pass SubclassedEvent constructor (argument with default values) +Pass SubclassedEvent constructor (argument with non-default values) +Pass UIEvent constructor (view argument with wrong type) \ No newline at end of file diff --git a/Tests/LibWeb/Text/expected/wpt-import/dom/events/Event-timestamp-cross-realm-getter.txt b/Tests/LibWeb/Text/expected/wpt-import/dom/events/Event-timestamp-cross-realm-getter.txt new file mode 100644 index 00000000000..1ceb23a64f3 --- /dev/null +++ b/Tests/LibWeb/Text/expected/wpt-import/dom/events/Event-timestamp-cross-realm-getter.txt @@ -0,0 +1,11 @@ +Summary + +Harness status: OK + +Rerun + +Found 1 tests + +1 Pass +Details +Result Test Name MessagePass event.timeStamp is initialized using event's relevant global object \ No newline at end of file diff --git a/Tests/LibWeb/Text/expected/wpt-import/dom/events/Event-timestamp-high-resolution.https.txt b/Tests/LibWeb/Text/expected/wpt-import/dom/events/Event-timestamp-high-resolution.https.txt new file mode 100644 index 00000000000..1e9b3d18239 --- /dev/null +++ b/Tests/LibWeb/Text/expected/wpt-import/dom/events/Event-timestamp-high-resolution.https.txt @@ -0,0 +1,11 @@ +Summary + +Harness status: OK + +Rerun + +Found 1 tests + +1 Fail +Details +Result Test Name MessageFail Constructed GamepadEvent timestamp should be high resolution and have the same time origin as performance.now() undefined is not a constructor (evaluated from 'window[]') \ No newline at end of file diff --git a/Tests/LibWeb/Text/expected/wpt-import/dom/events/Event-timestamp-high-resolution.txt b/Tests/LibWeb/Text/expected/wpt-import/dom/events/Event-timestamp-high-resolution.txt new file mode 100644 index 00000000000..21feddbc99e --- /dev/null +++ b/Tests/LibWeb/Text/expected/wpt-import/dom/events/Event-timestamp-high-resolution.txt @@ -0,0 +1,14 @@ +Summary + +Harness status: OK + +Rerun + +Found 4 tests + +4 Pass +Details +Result Test Name MessagePass Constructed MouseEvent timestamp should be high resolution and have the same time origin as performance.now() +Pass Constructed KeyboardEvent timestamp should be high resolution and have the same time origin as performance.now() +Pass Constructed WheelEvent timestamp should be high resolution and have the same time origin as performance.now() +Pass Constructed FocusEvent timestamp should be high resolution and have the same time origin as performance.now() \ No newline at end of file diff --git a/Tests/LibWeb/Text/expected/wpt-import/dom/events/Event-timestamp-safe-resolution.txt b/Tests/LibWeb/Text/expected/wpt-import/dom/events/Event-timestamp-safe-resolution.txt new file mode 100644 index 00000000000..8a8fe297ea8 --- /dev/null +++ b/Tests/LibWeb/Text/expected/wpt-import/dom/events/Event-timestamp-safe-resolution.txt @@ -0,0 +1,11 @@ +Summary + +Harness status: OK + +Rerun + +Found 1 tests + +1 Fail +Details +Result Test Name MessageFail Event timestamp should not have a resolution better than 5 microseconds \ No newline at end of file diff --git a/Tests/LibWeb/Text/expected/wpt-import/dom/events/Event-type-empty.txt b/Tests/LibWeb/Text/expected/wpt-import/dom/events/Event-type-empty.txt new file mode 100644 index 00000000000..c08935b362e --- /dev/null +++ b/Tests/LibWeb/Text/expected/wpt-import/dom/events/Event-type-empty.txt @@ -0,0 +1,12 @@ +Summary + +Harness status: OK + +Rerun + +Found 2 tests + +2 Pass +Details +Result Test Name MessagePass initEvent +Pass Constructor \ No newline at end of file diff --git a/Tests/LibWeb/Text/expected/wpt-import/dom/events/Event-type.txt b/Tests/LibWeb/Text/expected/wpt-import/dom/events/Event-type.txt new file mode 100644 index 00000000000..e815e26a159 --- /dev/null +++ b/Tests/LibWeb/Text/expected/wpt-import/dom/events/Event-type.txt @@ -0,0 +1,13 @@ +Summary + +Harness status: OK + +Rerun + +Found 3 tests + +3 Pass +Details +Result Test Name MessagePass Event.type should initially be the empty string +Pass Event.type should be initialized by initEvent +Pass Event.type should be initialized by the constructor \ No newline at end of file diff --git a/Tests/LibWeb/Text/expected/wpt-import/dom/events/EventListener-handleEvent.txt b/Tests/LibWeb/Text/expected/wpt-import/dom/events/EventListener-handleEvent.txt new file mode 100644 index 00000000000..6cc70959fd0 --- /dev/null +++ b/Tests/LibWeb/Text/expected/wpt-import/dom/events/EventListener-handleEvent.txt @@ -0,0 +1,16 @@ +Summary + +Harness status: OK + +Rerun + +Found 6 tests + +6 Pass +Details +Result Test Name MessagePass calls `handleEvent` method of `EventListener` +Pass performs `Get` every time event is dispatched +Pass doesn't call `handleEvent` method on callable `EventListener` +Pass rethrows errors when getting `handleEvent` +Pass throws if `handleEvent` is falsy and not callable +Pass throws if `handleEvent` is thruthy and not callable \ No newline at end of file diff --git a/Tests/LibWeb/Text/expected/wpt-import/dom/events/EventListenerOptions-capture.txt b/Tests/LibWeb/Text/expected/wpt-import/dom/events/EventListenerOptions-capture.txt new file mode 100644 index 00000000000..1f15aa46994 --- /dev/null +++ b/Tests/LibWeb/Text/expected/wpt-import/dom/events/EventListenerOptions-capture.txt @@ -0,0 +1,14 @@ +Summary + +Harness status: OK + +Rerun + +Found 4 tests + +4 Pass +Details +Result Test Name MessagePass Capture boolean should be honored correctly +Pass Capture option should be honored correctly +Pass Supports capture option +Pass Equivalence of option values \ No newline at end of file diff --git a/Tests/LibWeb/Text/expected/wpt-import/dom/events/EventTarget-add-listener-platform-object.txt b/Tests/LibWeb/Text/expected/wpt-import/dom/events/EventTarget-add-listener-platform-object.txt new file mode 100644 index 00000000000..b4612687f9f --- /dev/null +++ b/Tests/LibWeb/Text/expected/wpt-import/dom/events/EventTarget-add-listener-platform-object.txt @@ -0,0 +1,11 @@ +Summary + +Harness status: OK + +Rerun + +Found 1 tests + +1 Pass +Details +Result Test Name MessagePass addEventListener with a platform object \ No newline at end of file diff --git a/Tests/LibWeb/Text/expected/wpt-import/dom/events/EventTarget-dispatchEvent-returnvalue.txt b/Tests/LibWeb/Text/expected/wpt-import/dom/events/EventTarget-dispatchEvent-returnvalue.txt new file mode 100644 index 00000000000..3577f2e256d --- /dev/null +++ b/Tests/LibWeb/Text/expected/wpt-import/dom/events/EventTarget-dispatchEvent-returnvalue.txt @@ -0,0 +1,12 @@ +Summary + +Harness status: OK + +Rerun + +Found 2 tests + +2 Pass +Details +Result Test Name MessagePass Return value of EventTarget.dispatchEvent() affected by preventDefault(). +Pass Return value of EventTarget.dispatchEvent() affected by returnValue. \ No newline at end of file diff --git a/Tests/LibWeb/Text/expected/wpt-import/dom/events/EventTarget-dispatchEvent.txt b/Tests/LibWeb/Text/expected/wpt-import/dom/events/EventTarget-dispatchEvent.txt new file mode 100644 index 00000000000..00a5de00784 --- /dev/null +++ b/Tests/LibWeb/Text/expected/wpt-import/dom/events/EventTarget-dispatchEvent.txt @@ -0,0 +1,35 @@ +Summary + +Harness status: OK + +Rerun + +Found 25 tests + +25 Pass +Details +Result Test Name MessagePass Calling dispatchEvent(null). +Pass If the event's initialized flag is not set, an InvalidStateError must be thrown (BeforeUnloadEvent). +Pass If the event's initialized flag is not set, an InvalidStateError must be thrown (CompositionEvent). +Pass If the event's initialized flag is not set, an InvalidStateError must be thrown (CustomEvent). +Pass If the event's initialized flag is not set, an InvalidStateError must be thrown (DeviceMotionEvent). +Pass If the event's initialized flag is not set, an InvalidStateError must be thrown (DeviceOrientationEvent). +Pass If the event's initialized flag is not set, an InvalidStateError must be thrown (DragEvent). +Pass If the event's initialized flag is not set, an InvalidStateError must be thrown (Event). +Pass If the event's initialized flag is not set, an InvalidStateError must be thrown (Events). +Pass If the event's initialized flag is not set, an InvalidStateError must be thrown (FocusEvent). +Pass If the event's initialized flag is not set, an InvalidStateError must be thrown (HashChangeEvent). +Pass If the event's initialized flag is not set, an InvalidStateError must be thrown (HTMLEvents). +Pass If the event's initialized flag is not set, an InvalidStateError must be thrown (KeyboardEvent). +Pass If the event's initialized flag is not set, an InvalidStateError must be thrown (MessageEvent). +Pass If the event's initialized flag is not set, an InvalidStateError must be thrown (MouseEvent). +Pass If the event's initialized flag is not set, an InvalidStateError must be thrown (MouseEvents). +Pass If the event's initialized flag is not set, an InvalidStateError must be thrown (StorageEvent). +Pass If the event's initialized flag is not set, an InvalidStateError must be thrown (SVGEvents). +Pass If the event's initialized flag is not set, an InvalidStateError must be thrown (TextEvent). +Pass If the event's initialized flag is not set, an InvalidStateError must be thrown (UIEvent). +Pass If the event's initialized flag is not set, an InvalidStateError must be thrown (UIEvents). +Pass If the event's dispatch flag is set, an InvalidStateError must be thrown. +Pass Exceptions from event listeners must not be propagated. +Pass Event listeners added during dispatch should be called +Pass Capturing event listeners should be called before non-capturing ones \ No newline at end of file diff --git a/Tests/LibWeb/Text/expected/wpt-import/dom/events/EventTarget-this-of-listener.txt b/Tests/LibWeb/Text/expected/wpt-import/dom/events/EventTarget-this-of-listener.txt new file mode 100644 index 00000000000..9b7ab8896b1 --- /dev/null +++ b/Tests/LibWeb/Text/expected/wpt-import/dom/events/EventTarget-this-of-listener.txt @@ -0,0 +1,16 @@ +Summary + +Harness status: OK + +Rerun + +Found 6 tests + +6 Pass +Details +Result Test Name MessagePass the this value inside the event listener callback should be the node +Pass the this value inside the event listener object handleEvent should be the object +Pass dispatchEvent should invoke the current handleEvent method of the object +Pass addEventListener should not require handleEvent to be defined on object listeners +Pass handleEvent properties added to a function before addEventListener are not reached +Pass handleEvent properties added to a function after addEventListener are not reached \ No newline at end of file diff --git a/Tests/LibWeb/Text/expected/wpt-import/dom/events/KeyEvent-initKeyEvent.txt b/Tests/LibWeb/Text/expected/wpt-import/dom/events/KeyEvent-initKeyEvent.txt new file mode 100644 index 00000000000..1820c075d8b --- /dev/null +++ b/Tests/LibWeb/Text/expected/wpt-import/dom/events/KeyEvent-initKeyEvent.txt @@ -0,0 +1,13 @@ +Summary + +Harness status: OK + +Rerun + +Found 3 tests + +3 Pass +Details +Result Test Name MessagePass KeyboardEvent.initKeyEvent shouldn't be defined (created by createEvent("KeyboardEvent") +Pass KeyboardEvent.initKeyEvent shouldn't be defined (created by constructor) +Pass KeyboardEvent.prototype.initKeyEvent shouldn't be defined \ No newline at end of file diff --git a/Tests/LibWeb/Text/expected/wpt-import/dom/events/event-disabled-dynamic.txt b/Tests/LibWeb/Text/expected/wpt-import/dom/events/event-disabled-dynamic.txt new file mode 100644 index 00000000000..06acb7012c5 --- /dev/null +++ b/Tests/LibWeb/Text/expected/wpt-import/dom/events/event-disabled-dynamic.txt @@ -0,0 +1,11 @@ +Summary + +Harness status: OK + +Rerun + +Found 1 tests + +1 Pass +Details +Result Test Name MessagePass disabled is honored properly in presence of dynamic changes \ No newline at end of file diff --git a/Tests/LibWeb/Text/expected/wpt-import/dom/events/event-global.txt b/Tests/LibWeb/Text/expected/wpt-import/dom/events/event-global.txt new file mode 100644 index 00000000000..f2cc61b872f --- /dev/null +++ b/Tests/LibWeb/Text/expected/wpt-import/dom/events/event-global.txt @@ -0,0 +1,19 @@ +Summary + +Harness status: OK + +Rerun + +Found 8 tests + +7 Pass +1 Fail +Details +Result Test Name MessagePass event exists on window, which is initially set to undefined +Pass window.event is only defined during dispatch +Pass window.event is undefined if the target is in a shadow tree (event dispatched outside shadow tree) +Pass window.event is undefined if the target is in a shadow tree (event dispatched inside shadow tree) +Fail window.event is undefined inside window.onerror if the target is in a shadow tree (ErrorEvent dispatched inside shadow tree) +Pass window.event is set to the current event during dispatch +Pass window.event is set to the current event, which is the event passed to dispatch +Pass window.event is set to the current event, which is the event passed to dispatch (2) \ No newline at end of file diff --git a/Tests/LibWeb/Text/expected/wpt-import/dom/events/mouse-event-retarget.txt b/Tests/LibWeb/Text/expected/wpt-import/dom/events/mouse-event-retarget.txt new file mode 100644 index 00000000000..1d8c46f179f --- /dev/null +++ b/Tests/LibWeb/Text/expected/wpt-import/dom/events/mouse-event-retarget.txt @@ -0,0 +1,11 @@ +Summary + +Harness status: OK + +Rerun + +Found 1 tests + +1 Fail +Details +Result Test Name MessageFail offsetX is correctly adjusted \ No newline at end of file diff --git a/Tests/LibWeb/Text/expected/wpt-import/dom/events/passive-by-default.txt b/Tests/LibWeb/Text/expected/wpt-import/dom/events/passive-by-default.txt new file mode 100644 index 00000000000..ebcc2067da0 --- /dev/null +++ b/Tests/LibWeb/Text/expected/wpt-import/dom/events/passive-by-default.txt @@ -0,0 +1,111 @@ +Summary + +Harness status: OK + +Rerun + +Found 100 tests + +68 Pass +32 Fail +Details +Result Test Name MessageFail touchstart listener is passive by default for Window +Fail touchstart listener is passive with {passive:undefined} for Window +Pass touchstart listener is non-passive with {passive:false} for Window +Pass touchstart listener is passive with {passive:true} for Window +Fail touchstart listener is passive by default for HTMLDocument +Fail touchstart listener is passive with {passive:undefined} for HTMLDocument +Pass touchstart listener is non-passive with {passive:false} for HTMLDocument +Pass touchstart listener is passive with {passive:true} for HTMLDocument +Fail touchstart listener is passive by default for HTMLHtmlElement +Fail touchstart listener is passive with {passive:undefined} for HTMLHtmlElement +Pass touchstart listener is non-passive with {passive:false} for HTMLHtmlElement +Pass touchstart listener is passive with {passive:true} for HTMLHtmlElement +Fail touchstart listener is passive by default for HTMLBodyElement +Fail touchstart listener is passive with {passive:undefined} for HTMLBodyElement +Pass touchstart listener is non-passive with {passive:false} for HTMLBodyElement +Pass touchstart listener is passive with {passive:true} for HTMLBodyElement +Pass touchstart listener is non-passive by default for HTMLDivElement +Pass touchstart listener is non-passive with {passive:undefined} for HTMLDivElement +Pass touchstart listener is non-passive with {passive:false} for HTMLDivElement +Pass touchstart listener is passive with {passive:true} for HTMLDivElement +Fail touchmove listener is passive by default for Window +Fail touchmove listener is passive with {passive:undefined} for Window +Pass touchmove listener is non-passive with {passive:false} for Window +Pass touchmove listener is passive with {passive:true} for Window +Fail touchmove listener is passive by default for HTMLDocument +Fail touchmove listener is passive with {passive:undefined} for HTMLDocument +Pass touchmove listener is non-passive with {passive:false} for HTMLDocument +Pass touchmove listener is passive with {passive:true} for HTMLDocument +Fail touchmove listener is passive by default for HTMLHtmlElement +Fail touchmove listener is passive with {passive:undefined} for HTMLHtmlElement +Pass touchmove listener is non-passive with {passive:false} for HTMLHtmlElement +Pass touchmove listener is passive with {passive:true} for HTMLHtmlElement +Fail touchmove listener is passive by default for HTMLBodyElement +Fail touchmove listener is passive with {passive:undefined} for HTMLBodyElement +Pass touchmove listener is non-passive with {passive:false} for HTMLBodyElement +Pass touchmove listener is passive with {passive:true} for HTMLBodyElement +Pass touchmove listener is non-passive by default for HTMLDivElement +Pass touchmove listener is non-passive with {passive:undefined} for HTMLDivElement +Pass touchmove listener is non-passive with {passive:false} for HTMLDivElement +Pass touchmove listener is passive with {passive:true} for HTMLDivElement +Fail wheel listener is passive by default for Window +Fail wheel listener is passive with {passive:undefined} for Window +Pass wheel listener is non-passive with {passive:false} for Window +Pass wheel listener is passive with {passive:true} for Window +Fail wheel listener is passive by default for HTMLDocument +Fail wheel listener is passive with {passive:undefined} for HTMLDocument +Pass wheel listener is non-passive with {passive:false} for HTMLDocument +Pass wheel listener is passive with {passive:true} for HTMLDocument +Fail wheel listener is passive by default for HTMLHtmlElement +Fail wheel listener is passive with {passive:undefined} for HTMLHtmlElement +Pass wheel listener is non-passive with {passive:false} for HTMLHtmlElement +Pass wheel listener is passive with {passive:true} for HTMLHtmlElement +Fail wheel listener is passive by default for HTMLBodyElement +Fail wheel listener is passive with {passive:undefined} for HTMLBodyElement +Pass wheel listener is non-passive with {passive:false} for HTMLBodyElement +Pass wheel listener is passive with {passive:true} for HTMLBodyElement +Pass wheel listener is non-passive by default for HTMLDivElement +Pass wheel listener is non-passive with {passive:undefined} for HTMLDivElement +Pass wheel listener is non-passive with {passive:false} for HTMLDivElement +Pass wheel listener is passive with {passive:true} for HTMLDivElement +Fail mousewheel listener is passive by default for Window +Fail mousewheel listener is passive with {passive:undefined} for Window +Pass mousewheel listener is non-passive with {passive:false} for Window +Pass mousewheel listener is passive with {passive:true} for Window +Fail mousewheel listener is passive by default for HTMLDocument +Fail mousewheel listener is passive with {passive:undefined} for HTMLDocument +Pass mousewheel listener is non-passive with {passive:false} for HTMLDocument +Pass mousewheel listener is passive with {passive:true} for HTMLDocument +Fail mousewheel listener is passive by default for HTMLHtmlElement +Fail mousewheel listener is passive with {passive:undefined} for HTMLHtmlElement +Pass mousewheel listener is non-passive with {passive:false} for HTMLHtmlElement +Pass mousewheel listener is passive with {passive:true} for HTMLHtmlElement +Fail mousewheel listener is passive by default for HTMLBodyElement +Fail mousewheel listener is passive with {passive:undefined} for HTMLBodyElement +Pass mousewheel listener is non-passive with {passive:false} for HTMLBodyElement +Pass mousewheel listener is passive with {passive:true} for HTMLBodyElement +Pass mousewheel listener is non-passive by default for HTMLDivElement +Pass mousewheel listener is non-passive with {passive:undefined} for HTMLDivElement +Pass mousewheel listener is non-passive with {passive:false} for HTMLDivElement +Pass mousewheel listener is passive with {passive:true} for HTMLDivElement +Pass touchend listener is non-passive by default for Window +Pass touchend listener is non-passive with {passive:undefined} for Window +Pass touchend listener is non-passive with {passive:false} for Window +Pass touchend listener is passive with {passive:true} for Window +Pass touchend listener is non-passive by default for HTMLDocument +Pass touchend listener is non-passive with {passive:undefined} for HTMLDocument +Pass touchend listener is non-passive with {passive:false} for HTMLDocument +Pass touchend listener is passive with {passive:true} for HTMLDocument +Pass touchend listener is non-passive by default for HTMLHtmlElement +Pass touchend listener is non-passive with {passive:undefined} for HTMLHtmlElement +Pass touchend listener is non-passive with {passive:false} for HTMLHtmlElement +Pass touchend listener is passive with {passive:true} for HTMLHtmlElement +Pass touchend listener is non-passive by default for HTMLBodyElement +Pass touchend listener is non-passive with {passive:undefined} for HTMLBodyElement +Pass touchend listener is non-passive with {passive:false} for HTMLBodyElement +Pass touchend listener is passive with {passive:true} for HTMLBodyElement +Pass touchend listener is non-passive by default for HTMLDivElement +Pass touchend listener is non-passive with {passive:undefined} for HTMLDivElement +Pass touchend listener is non-passive with {passive:false} for HTMLDivElement +Pass touchend listener is passive with {passive:true} for HTMLDivElement \ No newline at end of file diff --git a/Tests/LibWeb/Text/expected/wpt-import/dom/events/preventDefault-during-activation-behavior.txt b/Tests/LibWeb/Text/expected/wpt-import/dom/events/preventDefault-during-activation-behavior.txt new file mode 100644 index 00000000000..856c3fa0d42 --- /dev/null +++ b/Tests/LibWeb/Text/expected/wpt-import/dom/events/preventDefault-during-activation-behavior.txt @@ -0,0 +1,11 @@ +Summary + +Harness status: OK + +Rerun + +Found 1 tests + +1 Pass +Details +Result Test Name MessagePass behavior of preventDefault during activation behavior \ No newline at end of file diff --git a/Tests/LibWeb/Text/expected/wpt-import/dom/events/remove-all-listeners.txt b/Tests/LibWeb/Text/expected/wpt-import/dom/events/remove-all-listeners.txt new file mode 100644 index 00000000000..619c33ed3a7 --- /dev/null +++ b/Tests/LibWeb/Text/expected/wpt-import/dom/events/remove-all-listeners.txt @@ -0,0 +1,13 @@ +Summary + +Harness status: OK + +Rerun + +Found 2 tests + +1 Pass +1 Fail +Details +Result Test Name MessagePass Removing all listeners and then adding a new one should work. +Fail Nested usage of once listeners should work. \ No newline at end of file diff --git a/Tests/LibWeb/Text/expected/wpt-import/dom/events/shadow-relatedTarget.txt b/Tests/LibWeb/Text/expected/wpt-import/dom/events/shadow-relatedTarget.txt new file mode 100644 index 00000000000..58eb8b39e0b --- /dev/null +++ b/Tests/LibWeb/Text/expected/wpt-import/dom/events/shadow-relatedTarget.txt @@ -0,0 +1,12 @@ +Summary + +Harness status: OK + +Rerun + +Found 2 tests + +2 Fail +Details +Result Test Name MessageFail relatedTarget should not leak at capturing phase, at window object. +Fail relatedTarget should not leak at target. \ No newline at end of file diff --git a/Tests/LibWeb/Text/input/wpt-import/dom/events/AddEventListenerOptions-once.any.js b/Tests/LibWeb/Text/input/wpt-import/dom/events/AddEventListenerOptions-once.any.js new file mode 100644 index 00000000000..b4edd4345c5 --- /dev/null +++ b/Tests/LibWeb/Text/input/wpt-import/dom/events/AddEventListenerOptions-once.any.js @@ -0,0 +1,96 @@ +// META: title=AddEventListenerOptions.once + +"use strict"; + +test(function() { + var invoked_once = false; + var invoked_normal = false; + function handler_once() { + invoked_once = true; + } + function handler_normal() { + invoked_normal = true; + } + + const et = new EventTarget(); + et.addEventListener('test', handler_once, {once: true}); + et.addEventListener('test', handler_normal); + et.dispatchEvent(new Event('test')); + assert_equals(invoked_once, true, "Once handler should be invoked"); + assert_equals(invoked_normal, true, "Normal handler should be invoked"); + + invoked_once = false; + invoked_normal = false; + et.dispatchEvent(new Event('test')); + assert_equals(invoked_once, false, "Once handler shouldn't be invoked again"); + assert_equals(invoked_normal, true, "Normal handler should be invoked again"); + et.removeEventListener('test', handler_normal); +}, "Once listener should be invoked only once"); + +test(function() { + const et = new EventTarget(); + var invoked_count = 0; + function handler() { + invoked_count++; + if (invoked_count == 1) + et.dispatchEvent(new Event('test')); + } + et.addEventListener('test', handler, {once: true}); + et.dispatchEvent(new Event('test')); + assert_equals(invoked_count, 1, "Once handler should only be invoked once"); + + invoked_count = 0; + function handler2() { + invoked_count++; + if (invoked_count == 1) + et.addEventListener('test', handler2, {once: true}); + if (invoked_count <= 2) + et.dispatchEvent(new Event('test')); + } + et.addEventListener('test', handler2, {once: true}); + et.dispatchEvent(new Event('test')); + assert_equals(invoked_count, 2, "Once handler should only be invoked once after each adding"); +}, "Once listener should be invoked only once even if the event is nested"); + +test(function() { + var invoked_count = 0; + function handler() { + invoked_count++; + } + + const et = new EventTarget(); + + et.addEventListener('test', handler, {once: true}); + et.addEventListener('test', handler); + et.dispatchEvent(new Event('test')); + assert_equals(invoked_count, 1, "The handler should only be added once"); + + invoked_count = 0; + et.dispatchEvent(new Event('test')); + assert_equals(invoked_count, 0, "The handler was added as a once listener"); + + invoked_count = 0; + et.addEventListener('test', handler, {once: true}); + et.removeEventListener('test', handler); + et.dispatchEvent(new Event('test')); + assert_equals(invoked_count, 0, "The handler should have been removed"); +}, "Once listener should be added / removed like normal listeners"); + +test(function() { + const et = new EventTarget(); + + var invoked_count = 0; + + for (let n = 4; n > 0; n--) { + et.addEventListener('test', (e) => { + invoked_count++; + e.stopImmediatePropagation(); + }, {once: true}); + } + + for (let n = 4; n > 0; n--) { + et.dispatchEvent(new Event('test')); + } + + assert_equals(invoked_count, 4, "The listeners should be invoked"); +}, "Multiple once listeners should be invoked even if the stopImmediatePropagation is set"); diff --git a/Tests/LibWeb/Text/input/wpt-import/dom/events/AddEventListenerOptions-passive.any.js b/Tests/LibWeb/Text/input/wpt-import/dom/events/AddEventListenerOptions-passive.any.js new file mode 100644 index 00000000000..8e59cf5b379 --- /dev/null +++ b/Tests/LibWeb/Text/input/wpt-import/dom/events/AddEventListenerOptions-passive.any.js @@ -0,0 +1,134 @@ +// META: title=AddEventListenerOptions.passive + +test(function() { + var supportsPassive = false; + var query_options = { + get passive() { + supportsPassive = true; + return false; + }, + get dummy() { + assert_unreached("dummy value getter invoked"); + return false; + } + }; + + const et = new EventTarget(); + et.addEventListener('test_event', null, query_options); + assert_true(supportsPassive, "addEventListener doesn't support the passive option"); + + supportsPassive = false; + et.removeEventListener('test_event', null, query_options); + assert_false(supportsPassive, "removeEventListener supports the passive option when it should not"); +}, "Supports passive option on addEventListener only"); + +function testPassiveValue(optionsValue, expectedDefaultPrevented, existingEventTarget) { + var defaultPrevented = undefined; + var handler = function handler(e) { + assert_false(e.defaultPrevented, "Event prematurely marked defaultPrevented"); + e.preventDefault(); + defaultPrevented = e.defaultPrevented; + } + const et = existingEventTarget || new EventTarget(); + et.addEventListener('test', handler, optionsValue); + var uncanceled = et.dispatchEvent(new Event('test', {bubbles: true, cancelable: true})); + + assert_equals(defaultPrevented, expectedDefaultPrevented, "Incorrect defaultPrevented for options: " + JSON.stringify(optionsValue)); + assert_equals(uncanceled, !expectedDefaultPrevented, "Incorrect return value from dispatchEvent"); + + et.removeEventListener('test', handler, optionsValue); +} + +test(function() { + testPassiveValue(undefined, true); + testPassiveValue({}, true); + testPassiveValue({passive: false}, true); + testPassiveValue({passive: true}, false); + testPassiveValue({passive: 0}, true); + testPassiveValue({passive: 1}, false); +}, "preventDefault should be ignored if-and-only-if the passive option is true"); + +function testPassiveValueOnReturnValue(test, optionsValue, expectedDefaultPrevented) { + var defaultPrevented = undefined; + var handler = test.step_func(e => { + assert_false(e.defaultPrevented, "Event prematurely marked defaultPrevented"); + e.returnValue = false; + defaultPrevented = e.defaultPrevented; + }); + const et = new EventTarget(); + et.addEventListener('test', handler, optionsValue); + var uncanceled = et.dispatchEvent(new Event('test', {bubbles: true, cancelable: true})); + + assert_equals(defaultPrevented, expectedDefaultPrevented, "Incorrect defaultPrevented for options: " + JSON.stringify(optionsValue)); + assert_equals(uncanceled, !expectedDefaultPrevented, "Incorrect return value from dispatchEvent"); + + et.removeEventListener('test', handler, optionsValue); +} + +async_test(t => { + testPassiveValueOnReturnValue(t, undefined, true); + testPassiveValueOnReturnValue(t, {}, true); + testPassiveValueOnReturnValue(t, {passive: false}, true); + testPassiveValueOnReturnValue(t, {passive: true}, false); + testPassiveValueOnReturnValue(t, {passive: 0}, true); + testPassiveValueOnReturnValue(t, {passive: 1}, false); + t.done(); +}, "returnValue should be ignored if-and-only-if the passive option is true"); + +function testPassiveWithOtherHandlers(optionsValue, expectedDefaultPrevented) { + var handlerInvoked1 = false; + var dummyHandler1 = function() { + handlerInvoked1 = true; + }; + var handlerInvoked2 = false; + var dummyHandler2 = function() { + handlerInvoked2 = true; + }; + + const et = new EventTarget(); + et.addEventListener('test', dummyHandler1, {passive:true}); + et.addEventListener('test', dummyHandler2); + + testPassiveValue(optionsValue, expectedDefaultPrevented, et); + + assert_true(handlerInvoked1, "Extra passive handler not invoked"); + assert_true(handlerInvoked2, "Extra non-passive handler not invoked"); + + et.removeEventListener('test', dummyHandler1); + et.removeEventListener('test', dummyHandler2); +} + +test(function() { + testPassiveWithOtherHandlers({}, true); + testPassiveWithOtherHandlers({passive: false}, true); + testPassiveWithOtherHandlers({passive: true}, false); +}, "passive behavior of one listener should be unaffected by the presence of other listeners"); + +function testOptionEquivalence(optionValue1, optionValue2, expectedEquality) { + var invocationCount = 0; + var handler = function handler(e) { + invocationCount++; + } + const et = new EventTarget(); + et.addEventListener('test', handler, optionValue1); + et.addEventListener('test', handler, optionValue2); + et.dispatchEvent(new Event('test', {bubbles: true})); + assert_equals(invocationCount, expectedEquality ? 1 : 2, "equivalence of options " + + JSON.stringify(optionValue1) + " and " + JSON.stringify(optionValue2)); + et.removeEventListener('test', handler, optionValue1); + et.removeEventListener('test', handler, optionValue2); +} + +test(function() { + // Sanity check options that should be treated as distinct handlers + testOptionEquivalence({capture:true}, {capture:false, passive:false}, false); + testOptionEquivalence({capture:true}, {passive:true}, false); + + // Option values that should be treated as equivalent + testOptionEquivalence({}, {passive:false}, true); + testOptionEquivalence({passive:true}, {passive:false}, true); + testOptionEquivalence(undefined, {passive:true}, true); + testOptionEquivalence({capture: true, passive: false}, {capture: true, passive: true}, true); + +}, "Equivalence of option values"); + diff --git a/Tests/LibWeb/Text/input/wpt-import/dom/events/AddEventListenerOptions-signal.any.js b/Tests/LibWeb/Text/input/wpt-import/dom/events/AddEventListenerOptions-signal.any.js new file mode 100644 index 00000000000..e6a34261594 --- /dev/null +++ b/Tests/LibWeb/Text/input/wpt-import/dom/events/AddEventListenerOptions-signal.any.js @@ -0,0 +1,143 @@ +'use strict'; + +test(function() { + let count = 0; + function handler() { + count++; + } + const et = new EventTarget(); + const controller = new AbortController(); + et.addEventListener('test', handler, { signal: controller.signal }); + et.dispatchEvent(new Event('test')); + assert_equals(count, 1, "Adding a signal still adds a listener"); + et.dispatchEvent(new Event('test')); + assert_equals(count, 2, "The listener was not added with the once flag"); + controller.abort(); + et.dispatchEvent(new Event('test')); + assert_equals(count, 2, "Aborting on the controller removes the listener"); + et.addEventListener('test', handler, { signal: controller.signal }); + et.dispatchEvent(new Event('test')); + assert_equals(count, 2, "Passing an aborted signal never adds the handler"); +}, "Passing an AbortSignal to addEventListener options should allow removing a listener"); + +test(function() { + let count = 0; + function handler() { + count++; + } + const et = new EventTarget(); + const controller = new AbortController(); + et.addEventListener('test', handler, { signal: controller.signal }); + et.removeEventListener('test', handler); + et.dispatchEvent(new Event('test')); + assert_equals(count, 0, "The listener was still removed"); +}, "Passing an AbortSignal to addEventListener does not prevent removeEventListener"); + +test(function() { + let count = 0; + function handler() { + count++; + } + const et = new EventTarget(); + const controller = new AbortController(); + et.addEventListener('test', handler, { signal: controller.signal, once: true }); + controller.abort(); + et.dispatchEvent(new Event('test')); + assert_equals(count, 0, "The listener was still removed"); +}, "Passing an AbortSignal to addEventListener works with the once flag"); + +test(function() { + let count = 0; + function handler() { + count++; + } + const et = new EventTarget(); + const controller = new AbortController(); + et.addEventListener('test', handler, { signal: controller.signal, once: true }); + et.removeEventListener('test', handler); + et.dispatchEvent(new Event('test')); + assert_equals(count, 0, "The listener was still removed"); +}, "Removing a once listener works with a passed signal"); + +test(function() { + let count = 0; + function handler() { + count++; + } + const et = new EventTarget(); + const controller = new AbortController(); + et.addEventListener('first', handler, { signal: controller.signal, once: true }); + et.addEventListener('second', handler, { signal: controller.signal, once: true }); + controller.abort(); + et.dispatchEvent(new Event('first')); + et.dispatchEvent(new Event('second')); + assert_equals(count, 0, "The listener was still removed"); +}, "Passing an AbortSignal to multiple listeners"); + +test(function() { + let count = 0; + function handler() { + count++; + } + const et = new EventTarget(); + const controller = new AbortController(); + et.addEventListener('test', handler, { signal: controller.signal, capture: true }); + controller.abort(); + et.dispatchEvent(new Event('test')); + assert_equals(count, 0, "The listener was still removed"); +}, "Passing an AbortSignal to addEventListener works with the capture flag"); + +test(function() { + let count = 0; + function handler() { + count++; + } + const et = new EventTarget(); + const controller = new AbortController(); + et.addEventListener('test', () => { + controller.abort(); + }, { signal: controller.signal }); + et.addEventListener('test', handler, { signal: controller.signal }); + et.dispatchEvent(new Event('test')); + assert_equals(count, 0, "The listener was still removed"); +}, "Aborting from a listener does not call future listeners"); + +test(function() { + let count = 0; + function handler() { + count++; + } + const et = new EventTarget(); + const controller = new AbortController(); + et.addEventListener('test', () => { + et.addEventListener('test', handler, { signal: controller.signal }); + controller.abort(); + }, { signal: controller.signal }); + et.dispatchEvent(new Event('test')); + assert_equals(count, 0, "The listener was still removed"); +}, "Adding then aborting a listener in another listener does not call it"); + +test(function() { + const et = new EventTarget(); + const ac = new AbortController(); + let count = 0; + et.addEventListener('foo', () => { + et.addEventListener('foo', () => { + count++; + if (count > 5) ac.abort(); + et.dispatchEvent(new Event('foo')); + }, { signal: ac.signal }); + et.dispatchEvent(new Event('foo')); + }, { once: true }); + et.dispatchEvent(new Event('foo')); +}, "Aborting from a nested listener should remove it"); + +test(function() { + const et = new EventTarget(); + assert_throws_js(TypeError, () => { et.addEventListener("foo", () => {}, { signal: null }); }); +}, "Passing null as the signal should throw"); + +test(function() { + const et = new EventTarget(); + assert_throws_js(TypeError, () => { et.addEventListener("foo", null, { signal: null }); }); +}, "Passing null as the signal should throw (listener is also null)"); diff --git a/Tests/LibWeb/Text/input/wpt-import/dom/events/Body-FrameSet-Event-Handlers.html b/Tests/LibWeb/Text/input/wpt-import/dom/events/Body-FrameSet-Event-Handlers.html new file mode 100644 index 00000000000..16d13815b1b --- /dev/null +++ b/Tests/LibWeb/Text/input/wpt-import/dom/events/Body-FrameSet-Event-Handlers.html @@ -0,0 +1,123 @@ + + +HTMLBodyElement and HTMLFrameSetElement Event Handler Tests + + + + + diff --git a/Tests/LibWeb/Text/input/wpt-import/dom/events/CustomEvent.html b/Tests/LibWeb/Text/input/wpt-import/dom/events/CustomEvent.html new file mode 100644 index 00000000000..cce9e915ddb --- /dev/null +++ b/Tests/LibWeb/Text/input/wpt-import/dom/events/CustomEvent.html @@ -0,0 +1,35 @@ + +CustomEvent + + +
+ diff --git a/Tests/LibWeb/Text/input/wpt-import/dom/events/Event-cancelBubble.html b/Tests/LibWeb/Text/input/wpt-import/dom/events/Event-cancelBubble.html new file mode 100644 index 00000000000..63fae65c33d --- /dev/null +++ b/Tests/LibWeb/Text/input/wpt-import/dom/events/Event-cancelBubble.html @@ -0,0 +1,132 @@ + + + + + Event.cancelBubble + + + + + + + +
+
+
+
+
+ + + diff --git a/Tests/LibWeb/Text/input/wpt-import/dom/events/Event-constants.html b/Tests/LibWeb/Text/input/wpt-import/dom/events/Event-constants.html new file mode 100644 index 00000000000..608be04737f --- /dev/null +++ b/Tests/LibWeb/Text/input/wpt-import/dom/events/Event-constants.html @@ -0,0 +1,23 @@ + +Event constants + + + +
+ diff --git a/Tests/LibWeb/Text/input/wpt-import/dom/events/Event-constructors.any.js b/Tests/LibWeb/Text/input/wpt-import/dom/events/Event-constructors.any.js new file mode 100644 index 00000000000..faa623ea929 --- /dev/null +++ b/Tests/LibWeb/Text/input/wpt-import/dom/events/Event-constructors.any.js @@ -0,0 +1,120 @@ +// META: title=Event constructors + +test(function() { + assert_throws_js( + TypeError, + () => Event(""), + "Calling Event constructor without 'new' must throw") +}) +test(function() { + assert_throws_js(TypeError, function() { + new Event() + }) +}) +test(function() { + var test_error = { name: "test" } + assert_throws_exactly(test_error, function() { + new Event({ toString: function() { throw test_error; } }) + }) +}) +test(function() { + var ev = new Event("") + assert_equals(ev.type, "") + assert_equals(ev.target, null) + assert_equals(ev.srcElement, null) + assert_equals(ev.currentTarget, null) + assert_equals(ev.eventPhase, Event.NONE) + assert_equals(ev.bubbles, false) + assert_equals(ev.cancelable, false) + assert_equals(ev.defaultPrevented, false) + assert_equals(ev.returnValue, true) + assert_equals(ev.isTrusted, false) + assert_true(ev.timeStamp > 0) + assert_true("initEvent" in ev) +}) +test(function() { + var ev = new Event("test") + assert_equals(ev.type, "test") + assert_equals(ev.target, null) + assert_equals(ev.srcElement, null) + assert_equals(ev.currentTarget, null) + assert_equals(ev.eventPhase, Event.NONE) + assert_equals(ev.bubbles, false) + assert_equals(ev.cancelable, false) + assert_equals(ev.defaultPrevented, false) + assert_equals(ev.returnValue, true) + assert_equals(ev.isTrusted, false) + assert_true(ev.timeStamp > 0) + assert_true("initEvent" in ev) +}) +test(function() { + assert_throws_js(TypeError, function() { Event("test") }, + 'Calling Event constructor without "new" must throw'); +}) +test(function() { + var ev = new Event("I am an event", { bubbles: true, cancelable: false}) + assert_equals(ev.type, "I am an event") + assert_equals(ev.bubbles, true) + assert_equals(ev.cancelable, false) +}) +test(function() { + var ev = new Event("@", { bubblesIGNORED: true, cancelable: true}) + assert_equals(ev.type, "@") + assert_equals(ev.bubbles, false) + assert_equals(ev.cancelable, true) +}) +test(function() { + var ev = new Event("@", { "bubbles\0IGNORED": true, cancelable: true}) + assert_equals(ev.type, "@") + assert_equals(ev.bubbles, false) + assert_equals(ev.cancelable, true) +}) +test(function() { + var ev = new Event("Xx", { cancelable: true}) + assert_equals(ev.type, "Xx") + assert_equals(ev.bubbles, false) + assert_equals(ev.cancelable, true) +}) +test(function() { + var ev = new Event("Xx", {}) + assert_equals(ev.type, "Xx") + assert_equals(ev.bubbles, false) + assert_equals(ev.cancelable, false) +}) +test(function() { + var ev = new Event("Xx", {bubbles: true, cancelable: false, sweet: "x"}) + assert_equals(ev.type, "Xx") + assert_equals(ev.bubbles, true) + assert_equals(ev.cancelable, false) + assert_equals(ev.sweet, undefined) +}) +test(function() { + var called = [] + var ev = new Event("Xx", { + get cancelable() { + called.push("cancelable") + return false + }, + get bubbles() { + called.push("bubbles") + return true; + }, + get sweet() { + called.push("sweet") + return "x" + } + }) + assert_array_equals(called, ["bubbles", "cancelable"]) + assert_equals(ev.type, "Xx") + assert_equals(ev.bubbles, true) + assert_equals(ev.cancelable, false) + assert_equals(ev.sweet, undefined) +}) +test(function() { + var ev = new CustomEvent("$", {detail: 54, sweet: "x", sweet2: "x", cancelable:true}) + assert_equals(ev.type, "$") + assert_equals(ev.bubbles, false) + assert_equals(ev.cancelable, true) + assert_equals(ev.sweet, undefined) + assert_equals(ev.detail, 54) +}) diff --git a/Tests/LibWeb/Text/input/wpt-import/dom/events/Event-defaultPrevented-after-dispatch.html b/Tests/LibWeb/Text/input/wpt-import/dom/events/Event-defaultPrevented-after-dispatch.html new file mode 100644 index 00000000000..c3557759bd8 --- /dev/null +++ b/Tests/LibWeb/Text/input/wpt-import/dom/events/Event-defaultPrevented-after-dispatch.html @@ -0,0 +1,44 @@ + + +Event.defaultPrevented is not reset after dispatchEvent() + + + + +
+ + diff --git a/Tests/LibWeb/Text/input/wpt-import/dom/events/Event-defaultPrevented.html b/Tests/LibWeb/Text/input/wpt-import/dom/events/Event-defaultPrevented.html new file mode 100644 index 00000000000..c4221925e43 --- /dev/null +++ b/Tests/LibWeb/Text/input/wpt-import/dom/events/Event-defaultPrevented.html @@ -0,0 +1,55 @@ + +Event.defaultPrevented + + +
+ diff --git a/Tests/LibWeb/Text/input/wpt-import/dom/events/Event-dispatch-bubble-canceled.html b/Tests/LibWeb/Text/input/wpt-import/dom/events/Event-dispatch-bubble-canceled.html new file mode 100644 index 00000000000..f34f22426c0 --- /dev/null +++ b/Tests/LibWeb/Text/input/wpt-import/dom/events/Event-dispatch-bubble-canceled.html @@ -0,0 +1,59 @@ + + + +Setting cancelBubble=true prior to dispatchEvent() + + + + +
+ + + + + + + + + + + + + + + + + diff --git a/Tests/LibWeb/Text/input/wpt-import/dom/events/Event-dispatch-bubbles-false.html b/Tests/LibWeb/Text/input/wpt-import/dom/events/Event-dispatch-bubbles-false.html new file mode 100644 index 00000000000..de8532a18be --- /dev/null +++ b/Tests/LibWeb/Text/input/wpt-import/dom/events/Event-dispatch-bubbles-false.html @@ -0,0 +1,98 @@ + + + Event.bubbles attribute is set to false + + + + +
+ + + + + + + + + + + + + diff --git a/Tests/LibWeb/Text/input/wpt-import/dom/events/Event-dispatch-bubbles-true.html b/Tests/LibWeb/Text/input/wpt-import/dom/events/Event-dispatch-bubbles-true.html new file mode 100644 index 00000000000..35784254b4d --- /dev/null +++ b/Tests/LibWeb/Text/input/wpt-import/dom/events/Event-dispatch-bubbles-true.html @@ -0,0 +1,108 @@ + + + Event.bubbles attribute is set to false + + + + +
+ + + + + + + + + + + + + diff --git a/Tests/LibWeb/Text/input/wpt-import/dom/events/Event-dispatch-click.html b/Tests/LibWeb/Text/input/wpt-import/dom/events/Event-dispatch-click.html new file mode 100644 index 00000000000..3f34fbc810c --- /dev/null +++ b/Tests/LibWeb/Text/input/wpt-import/dom/events/Event-dispatch-click.html @@ -0,0 +1,425 @@ + +Synthetic click event "magic" + + +
+ + diff --git a/Tests/LibWeb/Text/input/wpt-import/dom/events/Event-dispatch-click.tentative.html b/Tests/LibWeb/Text/input/wpt-import/dom/events/Event-dispatch-click.tentative.html new file mode 100644 index 00000000000..d9ff0fdc82f --- /dev/null +++ b/Tests/LibWeb/Text/input/wpt-import/dom/events/Event-dispatch-click.tentative.html @@ -0,0 +1,78 @@ + +Clicks on input element + + + + diff --git a/Tests/LibWeb/Text/input/wpt-import/dom/events/Event-dispatch-detached-click.html b/Tests/LibWeb/Text/input/wpt-import/dom/events/Event-dispatch-detached-click.html new file mode 100644 index 00000000000..a9080f16444 --- /dev/null +++ b/Tests/LibWeb/Text/input/wpt-import/dom/events/Event-dispatch-detached-click.html @@ -0,0 +1,20 @@ + +Click event on an element not in the document + + +
+ diff --git a/Tests/LibWeb/Text/input/wpt-import/dom/events/Event-dispatch-detached-input-and-change.html b/Tests/LibWeb/Text/input/wpt-import/dom/events/Event-dispatch-detached-input-and-change.html new file mode 100644 index 00000000000..a2fb6d75d84 --- /dev/null +++ b/Tests/LibWeb/Text/input/wpt-import/dom/events/Event-dispatch-detached-input-and-change.html @@ -0,0 +1,190 @@ + + + +input and change events for detached checkbox and radio elements + + + + + + diff --git a/Tests/LibWeb/Text/input/wpt-import/dom/events/Event-dispatch-handlers-changed.html b/Tests/LibWeb/Text/input/wpt-import/dom/events/Event-dispatch-handlers-changed.html new file mode 100644 index 00000000000..323c13bff0c --- /dev/null +++ b/Tests/LibWeb/Text/input/wpt-import/dom/events/Event-dispatch-handlers-changed.html @@ -0,0 +1,91 @@ + + + Dispatch additional events inside an event listener + + + +
+ + + + + + + + + + + + + + + diff --git a/Tests/LibWeb/Text/input/wpt-import/dom/events/Event-dispatch-listener-order.window.js b/Tests/LibWeb/Text/input/wpt-import/dom/events/Event-dispatch-listener-order.window.js new file mode 100644 index 00000000000..a01a472872b --- /dev/null +++ b/Tests/LibWeb/Text/input/wpt-import/dom/events/Event-dispatch-listener-order.window.js @@ -0,0 +1,20 @@ +test(t => { + const hostParent = document.createElement("section"), + host = hostParent.appendChild(document.createElement("div")), + shadowRoot = host.attachShadow({ mode: "closed" }), + targetParent = shadowRoot.appendChild(document.createElement("p")), + target = targetParent.appendChild(document.createElement("span")), + path = [hostParent, host, shadowRoot, targetParent, target], + expected = [], + result = []; + path.forEach((node, index) => { + expected.splice(index, 0, "capturing " + node.nodeName); + expected.splice(index + 1, 0, "bubbling " + node.nodeName); + }); + path.forEach(node => { + node.addEventListener("test", () => { result.push("bubbling " + node.nodeName) }); + node.addEventListener("test", () => { result.push("capturing " + node.nodeName) }, true); + }); + target.dispatchEvent(new CustomEvent('test', { detail: {}, bubbles: true, composed: true })); + assert_array_equals(result, expected); +}); diff --git a/Tests/LibWeb/Text/input/wpt-import/dom/events/Event-dispatch-multiple-cancelBubble.html b/Tests/LibWeb/Text/input/wpt-import/dom/events/Event-dispatch-multiple-cancelBubble.html new file mode 100644 index 00000000000..cab64768d35 --- /dev/null +++ b/Tests/LibWeb/Text/input/wpt-import/dom/events/Event-dispatch-multiple-cancelBubble.html @@ -0,0 +1,51 @@ + + + +Multiple dispatchEvent() and cancelBubble + + + + +
+ + + + + + diff --git a/Tests/LibWeb/Text/input/wpt-import/dom/events/Event-dispatch-multiple-stopPropagation.html b/Tests/LibWeb/Text/input/wpt-import/dom/events/Event-dispatch-multiple-stopPropagation.html new file mode 100644 index 00000000000..94b15d0de4e --- /dev/null +++ b/Tests/LibWeb/Text/input/wpt-import/dom/events/Event-dispatch-multiple-stopPropagation.html @@ -0,0 +1,51 @@ + + + + Multiple dispatchEvent() and stopPropagation() + + + + +
+ + + + + + diff --git a/Tests/LibWeb/Text/input/wpt-import/dom/events/Event-dispatch-omitted-capture.html b/Tests/LibWeb/Text/input/wpt-import/dom/events/Event-dispatch-omitted-capture.html new file mode 100644 index 00000000000..1ccbe040e81 --- /dev/null +++ b/Tests/LibWeb/Text/input/wpt-import/dom/events/Event-dispatch-omitted-capture.html @@ -0,0 +1,70 @@ + + +EventTarget.addEventListener: capture argument omitted + + + + +
+ + + + + + + + + + + + + diff --git a/Tests/LibWeb/Text/input/wpt-import/dom/events/Event-dispatch-order-at-target.html b/Tests/LibWeb/Text/input/wpt-import/dom/events/Event-dispatch-order-at-target.html new file mode 100644 index 00000000000..522b2c64a0f --- /dev/null +++ b/Tests/LibWeb/Text/input/wpt-import/dom/events/Event-dispatch-order-at-target.html @@ -0,0 +1,31 @@ + + +Listeners are invoked in correct order (AT_TARGET phase) + + +
+ diff --git a/Tests/LibWeb/Text/input/wpt-import/dom/events/Event-dispatch-order.html b/Tests/LibWeb/Text/input/wpt-import/dom/events/Event-dispatch-order.html new file mode 100644 index 00000000000..9adda01eb74 --- /dev/null +++ b/Tests/LibWeb/Text/input/wpt-import/dom/events/Event-dispatch-order.html @@ -0,0 +1,26 @@ + +Event phases order + + +
+ +
+
+
diff --git a/Tests/LibWeb/Text/input/wpt-import/dom/events/Event-dispatch-other-document.html b/Tests/LibWeb/Text/input/wpt-import/dom/events/Event-dispatch-other-document.html new file mode 100644 index 00000000000..203d8862ea3 --- /dev/null +++ b/Tests/LibWeb/Text/input/wpt-import/dom/events/Event-dispatch-other-document.html @@ -0,0 +1,23 @@ + +Custom event on an element in another document + + +
+ diff --git a/Tests/LibWeb/Text/input/wpt-import/dom/events/Event-dispatch-propagation-stopped.html b/Tests/LibWeb/Text/input/wpt-import/dom/events/Event-dispatch-propagation-stopped.html new file mode 100644 index 00000000000..46b8dc7b9bf --- /dev/null +++ b/Tests/LibWeb/Text/input/wpt-import/dom/events/Event-dispatch-propagation-stopped.html @@ -0,0 +1,59 @@ + + + + Calling stopPropagation() prior to dispatchEvent() + + + + +
+ + + + + + + + + + + + + + + + + diff --git a/Tests/LibWeb/Text/input/wpt-import/dom/events/Event-dispatch-reenter.html b/Tests/LibWeb/Text/input/wpt-import/dom/events/Event-dispatch-reenter.html new file mode 100644 index 00000000000..f440d03fa08 --- /dev/null +++ b/Tests/LibWeb/Text/input/wpt-import/dom/events/Event-dispatch-reenter.html @@ -0,0 +1,66 @@ + + + Dispatch additional events inside an event listener + + +
+ + + + + + + + + + + + + diff --git a/Tests/LibWeb/Text/input/wpt-import/dom/events/Event-dispatch-single-activation-behavior.html b/Tests/LibWeb/Text/input/wpt-import/dom/events/Event-dispatch-single-activation-behavior.html new file mode 100644 index 00000000000..532715a1cdb --- /dev/null +++ b/Tests/LibWeb/Text/input/wpt-import/dom/events/Event-dispatch-single-activation-behavior.html @@ -0,0 +1,164 @@ + + + Only one activation behavior is executed during dispatch + + + + + +
+ +
+ + + + + diff --git a/Tests/LibWeb/Text/input/wpt-import/dom/events/Event-dispatch-target-moved.html b/Tests/LibWeb/Text/input/wpt-import/dom/events/Event-dispatch-target-moved.html new file mode 100644 index 00000000000..266242ae4ec --- /dev/null +++ b/Tests/LibWeb/Text/input/wpt-import/dom/events/Event-dispatch-target-moved.html @@ -0,0 +1,73 @@ + + + Determined event propagation path - target moved + + + +
+ + + + + + + + + + + + + diff --git a/Tests/LibWeb/Text/input/wpt-import/dom/events/Event-dispatch-target-removed.html b/Tests/LibWeb/Text/input/wpt-import/dom/events/Event-dispatch-target-removed.html new file mode 100644 index 00000000000..3f85e8a9934 --- /dev/null +++ b/Tests/LibWeb/Text/input/wpt-import/dom/events/Event-dispatch-target-removed.html @@ -0,0 +1,72 @@ + + +Determined event propagation path - target removed + + + +
+ + + + + + + + + + + + + diff --git a/Tests/LibWeb/Text/input/wpt-import/dom/events/Event-dispatch-throwing-multiple-globals.html b/Tests/LibWeb/Text/input/wpt-import/dom/events/Event-dispatch-throwing-multiple-globals.html new file mode 100644 index 00000000000..32670516e38 --- /dev/null +++ b/Tests/LibWeb/Text/input/wpt-import/dom/events/Event-dispatch-throwing-multiple-globals.html @@ -0,0 +1,69 @@ + + + + + + diff --git a/Tests/LibWeb/Text/input/wpt-import/dom/events/Event-dispatch-throwing.html b/Tests/LibWeb/Text/input/wpt-import/dom/events/Event-dispatch-throwing.html new file mode 100644 index 00000000000..e53f6ee4af7 --- /dev/null +++ b/Tests/LibWeb/Text/input/wpt-import/dom/events/Event-dispatch-throwing.html @@ -0,0 +1,51 @@ + + +Throwing in event listeners + + +
+ diff --git a/Tests/LibWeb/Text/input/wpt-import/dom/events/Event-init-while-dispatching.html b/Tests/LibWeb/Text/input/wpt-import/dom/events/Event-init-while-dispatching.html new file mode 100644 index 00000000000..032cb7306df --- /dev/null +++ b/Tests/LibWeb/Text/input/wpt-import/dom/events/Event-init-while-dispatching.html @@ -0,0 +1,83 @@ + + +Re-initializing events while dispatching them + + + +
+ diff --git a/Tests/LibWeb/Text/input/wpt-import/dom/events/Event-initEvent.html b/Tests/LibWeb/Text/input/wpt-import/dom/events/Event-initEvent.html new file mode 100644 index 00000000000..f8c500479f3 --- /dev/null +++ b/Tests/LibWeb/Text/input/wpt-import/dom/events/Event-initEvent.html @@ -0,0 +1,136 @@ + +Event.initEvent + + + +
+ diff --git a/Tests/LibWeb/Text/input/wpt-import/dom/events/Event-isTrusted.any.js b/Tests/LibWeb/Text/input/wpt-import/dom/events/Event-isTrusted.any.js new file mode 100644 index 00000000000..00bcecd0ed6 --- /dev/null +++ b/Tests/LibWeb/Text/input/wpt-import/dom/events/Event-isTrusted.any.js @@ -0,0 +1,11 @@ +test(function() { + var desc1 = Object.getOwnPropertyDescriptor(new Event("x"), "isTrusted"); + assert_not_equals(desc1, undefined); + assert_equals(typeof desc1.get, "function"); + + var desc2 = Object.getOwnPropertyDescriptor(new Event("x"), "isTrusted"); + assert_not_equals(desc2, undefined); + assert_equals(typeof desc2.get, "function"); + + assert_equals(desc1.get, desc2.get); +}); diff --git a/Tests/LibWeb/Text/input/wpt-import/dom/events/Event-propagation.html b/Tests/LibWeb/Text/input/wpt-import/dom/events/Event-propagation.html new file mode 100644 index 00000000000..dfd17f67e77 --- /dev/null +++ b/Tests/LibWeb/Text/input/wpt-import/dom/events/Event-propagation.html @@ -0,0 +1,48 @@ + +Event propagation tests + +
+ + + diff --git a/Tests/LibWeb/Text/input/wpt-import/dom/events/Event-returnValue.html b/Tests/LibWeb/Text/input/wpt-import/dom/events/Event-returnValue.html new file mode 100644 index 00000000000..8db6ba9feb2 --- /dev/null +++ b/Tests/LibWeb/Text/input/wpt-import/dom/events/Event-returnValue.html @@ -0,0 +1,64 @@ + + + + + Event.returnValue + + + + + + + +
+ + + diff --git a/Tests/LibWeb/Text/input/wpt-import/dom/events/Event-stopImmediatePropagation.html b/Tests/LibWeb/Text/input/wpt-import/dom/events/Event-stopImmediatePropagation.html new file mode 100644 index 00000000000..6e101f9be87 --- /dev/null +++ b/Tests/LibWeb/Text/input/wpt-import/dom/events/Event-stopImmediatePropagation.html @@ -0,0 +1,34 @@ + + +Event's stopImmediatePropagation + + + + + + +
+ + diff --git a/Tests/LibWeb/Text/input/wpt-import/dom/events/Event-stopPropagation-cancel-bubbling.html b/Tests/LibWeb/Text/input/wpt-import/dom/events/Event-stopPropagation-cancel-bubbling.html new file mode 100644 index 00000000000..9c2e0a30024 --- /dev/null +++ b/Tests/LibWeb/Text/input/wpt-import/dom/events/Event-stopPropagation-cancel-bubbling.html @@ -0,0 +1,20 @@ + + + + + + + diff --git a/Tests/LibWeb/Text/input/wpt-import/dom/events/Event-subclasses-constructors.html b/Tests/LibWeb/Text/input/wpt-import/dom/events/Event-subclasses-constructors.html new file mode 100644 index 00000000000..8097ca6a32b --- /dev/null +++ b/Tests/LibWeb/Text/input/wpt-import/dom/events/Event-subclasses-constructors.html @@ -0,0 +1,179 @@ + + +Event constructors + + +
+ diff --git a/Tests/LibWeb/Text/input/wpt-import/dom/events/Event-timestamp-cross-realm-getter.html b/Tests/LibWeb/Text/input/wpt-import/dom/events/Event-timestamp-cross-realm-getter.html new file mode 100644 index 00000000000..84bc958906c --- /dev/null +++ b/Tests/LibWeb/Text/input/wpt-import/dom/events/Event-timestamp-cross-realm-getter.html @@ -0,0 +1,27 @@ + + +event.timeStamp is initialized using event's relevant global object + + + + + + diff --git a/Tests/LibWeb/Text/input/wpt-import/dom/events/Event-timestamp-high-resolution.html b/Tests/LibWeb/Text/input/wpt-import/dom/events/Event-timestamp-high-resolution.html new file mode 100644 index 00000000000..125c23fcc19 --- /dev/null +++ b/Tests/LibWeb/Text/input/wpt-import/dom/events/Event-timestamp-high-resolution.html @@ -0,0 +1,16 @@ + + + + + diff --git a/Tests/LibWeb/Text/input/wpt-import/dom/events/Event-timestamp-high-resolution.https.html b/Tests/LibWeb/Text/input/wpt-import/dom/events/Event-timestamp-high-resolution.https.html new file mode 100644 index 00000000000..0baefd0eab7 --- /dev/null +++ b/Tests/LibWeb/Text/input/wpt-import/dom/events/Event-timestamp-high-resolution.https.html @@ -0,0 +1,16 @@ + + + + + diff --git a/Tests/LibWeb/Text/input/wpt-import/dom/events/Event-timestamp-safe-resolution.html b/Tests/LibWeb/Text/input/wpt-import/dom/events/Event-timestamp-safe-resolution.html new file mode 100644 index 00000000000..d6a83d09696 --- /dev/null +++ b/Tests/LibWeb/Text/input/wpt-import/dom/events/Event-timestamp-safe-resolution.html @@ -0,0 +1,49 @@ + + + + \ No newline at end of file diff --git a/Tests/LibWeb/Text/input/wpt-import/dom/events/Event-type-empty.html b/Tests/LibWeb/Text/input/wpt-import/dom/events/Event-type-empty.html new file mode 100644 index 00000000000..f763ee5f3b0 --- /dev/null +++ b/Tests/LibWeb/Text/input/wpt-import/dom/events/Event-type-empty.html @@ -0,0 +1,35 @@ + +Event.type set to the empty string + + + + +
+ diff --git a/Tests/LibWeb/Text/input/wpt-import/dom/events/Event-type.html b/Tests/LibWeb/Text/input/wpt-import/dom/events/Event-type.html new file mode 100644 index 00000000000..7b51be5c65c --- /dev/null +++ b/Tests/LibWeb/Text/input/wpt-import/dom/events/Event-type.html @@ -0,0 +1,22 @@ + +Event.type + + + + +
+ diff --git a/Tests/LibWeb/Text/input/wpt-import/dom/events/EventListener-addEventListener.sub.window.js b/Tests/LibWeb/Text/input/wpt-import/dom/events/EventListener-addEventListener.sub.window.js new file mode 100644 index 00000000000..b44bc332859 --- /dev/null +++ b/Tests/LibWeb/Text/input/wpt-import/dom/events/EventListener-addEventListener.sub.window.js @@ -0,0 +1,9 @@ +async_test(function(t) { + let crossOriginFrame = document.createElement('iframe'); + crossOriginFrame.src = 'https://{{hosts[alt][]}}:{{ports[https][0]}}/common/blank.html'; + document.body.appendChild(crossOriginFrame); + crossOriginFrame.addEventListener('load', t.step_func_done(function() { + let crossOriginWindow = crossOriginFrame.contentWindow; + window.addEventListener('click', crossOriginWindow); + })); +}, "EventListener.addEventListener doesn't throw when a cross origin object is passed in."); diff --git a/Tests/LibWeb/Text/input/wpt-import/dom/events/EventListener-handleEvent.html b/Tests/LibWeb/Text/input/wpt-import/dom/events/EventListener-handleEvent.html new file mode 100644 index 00000000000..cbf878719c4 --- /dev/null +++ b/Tests/LibWeb/Text/input/wpt-import/dom/events/EventListener-handleEvent.html @@ -0,0 +1,102 @@ + + +EventListener::handleEvent() + + + +
+ diff --git a/Tests/LibWeb/Text/input/wpt-import/dom/events/EventListenerOptions-capture.html b/Tests/LibWeb/Text/input/wpt-import/dom/events/EventListenerOptions-capture.html new file mode 100644 index 00000000000..eb4d71e36f4 --- /dev/null +++ b/Tests/LibWeb/Text/input/wpt-import/dom/events/EventListenerOptions-capture.html @@ -0,0 +1,98 @@ + + +EventListenerOptions.capture + + + + +
+ + diff --git a/Tests/LibWeb/Text/input/wpt-import/dom/events/EventTarget-add-listener-platform-object.html b/Tests/LibWeb/Text/input/wpt-import/dom/events/EventTarget-add-listener-platform-object.html new file mode 100644 index 00000000000..4ba88440a14 --- /dev/null +++ b/Tests/LibWeb/Text/input/wpt-import/dom/events/EventTarget-add-listener-platform-object.html @@ -0,0 +1,32 @@ + + +addEventListener with a platform object + + + +Click me! + diff --git a/Tests/LibWeb/Text/input/wpt-import/dom/events/EventTarget-add-remove-listener.any.js b/Tests/LibWeb/Text/input/wpt-import/dom/events/EventTarget-add-remove-listener.any.js new file mode 100644 index 00000000000..b1d7ffb3e07 --- /dev/null +++ b/Tests/LibWeb/Text/input/wpt-import/dom/events/EventTarget-add-remove-listener.any.js @@ -0,0 +1,21 @@ +// META: title=EventTarget's addEventListener + removeEventListener + +"use strict"; + +function listener(evt) { + evt.preventDefault(); + return false; +} + +test(() => { + const et = new EventTarget(); + et.addEventListener("x", listener, false); + let event = new Event("x", { cancelable: true }); + let ret = et.dispatchEvent(event); + assert_false(ret); + + et.removeEventListener("x", listener); + event = new Event("x", { cancelable: true }); + ret = et.dispatchEvent(event); + assert_true(ret); +}, "Removing an event listener without explicit capture arg should succeed"); diff --git a/Tests/LibWeb/Text/input/wpt-import/dom/events/EventTarget-addEventListener.any.js b/Tests/LibWeb/Text/input/wpt-import/dom/events/EventTarget-addEventListener.any.js new file mode 100644 index 00000000000..e22da4aff85 --- /dev/null +++ b/Tests/LibWeb/Text/input/wpt-import/dom/events/EventTarget-addEventListener.any.js @@ -0,0 +1,9 @@ +// META: title=EventTarget.addEventListener + +// Step 1. +test(function() { + const et = new EventTarget(); + assert_equals(et.addEventListener("x", null, false), undefined); + assert_equals(et.addEventListener("x", null, true), undefined); + assert_equals(et.addEventListener("x", null), undefined); +}, "Adding a null event listener should succeed"); diff --git a/Tests/LibWeb/Text/input/wpt-import/dom/events/EventTarget-constructible.any.js b/Tests/LibWeb/Text/input/wpt-import/dom/events/EventTarget-constructible.any.js new file mode 100644 index 00000000000..4125d23f0c9 --- /dev/null +++ b/Tests/LibWeb/Text/input/wpt-import/dom/events/EventTarget-constructible.any.js @@ -0,0 +1,79 @@ +"use strict"; + +test(() => { + const target = new EventTarget(); + const event = new Event("foo", { bubbles: true, cancelable: false }); + let callCount = 0; + + function listener(e) { + assert_equals(e, event); + ++callCount; + } + + target.addEventListener("foo", listener); + + target.dispatchEvent(event); + assert_equals(callCount, 1); + + target.dispatchEvent(event); + assert_equals(callCount, 2); + + target.removeEventListener("foo", listener); + target.dispatchEvent(event); + assert_equals(callCount, 2); +}, "A constructed EventTarget can be used as expected"); + +test(() => { + const target = new EventTarget(); + const event = new Event("foo"); + + function listener(e) { + assert_equals(e, event); + assert_equals(e.target, target); + assert_equals(e.currentTarget, target); + assert_array_equals(e.composedPath(), [target]); + } + target.addEventListener("foo", listener, { once: true }); + target.dispatchEvent(event); + assert_equals(event.target, target); + assert_equals(event.currentTarget, null); + assert_array_equals(event.composedPath(), []); +}, "A constructed EventTarget implements dispatch correctly"); + +test(() => { + class NicerEventTarget extends EventTarget { + on(...args) { + this.addEventListener(...args); + } + + off(...args) { + this.removeEventListener(...args); + } + + dispatch(type, detail) { + this.dispatchEvent(new CustomEvent(type, { detail })); + } + } + + const target = new NicerEventTarget(); + const event = new Event("foo", { bubbles: true, cancelable: false }); + const detail = "some data"; + let callCount = 0; + + function listener(e) { + assert_equals(e.detail, detail); + ++callCount; + } + + target.on("foo", listener); + + target.dispatch("foo", detail); + assert_equals(callCount, 1); + + target.dispatch("foo", detail); + assert_equals(callCount, 2); + + target.off("foo", listener); + target.dispatch("foo", detail); + assert_equals(callCount, 2); +}, "EventTarget can be subclassed"); diff --git a/Tests/LibWeb/Text/input/wpt-import/dom/events/EventTarget-dispatchEvent-returnvalue.html b/Tests/LibWeb/Text/input/wpt-import/dom/events/EventTarget-dispatchEvent-returnvalue.html new file mode 100644 index 00000000000..c8f42eebd44 --- /dev/null +++ b/Tests/LibWeb/Text/input/wpt-import/dom/events/EventTarget-dispatchEvent-returnvalue.html @@ -0,0 +1,71 @@ + + +EventTarget.dispatchEvent: return value + + + + + + +
+ + + + + + + + + + + + + diff --git a/Tests/LibWeb/Text/input/wpt-import/dom/events/EventTarget-dispatchEvent.html b/Tests/LibWeb/Text/input/wpt-import/dom/events/EventTarget-dispatchEvent.html new file mode 100644 index 00000000000..11b9bb2e5ec --- /dev/null +++ b/Tests/LibWeb/Text/input/wpt-import/dom/events/EventTarget-dispatchEvent.html @@ -0,0 +1,104 @@ + + +EventTarget.dispatchEvent + + + + + + +
+ diff --git a/Tests/LibWeb/Text/input/wpt-import/dom/events/EventTarget-removeEventListener.any.js b/Tests/LibWeb/Text/input/wpt-import/dom/events/EventTarget-removeEventListener.any.js new file mode 100644 index 00000000000..289dfcfbabd --- /dev/null +++ b/Tests/LibWeb/Text/input/wpt-import/dom/events/EventTarget-removeEventListener.any.js @@ -0,0 +1,8 @@ +// META: title=EventTarget.removeEventListener + +// Step 1. +test(function() { + assert_equals(globalThis.removeEventListener("x", null, false), undefined); + assert_equals(globalThis.removeEventListener("x", null, true), undefined); + assert_equals(globalThis.removeEventListener("x", null), undefined); +}, "removing a null event listener should succeed"); diff --git a/Tests/LibWeb/Text/input/wpt-import/dom/events/EventTarget-this-of-listener.html b/Tests/LibWeb/Text/input/wpt-import/dom/events/EventTarget-this-of-listener.html new file mode 100644 index 00000000000..62590adf118 --- /dev/null +++ b/Tests/LibWeb/Text/input/wpt-import/dom/events/EventTarget-this-of-listener.html @@ -0,0 +1,182 @@ + + +EventTarget listeners this value + + + + + + diff --git a/Tests/LibWeb/Text/input/wpt-import/dom/events/KeyEvent-initKeyEvent.html b/Tests/LibWeb/Text/input/wpt-import/dom/events/KeyEvent-initKeyEvent.html new file mode 100644 index 00000000000..2a2894a482c --- /dev/null +++ b/Tests/LibWeb/Text/input/wpt-import/dom/events/KeyEvent-initKeyEvent.html @@ -0,0 +1,23 @@ + + +KeyEvent.initKeyEvent + + +
+ diff --git a/Tests/LibWeb/Text/input/wpt-import/dom/events/event-disabled-dynamic.html b/Tests/LibWeb/Text/input/wpt-import/dom/events/event-disabled-dynamic.html new file mode 100644 index 00000000000..4eb089fcbd5 --- /dev/null +++ b/Tests/LibWeb/Text/input/wpt-import/dom/events/event-disabled-dynamic.html @@ -0,0 +1,21 @@ + + +Test that disabled is honored immediately in presence of dynamic changes + + + + + + + + diff --git a/Tests/LibWeb/Text/input/wpt-import/dom/events/event-global-extra.window.js b/Tests/LibWeb/Text/input/wpt-import/dom/events/event-global-extra.window.js new file mode 100644 index 00000000000..0f14961c40a --- /dev/null +++ b/Tests/LibWeb/Text/input/wpt-import/dom/events/event-global-extra.window.js @@ -0,0 +1,90 @@ +const otherWindow = document.body.appendChild(document.createElement("iframe")).contentWindow; + +["EventTarget", "XMLHttpRequest"].forEach(constructorName => { + async_test(t => { + const eventTarget = new otherWindow[constructorName](); + eventTarget.addEventListener("hi", t.step_func_done(e => { + assert_equals(otherWindow.event, undefined); + assert_equals(e, window.event); + })); + eventTarget.dispatchEvent(new Event("hi")); + }, "window.event for constructors from another global: " + constructorName); +}); + +// XXX: It would be good to test a subclass of EventTarget once we sort out +// https://github.com/heycam/webidl/issues/540 + +async_test(t => { + const element = document.body.appendChild(otherWindow.document.createElement("meh")); + element.addEventListener("yo", t.step_func_done(e => { + assert_equals(e, window.event); + })); + element.dispatchEvent(new Event("yo")); +}, "window.event and element from another document"); + +async_test(t => { + const doc = otherWindow.document, + element = doc.body.appendChild(doc.createElement("meh")), + child = element.appendChild(doc.createElement("bleh")); + element.addEventListener("yoyo", t.step_func(e => { + document.body.appendChild(element); + assert_equals(element.ownerDocument, document); + assert_equals(window.event, e); + assert_equals(otherWindow.event, undefined); + }), true); + element.addEventListener("yoyo", t.step_func(e => { + assert_equals(element.ownerDocument, document); + assert_equals(window.event, e); + assert_equals(otherWindow.event, undefined); + }), true); + child.addEventListener("yoyo", t.step_func_done(e => { + assert_equals(child.ownerDocument, document); + assert_equals(window.event, e); + assert_equals(otherWindow.event, undefined); + })); + child.dispatchEvent(new Event("yoyo")); +}, "window.event and moving an element post-dispatch"); + +test(t => { + const host = document.createElement("div"), + shadow = host.attachShadow({ mode: "open" }), + child = shadow.appendChild(document.createElement("trala")), + furtherChild = child.appendChild(document.createElement("waddup")); + let counter = 0; + host.addEventListener("hi", t.step_func(e => { + assert_equals(window.event, e); + assert_equals(counter++, 3); + })); + child.addEventListener("hi", t.step_func(e => { + assert_equals(window.event, undefined); + assert_equals(counter++, 2); + })); + furtherChild.addEventListener("hi", t.step_func(e => { + host.appendChild(child); + assert_equals(window.event, undefined); + assert_equals(counter++, 0); + })); + furtherChild.addEventListener("hi", t.step_func(e => { + assert_equals(window.event, undefined); + assert_equals(counter++, 1); + })); + furtherChild.dispatchEvent(new Event("hi", { composed: true, bubbles: true })); + assert_equals(counter, 4); +}, "window.event should not be affected by nodes moving post-dispatch"); + +async_test(t => { + const frame = document.body.appendChild(document.createElement("iframe")); + frame.src = "resources/event-global-extra-frame.html"; + frame.onload = t.step_func_done((load_event) => { + const event = new Event("hi"); + document.addEventListener("hi", frame.contentWindow.listener); // listener intentionally not wrapped in t.step_func + document.addEventListener("hi", t.step_func(e => { + assert_equals(event, e); + assert_equals(window.event, e); + })); + document.dispatchEvent(event); + assert_equals(frameState.event, event); + assert_equals(frameState.windowEvent, event); + assert_equals(frameState.parentEvent, load_event); + }); +}, "Listener from a different global"); diff --git a/Tests/LibWeb/Text/input/wpt-import/dom/events/event-global-set-before-handleEvent-lookup.window.js b/Tests/LibWeb/Text/input/wpt-import/dom/events/event-global-set-before-handleEvent-lookup.window.js new file mode 100644 index 00000000000..8f934bcea97 --- /dev/null +++ b/Tests/LibWeb/Text/input/wpt-import/dom/events/event-global-set-before-handleEvent-lookup.window.js @@ -0,0 +1,19 @@ +// https://dom.spec.whatwg.org/#concept-event-listener-inner-invoke (steps 8.2 - 12) +// https://webidl.spec.whatwg.org/#call-a-user-objects-operation (step 10.1) + +test(() => { + const eventTarget = new EventTarget; + + let currentEvent; + eventTarget.addEventListener("foo", { + get handleEvent() { + currentEvent = window.event; + return () => {}; + } + }); + + const event = new Event("foo"); + eventTarget.dispatchEvent(event); + + assert_equals(currentEvent, event); +}, "window.event is set before 'handleEvent' lookup"); diff --git a/Tests/LibWeb/Text/input/wpt-import/dom/events/event-global.html b/Tests/LibWeb/Text/input/wpt-import/dom/events/event-global.html new file mode 100644 index 00000000000..f7739328046 --- /dev/null +++ b/Tests/LibWeb/Text/input/wpt-import/dom/events/event-global.html @@ -0,0 +1,127 @@ + +window.event tests + + + +
+ diff --git a/Tests/LibWeb/Text/input/wpt-import/dom/events/event-global.worker.js b/Tests/LibWeb/Text/input/wpt-import/dom/events/event-global.worker.js new file mode 100644 index 00000000000..116cf32932b --- /dev/null +++ b/Tests/LibWeb/Text/input/wpt-import/dom/events/event-global.worker.js @@ -0,0 +1,14 @@ +importScripts("/resources/testharness.js"); +test(t => { + let seen = false; + const event = new Event("hi"); + assert_equals(self.event, undefined); + self.addEventListener("hi", t.step_func(e => { + seen = true; + assert_equals(self.event, undefined); + assert_equals(e, event); + })); + self.dispatchEvent(event); + assert_true(seen); +}, "There's no self.event (that's why we call it window.event) in workers"); +done(); diff --git a/Tests/LibWeb/Text/input/wpt-import/dom/events/legacy-pre-activation-behavior.window.js b/Tests/LibWeb/Text/input/wpt-import/dom/events/legacy-pre-activation-behavior.window.js new file mode 100644 index 00000000000..e9e84bfad1e --- /dev/null +++ b/Tests/LibWeb/Text/input/wpt-import/dom/events/legacy-pre-activation-behavior.window.js @@ -0,0 +1,10 @@ +test(t => { + const input = document.body.appendChild(document.createElement('input')); + input.type = "radio"; + t.add_cleanup(() => input.remove()); + const clickEvent = new MouseEvent('click', { button: 0, which: 1 }); + input.addEventListener('change', t.step_func(() => { + assert_equals(clickEvent.eventPhase, Event.NONE); + })); + input.dispatchEvent(clickEvent); +}, "Use NONE phase during legacy-pre-activation behavior"); diff --git a/Tests/LibWeb/Text/input/wpt-import/dom/events/mouse-event-retarget.html b/Tests/LibWeb/Text/input/wpt-import/dom/events/mouse-event-retarget.html new file mode 100644 index 00000000000..8e031df9806 --- /dev/null +++ b/Tests/LibWeb/Text/input/wpt-import/dom/events/mouse-event-retarget.html @@ -0,0 +1,26 @@ + + +Script created MouseEvent properly retargets and adjusts offsetX + + + + + +
Hello
+ + diff --git a/Tests/LibWeb/Text/input/wpt-import/dom/events/passive-by-default.html b/Tests/LibWeb/Text/input/wpt-import/dom/events/passive-by-default.html new file mode 100644 index 00000000000..515fd1886bb --- /dev/null +++ b/Tests/LibWeb/Text/input/wpt-import/dom/events/passive-by-default.html @@ -0,0 +1,50 @@ + +Default passive event listeners on window, document, document element, body + + + + +
+ diff --git a/Tests/LibWeb/Text/input/wpt-import/dom/events/preventDefault-during-activation-behavior.html b/Tests/LibWeb/Text/input/wpt-import/dom/events/preventDefault-during-activation-behavior.html new file mode 100644 index 00000000000..4b3875fc3b1 --- /dev/null +++ b/Tests/LibWeb/Text/input/wpt-import/dom/events/preventDefault-during-activation-behavior.html @@ -0,0 +1,53 @@ + +preventDefault during activation behavior + + + + + + + + + +
+ +
+ + diff --git a/Tests/LibWeb/Text/input/wpt-import/dom/events/relatedTarget.window.js b/Tests/LibWeb/Text/input/wpt-import/dom/events/relatedTarget.window.js new file mode 100644 index 00000000000..ebc83ceb209 --- /dev/null +++ b/Tests/LibWeb/Text/input/wpt-import/dom/events/relatedTarget.window.js @@ -0,0 +1,81 @@ +// https://dom.spec.whatwg.org/#concept-event-dispatch + +const host = document.createElement("div"), + child = host.appendChild(document.createElement("p")), + shadow = host.attachShadow({ mode: "closed" }), + slot = shadow.appendChild(document.createElement("slot")); + +test(() => { + for (target of [shadow, slot]) { + for (relatedTarget of [new XMLHttpRequest(), self, host]) { + const event = new FocusEvent("demo", { relatedTarget: relatedTarget }); + target.dispatchEvent(event); + assert_equals(event.target, null); + assert_equals(event.relatedTarget, null); + } + } +}, "Reset if target pointed to a shadow tree"); + +test(() => { + for (relatedTarget of [shadow, slot]) { + for (target of [new XMLHttpRequest(), self, host]) { + const event = new FocusEvent("demo", { relatedTarget: relatedTarget }); + target.dispatchEvent(event); + assert_equals(event.target, target); + assert_equals(event.relatedTarget, host); + } + } +}, "Retarget a shadow-tree relatedTarget"); + +test(t => { + const shadowChild = shadow.appendChild(document.createElement("div")); + shadowChild.addEventListener("demo", t.step_func(() => document.body.appendChild(shadowChild))); + const event = new FocusEvent("demo", { relatedTarget: new XMLHttpRequest() }); + shadowChild.dispatchEvent(event); + assert_equals(shadowChild.parentNode, document.body); + assert_equals(event.target, null); + assert_equals(event.relatedTarget, null); + shadowChild.remove(); +}, "Reset if target pointed to a shadow tree pre-dispatch"); + +test(t => { + const shadowChild = shadow.appendChild(document.createElement("div")); + document.body.addEventListener("demo", t.step_func(() => document.body.appendChild(shadowChild))); + const event = new FocusEvent("demo", { relatedTarget: shadowChild }); + document.body.dispatchEvent(event); + assert_equals(shadowChild.parentNode, document.body); + assert_equals(event.target, document.body); + assert_equals(event.relatedTarget, host); + shadowChild.remove(); +}, "Retarget a shadow-tree relatedTarget, part 2"); + +test(t => { + const event = new FocusEvent("heya", { relatedTarget: shadow, cancelable: true }), + callback = t.unreached_func(); + host.addEventListener("heya", callback); + t.add_cleanup(() => host.removeEventListener("heya", callback)); + event.preventDefault(); + assert_true(event.defaultPrevented); + assert_false(host.dispatchEvent(event)); + assert_equals(event.target, null); + assert_equals(event.relatedTarget, null); + // Check that the dispatch flag is cleared + event.initEvent("x"); + assert_equals(event.type, "x"); +}, "Reset targets on early return"); + +test(t => { + const input = document.body.appendChild(document.createElement("input")), + event = new MouseEvent("click", { relatedTarget: shadow }); + let seen = false; + t.add_cleanup(() => input.remove()); + input.type = "checkbox"; + input.oninput = t.step_func(() => { + assert_equals(event.target, null); + assert_equals(event.relatedTarget, null); + assert_equals(event.composedPath().length, 0); + seen = true; + }); + assert_true(input.dispatchEvent(event)); + assert_true(seen); +}, "Reset targets before activation behavior"); diff --git a/Tests/LibWeb/Text/input/wpt-import/dom/events/remove-all-listeners.html b/Tests/LibWeb/Text/input/wpt-import/dom/events/remove-all-listeners.html new file mode 100644 index 00000000000..caaf6019a84 --- /dev/null +++ b/Tests/LibWeb/Text/input/wpt-import/dom/events/remove-all-listeners.html @@ -0,0 +1,95 @@ + +Various edge cases where listeners are removed during iteration + + +
+ diff --git a/Tests/LibWeb/Text/input/wpt-import/dom/events/shadow-relatedTarget.html b/Tests/LibWeb/Text/input/wpt-import/dom/events/shadow-relatedTarget.html new file mode 100644 index 00000000000..ef746380e03 --- /dev/null +++ b/Tests/LibWeb/Text/input/wpt-import/dom/events/shadow-relatedTarget.html @@ -0,0 +1,30 @@ + + + + +
+ + diff --git a/Tests/LibWeb/Text/input/wpt-import/dom/nodes/Document-createEvent.js b/Tests/LibWeb/Text/input/wpt-import/dom/nodes/Document-createEvent.js new file mode 100644 index 00000000000..0df5d3f6e1f --- /dev/null +++ b/Tests/LibWeb/Text/input/wpt-import/dom/nodes/Document-createEvent.js @@ -0,0 +1,22 @@ +var aliases = { + "BeforeUnloadEvent": "BeforeUnloadEvent", + "CompositionEvent": "CompositionEvent", + "CustomEvent": "CustomEvent", + "DeviceMotionEvent": "DeviceMotionEvent", + "DeviceOrientationEvent": "DeviceOrientationEvent", + "DragEvent": "DragEvent", + "Event": "Event", + "Events": "Event", + "FocusEvent": "FocusEvent", + "HashChangeEvent": "HashChangeEvent", + "HTMLEvents": "Event", + "KeyboardEvent": "KeyboardEvent", + "MessageEvent": "MessageEvent", + "MouseEvent": "MouseEvent", + "MouseEvents": "MouseEvent", + "StorageEvent": "StorageEvent", + "SVGEvents": "Event", + "TextEvent": "TextEvent", + "UIEvent": "UIEvent", + "UIEvents": "UIEvent", +};