Diff
Modified: trunk/Source/WebCore/ChangeLog (258074 => 258075)
--- trunk/Source/WebCore/ChangeLog 2020-03-07 18:26:37 UTC (rev 258074)
+++ trunk/Source/WebCore/ChangeLog 2020-03-07 18:34:55 UTC (rev 258075)
@@ -1,3 +1,16 @@
+2020-03-07 Chris Fleizach <[email protected]>
+
+ AX: Provide a way to run tests in isolated tree mode
+ https://bugs.webkit.org/show_bug.cgi?id=208629
+ <rdar://problem/60075583>
+
+ Reviewed by Ryosuke Niwa.
+
+ Now that we have a way to run this with tests, we don't need to allow usage for an unknown client.
+
+ * accessibility/AXObjectCache.cpp:
+ (WebCore::AXObjectCache::clientSupportsIsolatedTree):
+
2020-03-07 Zalan Bujtas <[email protected]>
[LFC][IFC] Use start-aligned horizontal adjustment when justify is not eligible.
Modified: trunk/Source/WebCore/accessibility/AXObjectCache.cpp (258074 => 258075)
--- trunk/Source/WebCore/accessibility/AXObjectCache.cpp 2020-03-07 18:26:37 UTC (rev 258074)
+++ trunk/Source/WebCore/accessibility/AXObjectCache.cpp 2020-03-07 18:34:55 UTC (rev 258075)
@@ -721,10 +721,7 @@
if (!RuntimeEnabledFeatures::sharedFeatures().isAccessibilityIsolatedTreeEnabled())
return false;
- AXClientType type = _AXGetClientForCurrentRequestUntrusted();
- // FIXME: Remove unknown client before setting isAccessibilityIsolatedTreeEnabled initial value = true.
- return type == kAXClientTypeVoiceOver
- || type == kAXClientTypeUnknown;
+ return _AXGetClientForCurrentRequestUntrusted() == kAXClientTypeVoiceOver;
}
#endif
Modified: trunk/Tools/ChangeLog (258074 => 258075)
--- trunk/Tools/ChangeLog 2020-03-07 18:26:37 UTC (rev 258074)
+++ trunk/Tools/ChangeLog 2020-03-07 18:34:55 UTC (rev 258075)
@@ -1,3 +1,44 @@
+2020-03-07 Chris Fleizach <[email protected]>
+
+ AX: Provide a way to run tests in isolated tree mode
+ https://bugs.webkit.org/show_bug.cgi?id=208629
+ <rdar://problem/60075583>
+
+ Reviewed by Ryosuke Niwa.
+
+ Provide the ability to run tests for accessibility in the isolated tree mode.
+ This sends a flag over to the injected bundle which calls the right HIServices override so that
+ the system thinks it is in isolated mode.
+
+ * Scripts/compare-webkit-configurations:
+ (flag_for_comparison):
+ * Scripts/webkitpy/layout_tests/run_webkit_tests.py:
+ (parse_args):
+ * Scripts/webkitpy/layout_tests/run_webkit_tests_integrationtest.py:
+ (parse_args):
+ * Scripts/webkitpy/port/driver.py:
+ (Driver.cmd_line):
+ * WebKitTestRunner/InjectedBundle/AccessibilityController.cpp:
+ (WTR::AccessibilityController::AccessibilityController):
+ (WTR::AccessibilityController::setAccessibilityIsolatedTreeMode):
+ (WTR::AccessibilityController::updateIsolatedTreeMode):
+ (WTR::AccessibilityController::executeOnAXThreadIfPossible):
+ * WebKitTestRunner/InjectedBundle/AccessibilityController.h:
+ * WebKitTestRunner/InjectedBundle/InjectedBundle.cpp:
+ (WTR::InjectedBundle::didReceiveMessageToPage):
+ (WTR::InjectedBundle::beginTesting):
+ * WebKitTestRunner/InjectedBundle/InjectedBundle.h:
+ * WebKitTestRunner/Options.cpp:
+ (WTR::handleOptionAccessibilityIsolatedTreeMode):
+ (WTR::OptionsHandler::OptionsHandler):
+ * WebKitTestRunner/Options.h:
+ * WebKitTestRunner/TestController.cpp:
+ (WTR::TestController::initialize):
+ (WTR::TestController::resetPreferencesToConsistentValues):
+ (WTR::TestController::resetStateToConsistentValues):
+ * WebKitTestRunner/TestController.h:
+ (WTR::TestController::accessibilityIsolatedTreeMode const):
+
2020-03-06 Per Arne Vollan <[email protected]>
[Cocoa] Re-enable CFPrefs direct mode
Modified: trunk/Tools/Scripts/compare-webkit-configurations (258074 => 258075)
--- trunk/Tools/Scripts/compare-webkit-configurations 2020-03-07 18:26:37 UTC (rev 258074)
+++ trunk/Tools/Scripts/compare-webkit-configurations 2020-03-07 18:34:55 UTC (rev 258075)
@@ -58,6 +58,8 @@
def flag_for_comparison(comparison_name):
if comparison_name == "remote-layer-tree":
return "--remote-layer-tree"
+ if comparison_name == "accessibility-isolated-tree":
+ return "--accessibility-isolated-tree"
if comparison_name == "accelerated-drawing":
return "--accelerated-drawing"
if comparison_name == "webkit2":
Modified: trunk/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests.py (258074 => 258075)
--- trunk/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests.py 2020-03-07 18:26:37 UTC (rev 258074)
+++ trunk/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests.py 2020-03-07 18:34:55 UTC (rev 258075)
@@ -302,6 +302,7 @@
help='"xvfb": Use a virtualized X11 server. "xorg": Use the current X11 session. '
'"weston": Use a virtualized Weston server. "wayland": Use the current wayland session.'),
optparse.make_option("--world-leaks", action="" default=False, help="Check for world leaks (currently, only documents). Differs from --leaks in that this uses internal instrumentation, rather than external tools."),
+ optparse.make_option("--accessibility-isolated-tree", action="" default=False, help="Runs tests in accessibility isolated tree mode."),
]))
option_group_definitions.append(("iOS Options", [
Modified: trunk/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests_integrationtest.py (258074 => 258075)
--- trunk/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests_integrationtest.py 2020-03-07 18:26:37 UTC (rev 258074)
+++ trunk/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests_integrationtest.py 2020-03-07 18:34:55 UTC (rev 258075)
@@ -60,6 +60,9 @@
if not '--world-leaks' in extra_args:
args.append('--world-leaks')
+ if not '--accessibility-isolated-tree' in extra_args:
+ args.append('--accessibility-isolated-tree')
+
args.extend(extra_args)
if not tests_included:
# We use the glob to test that globbing works.
Modified: trunk/Tools/Scripts/webkitpy/port/driver.py (258074 => 258075)
--- trunk/Tools/Scripts/webkitpy/port/driver.py 2020-03-07 18:26:37 UTC (rev 258074)
+++ trunk/Tools/Scripts/webkitpy/port/driver.py 2020-03-07 18:34:55 UTC (rev 258075)
@@ -520,6 +520,8 @@
cmd.append('--no-timeout')
if self._port.get_option('show_touches'):
cmd.append('--show-touches')
+ if self._port.get_option('accessibility_isolated_tree'):
+ cmd.append('--accessibility-isolated-tree')
for allowed_host in self._port.allowed_hosts():
cmd.append('--allowed-host')
Modified: trunk/Tools/WebKitTestRunner/InjectedBundle/AccessibilityController.cpp (258074 => 258075)
--- trunk/Tools/WebKitTestRunner/InjectedBundle/AccessibilityController.cpp 2020-03-07 18:26:37 UTC (rev 258074)
+++ trunk/Tools/WebKitTestRunner/InjectedBundle/AccessibilityController.cpp 2020-03-07 18:34:55 UTC (rev 258075)
@@ -32,7 +32,9 @@
#include "InjectedBundle.h"
#include "InjectedBundlePage.h"
#include "JSAccessibilityController.h"
-
+#if ENABLE(ACCESSIBILITY_ISOLATED_TREE)
+#include <pal/spi/mac/HIServicesSPI.h>
+#endif
#include <WebKit/WKBundle.h>
#include <WebKit/WKBundlePage.h>
#include <WebKit/WKBundlePagePrivate.h>
@@ -46,9 +48,6 @@
AccessibilityController::AccessibilityController()
{
-#if PLATFORM(MAC)
- m_useAXThread = WKAccessibilityCanUseSecondaryAXThread(InjectedBundle::singleton().page()->page());
-#endif
}
AccessibilityController::~AccessibilityController()
@@ -55,6 +54,21 @@
{
}
+#if ENABLE(ACCESSIBILITY_ISOLATED_TREE)
+void AccessibilityController::setAccessibilityIsolatedTreeMode(bool flag)
+{
+ m_accessibilityIsolatedTreeMode = flag;
+ updateIsolatedTreeMode();
+}
+
+void AccessibilityController::updateIsolatedTreeMode()
+{
+ // Override to set identifier to VoiceOver so that requests are handled in isolated mode.
+ _AXSetClientIdentificationOverride(m_accessibilityIsolatedTreeMode ? kAXClientTypeVoiceOver : kAXClientTypeNoActiveRequestFound);
+ m_useMockAXThread = WKAccessibilityCanUseSecondaryAXThread(InjectedBundle::singleton().page()->page());
+}
+#endif
+
void AccessibilityController::makeWindowObject(JSContextRef context, JSObjectRef windowObject, JSValueRef* exception)
{
setProperty(context, windowObject, "accessibilityController", this, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete, exception);
@@ -93,7 +107,8 @@
void AccessibilityController::executeOnAXThreadIfPossible(Function<void()>&& function)
{
- if (m_useAXThread) {
+#if ENABLE(ACCESSIBILITY_ISOLATED_TREE)
+ if (m_useMockAXThread) {
AXThread::dispatch([&function, this] {
function();
m_semaphore.signal();
@@ -106,6 +121,7 @@
CFRunLoopRunInMode(kCFRunLoopDefaultMode, .25, false);
m_semaphore.wait();
} else
+#endif
function();
}
#endif
Modified: trunk/Tools/WebKitTestRunner/InjectedBundle/AccessibilityController.h (258074 => 258075)
--- trunk/Tools/WebKitTestRunner/InjectedBundle/AccessibilityController.h 2020-03-07 18:26:37 UTC (rev 258074)
+++ trunk/Tools/WebKitTestRunner/InjectedBundle/AccessibilityController.h 2020-03-07 18:34:55 UTC (rev 258075)
@@ -51,6 +51,10 @@
// Enhanced accessibility.
void enableEnhancedAccessibility(bool);
bool enhancedAccessibilityEnabled();
+
+#if ENABLE(ACCESSIBILITY_ISOLATED_TREE)
+ void setAccessibilityIsolatedTreeMode(bool);
+#endif
JSRetainPtr<JSStringRef> platformName();
@@ -91,12 +95,15 @@
RefPtr<AccessibilityNotificationHandler> m_globalNotificationHandler;
#endif
-#if PLATFORM(COCOA)
+#if ENABLE(ACCESSIBILITY_ISOLATED_TREE)
+ void updateIsolatedTreeMode();
+
// _AXUIElementUseSecondaryAXThread and _AXUIElementRequestServicedBySecondaryAXThread
// do not work for WebKitTestRunner since this is calling directly into
// WebCore/accessibility via _javascript_ without going through HIServices.
// Thus to simulate the behavior of HIServices, AccessibilityController is spawning a secondary thread to service the _javascript_ requests.
- bool m_useAXThread { false };
+ bool m_useMockAXThread { false };
+ bool m_accessibilityIsolatedTreeMode { false };
BinarySemaphore m_semaphore;
#endif
};
Modified: trunk/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp (258074 => 258075)
--- trunk/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp 2020-03-07 18:26:37 UTC (rev 258074)
+++ trunk/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp 2020-03-07 18:34:55 UTC (rev 258075)
@@ -242,6 +242,11 @@
if (shouldGC)
WKBundleGarbageCollectJavaScriptObjects(m_bundle);
+#if ENABLE(ACCESSIBILITY_ISOLATED_TREE)
+ WKRetainPtr<WKStringRef> axIsolatedModeKey = adoptWK(WKStringCreateWithUTF8CString("AccessibilityIsolatedTree"));
+ m_accessibilityIsolatedTreeMode = WKBooleanGetValue(static_cast<WKBooleanRef>(WKDictionaryGetItemForKey(messageBodyDictionary, axIsolatedModeKey.get())));
+#endif
+
WKRetainPtr<WKStringRef> allowedHostsKey = adoptWK(WKStringCreateWithUTF8CString("AllowedHosts"));
WKTypeRef allowedHostsValue = WKDictionaryGetItemForKey(messageBodyDictionary, allowedHostsKey.get());
if (allowedHostsValue && WKGetTypeID(allowedHostsValue) == WKArrayGetTypeID()) {
@@ -557,7 +562,10 @@
m_textInputController = TextInputController::create();
#if HAVE(ACCESSIBILITY)
m_accessibilityController = AccessibilityController::create();
+#if ENABLE(ACCESSIBILITY_ISOLATED_TREE)
+ m_accessibilityController->setAccessibilityIsolatedTreeMode(m_accessibilityIsolatedTreeMode);
#endif
+#endif
// Don't change experimental or internal features here; those should be set in TestController::resetPreferencesToConsistentValues().
WKBundleSetAllowUniversalAccessFromFileURLs(m_bundle, m_pageGroup, true);
Modified: trunk/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.h (258074 => 258075)
--- trunk/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.h 2020-03-07 18:26:37 UTC (rev 258074)
+++ trunk/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.h 2020-03-07 18:34:55 UTC (rev 258075)
@@ -197,6 +197,7 @@
bool m_useWorkQueue { false };
bool m_pixelResultIsPending { false };
bool m_dumpJSConsoleLogInStdErr { false };
+ bool m_accessibilityIsolatedTreeMode { false };
WTF::Seconds m_timeout;
Modified: trunk/Tools/WebKitTestRunner/Options.cpp (258074 => 258075)
--- trunk/Tools/WebKitTestRunner/Options.cpp 2020-03-07 18:26:37 UTC (rev 258074)
+++ trunk/Tools/WebKitTestRunner/Options.cpp 2020-03-07 18:34:55 UTC (rev 258075)
@@ -99,6 +99,14 @@
return true;
}
+#if ENABLE(ACCESSIBILITY_ISOLATED_TREE)
+static bool handleOptionAccessibilityIsolatedTreeMode(Options& options, const char*, const char*)
+{
+ options.accessibilityIsolatedTreeMode = true;
+ return true;
+}
+#endif
+
static bool handleOptionAllowedHost(Options& options, const char*, const char* host)
{
options.allowedHosts.insert(host);
@@ -154,7 +162,10 @@
optionList.append(Option("--world-leaks", "Check for leaks of world objects (currently, documents)", handleOptionCheckForWorldLeaks));
optionList.append(Option("--experimental-feature", "Enable experimental feature", handleOptionExperimentalFeature, true));
optionList.append(Option("--internal-feature", "Enable internal feature", handleOptionInternalFeature, true));
-
+#if ENABLE(ACCESSIBILITY_ISOLATED_TREE)
+ optionList.append(Option("--accessibility-isolated-tree", "Enable accessibility isolated tree mode for tests", handleOptionAccessibilityIsolatedTreeMode));
+#endif
+
optionList.append(Option(0, 0, handleOptionUnmatched));
}
Modified: trunk/Tools/WebKitTestRunner/Options.h (258074 => 258075)
--- trunk/Tools/WebKitTestRunner/Options.h 2020-03-07 18:26:37 UTC (rev 258074)
+++ trunk/Tools/WebKitTestRunner/Options.h 2020-03-07 18:34:55 UTC (rev 258075)
@@ -52,6 +52,9 @@
bool shouldShowTouches { false };
bool checkForWorldLeaks { false };
bool allowAnyHTTPSCertificateForAllowedHosts { false };
+#if ENABLE(ACCESSIBILITY_ISOLATED_TREE)
+ bool accessibilityIsolatedTreeMode { false };
+#endif
std::vector<std::string> paths;
std::set<std::string> allowedHosts;
HashMap<String, bool> internalFeatures;
Modified: trunk/Tools/WebKitTestRunner/TestController.cpp (258074 => 258075)
--- trunk/Tools/WebKitTestRunner/TestController.cpp 2020-03-07 18:26:37 UTC (rev 258074)
+++ trunk/Tools/WebKitTestRunner/TestController.cpp 2020-03-07 18:34:55 UTC (rev 258075)
@@ -476,7 +476,9 @@
m_allowAnyHTTPSCertificateForAllowedHosts = options.allowAnyHTTPSCertificateForAllowedHosts;
m_internalFeatures = options.internalFeatures;
m_experimentalFeatures = options.experimentalFeatures;
-
+#if ENABLE(ACCESSIBILITY_ISOLATED_TREE)
+ m_accessibilityIsolatedTreeMode = options.accessibilityIsolatedTreeMode;
+#endif
m_usingServerMode = (m_paths.size() == 1 && m_paths[0] == "-");
if (m_usingServerMode)
m_printSeparators = true;
@@ -961,6 +963,10 @@
WKPreferencesSetShouldUseServiceWorkerShortTimeout(preferences, options.contextOptions.useServiceWorkerShortTimeout);
+#if ENABLE(ACCESSIBILITY_ISOLATED_TREE)
+ WKPreferencesSetIsAccessibilityIsolatedTreeEnabled(preferences, accessibilityIsolatedTreeMode());
+#endif
+
platformResetPreferencesToConsistentValues();
}
@@ -991,6 +997,12 @@
}
WKDictionarySetItem(resetMessageBody.get(), allowedHostsKey.get(), allowedHostsValue.get());
+#if ENABLE(ACCESSIBILITY_ISOLATED_TREE)
+ WKRetainPtr<WKStringRef> axIsolatedModeKey = adoptWK(WKStringCreateWithUTF8CString("AccessibilityIsolatedTree"));
+ WKRetainPtr<WKBooleanRef> axIsolatedModeValue = adoptWK(WKBooleanCreate(m_accessibilityIsolatedTreeMode));
+ WKDictionarySetItem(resetMessageBody.get(), axIsolatedModeKey.get(), axIsolatedModeValue.get());
+#endif
+
if (options.jscOptions.length()) {
WKRetainPtr<WKStringRef> jscOptionsKey = adoptWK(WKStringCreateWithUTF8CString("JSCOptions"));
WKRetainPtr<WKStringRef> jscOptionsValue = adoptWK(WKStringCreateWithUTF8CString(options.jscOptions.c_str()));
Modified: trunk/Tools/WebKitTestRunner/TestController.h (258074 => 258075)
--- trunk/Tools/WebKitTestRunner/TestController.h 2020-03-07 18:26:37 UTC (rev 258074)
+++ trunk/Tools/WebKitTestRunner/TestController.h 2020-03-07 18:34:55 UTC (rev 258075)
@@ -133,6 +133,10 @@
void simulateWebNotificationClick(uint64_t notificationID);
+#if ENABLE(ACCESSIBILITY_ISOLATED_TREE)
+ bool accessibilityIsolatedTreeMode() const { return m_accessibilityIsolatedTreeMode; }
+#endif
+
// Geolocation.
void setGeolocationPermission(bool);
void setMockGeolocationPosition(double latitude, double longitude, double accuracy, bool providesAltitude, double altitude, bool providesAltitudeAccuracy, double altitudeAccuracy, bool providesHeading, double heading, bool providesSpeed, double speed, bool providesFloorLevel, double floorLevel);
@@ -597,6 +601,10 @@
bool m_allowAnyHTTPSCertificateForAllowedHosts { false };
+#if ENABLE(ACCESSIBILITY_ISOLATED_TREE)
+ bool m_accessibilityIsolatedTreeMode { false };
+#endif
+
bool m_shouldDecideNavigationPolicyAfterDelay { false };
bool m_shouldDecideResponsePolicyAfterDelay { false };