From 49ec6632870e9699e6e6c80a53f2d9b8dcf4faf7 Mon Sep 17 00:00:00 2001 From: Tim Nguyen Date: Mon, 10 Apr 2023 19:57:32 -0700 Subject: [PATCH] Upstream Safari 16-16.4 RuntimeApplicationChecks 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 --- .../cocoa/RuntimeApplicationChecksCocoa.cpp | 20 +++++++++++++++++++ Source/WTF/wtf/spi/darwin/dyldSPI.h | 18 +++++++++++++++++ 2 files changed, 38 insertions(+) diff --git a/Source/WTF/wtf/cocoa/RuntimeApplicationChecksCocoa.cpp b/Source/WTF/wtf/cocoa/RuntimeApplicationChecksCocoa.cpp index 28c970cbcf2e..0c98766014cf 100644 --- a/Source/WTF/wtf/cocoa/RuntimeApplicationChecksCocoa.cpp +++ b/Source/WTF/wtf/cocoa/RuntimeApplicationChecksCocoa.cpp @@ -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; diff --git a/Source/WTF/wtf/spi/darwin/dyldSPI.h b/Source/WTF/wtf/spi/darwin/dyldSPI.h index 0bd2bd20a8a5..05bbd9baf09a 100644 --- a/Source/WTF/wtf/spi/darwin/dyldSPI.h +++ b/Source/WTF/wtf/spi/darwin/dyldSPI.h @@ -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 @@ -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; @@ -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 @@ -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 @@ -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);