Skip to content

Commit

Permalink
Upstream Safari 16-16.4 RuntimeApplicationChecks
Browse files Browse the repository at this point in the history
https://bugs.webkit.org/show_bug.cgi?id=255253
rdar://107853760

Reviewed by Aditya Keerthi.

* Source/WTF/wtf/cocoa/RuntimeApplicationChecksCocoa.cpp:
(WTF::computeSDKAlignedBehaviors):
* Source/WTF/wtf/spi/darwin/dyldSPI.h:

Canonical link: https://commits.webkit.org/262803@main
  • Loading branch information
nt1m committed Apr 11, 2023
1 parent d2179ea commit 49ec663
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 0 deletions.
20 changes: 20 additions & 0 deletions Source/WTF/wtf/cocoa/RuntimeApplicationChecksCocoa.cpp
Expand Up @@ -172,6 +172,26 @@ static SDKAlignedBehaviors computeSDKAlignedBehaviors()
if (linkedBefore(dyld_spring_2022_os_versions, DYLD_IOS_VERSION_15_4, DYLD_MACOSX_VERSION_12_3))
disableBehavior(SDKAlignedBehavior::AuthorizationHeaderOnSameOriginRedirects);

if (linkedBefore(dyld_fall_2022_os_versions, DYLD_IOS_VERSION_16_0, DYLD_MACOSX_VERSION_13_0)) {
disableBehavior(SDKAlignedBehavior::NoTypedArrayAPIQuirk);
disableBehavior(SDKAlignedBehavior::ForbidsDotPrefixedFonts);
disableBehavior(SDKAlignedBehavior::ContextMenuTriggersLinkActivationNavigationType);
disableBehavior(SDKAlignedBehavior::DoesNotParseStringEndingWithFullStopAsFloatingPointNumber);
disableBehavior(SDKAlignedBehavior::UIBackForwardSkipsHistoryItemsWithoutUserGesture);
}

if (linkedBefore(dyld_spring_2023_os_versions, DYLD_IOS_VERSION_16_4, DYLD_MACOSX_VERSION_13_4)) {
disableBehavior(SDKAlignedBehavior::NoShowModalDialog);
disableBehavior(SDKAlignedBehavior::DoesNotAddIntrinsicMarginsToFormControls);
disableBehavior(SDKAlignedBehavior::ProgrammaticFocusDuringUserScriptShowsInputViews);
disableBehavior(SDKAlignedBehavior::DefaultsToExcludingBackgroundsWhenPrinting);
disableBehavior(SDKAlignedBehavior::InspectableDefaultsToDisabled);
disableBehavior(SDKAlignedBehavior::PushStateFilePathRestriction);
disableBehavior(SDKAlignedBehavior::NoUNIQLOLazyIframeLoadingQuirk);
disableBehavior(SDKAlignedBehavior::UsesGameControllerPhysicalInputProfile);
disableBehavior(SDKAlignedBehavior::ScreenOrientationAPIEnabled);
}

disableAdditionalSDKAlignedBehaviors(behaviors);

return behaviors;
Expand Down
18 changes: 18 additions & 0 deletions Source/WTF/wtf/spi/darwin/dyldSPI.h
Expand Up @@ -81,6 +81,10 @@
#define DYLD_IOS_VERSION_16_0 0x00100000
#endif

#ifndef DYLD_IOS_VERSION_16_4
#define DYLD_IOS_VERSION_16_4 0x00100400
#endif

#ifndef DYLD_MACOSX_VERSION_10_13
#define DYLD_MACOSX_VERSION_10_13 0x000A0D00
#endif
Expand Down Expand Up @@ -121,6 +125,10 @@
#define DYLD_MACOSX_VERSION_13_0 0x000d0000
#endif

#ifndef DYLD_MACOSX_VERSION_13_4
#define DYLD_MACOSX_VERSION_13_4 0x000d0400
#endif

#else

typedef uint32_t dyld_platform_t;
Expand Down Expand Up @@ -150,6 +158,7 @@ typedef struct {
#define DYLD_IOS_VERSION_15_0 0x000f0000
#define DYLD_IOS_VERSION_15_4 0x000f0400
#define DYLD_IOS_VERSION_16_0 0x00100000
#define DYLD_IOS_VERSION_16_4 0x00100400

#define DYLD_MACOSX_VERSION_10_10 0x000A0A00
#define DYLD_MACOSX_VERSION_10_11 0x000A0B00
Expand All @@ -166,6 +175,7 @@ typedef struct {
#define DYLD_MACOSX_VERSION_12_00 0x000c0000
#define DYLD_MACOSX_VERSION_12_3 0x000c0300
#define DYLD_MACOSX_VERSION_13_0 0x000d0000
#define DYLD_MACOSX_VERSION_13_4 0x000d0400

#endif

Expand Down Expand Up @@ -239,6 +249,14 @@ WTF_EXTERN_C_BEGIN
#define dyld_spring_2022_os_versions ({ (dyld_build_version_t) { 0, 0 }; })
#endif

#ifndef dyld_fall_2022_os_versions
#define dyld_fall_2022_os_versions ({ (dyld_build_version_t) { 0, 0 }; })
#endif

#ifndef dyld_spring_2023_os_versions
#define dyld_spring_2023_os_versions ({ (dyld_build_version_t) { 0, 0 }; })
#endif

uint32_t dyld_get_program_sdk_version();
bool dyld_program_sdk_at_least(dyld_build_version_t);
extern const char* dyld_shared_cache_file_path(void);
Expand Down

0 comments on commit 49ec663

Please sign in to comment.