From 086c044dc34dfc0f74fbe41f4ecb402b2cd34884 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Fri, 19 Apr 2024 03:13:33 +0200 Subject: Merging upstream version 125.0.1. Signed-off-by: Daniel Baumann --- ...overscroll-event-fired-to-scrolled-element.html | 11 +- .../tests/dom/events/scrolling/scroll_support.js | 12 +- .../tests/dom/nodes/Document-createEvent.js | 2 +- ...nd-form-and-script-from-fragment.tentative.html | 22 +++ ...eferrer-and-script-from-fragment.tentative.html | 29 ++++ ...Child-script-and-button-from-div.tentative.html | 26 ++++ ...-script-and-custom-from-fragment.tentative.html | 34 +++++ ...default-style-meta-from-fragment.tentative.html | 35 +++++ ...ild-script-and-div-from-fragment.tentative.html | 29 ++++ ...de-appendChild-script-and-iframe.tentative.html | 89 +++++++++++ ...-script-and-source-from-fragment.tentative.html | 33 ++++ ...ode-appendChild-script-and-style.tentative.html | 118 +++++++++++++++ ...ode-appendChild-script-in-script.tentative.html | 51 +++++++ ...-script-with-mutation-observer-takeRecords.html | 21 +++ ...ndChild-text-and-script-in-style.tentative.html | 30 ++++ .../Node-appendChild-text-in-script.tentative.html | 24 +++ ...hild-three-scripts-from-fragment.tentative.html | 30 ++++ .../Node-appendChild-three-scripts.tentative.html | 30 ++++ .../insertion-removing-steps/blur-event.window.js | 19 +++ .../insertion-removing-steps-iframe.window.js | 158 ++++++++++++++++++++ .../insertion-removing-steps-script.window.js | 48 ++++++ .../script-does-not-run-on-child-removal.window.js | 33 ++++ .../tentative/observable-constructor.any.js | 35 ++++- .../observable/tentative/observable-drop.any.js | 152 +++++++++++++++++++ .../observable/tentative/observable-filter.any.js | 105 +++++++++++++ .../dom/observable/tentative/observable-map.any.js | 166 +++++++++++++++++++++ .../observable/tentative/observable-map.window.js | 40 +++++ .../observable/tentative/observable-take.any.js | 108 ++++++++++++++ .../tentative/observable-takeUntil.any.js | 130 +++++++++------- .../Range-in-shadow-after-the-shadow-removed.html | 47 ++++++ 30 files changed, 1598 insertions(+), 69 deletions(-) create mode 100644 testing/web-platform/tests/dom/nodes/insertion-removing-steps/Node-append-form-and-script-from-fragment.tentative.html create mode 100644 testing/web-platform/tests/dom/nodes/insertion-removing-steps/Node-append-meta-referrer-and-script-from-fragment.tentative.html create mode 100644 testing/web-platform/tests/dom/nodes/insertion-removing-steps/Node-appendChild-script-and-button-from-div.tentative.html create mode 100644 testing/web-platform/tests/dom/nodes/insertion-removing-steps/Node-appendChild-script-and-custom-from-fragment.tentative.html create mode 100644 testing/web-platform/tests/dom/nodes/insertion-removing-steps/Node-appendChild-script-and-default-style-meta-from-fragment.tentative.html create mode 100644 testing/web-platform/tests/dom/nodes/insertion-removing-steps/Node-appendChild-script-and-div-from-fragment.tentative.html create mode 100644 testing/web-platform/tests/dom/nodes/insertion-removing-steps/Node-appendChild-script-and-iframe.tentative.html create mode 100644 testing/web-platform/tests/dom/nodes/insertion-removing-steps/Node-appendChild-script-and-source-from-fragment.tentative.html create mode 100644 testing/web-platform/tests/dom/nodes/insertion-removing-steps/Node-appendChild-script-and-style.tentative.html create mode 100644 testing/web-platform/tests/dom/nodes/insertion-removing-steps/Node-appendChild-script-in-script.tentative.html create mode 100644 testing/web-platform/tests/dom/nodes/insertion-removing-steps/Node-appendChild-script-with-mutation-observer-takeRecords.html create mode 100644 testing/web-platform/tests/dom/nodes/insertion-removing-steps/Node-appendChild-text-and-script-in-style.tentative.html create mode 100644 testing/web-platform/tests/dom/nodes/insertion-removing-steps/Node-appendChild-text-in-script.tentative.html create mode 100644 testing/web-platform/tests/dom/nodes/insertion-removing-steps/Node-appendChild-three-scripts-from-fragment.tentative.html create mode 100644 testing/web-platform/tests/dom/nodes/insertion-removing-steps/Node-appendChild-three-scripts.tentative.html create mode 100644 testing/web-platform/tests/dom/nodes/insertion-removing-steps/blur-event.window.js create mode 100644 testing/web-platform/tests/dom/nodes/insertion-removing-steps/insertion-removing-steps-iframe.window.js create mode 100644 testing/web-platform/tests/dom/nodes/insertion-removing-steps/insertion-removing-steps-script.window.js create mode 100644 testing/web-platform/tests/dom/nodes/insertion-removing-steps/script-does-not-run-on-child-removal.window.js create mode 100644 testing/web-platform/tests/dom/observable/tentative/observable-drop.any.js create mode 100644 testing/web-platform/tests/dom/observable/tentative/observable-filter.any.js create mode 100644 testing/web-platform/tests/dom/observable/tentative/observable-map.any.js create mode 100644 testing/web-platform/tests/dom/observable/tentative/observable-map.window.js create mode 100644 testing/web-platform/tests/dom/observable/tentative/observable-take.any.js create mode 100644 testing/web-platform/tests/dom/ranges/Range-in-shadow-after-the-shadow-removed.html (limited to 'testing/web-platform/tests/dom') diff --git a/testing/web-platform/tests/dom/events/scrolling/overscroll-event-fired-to-scrolled-element.html b/testing/web-platform/tests/dom/events/scrolling/overscroll-event-fired-to-scrolled-element.html index cfc782a809..be4176df59 100644 --- a/testing/web-platform/tests/dom/events/scrolling/overscroll-event-fired-to-scrolled-element.html +++ b/testing/web-platform/tests/dom/events/scrolling/overscroll-event-fired-to-scrolled-element.html @@ -10,11 +10,14 @@ width: 200px; height: 200px; overflow: scroll; + position: absolute; + left: 150px; + top: 150px; } #innerDiv { - width: 400px; - height: 400px; + width: 250px; + height: 250px; } @@ -45,7 +48,7 @@ function runTest() { await waitForCompositorCommit(); // Do a horizontal scroll and wait for overscroll event. - await touchScrollInTarget(300, scrolling_div , 'right'); + await touchScrollInTarget(100, scrolling_div , 'right'); await waitFor(() => { return overscrolled_x_delta > 0; }, 'Scroller did not receive overscroll event after horizontal scroll.'); assert_equals(scrolling_div.scrollWidth - scrolling_div.scrollLeft, @@ -55,7 +58,7 @@ function runTest() { overscrolled_y_delta = 0; // Do a vertical scroll and wait for overscroll event. - await touchScrollInTarget(300, scrolling_div, 'down'); + await touchScrollInTarget(100, scrolling_div, 'down'); await waitFor(() => { return overscrolled_y_delta > 0; }, 'Scroller did not receive overscroll event after vertical scroll.'); assert_equals(scrolling_div.scrollHeight - scrolling_div.scrollTop, diff --git a/testing/web-platform/tests/dom/events/scrolling/scroll_support.js b/testing/web-platform/tests/dom/events/scrolling/scroll_support.js index e86ead5456..e536b7d748 100644 --- a/testing/web-platform/tests/dom/events/scrolling/scroll_support.js +++ b/testing/web-platform/tests/dom/events/scrolling/scroll_support.js @@ -26,17 +26,15 @@ async function waitForPointercancelEvent(test, target, timeoutMs = 500) { // Resets the scroll position to (0,0). If a scroll is required, then the // promise is not resolved until the scrollend event is received. -async function waitForScrollReset(test, scroller, timeoutMs = 500) { +async function waitForScrollReset(test, scroller, x = 0, y = 0) { return new Promise(resolve => { - if (scroller.scrollTop == 0 && - scroller.scrollLeft == 0) { + if (scroller.scrollTop == x && scroller.scrollLeft == y) { resolve(); } else { const eventTarget = scroller == document.scrollingElement ? document : scroller; - scroller.scrollTop = 0; - scroller.scrollLeft = 0; - waitForScrollendEvent(test, eventTarget, timeoutMs).then(resolve); + scroller.scrollTo(x, y); + waitForScrollendEventNoTimeout(eventTarget).then(resolve); } }); } @@ -121,7 +119,7 @@ function waitForCompositorCommit() { // deferred running the tests until after paint holding. async function waitForCompositorReady() { const animation = - document.body.animate({ opacity: [ 1, 1 ] }, {duration: 1 }); + document.body.animate({ opacity: [ 0, 1 ] }, {duration: 1 }); return animation.finished; } diff --git a/testing/web-platform/tests/dom/nodes/Document-createEvent.js b/testing/web-platform/tests/dom/nodes/Document-createEvent.js index 57e8e966f8..0df5d3f6e1 100644 --- a/testing/web-platform/tests/dom/nodes/Document-createEvent.js +++ b/testing/web-platform/tests/dom/nodes/Document-createEvent.js @@ -16,7 +16,7 @@ var aliases = { "MouseEvents": "MouseEvent", "StorageEvent": "StorageEvent", "SVGEvents": "Event", - "TextEvent": "CompositionEvent", + "TextEvent": "TextEvent", "UIEvent": "UIEvent", "UIEvents": "UIEvent", }; diff --git a/testing/web-platform/tests/dom/nodes/insertion-removing-steps/Node-append-form-and-script-from-fragment.tentative.html b/testing/web-platform/tests/dom/nodes/insertion-removing-steps/Node-append-form-and-script-from-fragment.tentative.html new file mode 100644 index 0000000000..10351d1645 --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/insertion-removing-steps/Node-append-form-and-script-from-fragment.tentative.html @@ -0,0 +1,22 @@ + + +Node.appendChild: inserting script and associated form + + + + diff --git a/testing/web-platform/tests/dom/nodes/insertion-removing-steps/Node-append-meta-referrer-and-script-from-fragment.tentative.html b/testing/web-platform/tests/dom/nodes/insertion-removing-steps/Node-append-meta-referrer-and-script-from-fragment.tentative.html new file mode 100644 index 0000000000..d247797603 --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/insertion-removing-steps/Node-append-meta-referrer-and-script-from-fragment.tentative.html @@ -0,0 +1,29 @@ + + +Node.appendChild: inserting script and meta-referrer from a div + + + diff --git a/testing/web-platform/tests/dom/nodes/insertion-removing-steps/Node-appendChild-script-and-button-from-div.tentative.html b/testing/web-platform/tests/dom/nodes/insertion-removing-steps/Node-appendChild-script-and-button-from-div.tentative.html new file mode 100644 index 0000000000..91f09ae500 --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/insertion-removing-steps/Node-appendChild-script-and-button-from-div.tentative.html @@ -0,0 +1,26 @@ + + +Node.appendChild: inserting script and button from a div + + +
+ diff --git a/testing/web-platform/tests/dom/nodes/insertion-removing-steps/Node-appendChild-script-and-custom-from-fragment.tentative.html b/testing/web-platform/tests/dom/nodes/insertion-removing-steps/Node-appendChild-script-and-custom-from-fragment.tentative.html new file mode 100644 index 0000000000..23a050f37e --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/insertion-removing-steps/Node-appendChild-script-and-custom-from-fragment.tentative.html @@ -0,0 +1,34 @@ + + +Node.appendChild: inserting script and custom element from a DocumentFragment + + + + diff --git a/testing/web-platform/tests/dom/nodes/insertion-removing-steps/Node-appendChild-script-and-default-style-meta-from-fragment.tentative.html b/testing/web-platform/tests/dom/nodes/insertion-removing-steps/Node-appendChild-script-and-default-style-meta-from-fragment.tentative.html new file mode 100644 index 0000000000..a9b7ba633e --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/insertion-removing-steps/Node-appendChild-script-and-default-style-meta-from-fragment.tentative.html @@ -0,0 +1,35 @@ + + +Node.appendChild: inserting script and default-style meta from a fragment + + + +
hello
+ diff --git a/testing/web-platform/tests/dom/nodes/insertion-removing-steps/Node-appendChild-script-and-div-from-fragment.tentative.html b/testing/web-platform/tests/dom/nodes/insertion-removing-steps/Node-appendChild-script-and-div-from-fragment.tentative.html new file mode 100644 index 0000000000..b154c1bf4f --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/insertion-removing-steps/Node-appendChild-script-and-div-from-fragment.tentative.html @@ -0,0 +1,29 @@ + + +Node.appendChild: inserting script and div from a DocumentFragment + + + + diff --git a/testing/web-platform/tests/dom/nodes/insertion-removing-steps/Node-appendChild-script-and-iframe.tentative.html b/testing/web-platform/tests/dom/nodes/insertion-removing-steps/Node-appendChild-script-and-iframe.tentative.html new file mode 100644 index 0000000000..68b288f24d --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/insertion-removing-steps/Node-appendChild-script-and-iframe.tentative.html @@ -0,0 +1,89 @@ + + +Node.appendChild: inserting script and iframe + + + + diff --git a/testing/web-platform/tests/dom/nodes/insertion-removing-steps/Node-appendChild-script-and-source-from-fragment.tentative.html b/testing/web-platform/tests/dom/nodes/insertion-removing-steps/Node-appendChild-script-and-source-from-fragment.tentative.html new file mode 100644 index 0000000000..7f93ac43bd --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/insertion-removing-steps/Node-appendChild-script-and-source-from-fragment.tentative.html @@ -0,0 +1,33 @@ + + +Node.appendChild: inserting script and source from a fragment + + + + diff --git a/testing/web-platform/tests/dom/nodes/insertion-removing-steps/Node-appendChild-script-and-style.tentative.html b/testing/web-platform/tests/dom/nodes/insertion-removing-steps/Node-appendChild-script-and-style.tentative.html new file mode 100644 index 0000000000..d3365f8a5e --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/insertion-removing-steps/Node-appendChild-script-and-style.tentative.html @@ -0,0 +1,118 @@ + + +Node.appendChild: inserting a script and a style where the script modifies the style + + + + diff --git a/testing/web-platform/tests/dom/nodes/insertion-removing-steps/Node-appendChild-script-in-script.tentative.html b/testing/web-platform/tests/dom/nodes/insertion-removing-steps/Node-appendChild-script-in-script.tentative.html new file mode 100644 index 0000000000..39c4393323 --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/insertion-removing-steps/Node-appendChild-script-in-script.tentative.html @@ -0,0 +1,51 @@ + + +Node.appendChild: inserting a script and some code in an empty script + + + + + diff --git a/testing/web-platform/tests/dom/nodes/insertion-removing-steps/Node-appendChild-script-with-mutation-observer-takeRecords.html b/testing/web-platform/tests/dom/nodes/insertion-removing-steps/Node-appendChild-script-with-mutation-observer-takeRecords.html new file mode 100644 index 0000000000..33598e6408 --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/insertion-removing-steps/Node-appendChild-script-with-mutation-observer-takeRecords.html @@ -0,0 +1,21 @@ + + +Node.appendChild: inserted script should be able to take own mutation record + + + +
+ diff --git a/testing/web-platform/tests/dom/nodes/insertion-removing-steps/Node-appendChild-text-and-script-in-style.tentative.html b/testing/web-platform/tests/dom/nodes/insertion-removing-steps/Node-appendChild-text-and-script-in-style.tentative.html new file mode 100644 index 0000000000..850af680a0 --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/insertion-removing-steps/Node-appendChild-text-and-script-in-style.tentative.html @@ -0,0 +1,30 @@ + + +Node.appendChild: inserting text and script nodes in a style element + + + + + diff --git a/testing/web-platform/tests/dom/nodes/insertion-removing-steps/Node-appendChild-text-in-script.tentative.html b/testing/web-platform/tests/dom/nodes/insertion-removing-steps/Node-appendChild-text-in-script.tentative.html new file mode 100644 index 0000000000..4d6543695c --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/insertion-removing-steps/Node-appendChild-text-in-script.tentative.html @@ -0,0 +1,24 @@ + + +Node.appendChild: inserting two text nodes in an empty script + + + + + diff --git a/testing/web-platform/tests/dom/nodes/insertion-removing-steps/Node-appendChild-three-scripts-from-fragment.tentative.html b/testing/web-platform/tests/dom/nodes/insertion-removing-steps/Node-appendChild-three-scripts-from-fragment.tentative.html new file mode 100644 index 0000000000..a7b7405b64 --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/insertion-removing-steps/Node-appendChild-three-scripts-from-fragment.tentative.html @@ -0,0 +1,30 @@ + + +Node.appendChild: inserting three scripts from a document fragment + + + + diff --git a/testing/web-platform/tests/dom/nodes/insertion-removing-steps/Node-appendChild-three-scripts.tentative.html b/testing/web-platform/tests/dom/nodes/insertion-removing-steps/Node-appendChild-three-scripts.tentative.html new file mode 100644 index 0000000000..6ffa35515e --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/insertion-removing-steps/Node-appendChild-three-scripts.tentative.html @@ -0,0 +1,30 @@ + + +Node.appendChild: inserting three scripts from a div + + + + diff --git a/testing/web-platform/tests/dom/nodes/insertion-removing-steps/blur-event.window.js b/testing/web-platform/tests/dom/nodes/insertion-removing-steps/blur-event.window.js new file mode 100644 index 0000000000..4c8cd85cbf --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/insertion-removing-steps/blur-event.window.js @@ -0,0 +1,19 @@ +test(() => { + const input = document.body.appendChild(document.createElement('input')); + input.focus(); + + let blurCalled = false; + input.onblur = e => blurCalled = true; + input.remove(); + assert_false(blurCalled, "Blur event was not fired"); +}, " element does not fire blur event upon DOM removal"); + +test(() => { + const button = document.body.appendChild(document.createElement('button')); + button.focus(); + + let blurCalled = false; + button.onblur = e => blurCalled = true; + button.remove(); + assert_false(blurCalled, "Blur event was not fired"); +}, "