Title: [261481] trunk
Revision
261481
Author
[email protected]
Date
2020-05-11 09:26:59 -0700 (Mon, 11 May 2020)

Log Message

Add mechanism to turn on accessibility isolated tree mode from WebKitTestRunner.
https://bugs.webkit.org/show_bug.cgi?id=211725

Reviewed by Chris Fleizach.

Source/WebCore:

If the client is WebKitTestRunner, enable isolated tree mode.

* accessibility/AXObjectCache.cpp:
(WebCore::AXObjectCache::isIsolatedTreeEnabled):

Source/WebCore/PAL:

Added _AXSSetIsolatedTreeMode to turn on isolated tree mode from WebKitTestRunner.

* pal/spi/cocoa/AccessibilitySupportSPI.h:
* pal/spi/mac/HIServicesSPI.h:

Tools:

Turn on isolated tree mode when appropriate.

* WebKitTestRunner/Configurations/InjectedBundle.xcconfig:
* WebKitTestRunner/InjectedBundle/AccessibilityController.cpp:
(WTR::AccessibilityController::updateIsolatedTreeMode):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (261480 => 261481)


--- trunk/Source/WebCore/ChangeLog	2020-05-11 16:22:56 UTC (rev 261480)
+++ trunk/Source/WebCore/ChangeLog	2020-05-11 16:26:59 UTC (rev 261481)
@@ -1,3 +1,15 @@
+2020-05-11  Andres Gonzalez  <[email protected]>
+
+        Add mechanism to turn on accessibility isolated tree mode from WebKitTestRunner.
+        https://bugs.webkit.org/show_bug.cgi?id=211725
+
+        Reviewed by Chris Fleizach.
+
+        If the client is WebKitTestRunner, enable isolated tree mode.
+
+        * accessibility/AXObjectCache.cpp:
+        (WebCore::AXObjectCache::isIsolatedTreeEnabled):
+
 2020-05-11  Per Arne Vollan  <[email protected]>
 
         Unreviewed, reverting r261296.

Modified: trunk/Source/WebCore/PAL/ChangeLog (261480 => 261481)


--- trunk/Source/WebCore/PAL/ChangeLog	2020-05-11 16:22:56 UTC (rev 261480)
+++ trunk/Source/WebCore/PAL/ChangeLog	2020-05-11 16:26:59 UTC (rev 261481)
@@ -1,3 +1,15 @@
+2020-05-11  Andres Gonzalez  <[email protected]>
+
+        Add mechanism to turn on accessibility isolated tree mode from WebKitTestRunner.
+        https://bugs.webkit.org/show_bug.cgi?id=211725
+
+        Reviewed by Chris Fleizach.
+
+        Added _AXSSetIsolatedTreeMode to turn on isolated tree mode from WebKitTestRunner.
+
+        * pal/spi/cocoa/AccessibilitySupportSPI.h:
+        * pal/spi/mac/HIServicesSPI.h:
+
 2020-05-09  David Kilzer  <[email protected]>
 
         Adapt LocalCurrentGraphicsContext for iOS

Modified: trunk/Source/WebCore/PAL/pal/spi/cocoa/AccessibilitySupportSPI.h (261480 => 261481)


--- trunk/Source/WebCore/PAL/pal/spi/cocoa/AccessibilitySupportSPI.h	2020-05-11 16:22:56 UTC (rev 261480)
+++ trunk/Source/WebCore/PAL/pal/spi/cocoa/AccessibilitySupportSPI.h	2020-05-11 16:26:59 UTC (rev 261481)
@@ -42,6 +42,7 @@
 };
 
 AXSIsolatedTreeMode _AXSIsolatedTreeMode(void);
+void _AXSSetIsolatedTreeMode(AXSIsolatedTreeMode);
 #endif // ENABLE(ACCESSIBILITY_ISOLATED_TREE)
 
 WTF_EXTERN_C_END

Modified: trunk/Source/WebCore/PAL/pal/spi/mac/HIServicesSPI.h (261480 => 261481)


--- trunk/Source/WebCore/PAL/pal/spi/mac/HIServicesSPI.h	2020-05-11 16:22:56 UTC (rev 261480)
+++ trunk/Source/WebCore/PAL/pal/spi/mac/HIServicesSPI.h	2020-05-11 16:26:59 UTC (rev 261481)
@@ -131,7 +131,7 @@
 #if HAVE(AX_CLIENT_TYPE)
 typedef CF_ENUM(int32_t, AXClientType)
 {
-    kAXClientTypeNoActiveRequestFound  = 0,
+    kAXClientTypeNoActiveRequestFound = 0,
     kAXClientTypeUnknown,
     kAXClientTypeRaft,
     kAXClientTypeXCUITest,
@@ -149,3 +149,5 @@
 WTF_EXTERN_C_END
 
 #endif // USE(APPLE_INTERNAL_SDK)
+
+#define kAXClientTypeWebKitTesting 999999

Modified: trunk/Source/WebCore/accessibility/AXObjectCache.cpp (261480 => 261481)


--- trunk/Source/WebCore/accessibility/AXObjectCache.cpp	2020-05-11 16:22:56 UTC (rev 261480)
+++ trunk/Source/WebCore/accessibility/AXObjectCache.cpp	2020-05-11 16:26:59 UTC (rev 261481)
@@ -703,6 +703,9 @@
 
 bool AXObjectCache::isIsolatedTreeEnabled()
 {
+    if (UNLIKELY(_AXGetClientForCurrentRequestUntrusted() == kAXClientTypeWebKitTesting))
+        return true;
+
     return _AXSIsolatedTreeModeFunctionIsAvailable() && _AXSIsolatedTreeMode_Soft() != AXSIsolatedTreeModeOff && clientSupportsIsolatedTree();
 }
 

Modified: trunk/Tools/ChangeLog (261480 => 261481)


--- trunk/Tools/ChangeLog	2020-05-11 16:22:56 UTC (rev 261480)
+++ trunk/Tools/ChangeLog	2020-05-11 16:26:59 UTC (rev 261481)
@@ -1,3 +1,16 @@
+2020-05-11  Andres Gonzalez  <[email protected]>
+
+        Add mechanism to turn on accessibility isolated tree mode from WebKitTestRunner.
+        https://bugs.webkit.org/show_bug.cgi?id=211725
+
+        Reviewed by Chris Fleizach.
+
+        Turn on isolated tree mode when appropriate.
+
+        * WebKitTestRunner/Configurations/InjectedBundle.xcconfig:
+        * WebKitTestRunner/InjectedBundle/AccessibilityController.cpp:
+        (WTR::AccessibilityController::updateIsolatedTreeMode):
+
 2020-05-11  Per Arne Vollan  <[email protected]>
 
         Unreviewed, reverting r261296.

Modified: trunk/Tools/WebKitTestRunner/Configurations/InjectedBundle.xcconfig (261480 => 261481)


--- trunk/Tools/WebKitTestRunner/Configurations/InjectedBundle.xcconfig	2020-05-11 16:22:56 UTC (rev 261480)
+++ trunk/Tools/WebKitTestRunner/Configurations/InjectedBundle.xcconfig	2020-05-11 16:26:59 UTC (rev 261481)
@@ -33,7 +33,7 @@
 OTHER_LDFLAGS_BASE = -framework CoreText -framework QuartzCore;
 OTHER_LDFLAGS = $(inherited) $(OTHER_LDFLAGS_BASE) $(OTHER_LDFLAGS_$(WK_COCOA_TOUCH));
 OTHER_LDFLAGS_cocoatouch = -framework CFNetwork -framework CoreFoundation -framework CoreGraphics -framework Foundation -framework UIKit;
-OTHER_LDFLAGS_ = -framework Carbon -framework Cocoa;
+OTHER_LDFLAGS_ = -framework Carbon -framework Cocoa -lAccessibility;
 
 STRIP_STYLE = debugging;
 

Modified: trunk/Tools/WebKitTestRunner/InjectedBundle/AccessibilityController.cpp (261480 => 261481)


--- trunk/Tools/WebKitTestRunner/InjectedBundle/AccessibilityController.cpp	2020-05-11 16:22:56 UTC (rev 261480)
+++ trunk/Tools/WebKitTestRunner/InjectedBundle/AccessibilityController.cpp	2020-05-11 16:26:59 UTC (rev 261481)
@@ -33,6 +33,7 @@
 #include "InjectedBundlePage.h"
 #include "JSAccessibilityController.h"
 #if ENABLE(ACCESSIBILITY_ISOLATED_TREE)
+#include <pal/spi/cocoa/AccessibilitySupportSPI.h>
 #include <pal/spi/mac/HIServicesSPI.h>
 #endif
 #include <WebKit/WKBundle.h>
@@ -66,7 +67,8 @@
 void AccessibilityController::updateIsolatedTreeMode()
 {
     // Override to set identifier to VoiceOver so that requests are handled in isolated mode.
-    _AXSetClientIdentificationOverride(m_accessibilityIsolatedTreeMode ? kAXClientTypeVoiceOver : kAXClientTypeNoActiveRequestFound);
+    _AXSetClientIdentificationOverride(m_accessibilityIsolatedTreeMode ? (AXClientType)kAXClientTypeWebKitTesting : kAXClientTypeNoActiveRequestFound);
+    _AXSSetIsolatedTreeMode(m_accessibilityIsolatedTreeMode ? AXSIsolatedTreeModeMainThread : AXSIsolatedTreeModeOff);
     m_useMockAXThread = WKAccessibilityCanUseSecondaryAXThread(InjectedBundle::singleton().page()->page());
 }
 #endif
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to