From 43a97878ce14b72f0981164f87f2e35e14151312 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 11:22:09 +0200 Subject: Adding upstream version 110.0.1. Signed-off-by: Daniel Baumann --- .../browsers/the-window-object/BarProp.window.js | 59 ++++ .../the-window-object/Document-defaultView.html | 38 +++ .../the-window-object/Window-document.html | 25 ++ .../indexed-browsing-contexts-01.html | 47 +++ .../indexed-browsing-contexts-02.html | 62 ++++ .../indexed-browsing-contexts-03.html | 30 ++ .../iterator.html | 11 + .../accessing-other-browsing-contexts/test1.html | 12 + .../accessing-other-browsing-contexts/test2.html | 6 + .../accessing-other-browsing-contexts/test3.html | 8 + .../window_length.html | 51 +++ .../the-window-object/close-method.window.js | 39 +++ .../the-window-object/closed-attribute.window.js | 69 ++++ .../browsers/the-window-object/defaultstatus.html | 17 + .../the-window-object/document-attribute.window.js | 15 + .../browsers/the-window-object/focus.window.js | 15 + .../discard_iframe_history_1-1.html | 20 ++ .../discard_iframe_history_1-2.html | 2 + .../discard_iframe_history_1.html | 10 + .../discard_iframe_history_2-1.html | 22 ++ .../discard_iframe_history_2.html | 10 + .../discard_iframe_history_3-1.html | 21 ++ .../discard_iframe_history_3-2.html | 4 + .../discard_iframe_history_3-3.html | 4 + .../discard_iframe_history_3.html | 9 + .../discard_iframe_history_4-1.html | 21 ++ .../discard_iframe_history_4-2.html | 4 + .../discard_iframe_history_4-3.html | 4 + .../discard_iframe_history_4.html | 9 + .../non-automated/discard_iframe_history_1-1.html | 27 ++ .../non-automated/discard_iframe_history_1-2.html | 2 + .../discard_iframe_history_1-manual.html | 10 + .../non-automated/discard_iframe_history_2-1.html | 19 ++ .../non-automated/discard_iframe_history_2-2.html | 1 + .../non-automated/discard_iframe_history_2-3.html | 1 + .../discard_iframe_history_2-manual.html | 10 + .../the-window-object/historical.window.js | 4 + .../the-window-object/length-attribute.window.js | 24 ++ .../the-window-object/name-attribute.window.js | 18 ++ .../cross-global-npo.html | 38 +++ .../cross-global-support.html | 4 + .../named-objects.html | 76 +++++ .../navigated-named-objects.window.js | 67 ++++ .../prototype.html | 94 ++++++ .../named-access-on-the-window-object/test.html | 7 + .../window-named-properties.html | 83 +++++ .../window-null-names.html | 20 ++ ...-to-about-blank-while-initial-load-pending.html | 26 ++ .../noopener-noreferrer-BarProp.window.js | 23 ++ .../noopener-noreferrer-sizing.window.js | 17 + .../the-window-object/open-close/callback.js | 1 + .../open-close/close_beforeunload-1.html | 7 + .../open-close/close_beforeunload.html | 16 + .../open-close/close_script_defer-1.html | 1 + .../open-close/close_script_defer.html | 18 ++ .../open-close/close_unload-1.html | 7 + .../the-window-object/open-close/close_unload.html | 16 + .../creating_browsing_context_test_01.html | 39 +++ ..._open_when_term_nesting_level_nonzero.window.js | 113 +++++++ .../open-close/non_automated/001-1.html | 2 + .../open-close/non_automated/001-2.html | 16 + .../open-close/non_automated/001.html | 3 + .../open-close/non_automated/002-1.html | 8 + .../open-close/non_automated/002-2.html | 16 + .../open-close/non_automated/002.html | 3 + .../open-features-is-popup-condition.html | 149 +++++++++ ...n-features-negative-innerwidth-innerheight.html | 75 +++++ .../open-features-negative-screenx-screeny.html | 67 ++++ .../open-features-negative-top-left.html | 68 ++++ .../open-features-negative-width-height.html | 75 +++++ .../open-features-non-integer-height.html | 91 ++++++ .../open-features-non-integer-innerheight.html | 76 +++++ .../open-features-non-integer-innerwidth.html | 75 +++++ .../open-close/open-features-non-integer-left.html | 76 +++++ .../open-features-non-integer-screenx.html | 75 +++++ .../open-features-non-integer-screeny.html | 76 +++++ .../open-close/open-features-non-integer-top.html | 73 +++++ .../open-features-non-integer-width.html | 91 ++++++ ...atures-tokenization-innerheight-innerwidth.html | 55 ++++ .../open-features-tokenization-noopener.html | 11 + .../open-features-tokenization-noreferrer.html | 11 + ...open-features-tokenization-screenx-screeny.html | 55 ++++ .../open-features-tokenization-top-left.html | 69 ++++ .../open-features-tokenization-width-height.html | 71 ++++ .../open-close/resources/close-self.html | 3 + .../open-close/resources/is-popup-barprop.html | 15 + .../open-close/resources/message-opener.html | 22 ++ .../resources/tokenization-noopener-noreferrer.js | 152 +++++++++ .../proxy-getOwnPropertyDescriptor.html | 126 ++++++++ .../security-window/window-security.https.html | 200 ++++++++++++ .../the-window-object/self-et-al.window.js | 43 +++ .../the-window-object/support/BarProp-target.html | 17 + .../browsers/the-window-object/support/closed.html | 12 + .../the-window-object/support/noopener-target.html | 15 + .../support/noreferrer-target.html | 13 + .../support/same-origin-iframe.html | 8 + .../the-window-object/support/sizing-target.html | 17 + .../support/window-open-popup-target.html | 24 ++ .../support/windowFeature-values-target.html | 24 ++ .../browsers/the-window-object/window-aliases.html | 28 ++ .../window-indexed-properties-delete-no-cache.html | 31 ++ .../window-indexed-properties-strict.html | 75 +++++ .../window-indexed-properties.html | 71 ++++ .../window-open-defaults.window.js | 12 + .../the-window-object/window-open-invalid-url.html | 10 + .../the-window-object/window-open-noopener.html | 137 ++++++++ .../the-window-object/window-open-noreferrer.html | 20 ++ .../window-open-popup-behavior.html | 51 +++ .../window-open-windowfeatures-values.html | 72 +++++ .../window-opener-unconfigurable.window.js | 17 + .../the-window-object/window-properties.https.html | 358 +++++++++++++++++++++ .../the-window-object/window-prototype-chain.html | 32 ++ ...euse-in-nested-browsing-contexts.tentative.html | 158 +++++++++ 113 files changed, 4583 insertions(+) create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/BarProp.window.js create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/Document-defaultView.html create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/Window-document.html create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/accessing-other-browsing-contexts/indexed-browsing-contexts-01.html create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/accessing-other-browsing-contexts/indexed-browsing-contexts-02.html create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/accessing-other-browsing-contexts/indexed-browsing-contexts-03.html create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/accessing-other-browsing-contexts/iterator.html create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/accessing-other-browsing-contexts/test1.html create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/accessing-other-browsing-contexts/test2.html create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/accessing-other-browsing-contexts/test3.html create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/accessing-other-browsing-contexts/window_length.html create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/close-method.window.js create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/closed-attribute.window.js create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/defaultstatus.html create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/document-attribute.window.js create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/focus.window.js create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/discard_iframe_history_1-1.html create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/discard_iframe_history_1-2.html create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/discard_iframe_history_1.html create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/discard_iframe_history_2-1.html create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/discard_iframe_history_2.html create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/discard_iframe_history_3-1.html create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/discard_iframe_history_3-2.html create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/discard_iframe_history_3-3.html create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/discard_iframe_history_3.html create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/discard_iframe_history_4-1.html create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/discard_iframe_history_4-2.html create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/discard_iframe_history_4-3.html create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/discard_iframe_history_4.html create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/non-automated/discard_iframe_history_1-1.html create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/non-automated/discard_iframe_history_1-2.html create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/non-automated/discard_iframe_history_1-manual.html create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/non-automated/discard_iframe_history_2-1.html create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/non-automated/discard_iframe_history_2-2.html create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/non-automated/discard_iframe_history_2-3.html create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/non-automated/discard_iframe_history_2-manual.html create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/historical.window.js create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/length-attribute.window.js create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/name-attribute.window.js create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/named-access-on-the-window-object/cross-global-npo.html create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/named-access-on-the-window-object/cross-global-support.html create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/named-access-on-the-window-object/named-objects.html create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/named-access-on-the-window-object/navigated-named-objects.window.js create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/named-access-on-the-window-object/prototype.html create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/named-access-on-the-window-object/test.html create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/named-access-on-the-window-object/window-named-properties.html create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/named-access-on-the-window-object/window-null-names.html create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/navigate-to-about-blank-while-initial-load-pending.html create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/noopener-noreferrer-BarProp.window.js create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/noopener-noreferrer-sizing.window.js create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/open-close/callback.js create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/open-close/close_beforeunload-1.html create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/open-close/close_beforeunload.html create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/open-close/close_script_defer-1.html create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/open-close/close_script_defer.html create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/open-close/close_unload-1.html create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/open-close/close_unload.html create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/open-close/creating_browsing_context_test_01.html create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/open-close/no_window_open_when_term_nesting_level_nonzero.window.js create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/open-close/non_automated/001-1.html create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/open-close/non_automated/001-2.html create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/open-close/non_automated/001.html create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/open-close/non_automated/002-1.html create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/open-close/non_automated/002-2.html create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/open-close/non_automated/002.html create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/open-close/open-features-is-popup-condition.html create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/open-close/open-features-negative-innerwidth-innerheight.html create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/open-close/open-features-negative-screenx-screeny.html create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/open-close/open-features-negative-top-left.html create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/open-close/open-features-negative-width-height.html create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/open-close/open-features-non-integer-height.html create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/open-close/open-features-non-integer-innerheight.html create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/open-close/open-features-non-integer-innerwidth.html create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/open-close/open-features-non-integer-left.html create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/open-close/open-features-non-integer-screenx.html create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/open-close/open-features-non-integer-screeny.html create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/open-close/open-features-non-integer-top.html create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/open-close/open-features-non-integer-width.html create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/open-close/open-features-tokenization-innerheight-innerwidth.html create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/open-close/open-features-tokenization-noopener.html create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/open-close/open-features-tokenization-noreferrer.html create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/open-close/open-features-tokenization-screenx-screeny.html create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/open-close/open-features-tokenization-top-left.html create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/open-close/open-features-tokenization-width-height.html create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/open-close/resources/close-self.html create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/open-close/resources/is-popup-barprop.html create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/open-close/resources/message-opener.html create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/open-close/resources/tokenization-noopener-noreferrer.js create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/proxy-getOwnPropertyDescriptor.html create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/security-window/window-security.https.html create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/self-et-al.window.js create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/support/BarProp-target.html create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/support/closed.html create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/support/noopener-target.html create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/support/noreferrer-target.html create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/support/same-origin-iframe.html create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/support/sizing-target.html create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/support/window-open-popup-target.html create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/support/windowFeature-values-target.html create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/window-aliases.html create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/window-indexed-properties-delete-no-cache.html create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/window-indexed-properties-strict.html create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/window-indexed-properties.html create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/window-open-defaults.window.js create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/window-open-invalid-url.html create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/window-open-noopener.html create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/window-open-noreferrer.html create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/window-open-popup-behavior.html create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/window-open-windowfeatures-values.html create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/window-opener-unconfigurable.window.js create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/window-properties.https.html create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/window-prototype-chain.html create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/window-reuse-in-nested-browsing-contexts.tentative.html (limited to 'testing/web-platform/tests/html/browsers/the-window-object') diff --git a/testing/web-platform/tests/html/browsers/the-window-object/BarProp.window.js b/testing/web-platform/tests/html/browsers/the-window-object/BarProp.window.js new file mode 100644 index 0000000000..27a357cab5 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/BarProp.window.js @@ -0,0 +1,59 @@ +function assert_barProps(barPropObjects, visible) { + let lastBarProp = undefined; + for (const currentBarProp of barPropObjects) { + assert_not_equals(currentBarProp, lastBarProp, "BarBrop objects of different properties are identical"); + assert_equals(currentBarProp.visible, visible, "a BarProp's visible is wrong"); + lastBarProp = currentBarProp; + } +} + +function assert_identical_barProps(barProps, w, oldBarPropObjects, visible) { + barProps.map(val => w[val]).map((val, index) => { + assert_equals(val, oldBarPropObjects[index], "BarProp identity not preserved"); + }); + assert_barProps(oldBarPropObjects, visible); +} + +async_test(t => { + const frame = document.body.appendChild(document.createElement("iframe")), + frameW = frame.contentWindow, + barProps = ["locationbar", "menubar", "personalbar", "scrollbars", "statusbar", "toolbar"], + barPropObjects = barProps.map(val => frameW[val]); + + assert_barProps(barPropObjects, true); + frame.remove(); + assert_identical_barProps(barProps, frameW, barPropObjects, false); + t.step_timeout(() => { + assert_identical_barProps(barProps, frameW, barPropObjects, false); + t.done(); + }, 0); +}, "BarBrop objects of a nested Window"); + +async_test(t => { + const openee = window.open("/common/blank.html"), + barProps = ["locationbar", "menubar", "personalbar", "scrollbars", "statusbar", "toolbar"], + barPropObjects = barProps.map(val => openee[val]); + + // This is used to demonstrate that the Document is replaced while the global object (not the + // global this object) stays the same + openee.tiedToGlobalObject = openee.document; + + assert_barProps(barPropObjects, true); + openee.onload = t.step_func(() => { + assert_own_property(openee, "tiedToGlobalObject"); + assert_not_equals(openee.tiedToGlobalObject, openee.document); + + assert_identical_barProps(barProps, openee, barPropObjects, true); + + openee.onunload = t.step_func(() => { + assert_identical_barProps(barProps, openee, barPropObjects, true); + t.step_timeout(() => { + assert_identical_barProps(barProps, openee, barPropObjects, false); + t.done(); + }, 0); + }); + + openee.close(); + assert_identical_barProps(barProps, openee, barPropObjects, true); + }); +}, "BarProp objects of an auxiliary Window"); diff --git a/testing/web-platform/tests/html/browsers/the-window-object/Document-defaultView.html b/testing/web-platform/tests/html/browsers/the-window-object/Document-defaultView.html new file mode 100644 index 0000000000..dbc75d30b2 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/Document-defaultView.html @@ -0,0 +1,38 @@ + + +Document#defaultView + + +
+ diff --git a/testing/web-platform/tests/html/browsers/the-window-object/Window-document.html b/testing/web-platform/tests/html/browsers/the-window-object/Window-document.html new file mode 100644 index 0000000000..9b27f5f7c7 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/Window-document.html @@ -0,0 +1,25 @@ + + +Window#document + + +
+ diff --git a/testing/web-platform/tests/html/browsers/the-window-object/accessing-other-browsing-contexts/indexed-browsing-contexts-01.html b/testing/web-platform/tests/html/browsers/the-window-object/accessing-other-browsing-contexts/indexed-browsing-contexts-01.html new file mode 100644 index 0000000000..9710d15fb2 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/accessing-other-browsing-contexts/indexed-browsing-contexts-01.html @@ -0,0 +1,47 @@ + + +HTML Test: the browsing contexts must be sorted in the order that their containers were inserted into the Document + + + + +
+ + + + diff --git a/testing/web-platform/tests/html/browsers/the-window-object/accessing-other-browsing-contexts/indexed-browsing-contexts-02.html b/testing/web-platform/tests/html/browsers/the-window-object/accessing-other-browsing-contexts/indexed-browsing-contexts-02.html new file mode 100644 index 0000000000..d09c944fd8 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/accessing-other-browsing-contexts/indexed-browsing-contexts-02.html @@ -0,0 +1,62 @@ + + + + HTML Test: the browsing contexts created by various container elements + + + + + + +
+
+ + + + +
+ diff --git a/testing/web-platform/tests/html/browsers/the-window-object/accessing-other-browsing-contexts/indexed-browsing-contexts-03.html b/testing/web-platform/tests/html/browsers/the-window-object/accessing-other-browsing-contexts/indexed-browsing-contexts-03.html new file mode 100644 index 0000000000..1548891175 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/accessing-other-browsing-contexts/indexed-browsing-contexts-03.html @@ -0,0 +1,30 @@ + + + + HTML Test: indexed property of a Window object + + + + + + +
+
+
+ + +
+ diff --git a/testing/web-platform/tests/html/browsers/the-window-object/accessing-other-browsing-contexts/iterator.html b/testing/web-platform/tests/html/browsers/the-window-object/accessing-other-browsing-contexts/iterator.html new file mode 100644 index 0000000000..76dc7dbae6 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/accessing-other-browsing-contexts/iterator.html @@ -0,0 +1,11 @@ + + +window[@@iterator] + + +
+ diff --git a/testing/web-platform/tests/html/browsers/the-window-object/accessing-other-browsing-contexts/test1.html b/testing/web-platform/tests/html/browsers/the-window-object/accessing-other-browsing-contexts/test1.html new file mode 100644 index 0000000000..f85f90f7c6 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/accessing-other-browsing-contexts/test1.html @@ -0,0 +1,12 @@ + + +HTML Test: child browsing contexts created by iframe elements + + + + + + +
+ +
diff --git a/testing/web-platform/tests/html/browsers/the-window-object/accessing-other-browsing-contexts/test2.html b/testing/web-platform/tests/html/browsers/the-window-object/accessing-other-browsing-contexts/test2.html new file mode 100644 index 0000000000..d6a16647fe --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/accessing-other-browsing-contexts/test2.html @@ -0,0 +1,6 @@ + + +HTML Test: child browsing contexts created by object and embed elements + + + diff --git a/testing/web-platform/tests/html/browsers/the-window-object/accessing-other-browsing-contexts/test3.html b/testing/web-platform/tests/html/browsers/the-window-object/accessing-other-browsing-contexts/test3.html new file mode 100644 index 0000000000..a62fdbaae7 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/accessing-other-browsing-contexts/test3.html @@ -0,0 +1,8 @@ + + +HTML Test: child browsing contexts created by frame elements + + + + + diff --git a/testing/web-platform/tests/html/browsers/the-window-object/accessing-other-browsing-contexts/window_length.html b/testing/web-platform/tests/html/browsers/the-window-object/accessing-other-browsing-contexts/window_length.html new file mode 100644 index 0000000000..c9559b531a --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/accessing-other-browsing-contexts/window_length.html @@ -0,0 +1,51 @@ + +window.length + + +
+ diff --git a/testing/web-platform/tests/html/browsers/the-window-object/close-method.window.js b/testing/web-platform/tests/html/browsers/the-window-object/close-method.window.js new file mode 100644 index 0000000000..0288f9cab8 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/close-method.window.js @@ -0,0 +1,39 @@ +function assert_closed_opener(w, closed, opener) { + assert_equals(w.closed, closed); + assert_equals(w.opener, opener); +} + +async_test(t => { + const openee = window.open(); + assert_closed_opener(openee, false, self); + openee.onunload = t.step_func(() => { + assert_closed_opener(openee, true, self); + t.step_timeout(() => { + assert_closed_opener(openee, true, null); + t.done(); + }, 0); + }); + openee.close(); + assert_closed_opener(openee, true, self); +}, "window.close() queues a task to discard, but window.closed knows immediately"); + +async_test(t => { + const openee = window.open("", "greatname"); + assert_closed_opener(openee, false, self); + openee.close(); + assert_closed_opener(openee, true, self); + const openee2 = window.open("", "greatname"); + assert_not_equals(openee, openee2); + assert_closed_opener(openee, true, self); // Ensure second window.open() call was synchronous + openee2.onunload = t.step_func(() => { + assert_closed_opener(openee2, true, self); + t.step_timeout(() => { + assert_closed_opener(openee, true, null); + assert_closed_opener(openee2, true, null); + t.done(); + }, 0); + }); + openee2.close(); + assert_closed_opener(openee, true, self); // Ensure second close() call was synchronous + assert_closed_opener(openee2, true, self); +}, "window.close() affects name targeting immediately"); diff --git a/testing/web-platform/tests/html/browsers/the-window-object/closed-attribute.window.js b/testing/web-platform/tests/html/browsers/the-window-object/closed-attribute.window.js new file mode 100644 index 0000000000..88a3beba6f --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/closed-attribute.window.js @@ -0,0 +1,69 @@ +// META: script=/common/get-host-info.sub.js + +function closedTest(newWindow, closeNewWindowsBrowsingContext) { + assert_equals(newWindow.closed, false); + closeNewWindowsBrowsingContext(); + assert_equals(newWindow.closed, true); +} + +test(() => { + const frame = document.body.appendChild(document.createElement("iframe")); + closedTest(frame.contentWindow, () => frame.remove()); +}, "closed and same-origin nested browsing context"); + +test(() => { + const openee = window.open(); + closedTest(openee, () => openee.close()); + + // close() is a no-op once "is closing" is set + openee.close(); + assert_equals(openee.closed, true); +}, "closed/close() and same-origin auxiliary browsing context"); + +const support = new URL("support/closed.html", location.href).pathname; +[ + { + type: "cross-origin", + url: `${get_host_info().HTTP_REMOTE_ORIGIN}${support}` + }, + { + type: "cross-site", + url: `${get_host_info().HTTP_NOTSAMESITE_ORIGIN}${support}` + } +].forEach(val => { + async_test(t => { + const frame = document.createElement("iframe"), + ident = `${val.type}-nested-bc`; + frame.src = `${val.url}?window=parent&ident=${ident}`; + const listener = t.step_func(e => { + if (e.data === ident) { + closedTest(frame.contentWindow, () => frame.remove()); + self.removeEventListener("message", listener); + t.done(); + } + }); + // Use a message event rather than onload for consistency with auxiliary browsing contexts. + self.addEventListener("message", listener); + document.body.append(frame); + }, `closed and ${val.type} nested browsing context`); + + async_test(t => { + const ident = `${val.type}-auxiliary-bc`, + support = new URL("support/closed.html", location.href).pathname, + openee = window.open(`${val.url}?window=opener&ident=${ident}`), + listener = t.step_func(e => { + if (e.data === ident) { + closedTest(openee, () => openee.close()); + + // close() is a no-op once "is closing" is set + openee.close(); + assert_equals(openee.closed, true); + + self.removeEventListener("message", listener); + t.done(); + } + }); + // As there's no cross-origin onload, use a message event. + self.addEventListener("message", listener); + }, `closed/close() and ${val.type} auxiliary browsing context`); +}); diff --git a/testing/web-platform/tests/html/browsers/the-window-object/defaultstatus.html b/testing/web-platform/tests/html/browsers/the-window-object/defaultstatus.html new file mode 100644 index 0000000000..f683f130cd --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/defaultstatus.html @@ -0,0 +1,17 @@ + + +window.defaultStatus and window.defaultstatus are not supported + + + + + + + diff --git a/testing/web-platform/tests/html/browsers/the-window-object/document-attribute.window.js b/testing/web-platform/tests/html/browsers/the-window-object/document-attribute.window.js new file mode 100644 index 0000000000..f13acdb8a3 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/document-attribute.window.js @@ -0,0 +1,15 @@ +async_test(t => { + const frame = document.createElement("iframe"); + frame.onload = t.step_func(() => { + const frameW = frame.contentWindow, + frameD = frame.contentDocument; + assert_equals(frameW.document, frameD); + frame.remove(); + assert_equals(frameW.document, frameD); + t.step_timeout(() => { + assert_equals(frameW.document, frameD); + t.done(); + }, 100); + }); + document.body.append(frame); +}, "Window object's document IDL attribute and discarding the browsing context"); diff --git a/testing/web-platform/tests/html/browsers/the-window-object/focus.window.js b/testing/web-platform/tests/html/browsers/the-window-object/focus.window.js new file mode 100644 index 0000000000..6ec7feee28 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/focus.window.js @@ -0,0 +1,15 @@ +async_test(t => { + const input = document.body.appendChild(document.createElement("input")); + input.onfocus = t.step_func(() => { + const frame = document.body.appendChild(document.createElement("iframe")), + frameW = frame.contentWindow; + frameW.onfocus = t.unreached_func(); + frame.remove(); + frameW.focus(); + t.step_timeout(() => { + assert_equals(document.activeElement, input); + t.done(); + }, 100); + }); + input.focus(); +}); diff --git a/testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/discard_iframe_history_1-1.html b/testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/discard_iframe_history_1-1.html new file mode 100644 index 0000000000..217608e46e --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/discard_iframe_history_1-1.html @@ -0,0 +1,20 @@ + + + diff --git a/testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/discard_iframe_history_1-2.html b/testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/discard_iframe_history_1-2.html new file mode 100644 index 0000000000..b43598f2cd --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/discard_iframe_history_1-2.html @@ -0,0 +1,2 @@ + +Filler text diff --git a/testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/discard_iframe_history_1.html b/testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/discard_iframe_history_1.html new file mode 100644 index 0000000000..4d1e473fc0 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/discard_iframe_history_1.html @@ -0,0 +1,10 @@ + +Removing iframe from document removes it from history + + +
+ + diff --git a/testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/discard_iframe_history_2-1.html b/testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/discard_iframe_history_2-1.html new file mode 100644 index 0000000000..61e5891ebd --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/discard_iframe_history_2-1.html @@ -0,0 +1,22 @@ + + + diff --git a/testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/discard_iframe_history_2.html b/testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/discard_iframe_history_2.html new file mode 100644 index 0000000000..89d0fb4c64 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/discard_iframe_history_2.html @@ -0,0 +1,10 @@ + +Removing iframe from document via innerHTML removes it from history + + +
+ + diff --git a/testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/discard_iframe_history_3-1.html b/testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/discard_iframe_history_3-1.html new file mode 100644 index 0000000000..de3f075d64 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/discard_iframe_history_3-1.html @@ -0,0 +1,21 @@ + + diff --git a/testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/discard_iframe_history_3-2.html b/testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/discard_iframe_history_3-2.html new file mode 100644 index 0000000000..95f9fce5d8 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/discard_iframe_history_3-2.html @@ -0,0 +1,4 @@ +Click me + diff --git a/testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/discard_iframe_history_3-3.html b/testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/discard_iframe_history_3-3.html new file mode 100644 index 0000000000..4672b0ec30 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/discard_iframe_history_3-3.html @@ -0,0 +1,4 @@ + + diff --git a/testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/discard_iframe_history_3.html b/testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/discard_iframe_history_3.html new file mode 100644 index 0000000000..38dbdbd0fa --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/discard_iframe_history_3.html @@ -0,0 +1,9 @@ + +Removing iframe from document removes it from history + + +
+ diff --git a/testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/discard_iframe_history_4-1.html b/testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/discard_iframe_history_4-1.html new file mode 100644 index 0000000000..1b5726cdcd --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/discard_iframe_history_4-1.html @@ -0,0 +1,21 @@ + + diff --git a/testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/discard_iframe_history_4-2.html b/testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/discard_iframe_history_4-2.html new file mode 100644 index 0000000000..979b2b28e4 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/discard_iframe_history_4-2.html @@ -0,0 +1,4 @@ +Click me + diff --git a/testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/discard_iframe_history_4-3.html b/testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/discard_iframe_history_4-3.html new file mode 100644 index 0000000000..b4308f439a --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/discard_iframe_history_4-3.html @@ -0,0 +1,4 @@ + + diff --git a/testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/discard_iframe_history_4.html b/testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/discard_iframe_history_4.html new file mode 100644 index 0000000000..ffd444e3bf --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/discard_iframe_history_4.html @@ -0,0 +1,9 @@ + +Removing iframe from document removes it from history + + +
+ diff --git a/testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/non-automated/discard_iframe_history_1-1.html b/testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/non-automated/discard_iframe_history_1-1.html new file mode 100644 index 0000000000..9969427989 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/non-automated/discard_iframe_history_1-1.html @@ -0,0 +1,27 @@ + + + + diff --git a/testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/non-automated/discard_iframe_history_1-2.html b/testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/non-automated/discard_iframe_history_1-2.html new file mode 100644 index 0000000000..8c3d1a9dad --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/non-automated/discard_iframe_history_1-2.html @@ -0,0 +1,2 @@ + + diff --git a/testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/non-automated/discard_iframe_history_1-manual.html b/testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/non-automated/discard_iframe_history_1-manual.html new file mode 100644 index 0000000000..ca9dd91f2e --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/non-automated/discard_iframe_history_1-manual.html @@ -0,0 +1,10 @@ + +Removing iframe from document removes it from history + + +
+ diff --git a/testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/non-automated/discard_iframe_history_2-1.html b/testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/non-automated/discard_iframe_history_2-1.html new file mode 100644 index 0000000000..bc01cae88c --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/non-automated/discard_iframe_history_2-1.html @@ -0,0 +1,19 @@ + + diff --git a/testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/non-automated/discard_iframe_history_2-2.html b/testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/non-automated/discard_iframe_history_2-2.html new file mode 100644 index 0000000000..b25bf5f001 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/non-automated/discard_iframe_history_2-2.html @@ -0,0 +1 @@ +Click me diff --git a/testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/non-automated/discard_iframe_history_2-3.html b/testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/non-automated/discard_iframe_history_2-3.html new file mode 100644 index 0000000000..68847e9a7c --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/non-automated/discard_iframe_history_2-3.html @@ -0,0 +1 @@ + diff --git a/testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/non-automated/discard_iframe_history_2-manual.html b/testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/non-automated/discard_iframe_history_2-manual.html new file mode 100644 index 0000000000..57eaabcd0c --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/non-automated/discard_iframe_history_2-manual.html @@ -0,0 +1,10 @@ + +Removing iframe from document removes it from history + + +
+ diff --git a/testing/web-platform/tests/html/browsers/the-window-object/historical.window.js b/testing/web-platform/tests/html/browsers/the-window-object/historical.window.js new file mode 100644 index 0000000000..653f12b464 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/historical.window.js @@ -0,0 +1,4 @@ +test(() => { + assert_false("showModalDialog" in window) + assert_false("showModalDialog" in Window.prototype) +}, "showModalDialog() has been removed from the platform") diff --git a/testing/web-platform/tests/html/browsers/the-window-object/length-attribute.window.js b/testing/web-platform/tests/html/browsers/the-window-object/length-attribute.window.js new file mode 100644 index 0000000000..d56e1e4692 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/length-attribute.window.js @@ -0,0 +1,24 @@ +async_test(t => { + const frame = document.createElement("iframe"); + frame.srcdoc = ""; + frame.onload = t.step_func_done(() => { + const frameW = frame.contentWindow; + assert_equals(frameW.length, 2); + assert_not_equals(frameW.x, undefined); + assert_not_equals(frameW.y, undefined); + assert_equals(frameW.z, undefined); + assert_equals(frameW.x, frameW[0]); + assert_equals(frameW.y, frameW[1]); + const xFrameW = frameW.x; + assert_equals(xFrameW.length, 1); + assert_not_equals(xFrameW.z, undefined); + assert_equals(xFrameW.z, xFrameW[0]); + frame.remove(); + assert_equals(frameW.length, 0); + assert_equals(frameW.x, undefined); + assert_equals(frameW[0], undefined); + assert_equals(xFrameW.length, 0); + assert_equals(xFrameW.z, undefined); + }); + document.body.append(frame); +}, "Window object's length IDL attribute (and named access)"); diff --git a/testing/web-platform/tests/html/browsers/the-window-object/name-attribute.window.js b/testing/web-platform/tests/html/browsers/the-window-object/name-attribute.window.js new file mode 100644 index 0000000000..f266dd7acb --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/name-attribute.window.js @@ -0,0 +1,18 @@ +test(() => { + const frame = document.createElement("iframe"), + name = "A", + name2 = "B"; + frame.setAttribute("name", name); + document.body.append(frame); + const frameW = frame.contentWindow; + assert_equals(frameW.name, name); + frameW.name = name2; + assert_equals(frame.getAttribute("name"), name); + assert_equals(frameW.name, name2); + frame.remove(); + assert_equals(frame.getAttribute("name"), name); + assert_equals(frameW.name, ""); + frameW.name = name2; + assert_equals(frame.getAttribute("name"), name); + assert_equals(frameW.name, ""); +}, "Window object's name IDL attribute"); diff --git a/testing/web-platform/tests/html/browsers/the-window-object/named-access-on-the-window-object/cross-global-npo.html b/testing/web-platform/tests/html/browsers/the-window-object/named-access-on-the-window-object/cross-global-npo.html new file mode 100644 index 0000000000..2acad0734c --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/named-access-on-the-window-object/cross-global-npo.html @@ -0,0 +1,38 @@ + + +Named access across globals + + +
+ diff --git a/testing/web-platform/tests/html/browsers/the-window-object/named-access-on-the-window-object/cross-global-support.html b/testing/web-platform/tests/html/browsers/the-window-object/named-access-on-the-window-object/cross-global-support.html new file mode 100644 index 0000000000..9d7b9f8a25 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/named-access-on-the-window-object/cross-global-support.html @@ -0,0 +1,4 @@ + + +Named access across globals: support file + diff --git a/testing/web-platform/tests/html/browsers/the-window-object/named-access-on-the-window-object/named-objects.html b/testing/web-platform/tests/html/browsers/the-window-object/named-access-on-the-window-object/named-objects.html new file mode 100644 index 0000000000..d5b1789d59 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/named-access-on-the-window-object/named-objects.html @@ -0,0 +1,76 @@ + + +HTML Test: Named access on the Window object + + + + +
+
+

+ + + +
+ + + + + + + + + + + + +
+ diff --git a/testing/web-platform/tests/html/browsers/the-window-object/named-access-on-the-window-object/navigated-named-objects.window.js b/testing/web-platform/tests/html/browsers/the-window-object/named-access-on-the-window-object/navigated-named-objects.window.js new file mode 100644 index 0000000000..59d94efc99 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/named-access-on-the-window-object/navigated-named-objects.window.js @@ -0,0 +1,67 @@ +// META: script=/common/get-host-info.sub.js + +function echoURL(content) { + return `/common/echo.py?content=${encodeURIComponent(content)}`; +} + +function setSrc(frame, type, content) { + if (type === "same-origin") { + frame.src = echoURL(content); + } else if (type === "cross-site") { + frame.src = `${get_host_info().HTTP_NOTSAMESITE_ORIGIN}${echoURL(content)}`; + } else { + frame.srcdoc = content; + } +} + +["srcdoc", "same-origin", "cross-site"].forEach(type => { + const initialType = type === "srcdoc" ? type : "same-origin"; + + [ + { + "namedObject": "
", + "namedObjectLocalName": "div" + }, + { + "namedObject": "", + "namedObjectLocalName": "object" + }, + { + "namedObject": "", + "namedObjectLocalName": "iframe" + } + ].forEach(testData => { + async_test(t => { + const frame = document.createElement("iframe"); + t.add_cleanup(() => frame.remove()); + setSrc(frame, initialType, `${testData.namedObject}`); + frame.onload = t.step_func(() => { + const f = frame.contentWindow.f, + associatedAbc = f(); + frame.onload = t.step_func_done(() => { + assert_equals(f(), associatedAbc); + assert_equals(associatedAbc.localName, testData.namedObjectLocalName); + }); + setSrc(frame, type, ""); + }); + document.body.append(frame); + }, `Window's associated Document object is used for finding named objects (<${testData.namedObjectLocalName}> via ${type} + + + + + diff --git a/testing/web-platform/tests/html/browsers/the-window-object/named-access-on-the-window-object/window-null-names.html b/testing/web-platform/tests/html/browsers/the-window-object/named-access-on-the-window-object/window-null-names.html new file mode 100644 index 0000000000..6801ef9d8a --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/named-access-on-the-window-object/window-null-names.html @@ -0,0 +1,20 @@ + + +Named access with null characters + + + + + + +
+ diff --git a/testing/web-platform/tests/html/browsers/the-window-object/navigate-to-about-blank-while-initial-load-pending.html b/testing/web-platform/tests/html/browsers/the-window-object/navigate-to-about-blank-while-initial-load-pending.html new file mode 100644 index 0000000000..3a0def8ae6 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/navigate-to-about-blank-while-initial-load-pending.html @@ -0,0 +1,26 @@ + + +Test navigating to about:blank while window.open initial load pending. + + +
+ diff --git a/testing/web-platform/tests/html/browsers/the-window-object/noopener-noreferrer-BarProp.window.js b/testing/web-platform/tests/html/browsers/the-window-object/noopener-noreferrer-BarProp.window.js new file mode 100644 index 0000000000..a75a034650 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/noopener-noreferrer-BarProp.window.js @@ -0,0 +1,23 @@ +const barProps = ["locationbar", "menubar", "personalbar", "scrollbars", "statusbar", "toolbar"]; + +test(() => { + for(const prop of barProps) { + assert_true(window[prop].visible); + } +}, "All bars visible"); + +["noopener", "noreferrer"].forEach(openerStyle => { + async_test(t => { + const channelName = "5454" + openerStyle + "34324"; + const channel = new BroadcastChannel(channelName); + window.open("support/BarProp-target.html?" + channelName, "", openerStyle); + channel.onmessage = t.step_func_done(e => { + // Send message first so if asserts throw the popup is still closed + channel.postMessage(null); + + for(const prop of barProps) { + assert_true(e.data[prop]); + } + }); + }, `window.open() with ${openerStyle} should have all bars visible`); +}); diff --git a/testing/web-platform/tests/html/browsers/the-window-object/noopener-noreferrer-sizing.window.js b/testing/web-platform/tests/html/browsers/the-window-object/noopener-noreferrer-sizing.window.js new file mode 100644 index 0000000000..cc53ba5f2f --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/noopener-noreferrer-sizing.window.js @@ -0,0 +1,17 @@ +const windowProps = ["innerWidth", "innerHeight"]; + +["noopener", "noreferrer"].forEach(openerStyle => { + async_test(t => { + const channelName = "34342" + openerStyle + "8907"; + const channel = new BroadcastChannel(channelName); + window.open("support/sizing-target.html?" + channelName, "", openerStyle); + channel.onmessage = t.step_func_done(e => { + // Send message first so if asserts throw the popup is still closed + channel.postMessage(null); + + for(const prop of windowProps) { + assert_equals(window[prop], e.data[prop]); + } + }); + }, `window.open() with ${openerStyle} should have equal viewport width and height`); +}); diff --git a/testing/web-platform/tests/html/browsers/the-window-object/open-close/callback.js b/testing/web-platform/tests/html/browsers/the-window-object/open-close/callback.js new file mode 100644 index 0000000000..ae51265a21 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/open-close/callback.js @@ -0,0 +1 @@ +opener.callback() \ No newline at end of file diff --git a/testing/web-platform/tests/html/browsers/the-window-object/open-close/close_beforeunload-1.html b/testing/web-platform/tests/html/browsers/the-window-object/open-close/close_beforeunload-1.html new file mode 100644 index 0000000000..6f44d8a83e --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/open-close/close_beforeunload-1.html @@ -0,0 +1,7 @@ + + diff --git a/testing/web-platform/tests/html/browsers/the-window-object/open-close/close_beforeunload.html b/testing/web-platform/tests/html/browsers/the-window-object/open-close/close_beforeunload.html new file mode 100644 index 0000000000..dcb8830ab6 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/open-close/close_beforeunload.html @@ -0,0 +1,16 @@ + +Running beforeunload handler in window.close() + + +
+ diff --git a/testing/web-platform/tests/html/browsers/the-window-object/open-close/close_script_defer-1.html b/testing/web-platform/tests/html/browsers/the-window-object/open-close/close_script_defer-1.html new file mode 100644 index 0000000000..c50eddd41f --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/open-close/close_script_defer-1.html @@ -0,0 +1 @@ + diff --git a/testing/web-platform/tests/html/browsers/the-window-object/open-close/close_script_defer.html b/testing/web-platform/tests/html/browsers/the-window-object/open-close/close_script_defer.html new file mode 100644 index 0000000000..1217882b16 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/open-close/close_script_defer.html @@ -0,0 +1,18 @@ + +Running defer script in window.close() + + +
+ diff --git a/testing/web-platform/tests/html/browsers/the-window-object/open-close/close_unload-1.html b/testing/web-platform/tests/html/browsers/the-window-object/open-close/close_unload-1.html new file mode 100644 index 0000000000..9a9e304e84 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/open-close/close_unload-1.html @@ -0,0 +1,7 @@ + + diff --git a/testing/web-platform/tests/html/browsers/the-window-object/open-close/close_unload.html b/testing/web-platform/tests/html/browsers/the-window-object/open-close/close_unload.html new file mode 100644 index 0000000000..e4d231b285 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/open-close/close_unload.html @@ -0,0 +1,16 @@ + +Running unload handler in window.close() + + +
+ diff --git a/testing/web-platform/tests/html/browsers/the-window-object/open-close/creating_browsing_context_test_01.html b/testing/web-platform/tests/html/browsers/the-window-object/open-close/creating_browsing_context_test_01.html new file mode 100644 index 0000000000..062f61949d --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/open-close/creating_browsing_context_test_01.html @@ -0,0 +1,39 @@ + + +[Browsing Context] : [APIs for creating browsing_contexts by name] + + + + + + diff --git a/testing/web-platform/tests/html/browsers/the-window-object/open-close/no_window_open_when_term_nesting_level_nonzero.window.js b/testing/web-platform/tests/html/browsers/the-window-object/open-close/no_window_open_when_term_nesting_level_nonzero.window.js new file mode 100644 index 0000000000..3dff403b9c --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/open-close/no_window_open_when_term_nesting_level_nonzero.window.js @@ -0,0 +1,113 @@ +test(function() { + var test_window = window.open('', '', 'height=1,width=1'); + var test_document = test_window.document; + + var frame = test_document.createElement('iframe'); + test_document.body.appendChild(frame); + + frame.contentWindow.onpagehide = function(evt) { + assert_equals(frame.contentWindow.open('', '', 'height=1,width=1'), null, + "expected no popup during pagehide"); + }; + frame.contentDocument.onvisibilitychange = function(evt) { + assert_equals(frame.contentWindow.open('', '', 'height=1,width=1'), null, + "expected no popup during visibilitychange"); + }; + frame.contentWindow.onbeforeunload = function(evt) { + assert_equals(frame.contentWindow.open('', '', 'height=1,width=1'), null, + "expected no popup during beforeunload"); + }; + frame.contentWindow.onunload = function(evt) { + assert_equals(frame.contentWindow.open('', '', 'height=1,width=1'), null, + "expected no popup during unload"); + }; + + frame.remove(); +}, 'no popups with frame removal'); + +async_test(function(t) { + var test_window = window.open('', '', 'height=1,width=1'); + var test_document = test_window.document; + + var frame = test_document.createElement('iframe'); + test_document.body.appendChild(frame); + + frame.contentWindow.onpagehide = t.step_func(function(evt) { + assert_equals(frame.contentWindow.open('', '', 'height=1,width=1'), null, + "expected no popup during pagehide"); + }); + frame.contentDocument.onvisibilitychange = t.step_func(function(evt) { + assert_equals(frame.contentWindow.open('', '', 'height=1,width=1'), null, + "expected no popup during visibilitychange"); + }); + frame.contentWindow.onbeforeunload = t.step_func(function(evt) { + assert_equals(frame.contentWindow.open('', '', 'height=1,width=1'), null, + "expected no popup during beforeunload"); + }); + frame.contentWindow.onunload = t.step_func(function(evt) { + assert_equals(frame.contentWindow.open('', '', 'height=1,width=1'), null, + "expected no popup during unload"); + }); + + frame.onload = t.step_func_done(); + + frame.contentWindow.location.href = "about:blank"; +}, 'no popups with frame navigation'); + +async_test(function(t) { + var test_window = window.open('', '', 'height=1,width=1'); + var test_document = test_window.document; + + var frame = test_document.createElement('iframe'); + test_document.body.appendChild(frame); + + frame.contentWindow.onpagehide = t.step_func(function(evt) { + assert_equals(test_window.open('', '', 'height=1,width=1'), null, + "expected no popup during pagehide"); + }); + frame.contentDocument.onvisibilitychange = t.step_func(function(evt) { + assert_equals(test_window.open('', '', 'height=1,width=1'), null, + "expected no popup during visibilitychange"); + }); + frame.contentWindow.onbeforeunload = t.step_func(function(evt) { + assert_equals(test_window.open('', '', 'height=1,width=1'), null, + "expected no popup during beforeunload"); + }); + frame.contentWindow.onunload = t.step_func(function(evt) { + assert_equals(test_window.open('', '', 'height=1,width=1'), null, + "expected no popup during unload"); + }); + + frame.onload = t.step_func_done(); + + frame.contentWindow.location.href = "about:blank"; +}, 'no popups from synchronously reachable window'); + +async_test(function(t) { + var test_window = window.open('', '', 'height=1,width=1'); + var test_document = test_window.document; + + var frame = test_document.createElement('iframe'); + test_document.body.appendChild(frame); + + frame.contentWindow.onpagehide = t.step_func(function(evt) { + assert_equals(window.open('', '', 'height=1,width=1'), null, + "expected no popup during pagehide"); + }); + frame.contentDocument.onvisibilitychange = t.step_func(function(evt) { + assert_equals(window.open('', '', 'height=1,width=1'), null, + "expected no popup during visibilitychange"); + }); + frame.contentWindow.onbeforeunload = t.step_func(function(evt) { + assert_equals(window.open('', '', 'height=1,width=1'), null, + "expected no popup during beforeunload"); + }); + frame.contentWindow.onunload = t.step_func(function(evt) { + assert_equals(window.open('', '', 'height=1,width=1'), null, + "expected no popup during unload"); + }); + + frame.onload = t.step_func_done(); + + frame.contentWindow.location.href = "about:blank"; +}, 'no popups from another synchronously reachable window'); diff --git a/testing/web-platform/tests/html/browsers/the-window-object/open-close/non_automated/001-1.html b/testing/web-platform/tests/html/browsers/the-window-object/open-close/non_automated/001-1.html new file mode 100644 index 0000000000..7dd48b41c2 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/open-close/non_automated/001-1.html @@ -0,0 +1,2 @@ + +

Now open a new tab and navigate to 001-2

diff --git a/testing/web-platform/tests/html/browsers/the-window-object/open-close/non_automated/001-2.html b/testing/web-platform/tests/html/browsers/the-window-object/open-close/non_automated/001-2.html new file mode 100644 index 0000000000..b1413861a3 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/open-close/non_automated/001-2.html @@ -0,0 +1,16 @@ + + diff --git a/testing/web-platform/tests/html/browsers/the-window-object/open-close/non_automated/001.html b/testing/web-platform/tests/html/browsers/the-window-object/open-close/non_automated/001.html new file mode 100644 index 0000000000..7b0f21ec04 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/open-close/non_automated/001.html @@ -0,0 +1,3 @@ + +Accessing named windows from outside the unit of related browsing contexts +Click here diff --git a/testing/web-platform/tests/html/browsers/the-window-object/open-close/non_automated/002-1.html b/testing/web-platform/tests/html/browsers/the-window-object/open-close/non_automated/002-1.html new file mode 100644 index 0000000000..0e210f351b --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/open-close/non_automated/002-1.html @@ -0,0 +1,8 @@ + +

Now open a new tab and navigate to

+ diff --git a/testing/web-platform/tests/html/browsers/the-window-object/open-close/non_automated/002-2.html b/testing/web-platform/tests/html/browsers/the-window-object/open-close/non_automated/002-2.html new file mode 100644 index 0000000000..b1413861a3 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/open-close/non_automated/002-2.html @@ -0,0 +1,16 @@ + + diff --git a/testing/web-platform/tests/html/browsers/the-window-object/open-close/non_automated/002.html b/testing/web-platform/tests/html/browsers/the-window-object/open-close/non_automated/002.html new file mode 100644 index 0000000000..b568ae8d48 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/open-close/non_automated/002.html @@ -0,0 +1,3 @@ + +Accessing different-origin named windows from outside the unit of related browsing contexts +Click here diff --git a/testing/web-platform/tests/html/browsers/the-window-object/open-close/open-features-is-popup-condition.html b/testing/web-platform/tests/html/browsers/the-window-object/open-close/open-features-is-popup-condition.html new file mode 100644 index 0000000000..4f52e2e8de --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/open-close/open-features-is-popup-condition.html @@ -0,0 +1,149 @@ + + +HTML: window.open `features`: condition for is popup + + + + + + + + + + + diff --git a/testing/web-platform/tests/html/browsers/the-window-object/open-close/open-features-negative-innerwidth-innerheight.html b/testing/web-platform/tests/html/browsers/the-window-object/open-close/open-features-negative-innerwidth-innerheight.html new file mode 100644 index 0000000000..7f55f1bb1d --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/open-close/open-features-negative-innerwidth-innerheight.html @@ -0,0 +1,75 @@ + + +HTML: window.open `features`: negative values for legacy `innerwidth`, `innerheight` + + + + + + + + + + diff --git a/testing/web-platform/tests/html/browsers/the-window-object/open-close/open-features-negative-screenx-screeny.html b/testing/web-platform/tests/html/browsers/the-window-object/open-close/open-features-negative-screenx-screeny.html new file mode 100644 index 0000000000..09fb2d6b0a --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/open-close/open-features-negative-screenx-screeny.html @@ -0,0 +1,67 @@ + + +HTML: window.open `features`: negative values for legacy `screenx`, `screeny` + + + + + + + + + + diff --git a/testing/web-platform/tests/html/browsers/the-window-object/open-close/open-features-negative-top-left.html b/testing/web-platform/tests/html/browsers/the-window-object/open-close/open-features-negative-top-left.html new file mode 100644 index 0000000000..15b3103db3 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/open-close/open-features-negative-top-left.html @@ -0,0 +1,68 @@ + + +HTML: window.open `features`: negative values for `top`, `left` + + + + + + + + + + diff --git a/testing/web-platform/tests/html/browsers/the-window-object/open-close/open-features-negative-width-height.html b/testing/web-platform/tests/html/browsers/the-window-object/open-close/open-features-negative-width-height.html new file mode 100644 index 0000000000..30b70926f2 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/open-close/open-features-negative-width-height.html @@ -0,0 +1,75 @@ + + +HTML: window.open `features`: negative values for `width`, `height` + + + + + + + + + + diff --git a/testing/web-platform/tests/html/browsers/the-window-object/open-close/open-features-non-integer-height.html b/testing/web-platform/tests/html/browsers/the-window-object/open-close/open-features-non-integer-height.html new file mode 100644 index 0000000000..cd2d019c47 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/open-close/open-features-non-integer-height.html @@ -0,0 +1,91 @@ + + +HTML: window.open `features`: non-integer values for feature `height` + + + + + + + + + + diff --git a/testing/web-platform/tests/html/browsers/the-window-object/open-close/open-features-non-integer-innerheight.html b/testing/web-platform/tests/html/browsers/the-window-object/open-close/open-features-non-integer-innerheight.html new file mode 100644 index 0000000000..5ee752caed --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/open-close/open-features-non-integer-innerheight.html @@ -0,0 +1,76 @@ + + +HTML: window.open `features`: non-integer values for legacy feature `innerheight` + + + + + + + + + + diff --git a/testing/web-platform/tests/html/browsers/the-window-object/open-close/open-features-non-integer-innerwidth.html b/testing/web-platform/tests/html/browsers/the-window-object/open-close/open-features-non-integer-innerwidth.html new file mode 100644 index 0000000000..972beef48a --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/open-close/open-features-non-integer-innerwidth.html @@ -0,0 +1,75 @@ + + +HTML: window.open `features`: non-integer values for legacy feature `innerwidth` + + + + + + + + + + diff --git a/testing/web-platform/tests/html/browsers/the-window-object/open-close/open-features-non-integer-left.html b/testing/web-platform/tests/html/browsers/the-window-object/open-close/open-features-non-integer-left.html new file mode 100644 index 0000000000..fbb2a30ee2 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/open-close/open-features-non-integer-left.html @@ -0,0 +1,76 @@ + + +HTML: window.open `features`: non-integer values for feature `left` + + + + + + + + + + diff --git a/testing/web-platform/tests/html/browsers/the-window-object/open-close/open-features-non-integer-screenx.html b/testing/web-platform/tests/html/browsers/the-window-object/open-close/open-features-non-integer-screenx.html new file mode 100644 index 0000000000..2aeab9bb79 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/open-close/open-features-non-integer-screenx.html @@ -0,0 +1,75 @@ + + +HTML: window.open `features`: non-integer values for legacy feature `screenx` + + + + + + + + + + diff --git a/testing/web-platform/tests/html/browsers/the-window-object/open-close/open-features-non-integer-screeny.html b/testing/web-platform/tests/html/browsers/the-window-object/open-close/open-features-non-integer-screeny.html new file mode 100644 index 0000000000..cb4e873f26 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/open-close/open-features-non-integer-screeny.html @@ -0,0 +1,76 @@ + + +HTML: window.open `features`: non-integer values for legacy feature `screeny` + + + + + + + + + + diff --git a/testing/web-platform/tests/html/browsers/the-window-object/open-close/open-features-non-integer-top.html b/testing/web-platform/tests/html/browsers/the-window-object/open-close/open-features-non-integer-top.html new file mode 100644 index 0000000000..d4f4e90d96 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/open-close/open-features-non-integer-top.html @@ -0,0 +1,73 @@ + + +HTML: window.open `features`: non-integer values for feature `top` + + + + + + + + + + diff --git a/testing/web-platform/tests/html/browsers/the-window-object/open-close/open-features-non-integer-width.html b/testing/web-platform/tests/html/browsers/the-window-object/open-close/open-features-non-integer-width.html new file mode 100644 index 0000000000..a746abed3f --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/open-close/open-features-non-integer-width.html @@ -0,0 +1,91 @@ + + +HTML: window.open `features`: non-integer values for feature `width` + + + + + + + + + + diff --git a/testing/web-platform/tests/html/browsers/the-window-object/open-close/open-features-tokenization-innerheight-innerwidth.html b/testing/web-platform/tests/html/browsers/the-window-object/open-close/open-features-tokenization-innerheight-innerwidth.html new file mode 100644 index 0000000000..c839c6ca06 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/open-close/open-features-tokenization-innerheight-innerwidth.html @@ -0,0 +1,55 @@ + + +HTML: window.open `features`: tokenization -- legacy size features `innerheight`, `innerwidth` + + + + + + + + + + diff --git a/testing/web-platform/tests/html/browsers/the-window-object/open-close/open-features-tokenization-noopener.html b/testing/web-platform/tests/html/browsers/the-window-object/open-close/open-features-tokenization-noopener.html new file mode 100644 index 0000000000..c955e67789 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/open-close/open-features-tokenization-noopener.html @@ -0,0 +1,11 @@ + + +HTML: window.open `features`: tokenization -- `noopener` + + + + + + diff --git a/testing/web-platform/tests/html/browsers/the-window-object/open-close/open-features-tokenization-noreferrer.html b/testing/web-platform/tests/html/browsers/the-window-object/open-close/open-features-tokenization-noreferrer.html new file mode 100644 index 0000000000..4807f634fd --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/open-close/open-features-tokenization-noreferrer.html @@ -0,0 +1,11 @@ + + +HTML: window.open `features`: tokenization -- `noreferrer` + + + + + + diff --git a/testing/web-platform/tests/html/browsers/the-window-object/open-close/open-features-tokenization-screenx-screeny.html b/testing/web-platform/tests/html/browsers/the-window-object/open-close/open-features-tokenization-screenx-screeny.html new file mode 100644 index 0000000000..bb6fc4b84b --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/open-close/open-features-tokenization-screenx-screeny.html @@ -0,0 +1,55 @@ + + +HTML: window.open `features`: tokenization -- legacy position features `screenx`, `screeny` + + + + + + + + + + diff --git a/testing/web-platform/tests/html/browsers/the-window-object/open-close/open-features-tokenization-top-left.html b/testing/web-platform/tests/html/browsers/the-window-object/open-close/open-features-tokenization-top-left.html new file mode 100644 index 0000000000..ef098a1062 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/open-close/open-features-tokenization-top-left.html @@ -0,0 +1,69 @@ + + +HTML: window.open `features`: tokenization -- position features `top` and `left` + + + + + + + + + + diff --git a/testing/web-platform/tests/html/browsers/the-window-object/open-close/open-features-tokenization-width-height.html b/testing/web-platform/tests/html/browsers/the-window-object/open-close/open-features-tokenization-width-height.html new file mode 100644 index 0000000000..cac4ae639b --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/open-close/open-features-tokenization-width-height.html @@ -0,0 +1,71 @@ + + +HTML: window.open `features`: tokenization -- size features `width` and `height` + + + + + + + + + + diff --git a/testing/web-platform/tests/html/browsers/the-window-object/open-close/resources/close-self.html b/testing/web-platform/tests/html/browsers/the-window-object/open-close/resources/close-self.html new file mode 100644 index 0000000000..0c0cf9fc49 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/open-close/resources/close-self.html @@ -0,0 +1,3 @@ + diff --git a/testing/web-platform/tests/html/browsers/the-window-object/open-close/resources/is-popup-barprop.html b/testing/web-platform/tests/html/browsers/the-window-object/open-close/resources/is-popup-barprop.html new file mode 100644 index 0000000000..5636e29878 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/open-close/resources/is-popup-barprop.html @@ -0,0 +1,15 @@ + + diff --git a/testing/web-platform/tests/html/browsers/the-window-object/open-close/resources/message-opener.html b/testing/web-platform/tests/html/browsers/the-window-object/open-close/resources/message-opener.html new file mode 100644 index 0000000000..07662c63cd --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/open-close/resources/message-opener.html @@ -0,0 +1,22 @@ + + diff --git a/testing/web-platform/tests/html/browsers/the-window-object/open-close/resources/tokenization-noopener-noreferrer.js b/testing/web-platform/tests/html/browsers/the-window-object/open-close/resources/tokenization-noopener-noreferrer.js new file mode 100644 index 0000000000..a9d42e26de --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/open-close/resources/tokenization-noopener-noreferrer.js @@ -0,0 +1,152 @@ +function booleanTests(feature) { + const windowURL = 'resources/close-self.html'; + // Tests for how windows features are tokenized into 'name', 'value' + // window features separators are ASCII whitespace, '=' and ',' + + const featureUpper = feature.toUpperCase(), + featureSplitBegin = feature.slice(0, 2), + featureSplitEnd = feature.slice(2), + featureMixedCase = featureSplitBegin.toUpperCase() + featureSplitEnd; + featureMixedCase2 = featureSplitBegin + featureSplitEnd.toUpperCase(); + + test (t => { + // Tokenizing `name`: initial window features separators are ignored + // Each of these variants should tokenize to (`${feature}`, '') + [ + ` ${feature}`, + `=${feature}`, + `,,${feature}`, + `,=, ${feature}`, + `\n=${feature}=`, + `\t${feature}`, + `\r,,,=${feature}`, + `\u000C${feature}` + ].forEach(variant => { + const win = window.open(windowURL, "", variant); + assert_equals(win, null, `"${variant}" should activate feature "${feature}"`); + }); + }, `Tokenization of "${feature}" should skip window features separators before feature`); + + test (t => { + // Tokenizing `name`: lowercase conversion + // Each of these variants should tokenize as feature (`${feature}`, '') + // except where indicated + // Note also that `value` is lowercased during tokenization + [ + `${featureUpper}`, + `${featureMixedCase}`, + ` ${featureMixedCase2}`, + `=${featureUpper}`, + `${featureUpper}=1`, + `${featureUpper}=1`, + `${featureUpper}=yes`, + `${feature}=YES`, + ].forEach(variant => { + const win = window.open(windowURL, '', variant); + assert_equals(win, null, `"${variant}" should activate feature "${feature}"`); + }); + }, `Feature "${feature}" should be converted to ASCII lowercase`); + + test (t => { + // After `name` has been collected, ignore any window features separators until '=' + // except ',' OR a non-window-features-separator — break in those cases + // i.e. ignore whitespace until '=' unless a ',' is encountered first + // Each of these variants should tokenize as feature ('noopener', '') + [ + `${feature}`, + ` ${feature}\r`, + `${feature}\n =`, + `${feature},`, + `${feature} =,`, + `, ${feature} =`, + `${feature},=`, + `${feature} foo`, + `foo ${feature}=1`, + `foo=\u000Cbar\u000C${feature}` + ].forEach(variant => { + const win = window.open(windowURL, '', variant); + assert_equals(win, null, `"${variant}" should activate feature "${feature}"`); + }); + }, `After "${feature}", tokenization should skip window features separators that are not "=" or ","`); + + test (t => { + // After initial '=', tokenizing should ignore all separators except ',' + // before collecting `value` + // Each of these variants should tokenize as feature ('noopener', '') + // Except where indicated + [ + `${feature}= yes`, + `${feature}==,`, + `${feature}=\n ,`, + `${feature} = \t ,`, + `${feature}\n=\r 1,`, + `${feature}=,yes`, + `${feature}= yes=,`, + `${feature} = \u000Cyes` + ].forEach(variant => { + const win = window.open(windowURL, '', variant); + assert_equals(win, null, `"${variant}" should activate feature "${feature}"`); + }); + }, `Tokenizing "${feature}" should ignore window feature separators except "," after initial "=" and before value`); + + test (t => { + // Tokenizing `value` should collect any non-separator code points until first separator + [ + `${feature}=1`, + `${feature}=yes`, + `${feature} = yes ,`, + `${feature}=\nyes ,`, + `${feature}=yes yes`, + `${feature}=yes\ts`, + `${feature}==`, + `${feature}=1\n,`, + `==${feature}===`, + `${feature}==\u000C` + ].forEach(variant => { + const win = window.open(windowURL, '', variant); + assert_equals(win, null, `"${variant}" should set "${feature}"`); + }); + }, `Tokenizing "${feature}" should read characters until first window feature separator as \`value\``); + + test (t => { + [ + `${feature}=1`, + `${feature}=2`, + `${feature}=12345`, + `${feature}=1.5`, + `${feature}=-1`, + ].forEach(variant => { + const win = window.open(windowURL, '', variant); + assert_equals(win, null, `"${variant}" should activate feature "${feature}"`); + }); + }, 'Integer values other than 0 should activate the feature'); + + test (t => { + [ + `${feature}=0`, + `${feature}=0.5`, + `${feature}=error`, + ].forEach(variant => { + const win = window.open(windowURL, '', variant); + assert_not_equals(win, null, `"${variant}" should NOT activate feature "${feature}"`); + }); + }, `Integer value of 0 should not activate "${feature}"`); + + test (t => { + [ + `-${feature}`, + `${featureUpper}RRR`, + `${featureMixedCase}R`, + `${featureSplitBegin}_${featureSplitEnd}`, + ` ${featureSplitBegin} ${featureSplitEnd}`, + `${featureSplitBegin}\n${featureSplitEnd}`, + `${featureSplitBegin},${featureSplitEnd}`, + `\0${feature}`, + `${feature}\u0000=yes`, + `foo=\u000C${feature}` + ].forEach(variant => { + const win = window.open(windowURL, '', variant); + assert_not_equals(win, null, `"${variant}" should NOT activate feature "${feature}"`); + }); + }, `Invalid feature names should not tokenize as "${feature}"`); +} diff --git a/testing/web-platform/tests/html/browsers/the-window-object/proxy-getOwnPropertyDescriptor.html b/testing/web-platform/tests/html/browsers/the-window-object/proxy-getOwnPropertyDescriptor.html new file mode 100644 index 0000000000..4ea9504870 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/proxy-getOwnPropertyDescriptor.html @@ -0,0 +1,126 @@ + + + + + getOwnPropertyDescriptor() is correct for Proxy with host object target + + + + + + + + + diff --git a/testing/web-platform/tests/html/browsers/the-window-object/security-window/window-security.https.html b/testing/web-platform/tests/html/browsers/the-window-object/security-window/window-security.https.html new file mode 100644 index 0000000000..68af5bd90b --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/security-window/window-security.https.html @@ -0,0 +1,200 @@ + + +HTML Test: Window Security + + + + + + + + + + + + +
+ + diff --git a/testing/web-platform/tests/html/browsers/the-window-object/self-et-al.window.js b/testing/web-platform/tests/html/browsers/the-window-object/self-et-al.window.js new file mode 100644 index 0000000000..1b0fa1211a --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/self-et-al.window.js @@ -0,0 +1,43 @@ +function delayed_assert_done(t, w, windowProxySelfReference) { + // Let's make sure nobody is being sneaky + t.step_timeout(() => { + t.step_timeout(() => { + assert_equals(w[windowProxySelfReference], w, `${windowProxySelfReference} got cleared after some time`); + t.done(); + }, 0); + }, 0); +} + +[ + "frames", + "globalThis", + "self", + "window" +].forEach(windowProxySelfReference => { + async_test(t => { + const frame = document.body.appendChild(document.createElement("iframe")), + otherW = frame.contentWindow; + assert_equals(otherW[windowProxySelfReference], otherW, `${windowProxySelfReference} is broken`); + frame.remove(); + assert_equals(otherW[windowProxySelfReference], otherW, `${windowProxySelfReference} got cleared after browsing context removal`); + assert_true(otherW.closed); + + delayed_assert_done(t, otherW, windowProxySelfReference); + }, `iframeWindow.${windowProxySelfReference} before and after removal`); + + async_test(t => { + const otherW = window.open(); + assert_equals(otherW[windowProxySelfReference], otherW, `${windowProxySelfReference} is broken`); + otherW.onunload = t.step_func(() => { + assert_equals(otherW[windowProxySelfReference], otherW, `${windowProxySelfReference} got cleared after browsing context unload`); + t.step_timeout(() => { + assert_equals(otherW.opener, null); // Ensure browsing context is discarded + assert_equals(otherW[windowProxySelfReference], otherW, `${windowProxySelfReference} got cleared after browsing context removal`); + delayed_assert_done(t, otherW, windowProxySelfReference); + }, 0); + }); + otherW.close(); + assert_equals(otherW[windowProxySelfReference], otherW, `${windowProxySelfReference} got cleared after browsing context closure`); + assert_true(otherW.closed); + }, `popupWindow.${windowProxySelfReference} before, after closing, and after discarding`) +}); diff --git a/testing/web-platform/tests/html/browsers/the-window-object/support/BarProp-target.html b/testing/web-platform/tests/html/browsers/the-window-object/support/BarProp-target.html new file mode 100644 index 0000000000..9921e7a577 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/support/BarProp-target.html @@ -0,0 +1,17 @@ + + diff --git a/testing/web-platform/tests/html/browsers/the-window-object/support/closed.html b/testing/web-platform/tests/html/browsers/the-window-object/support/closed.html new file mode 100644 index 0000000000..3b70598e34 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/support/closed.html @@ -0,0 +1,12 @@ + + + diff --git a/testing/web-platform/tests/html/browsers/the-window-object/support/noopener-target.html b/testing/web-platform/tests/html/browsers/the-window-object/support/noopener-target.html new file mode 100644 index 0000000000..41e197a746 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/support/noopener-target.html @@ -0,0 +1,15 @@ + + diff --git a/testing/web-platform/tests/html/browsers/the-window-object/support/noreferrer-target.html b/testing/web-platform/tests/html/browsers/the-window-object/support/noreferrer-target.html new file mode 100644 index 0000000000..c2446c6fe9 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/support/noreferrer-target.html @@ -0,0 +1,13 @@ + diff --git a/testing/web-platform/tests/html/browsers/the-window-object/support/same-origin-iframe.html b/testing/web-platform/tests/html/browsers/the-window-object/support/same-origin-iframe.html new file mode 100644 index 0000000000..763d9e466b --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/support/same-origin-iframe.html @@ -0,0 +1,8 @@ + + + + + + diff --git a/testing/web-platform/tests/html/browsers/the-window-object/support/sizing-target.html b/testing/web-platform/tests/html/browsers/the-window-object/support/sizing-target.html new file mode 100644 index 0000000000..7cd5348a85 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/support/sizing-target.html @@ -0,0 +1,17 @@ + + diff --git a/testing/web-platform/tests/html/browsers/the-window-object/support/window-open-popup-target.html b/testing/web-platform/tests/html/browsers/the-window-object/support/window-open-popup-target.html new file mode 100644 index 0000000000..a0588de829 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/support/window-open-popup-target.html @@ -0,0 +1,24 @@ + + \ No newline at end of file diff --git a/testing/web-platform/tests/html/browsers/the-window-object/support/windowFeature-values-target.html b/testing/web-platform/tests/html/browsers/the-window-object/support/windowFeature-values-target.html new file mode 100644 index 0000000000..3a78ddf660 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/support/windowFeature-values-target.html @@ -0,0 +1,24 @@ + diff --git a/testing/web-platform/tests/html/browsers/the-window-object/window-aliases.html b/testing/web-platform/tests/html/browsers/the-window-object/window-aliases.html new file mode 100644 index 0000000000..135be02a30 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/window-aliases.html @@ -0,0 +1,28 @@ + + +Aliases of the window object + + + + + + +
+ diff --git a/testing/web-platform/tests/html/browsers/the-window-object/window-indexed-properties-delete-no-cache.html b/testing/web-platform/tests/html/browsers/the-window-object/window-indexed-properties-delete-no-cache.html new file mode 100644 index 0000000000..22262943aa --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/window-indexed-properties-delete-no-cache.html @@ -0,0 +1,31 @@ + + +Deletion of WindowProxy's indexed properties is not cached + + + +
+ diff --git a/testing/web-platform/tests/html/browsers/the-window-object/window-indexed-properties-strict.html b/testing/web-platform/tests/html/browsers/the-window-object/window-indexed-properties-strict.html new file mode 100644 index 0000000000..2ee10a7a64 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/window-indexed-properties-strict.html @@ -0,0 +1,75 @@ + + +Indexed properties of the window object (strict mode) + + + + + + + +
+ + diff --git a/testing/web-platform/tests/html/browsers/the-window-object/window-indexed-properties.html b/testing/web-platform/tests/html/browsers/the-window-object/window-indexed-properties.html new file mode 100644 index 0000000000..57f18c5944 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/window-indexed-properties.html @@ -0,0 +1,71 @@ + + +Indexed properties of the window object (non-strict mode) + + + + + + + +
+ + diff --git a/testing/web-platform/tests/html/browsers/the-window-object/window-open-defaults.window.js b/testing/web-platform/tests/html/browsers/the-window-object/window-open-defaults.window.js new file mode 100644 index 0000000000..1b2d68a462 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/window-open-defaults.window.js @@ -0,0 +1,12 @@ +async_test(t => { + const frame = document.createElement("iframe"); + t.add_cleanup(() => frame.remove()); + frame.name = "foo"; + frame.src = "/common/blank.html"; + frame.onload = t.step_func(() => { + frame.onload = t.unreached_func(); + t.step_timeout(() => t.done(), 500); + assert_equals(window[0], window.open(undefined, "foo")); + }); + document.body.append(frame); +}, "window.open()'s url parameter default"); diff --git a/testing/web-platform/tests/html/browsers/the-window-object/window-open-invalid-url.html b/testing/web-platform/tests/html/browsers/the-window-object/window-open-invalid-url.html new file mode 100644 index 0000000000..cabc143b9d --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/window-open-invalid-url.html @@ -0,0 +1,10 @@ + + +window.open() with an invalid URL + + + diff --git a/testing/web-platform/tests/html/browsers/the-window-object/window-open-noopener.html b/testing/web-platform/tests/html/browsers/the-window-object/window-open-noopener.html new file mode 100644 index 0000000000..8d3a95df63 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/window-open-noopener.html @@ -0,0 +1,137 @@ + + +window.open() with "noopener" tests + + + + + + + + + + diff --git a/testing/web-platform/tests/html/browsers/the-window-object/window-open-noreferrer.html b/testing/web-platform/tests/html/browsers/the-window-object/window-open-noreferrer.html new file mode 100644 index 0000000000..92b72cdb5f --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/window-open-noreferrer.html @@ -0,0 +1,20 @@ + + +window.open() with "noreferrer" tests + + + diff --git a/testing/web-platform/tests/html/browsers/the-window-object/window-open-popup-behavior.html b/testing/web-platform/tests/html/browsers/the-window-object/window-open-popup-behavior.html new file mode 100644 index 0000000000..258698d94d --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/window-open-popup-behavior.html @@ -0,0 +1,51 @@ + + + +Window.open popup behavior + + + + + + diff --git a/testing/web-platform/tests/html/browsers/the-window-object/window-open-windowfeatures-values.html b/testing/web-platform/tests/html/browsers/the-window-object/window-open-windowfeatures-values.html new file mode 100644 index 0000000000..32551dd8d7 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/window-open-windowfeatures-values.html @@ -0,0 +1,72 @@ + + + +window.open() windowFeature value parsing + + + + + diff --git a/testing/web-platform/tests/html/browsers/the-window-object/window-opener-unconfigurable.window.js b/testing/web-platform/tests/html/browsers/the-window-object/window-opener-unconfigurable.window.js new file mode 100644 index 0000000000..2b9bda6792 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/window-opener-unconfigurable.window.js @@ -0,0 +1,17 @@ +test(t => { + let desc = Object.getOwnPropertyDescriptor(self, "opener"); + assert_true(!!desc.get, "Initially {get: function}"); + assert_true(!!desc.set, "Initially {set: function}"); + assert_true(desc.configurable, "Initially {configurable: true}"); + assert_true(desc.enumerable, "Initially {enumerable: true}"); + + Object.defineProperty(self, "opener", {configurable: false}); + + desc = Object.getOwnPropertyDescriptor(self, "opener"); + assert_true(!!desc.get, "Still has {get: function}"); + assert_true(!!desc.set, "Still has {set: function}"); + assert_false(desc.configurable, "Changed to {configurable: false}"); + assert_true(desc.enumerable, "Still has {enumerable: true}"); + + assert_throws_js(TypeError, () => self.opener = "something", "Throws a TypeError due to {configurable: false}"); +}, "Corner case: self.opener is set while it's not configurable"); diff --git a/testing/web-platform/tests/html/browsers/the-window-object/window-properties.https.html b/testing/web-platform/tests/html/browsers/the-window-object/window-properties.https.html new file mode 100644 index 0000000000..c61fb04ae2 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/window-properties.https.html @@ -0,0 +1,358 @@ + + +Properties of the window object + + + + + + + + + + + + + + + + + + +
+ diff --git a/testing/web-platform/tests/html/browsers/the-window-object/window-prototype-chain.html b/testing/web-platform/tests/html/browsers/the-window-object/window-prototype-chain.html new file mode 100644 index 0000000000..14dbca35e8 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/window-prototype-chain.html @@ -0,0 +1,32 @@ + + +Prototype chain of the window object + + + + + + + +
+ diff --git a/testing/web-platform/tests/html/browsers/the-window-object/window-reuse-in-nested-browsing-contexts.tentative.html b/testing/web-platform/tests/html/browsers/the-window-object/window-reuse-in-nested-browsing-contexts.tentative.html new file mode 100644 index 0000000000..03c7a68dfd --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/window-reuse-in-nested-browsing-contexts.tentative.html @@ -0,0 +1,158 @@ + + + + + +
+ -- cgit v1.2.3