Title: [279663] branches/safari-612.1.22.0-branch/Source/WebKit
- Revision
- 279663
- Author
- rubent...@apple.com
- Date
- 2021-07-07 13:39:21 -0700 (Wed, 07 Jul 2021)
Log Message
Cherry-pick r279342. rdar://problem/80282918
Pass correct value of AX per app settings to the WebContent process
https://bugs.webkit.org/show_bug.cgi?id=227441
<rdar://problem/79857797>
Reviewed by Brent Fulgham.
Pass value of type AXValueState instead of a boolean value for per app AX settings.
* Shared/AccessibilityPreferences.h:
* UIProcess/Cocoa/WebProcessPoolCocoa.mm:
(WebKit::accessibilityPreferences):
* WebProcess/cocoa/WebProcessCocoa.mm:
(WebKit::WebProcess::accessibilityPreferencesDidChange):
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@279342 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Modified Paths
Diff
Modified: branches/safari-612.1.22.0-branch/Source/WebKit/ChangeLog (279662 => 279663)
--- branches/safari-612.1.22.0-branch/Source/WebKit/ChangeLog 2021-07-07 20:20:06 UTC (rev 279662)
+++ branches/safari-612.1.22.0-branch/Source/WebKit/ChangeLog 2021-07-07 20:39:21 UTC (rev 279663)
@@ -1,3 +1,40 @@
+2021-07-07 Ruben Turcios <rubent...@apple.com>
+
+ Cherry-pick r279342. rdar://problem/80282918
+
+ Pass correct value of AX per app settings to the WebContent process
+ https://bugs.webkit.org/show_bug.cgi?id=227441
+ <rdar://problem/79857797>
+
+ Reviewed by Brent Fulgham.
+
+ Pass value of type AXValueState instead of a boolean value for per app AX settings.
+
+ * Shared/AccessibilityPreferences.h:
+ * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
+ (WebKit::accessibilityPreferences):
+ * WebProcess/cocoa/WebProcessCocoa.mm:
+ (WebKit::WebProcess::accessibilityPreferencesDidChange):
+
+
+ git-svn-id: https://svn.webkit.org/repository/webkit/trunk@279342 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+ 2021-06-28 Per Arne <pvol...@apple.com>
+
+ Pass correct value of AX per app settings to the WebContent process
+ https://bugs.webkit.org/show_bug.cgi?id=227441
+ <rdar://problem/79857797>
+
+ Reviewed by Brent Fulgham.
+
+ Pass value of type AXValueState instead of a boolean value for per app AX settings.
+
+ * Shared/AccessibilityPreferences.h:
+ * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
+ (WebKit::accessibilityPreferences):
+ * WebProcess/cocoa/WebProcessCocoa.mm:
+ (WebKit::WebProcess::accessibilityPreferencesDidChange):
+
2021-06-30 Alan Coon <alanc...@apple.com>
Cherry-pick r279411. rdar://problem/79970312
Modified: branches/safari-612.1.22.0-branch/Source/WebKit/Shared/AccessibilityPreferences.h (279662 => 279663)
--- branches/safari-612.1.22.0-branch/Source/WebKit/Shared/AccessibilityPreferences.h 2021-07-07 20:20:06 UTC (rev 279662)
+++ branches/safari-612.1.22.0-branch/Source/WebKit/Shared/AccessibilityPreferences.h 2021-07-07 20:39:21 UTC (rev 279663)
@@ -31,15 +31,19 @@
#include <WebCore/CaptionUserPreferences.h>
#endif
+#if HAVE(PER_APP_ACCESSIBILITY_PREFERENCES)
+#include "AccessibilitySupportSPI.h"
+#endif
+
namespace WebKit {
struct AccessibilityPreferences {
#if HAVE(PER_APP_ACCESSIBILITY_PREFERENCES)
- bool reduceMotionEnabled { false };
- bool increaseButtonLegibility { false };
- bool enhanceTextLegibility { false };
- bool darkenSystemColors { false };
- bool invertColorsEnabled { false };
+ AXValueState reduceMotionEnabled { AXValueStateEmpty };
+ AXValueState increaseButtonLegibility { AXValueStateEmpty };
+ AXValueState enhanceTextLegibility { AXValueStateEmpty };
+ AXValueState darkenSystemColors { AXValueStateEmpty };
+ AXValueState invertColorsEnabled { AXValueStateEmpty };
#endif
#if HAVE(MEDIA_ACCESSIBILITY_FRAMEWORK)
WebCore::CaptionUserPreferences::CaptionDisplayMode captionDisplayMode;
@@ -55,3 +59,19 @@
static std::optional<WebKit::AccessibilityPreferences> decode(Decoder&);
};
}
+
+#if HAVE(PER_APP_ACCESSIBILITY_PREFERENCES)
+namespace WTF {
+
+template<> struct EnumTraits<AXValueState> {
+ using values = EnumValues<
+ AXValueState,
+ AXValueState::AXValueStateInvalid,
+ AXValueState::AXValueStateEmpty,
+ AXValueState::AXValueStateOff,
+ AXValueState::AXValueStateOn
+ >;
+};
+
+} // namespace WTF
+#endif
Modified: branches/safari-612.1.22.0-branch/Source/WebKit/UIProcess/Cocoa/WebProcessPoolCocoa.mm (279662 => 279663)
--- branches/safari-612.1.22.0-branch/Source/WebKit/UIProcess/Cocoa/WebProcessPoolCocoa.mm 2021-07-07 20:20:06 UTC (rev 279662)
+++ branches/safari-612.1.22.0-branch/Source/WebKit/UIProcess/Cocoa/WebProcessPoolCocoa.mm 2021-07-07 20:39:21 UTC (rev 279663)
@@ -279,11 +279,11 @@
#if HAVE(PER_APP_ACCESSIBILITY_PREFERENCES)
auto appId = WebCore::applicationBundleIdentifier().createCFString();
- preferences.reduceMotionEnabled = _AXSReduceMotionEnabledApp(appId.get()) == AXValueStateOn;
- preferences.increaseButtonLegibility = _AXSIncreaseButtonLegibilityApp(appId.get()) == AXValueStateOn;
- preferences.enhanceTextLegibility = _AXSEnhanceTextLegibilityEnabledApp(appId.get()) == AXValueStateOn;
- preferences.darkenSystemColors = _AXDarkenSystemColorsApp(appId.get()) == AXValueStateOn;
- preferences.invertColorsEnabled = _AXSInvertColorsEnabledApp(appId.get()) == AXValueStateOn;
+ preferences.reduceMotionEnabled = _AXSReduceMotionEnabledApp(appId.get());
+ preferences.increaseButtonLegibility = _AXSIncreaseButtonLegibilityApp(appId.get());
+ preferences.enhanceTextLegibility = _AXSEnhanceTextLegibilityEnabledApp(appId.get());
+ preferences.darkenSystemColors = _AXDarkenSystemColorsApp(appId.get());
+ preferences.invertColorsEnabled = _AXSInvertColorsEnabledApp(appId.get());
#endif
#if HAVE(MEDIA_ACCESSIBILITY_FRAMEWORK)
preferences.captionDisplayMode = WebCore::CaptionUserPreferencesMediaAF::platformCaptionDisplayMode();
Modified: branches/safari-612.1.22.0-branch/Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm (279662 => 279663)
--- branches/safari-612.1.22.0-branch/Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm 2021-07-07 20:20:06 UTC (rev 279662)
+++ branches/safari-612.1.22.0-branch/Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm 2021-07-07 20:39:21 UTC (rev 279663)
@@ -1094,19 +1094,20 @@
{
#if HAVE(PER_APP_ACCESSIBILITY_PREFERENCES)
auto appID = CFSTR("com.apple.WebKit.WebContent");
- auto reduceMotionEnabled = preferences.reduceMotionEnabled ? AXValueStateOn : AXValueStateOff;
+ auto reduceMotionEnabled = preferences.reduceMotionEnabled;
+ WTFLogAlways("AX: reduce motion: %d", (int)reduceMotionEnabled);
if (_AXSReduceMotionEnabledApp(appID) != reduceMotionEnabled)
_AXSSetReduceMotionEnabledApp(reduceMotionEnabled, appID);
- auto increaseButtonLegibility = preferences.increaseButtonLegibility ? AXValueStateOn : AXValueStateOff;
+ auto increaseButtonLegibility = preferences.increaseButtonLegibility;
if (_AXSIncreaseButtonLegibilityApp(appID) != increaseButtonLegibility)
_AXSSetIncreaseButtonLegibilityApp(increaseButtonLegibility, appID);
- auto enhanceTextLegibility = preferences.enhanceTextLegibility ? AXValueStateOn : AXValueStateOff;
+ auto enhanceTextLegibility = preferences.enhanceTextLegibility;
if (_AXSEnhanceTextLegibilityEnabledApp(appID) != enhanceTextLegibility)
_AXSSetEnhanceTextLegibilityEnabledApp(enhanceTextLegibility, appID);
- auto darkenSystemColors = preferences.darkenSystemColors ? AXValueStateOn : AXValueStateOff;
+ auto darkenSystemColors = preferences.darkenSystemColors;
if (_AXDarkenSystemColorsApp(appID) != darkenSystemColors)
_AXSSetDarkenSystemColorsApp(darkenSystemColors, appID);
- auto invertColorsEnabled = preferences.invertColorsEnabled ? AXValueStateOn : AXValueStateOff;
+ auto invertColorsEnabled = preferences.invertColorsEnabled;
if (_AXSInvertColorsEnabledApp(appID) != invertColorsEnabled)
_AXSInvertColorsSetEnabledApp(invertColorsEnabled, appID);
#endif
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes