Skip to content

Commit

Permalink
AX: Rename HAVE_ACCESSIBILITY_ANIMATED_IMAGES to HAVE_ACCESSIBILITY_A…
Browse files Browse the repository at this point in the history
…NIMATED_IMAGE_CONTROL, make HAVE_ACCESSIBILITY_FRAMEWORK unconditionally enabled for Cocoa platforms

https://bugs.webkit.org/show_bug.cgi?id=247820
rdar://problem/102249495

Reviewed by Chris Fleizach.

1. Rename HAVE_ACCESSIBILITY_ANIMATED_IMAGES to HAVE_ACCESSIBILITY_ANIMATED_IMAGE_CONTROL
   because that more accurately captures the intent of the flag.

2. Make HAVE_ACCESSIBILITY_FRAMEWORK unconditionally enabled for Cocoa platforms because we
   no longer support any of the currently listed minimum build versions for the flag.

* Source/WTF/wtf/PlatformHave.h:
* Source/WebKit/UIProcess/Cocoa/WebProcessPoolCocoa.mm:
(WebKit::accessibilityPreferences):
(WebKit::WebProcessPool::registerNotificationObservers):

Canonical link: https://commits.webkit.org/256600@main
  • Loading branch information
twilco committed Nov 12, 2022
1 parent da821c3 commit 8b4aafa
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
7 changes: 2 additions & 5 deletions Source/WTF/wtf/PlatformHave.h
Expand Up @@ -1314,10 +1314,7 @@
#define HAVE_LOCKDOWN_MODE_PDF_ADDITIONS 1
#endif

#if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101600) \
|| (PLATFORM(IOS_FAMILY) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 140000) \
|| (PLATFORM(WATCHOS) && __WATCH_OS_VERSION_MIN_REQUIRED >= 70000) \
|| (PLATFORM(APPLETV) && __TV_OS_VERSION_MIN_REQUIRED >= 140000)
#if PLATFORM(COCOA)
#define HAVE_ACCESSIBILITY_FRAMEWORK 1
#endif

Expand All @@ -1342,7 +1339,7 @@

#if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 140000) \
|| ((PLATFORM(IOS) || PLATFORM(MACCATALYST)) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 170000)
#define HAVE_ACCESSIBILITY_ANIMATED_IMAGES 1
#define HAVE_ACCESSIBILITY_ANIMATED_IMAGE_CONTROL 1
#endif

#if PLATFORM(IOS) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 160100
Expand Down
6 changes: 3 additions & 3 deletions Source/WebKit/UIProcess/Cocoa/WebProcessPoolCocoa.mm
Expand Up @@ -183,7 +183,7 @@ static bool canaryInBaseState()
SOFT_LINK(BackBoardServices, BKSDisplayBrightnessGetCurrent, float, (), ());
#endif

#if HAVE(ACCESSIBILITY_ANIMATED_IMAGES)
#if HAVE(ACCESSIBILITY_ANIMATED_IMAGE_CONTROL)
SOFT_LINK_LIBRARY_OPTIONAL(libAccessibility)
SOFT_LINK_OPTIONAL(libAccessibility, _AXSReduceMotionAutoplayAnimatedImagesEnabled, Boolean, (), ());
SOFT_LINK_CONSTANT_MAY_FAIL(libAccessibility, kAXSReduceMotionAutoplayAnimatedImagesChangedNotification, CFStringRef)
Expand Down Expand Up @@ -267,7 +267,7 @@ static AccessibilityPreferences accessibilityPreferences()
preferences.invertColorsEnabled = _AXSInvertColorsEnabledApp(appId.get());
#endif
preferences.enhanceTextLegibilityOverall = _AXSEnhanceTextLegibilityEnabled();
#if HAVE(ACCESSIBILITY_ANIMATED_IMAGES)
#if HAVE(ACCESSIBILITY_ANIMATED_IMAGE_CONTROL)
if (auto* functionPointer = _AXSReduceMotionAutoplayAnimatedImagesEnabledPtr())
preferences.imageAnimationEnabled = functionPointer();
#endif
Expand Down Expand Up @@ -826,7 +826,7 @@ static bool determineIfWeShouldCrashWhenCreatingWebProcess()
addCFNotificationObserver(accessibilityPreferencesChangedCallback, kAXSDarkenSystemColorsEnabledNotification);
addCFNotificationObserver(accessibilityPreferencesChangedCallback, kAXSInvertColorsEnabledNotification);
#endif
#if HAVE(ACCESSIBILITY_ANIMATED_IMAGES)
#if HAVE(ACCESSIBILITY_ANIMATED_IMAGE_CONTROL)
if (canLoadkAXSReduceMotionAutoplayAnimatedImagesChangedNotification())
addCFNotificationObserver(accessibilityPreferencesChangedCallback, getkAXSReduceMotionAutoplayAnimatedImagesChangedNotification());
#endif
Expand Down

0 comments on commit 8b4aafa

Please sign in to comment.