From 55e40bb437f0e3044390040b5d2471aa8737ab16 Mon Sep 17 00:00:00 2001 From: Alexey Shvayka Date: Fri, 23 Jul 2021 20:59:58 +0300 Subject: [PATCH 1/2] WebKit export of https://bugs.webkit.org/show_bug.cgi?id=225997 --- ...bject-implicit-this-value-cross-realm.html | 97 ++++++++++++++++ .../invalid-this-value-cross-realm.html | 45 ++++++++ .../support/create-realm.js | 12 ++ .../support/dummy-iframe.html | 7 ++ ...ion-and-location-href-cross-realm-set.html | 106 ++++++++++++++++++ ...upportedEntryTypes-cross-realm-access.html | 18 +++ .../sframe-transform-readable.html | 3 +- 7 files changed, 287 insertions(+), 1 deletion(-) create mode 100644 WebIDL/ecmascript-binding/global-object-implicit-this-value-cross-realm.html create mode 100644 WebIDL/ecmascript-binding/invalid-this-value-cross-realm.html create mode 100644 WebIDL/ecmascript-binding/support/create-realm.js create mode 100644 WebIDL/ecmascript-binding/support/dummy-iframe.html create mode 100644 html/browsers/origin/cross-origin-objects/window-location-and-location-href-cross-realm-set.html create mode 100644 performance-timeline/supportedEntryTypes-cross-realm-access.html diff --git a/WebIDL/ecmascript-binding/global-object-implicit-this-value-cross-realm.html b/WebIDL/ecmascript-binding/global-object-implicit-this-value-cross-realm.html new file mode 100644 index 00000000000000..891dda9bdcaa79 --- /dev/null +++ b/WebIDL/ecmascript-binding/global-object-implicit-this-value-cross-realm.html @@ -0,0 +1,97 @@ + + +Cross-realm getter / setter / operation doesn't use lexical global object if |this| value is incompatible object / null / undefined + + + + + + + + + + diff --git a/WebIDL/ecmascript-binding/invalid-this-value-cross-realm.html b/WebIDL/ecmascript-binding/invalid-this-value-cross-realm.html new file mode 100644 index 00000000000000..4db319215ede4a --- /dev/null +++ b/WebIDL/ecmascript-binding/invalid-this-value-cross-realm.html @@ -0,0 +1,45 @@ + + +Cross-realm getter / setter / operation doesn't use lexical global object to throw an error for incompatible |this| value + + + + + + + + + + diff --git a/WebIDL/ecmascript-binding/support/create-realm.js b/WebIDL/ecmascript-binding/support/create-realm.js new file mode 100644 index 00000000000000..45ded884fc1f22 --- /dev/null +++ b/WebIDL/ecmascript-binding/support/create-realm.js @@ -0,0 +1,12 @@ +"use strict"; + +function createRealm(t) { + return new Promise(resolve => { + const iframe = document.createElement("iframe"); + t.add_cleanup(() => { iframe.remove(); }); + iframe.onload = () => { resolve(iframe.contentWindow); }; + iframe.name = "dummy"; + iframe.src = "support/dummy-iframe.html"; + document.body.append(iframe); + }); +} diff --git a/WebIDL/ecmascript-binding/support/dummy-iframe.html b/WebIDL/ecmascript-binding/support/dummy-iframe.html new file mode 100644 index 00000000000000..3f773ae6f811ac --- /dev/null +++ b/WebIDL/ecmascript-binding/support/dummy-iframe.html @@ -0,0 +1,7 @@ + + +foo + + diff --git a/html/browsers/origin/cross-origin-objects/window-location-and-location-href-cross-realm-set.html b/html/browsers/origin/cross-origin-objects/window-location-and-location-href-cross-realm-set.html new file mode 100644 index 00000000000000..8270bdcc23dce0 --- /dev/null +++ b/html/browsers/origin/cross-origin-objects/window-location-and-location-href-cross-realm-set.html @@ -0,0 +1,106 @@ + + +Cross-realm [[Set]] to window.location and location.href throws an error of correct realm + + + + + + + diff --git a/performance-timeline/supportedEntryTypes-cross-realm-access.html b/performance-timeline/supportedEntryTypes-cross-realm-access.html new file mode 100644 index 00000000000000..8b86a6398bfd49 --- /dev/null +++ b/performance-timeline/supportedEntryTypes-cross-realm-access.html @@ -0,0 +1,18 @@ + + +Cross-realm access of supportedEntryTypes returns Array of another realm + + + + + diff --git a/webrtc-encoded-transform/sframe-transform-readable.html b/webrtc-encoded-transform/sframe-transform-readable.html index e6618250bd1873..2afce1b271ec31 100644 --- a/webrtc-encoded-transform/sframe-transform-readable.html +++ b/webrtc-encoded-transform/sframe-transform-readable.html @@ -9,9 +9,10 @@ From 84eb89e6ea9a49eef96e5b94738c93b75b6aed28 Mon Sep 17 00:00:00 2001 From: Alexey Shvayka Date: Fri, 23 Jul 2021 21:16:25 +0300 Subject: [PATCH 2/2] Remove trailing whitespace --- .../global-object-implicit-this-value-cross-realm.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/WebIDL/ecmascript-binding/global-object-implicit-this-value-cross-realm.html b/WebIDL/ecmascript-binding/global-object-implicit-this-value-cross-realm.html index 891dda9bdcaa79..17a7b282f0ef8e 100644 --- a/WebIDL/ecmascript-binding/global-object-implicit-this-value-cross-realm.html +++ b/WebIDL/ecmascript-binding/global-object-implicit-this-value-cross-realm.html @@ -78,7 +78,7 @@ const other = await createRealm(t); const otherFocus = other.focus; const otherDispatchEvent = other.dispatchEvent; - + assert_equals(document.activeElement, document.body); // An engine might have different code path for calling a function from outer scope to implement step 1.b.iii of https://tc39.es/ecma262/#sec-evaluatecall (() => { otherFocus(); })();