Skip to content

[Swift in WebKit] Adopt the new spelling of some Swift-Cxx interop annotations - #75641

Open
rr-codes wants to merge 1 commit into
WebKit:mainfrom
rr-codes:eng/Swift-in-WebKit-Adopt-the-new-spelling-of-some-Swift-Cxx-interop-annotations
Open

rr-codes wants to merge 1 commit into
WebKit:mainfrom
rr-codes:eng/Swift-in-WebKit-Adopt-the-new-spelling-of-some-Swift-Cxx-interop-annotations

Conversation

@rr-codes

@rr-codes rr-codes commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

38a3b25

[Swift in WebKit] Adopt the new spelling of some Swift-Cxx interop annotations
https://bugs.webkit.org/show_bug.cgi?id=326059
rdar://188992301

Reviewed by NOBODY (OOPS!).

Rename SWIFT_ESCAPABLE, SWIFT_ESCAPABLE_IF, and SWIFT_NONESCAPABLE to SWIFT_SELF_CONTAINED,
SWIFT_SELF_CONTAINED_IF, and SWIFT_VIEW respectively.

* Source/WTF/wtf/EscapableByteSpan.h:
* Source/WTF/wtf/Function.h:
(WTF::Function<Out):
* Source/WTF/wtf/HashMap.h:
* Source/WTF/wtf/InlineWeakPtr.h:
* Source/WTF/wtf/InlineWeakRef.h:
* Source/WTF/wtf/RangeSet.h:
* Source/WTF/wtf/Ref.h:
* Source/WTF/wtf/RefPtr.h:
* Source/WTF/wtf/RetainPtr.h:
* Source/WTF/wtf/SwiftBridging.h:
* Source/WTF/wtf/ThreadSafeWeakPtr.h:
* Source/WTF/wtf/UniqueRef.h:
* Source/WTF/wtf/Variant.h:
* Source/WTF/wtf/Vector.h:
* Source/WTF/wtf/WeakPtr.h:
* Source/WTF/wtf/text/CString.h:
* Source/WTF/wtf/text/WTFString.h:
* Source/WebCore/platform/SelectionGeometry.h:
* Source/WebCore/platform/graphics/IntRect.h:
* Source/WebGPU/WebGPU/QuerySet.h:
* Source/WebGPU/WebGPU/WebGPU.h:
* Source/WebKit/Shared/SessionState.h:

38a3b25

Misc iOS, visionOS, tvOS & watchOS macOS Linux Windows Apple Internal
❌ 🧪 style ✅ 🛠 ios ✅ 🛠 mac ✅ 🛠 wpe ⏳ 🛠 win ✅ 🛠 ios-apple
✅ 🧪 bindings ✅ 🛠 ios-sim ✅ 🛠 mac-AS-debug ✅ 🧪 wpe-wk2 ⏳ 🧪 win-tests ✅ 🛠 mac-apple
✅ 🧪 webkitperl ⏳ 🧪 ios-wk2 ⏳ 🧪 api-mac ⏳ 🧪 api-wpe ✅ 🛠 vision-apple
✅ 🧪 ios-wk2-wpt ⏳ 🧪 api-mac-debug loading 🧪 jsc-wpe
✅ 🧪 jsc-x86-64 ⏳ 🧪 api-ios ✅ 🧪 mac-wk2 ✅ 🛠 gtk3-gcc
✅ 🛠 🧪 jsc-debug-arm64 ⏳ 🛠 ios-safer-cpp ⏳ 🧪 mac-AS-debug-wk2 ✅ 🛠 gtk
✅ 🛠 vision ⏳ 🧪 gtk-wk2
✅ 🛠 vision-sim ⏳ 🧪 mac-intel-wk2 ✅ 🧪 api-gtk
✅ 🧪 vision-wk2 ⏳ 🛠 mac-safer-cpp ✅ 🛠 playstation
✅ 🛠 tv ✅ 🧪 mac-site-isolation
✅ 🛠 tv-sim
✅ 🛠 watch
✅ 🛠 watch-sim

…notations

https://bugs.webkit.org/show_bug.cgi?id=326059
rdar://188992301

Reviewed by NOBODY (OOPS!).

Rename SWIFT_ESCAPABLE, SWIFT_ESCAPABLE_IF, and SWIFT_NONESCAPABLE to SWIFT_SELF_CONTAINED,
SWIFT_SELF_CONTAINED_IF, and SWIFT_VIEW respectively.

* Source/WTF/wtf/EscapableByteSpan.h:
* Source/WTF/wtf/Function.h:
(WTF::Function<Out):
* Source/WTF/wtf/HashMap.h:
* Source/WTF/wtf/InlineWeakPtr.h:
* Source/WTF/wtf/InlineWeakRef.h:
* Source/WTF/wtf/RangeSet.h:
* Source/WTF/wtf/Ref.h:
* Source/WTF/wtf/RefPtr.h:
* Source/WTF/wtf/RetainPtr.h:
* Source/WTF/wtf/SwiftBridging.h:
* Source/WTF/wtf/ThreadSafeWeakPtr.h:
* Source/WTF/wtf/UniqueRef.h:
* Source/WTF/wtf/Variant.h:
* Source/WTF/wtf/Vector.h:
* Source/WTF/wtf/WeakPtr.h:
* Source/WTF/wtf/text/CString.h:
* Source/WTF/wtf/text/WTFString.h:
* Source/WebCore/platform/SelectionGeometry.h:
* Source/WebCore/platform/graphics/IntRect.h:
* Source/WebGPU/WebGPU/QuerySet.h:
* Source/WebGPU/WebGPU/WebGPU.h:
* Source/WebKit/Shared/SessionState.h:
@rr-codes
rr-codes requested review from a team, mwyrzykowski and tadeuzagallo as code owners October 2, 2026 10:19
@rr-codes rr-codes self-assigned this Oct 2, 2026
@rr-codes rr-codes added the WebKit Misc. For miscellaneous bugs in the WebKit framework (and not JavaScriptCore or WebCore). label Oct 2, 2026

@Xazax-hun Xazax-hun left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good from the toolchain point of view. Added some nits inline for your consideration, but none of them are blockers.

#ifndef SWIFT_NONESCAPABLE
#define SWIFT_NONESCAPABLE SWIFT_VIEW
#endif
#else

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: I wonder if a comment might make it clearer what this else belongs to.

// prefer the new spellings.
#ifdef SWIFT_VIEW
#ifndef SWIFT_ESCAPABLE
#define SWIFT_ESCAPABLE SWIFT_SELF_CONTAINED

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alternatively, if we don't want WebKit to ever use the old names, they could expand to something like static_assert(false, "SWIFT_ESCAPABLE is removed; use SWIFT_SELF_CONTAINED"). What do you think?

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alternatively, if that doesn't produce the message we want, we could try #pragma GCC poison OLD_MACRO or something similar.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or you might be able to do something like:

#pragma clang deprecated(SWIFT_ESCAPABLE, "use 'SWIFT_SELF_CONTAINED' instead")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

WebKit Misc. For miscellaneous bugs in the WebKit framework (and not JavaScriptCore or WebCore).

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants