Show Safari also supports Atomics (gated by COOP/COEP) #14528
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
In Safari version 15.2, Safari re-enabled
SharedArrayBufferbut they also re-enabledAtomicsbut it was not mentioned in the release notes.On top of that,
Atomics.wakeappears to have been renamed toAtomics.notifyin line with other browsers and the spec that changed. tc39/ecma262#1220Test results and supporting details
I've tested it myself in MacOS Safari 15.2. Note that other browsers support
Atomicsall the time, regardless of COOP/COEP headers but in Safari 15.2Atomicsis not defined unless in a cross-origin isolated context (ifSharedArrayBufferworks, it also works).I've built a little testing site with the cross-origin headers set correctly: https://atomics-browser-test.web.app/
Code is here: https://github.com/katharosada/atomics-test
I don't have a device with iOS but friends have reported the testing site is all green if on Safari 15.2 and the 15.3 public beta.
Supporting information
I've tried to follow the paper trail as best I can to figure out why it wasn't mentioned in the release notes.
Release notes for Safari 15.2 say that
SharedArrayBufferis enabled but do not mentionAtomics: https://developer.apple.com/documentation/safari-release-notes/safari-15_2-release-notesHowever, preview release notes for past versions clearly state that
Atomicsare enabled under the same feature flag:JSC_useSharedArrayBuffer. See: https://developer.apple.com/safari/technology-preview/release-notes/And the release notes that describe enabling
SharedArrayBufferdo so by enabling the JSC flag - as outlined in the linked changeset: https://trac.webkit.org/changeset/281832/webkit/Related issues
#14056