-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Raise the bar for SharedArrayBuffer via postMessage() #4734
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
The original test could not work. This should be able to work and also adds COOP/COEP headers for future proofing. No browser passes still. For whatwg/html#4734.
I've updated OP with a number of tests of which some are landed. I made the decision to land test changes as this is a large undertaking that has multi-implementer buy-in and landing it all at once would it a lot more likely we'd miss important things. The changes should minimally disrupt existing coverage. I'll try to continue to keep OP up-to-date. |
…ffer success case revamp, a=testonly Automatic update from web-platform-tests HTML: BroadcastChannel and SharedArrayBuffer success case revamp The original test could not work. This should be able to work and also adds COOP/COEP headers for future proofing. No browser passes still. For whatwg/html#4734. -- wpt-commits: dedb45f5f20e0ac884ac59634cceb8659cdcff7d wpt-pr: 17760
…ffer success case revamp, a=testonly Automatic update from web-platform-tests HTML: BroadcastChannel and SharedArrayBuffer success case revamp The original test could not work. This should be able to work and also adds COOP/COEP headers for future proofing. No browser passes still. For whatwg/html#4734. -- wpt-commits: dedb45f5f20e0ac884ac59634cceb8659cdcff7d wpt-pr: 17760
…djustments, a=testonly Automatic update from web-platform-tests HTML: SharedArrayBuffer infrastructure adjustments For whatwg/html#4734. -- wpt-commits: a140f239fa9dc4fc3db593b664064b65340e7d4b wpt-pr: 17761 --HG-- rename : testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/resources/broadcastchannel-iframe.html.headers => testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/resources/echo-iframe.html.headers rename : testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/resources/broadcastchannel-iframe.html.headers => testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/resources/echo-worker.js.headers rename : testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/broadcastchannel-success-and-failure.html => testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/broadcastchannel-success-and-failure.https.html rename : testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/identity-not-preserved.html => testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/identity-not-preserved.https.html rename : testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/no-transferring.html => testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/no-transferring.https.html rename : testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/resources/broadcastchannel-iframe.html.headers => testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/resources/broadcastchannel-sharedworker.js.headers rename : testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/resources/broadcastchannel-iframe.html.headers => testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/resources/broadcastchannel-worker.js.headers rename : testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/resources/broadcastchannel-iframe.html.headers => testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/resources/incrementer-worker-with-channel.js.headers rename : testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/resources/broadcastchannel-iframe.html.headers => testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/resources/incrementer-worker.js.headers rename : testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/resources/broadcastchannel-iframe.html.headers => testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/resources/nested-worker-success.js.headers rename : testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/resources/broadcastchannel-iframe.html.headers => testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/resources/serviceworker-failure.js.headers rename : testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/resources/broadcastchannel-iframe.html.headers => testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/resources/sharedworker-failure.js.headers rename : testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/serialization-via-history.html => testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/serialization-via-history.https.html rename : testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/window-domain-success.sub.html => testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/window-domain-success.https.sub.html rename : testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/window-iframe-messagechannel-success.html => testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/window-iframe-messagechannel-success.https.html rename : testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/window-messagechannel-success.html => testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/window-messagechannel-success.https.html rename : testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/window-sharedworker-failure.html => testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/window-sharedworker-failure.https.html rename : testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/window-similar-but-cross-origin-success.sub.html => testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/window-similar-but-cross-origin-success.https.sub.html rename : testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/window-simple-success.html => testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/window-simple-success.https.html
…er throws without COOP+COEP, a=testonly Automatic update from web-platform-tests HTML: ensure serializing SharedArrayBuffer throws without COOP+COEP For whatwg/html#4734. -- wpt-commits: aecedb53e28abad5432227e293dd016cfc46d4b7 wpt-pr: 17802
…djustments, a=testonly Automatic update from web-platform-tests HTML: SharedArrayBuffer infrastructure adjustments For whatwg/html#4734. -- wpt-commits: a140f239fa9dc4fc3db593b664064b65340e7d4b wpt-pr: 17761
…er throws without COOP+COEP, a=testonly Automatic update from web-platform-tests HTML: ensure serializing SharedArrayBuffer throws without COOP+COEP For whatwg/html#4734. -- wpt-commits: aecedb53e28abad5432227e293dd016cfc46d4b7 wpt-pr: 17802
This comment has been minimized.
This comment has been minimized.
b465512
to
c772611
Compare
A top-level navigation response with Cross-Origin-Opener-Policy set to same-origin and Cross-Origin-Embedder-Policy set to require-corp will create a cross-origin isolated browsing context group. And all agent clusters therein will be cross-origin isolated as well (shared and service workers can still not be, as they sit on the side). This change also: * Gates SharedArrayBuffer exposure behind that primitive for web compatibility reasons. * Gates SharedArrayBuffer sharing behind that primitive. * Exposes it through self.crossOriginIsolated. * Makes document.domain return before it mutates the origin. * Makes agent clusters keyed on origin. Tests: * web-platform-tests/wpt#17719 * web-platform-tests/wpt#17760 * web-platform-tests/wpt#17761 * web-platform-tests/wpt#17802 * web-platform-tests/wpt#17909 * web-platform-tests/wpt#18543 * web-platform-tests/wpt#20116 * web-platform-tests/wpt#22358 Closes #4732. Closes #5122. Closes #5444. Follow-up: #5435.
a27a45d
to
50ebcb4
Compare
I squashed and then rebased and there were no issues. Somewhat strange. I'll work on some fixups now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM with nits, hooray
Oh wait, given the wording in tc39/ecma262#1903 I guess it's solely up to the host, not the implementation. So this is all good. |
…ffer success case revamp, a=testonly Automatic update from web-platform-tests HTML: BroadcastChannel and SharedArrayBuffer success case revamp The original test could not work. This should be able to work and also adds COOP/COEP headers for future proofing. No browser passes still. For whatwg/html#4734. -- wpt-commits: dedb45f5f20e0ac884ac59634cceb8659cdcff7d wpt-pr: 17760
…ffer success case revamp, a=testonly Automatic update from web-platform-tests HTML: BroadcastChannel and SharedArrayBuffer success case revamp The original test could not work. This should be able to work and also adds COOP/COEP headers for future proofing. No browser passes still. For whatwg/html#4734. -- wpt-commits: dedb45f5f20e0ac884ac59634cceb8659cdcff7d wpt-pr: 17760
…djustments, a=testonly Automatic update from web-platform-tests HTML: SharedArrayBuffer infrastructure adjustments For whatwg/html#4734. -- wpt-commits: a140f239fa9dc4fc3db593b664064b65340e7d4b wpt-pr: 17761
…er throws without COOP+COEP, a=testonly Automatic update from web-platform-tests HTML: ensure serializing SharedArrayBuffer throws without COOP+COEP For whatwg/html#4734. -- wpt-commits: aecedb53e28abad5432227e293dd016cfc46d4b7 wpt-pr: 17802
Automatic update from web-platform-tests HTML: COEP and ImageBitmap Helps with whatwg/html#4734 and #18354. -- wpt-commits: 53c7a93cc4ba3a5fa1fe3f3358eeb9ad2ad2f0e9 wpt-pr: 18543
This test was used to verify that postMessaging to a same-origin-domain (but not same-origin) iframe allows them to see each others' modification. However, we now only allow same-origin to postMessage SharedArrayBuffer. And, that means same-origin-domain are not allowed to do that. Therefore, this test is rewrited to verify that postMessage SharedArrayBuffer from a same-origin-domain iframe would result the receiver (parent) to get a message error event. Github issue: whatwg/html#4734 Differential Revision: https://phabricator.services.mozilla.com/D70348
…; r=annevk Changes for using messagechannel to share the SharedArrayBuffer. Github issue: whatwg/html#4734 Differential Revision: https://phabricator.services.mozilla.com/D70349
….https.sub.html; r=annevk We have window-domain-failure.https.sub.html so we don't need this test. Github issue: whatwg/html#4734 Differential Revision: https://phabricator.services.mozilla.com/D70350
This depends on the work to add Cross-Origin-Opener-Policy and Cross-Origin-Embedder-Policy. It specifies how postMessage() is affected when both those headers are set for the agent clusters they impact.
Closes #4732.
(See WHATWG Working Mode: Changes for more details.)
/browsers.html ( diff )
/origin.html ( diff )
/structured-data.html ( diff )
/webappapis.html ( diff )
/workers.html ( diff )