AX: Not able to use arrow keys to read text with VoiceOver before selection is set...
authorsamuel_white@apple.com <samuel_white@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 19 Mar 2014 06:16:40 +0000 (06:16 +0000)
committersamuel_white@apple.com <samuel_white@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 19 Mar 2014 06:16:40 +0000 (06:16 +0000)
commit0f46904b74d8f9929426e59d8caeedefea53e953
treeb94cc7f3d19a65686c8c60cb8e2d9dd3033e7950
parentdb64ec9b34fde9ec7f1d7fa2a63e7a01758a693c
AX: Not able to use arrow keys to read text with VoiceOver before selection is set someplace (anyplace).
https://bugs.webkit.org/show_bug.cgi?id=130250

Reviewed by Chris Fleizach.

Source/WebCore:

If initial selection isn't set when we handle selection movement for accessibility, we need to set it. If we don't, using arrow
keys to read text with VoiceOver doesn't work as expected. Things will only start working after the user holds shift and arrows
around to select any arbitrary thing to force selection to get set. This logic handles that special case more gracefully.

Test: platform/mac/accessibility/selection-initial.html

* page/EventHandler.cpp:
(WebCore::handleKeyboardSelectionMovement):
(WebCore::EventHandler::handleKeyboardSelectionMovementForAccessibility):
* testing/Internals.cpp:
(WebCore::Internals::resetToConsistentState):

Source/WebKit:

* WebKit.vcxproj/WebKitExportGenerator/WebKitExports.def.in:

Source/WebKit/mac:

Added ability to toggle enhanced accessibility on and off to support tests that require it.

* WebView/WebFrame.mm:
(-[WebFrame enhancedAccessibilityEnabled]):
(-[WebFrame setEnhancedAccessibility:]):
* WebView/WebFramePrivate.h:

Source/WebKit2:

Added ability to toggle enhanced accessibility on and off to support tests that require it.

* WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
(WKAccessibilityEnableEnhancedAccessibility):
(WKAccessibilityEnhancedAccessibilityEnabled):
* WebProcess/InjectedBundle/API/c/WKBundlePagePrivate.h:

Tools:

Added ability to toggle enhanced accessibility on and off to support tests that require it.

* DumpRenderTree/AccessibilityController.cpp:
(enableEnhancedAccessibilityCallback):
(getEnhancedAccessibilityEnabledCallback):
(AccessibilityController::getJSClass):
* DumpRenderTree/AccessibilityController.h:
* DumpRenderTree/atk/AccessibilityControllerAtk.cpp:
(AccessibilityController::enableEnhancedAccessibility):
(AccessibilityController::enhancedAccessibilityEnabled):
* DumpRenderTree/ios/AccessibilityControllerIOS.mm:
(AccessibilityController::enableEnhancedAccessibility):
(AccessibilityController::enhancedAccessibilityEnabled):
* DumpRenderTree/mac/AccessibilityControllerMac.mm:
(AccessibilityController::enableEnhancedAccessibility):
(AccessibilityController::enhancedAccessibilityEnabled):
* DumpRenderTree/win/AccessibilityControllerWin.cpp:
(AccessibilityController::enableEnhancedAccessibility):
(AccessibilityController::enhancedAccessibilityEnabled):
* WebKitTestRunner/InjectedBundle/AccessibilityController.cpp:
(WTR::AccessibilityController::enableEnhancedAccessibility):
(WTR::AccessibilityController::enhancedAccessibilityEnabled):
* WebKitTestRunner/InjectedBundle/AccessibilityController.h:
* WebKitTestRunner/InjectedBundle/Bindings/AccessibilityController.idl:

LayoutTests:

Added test to ensure that initial selection gets set when enhanced accessibility is enabled and an arrow key is pressed.

* platform/mac/accessibility/selection-initial-expected.txt: Added.
* platform/mac/accessibility/selection-initial.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@165870 268f45cc-cd09-0410-ab3c-d52691b4dbfc
24 files changed:
LayoutTests/ChangeLog
LayoutTests/platform/mac/accessibility/selection-initial-expected.txt [new file with mode: 0644]
LayoutTests/platform/mac/accessibility/selection-initial.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/page/EventHandler.cpp
Source/WebCore/testing/Internals.cpp
Source/WebKit/ChangeLog
Source/WebKit/WebKit.vcxproj/WebKitExportGenerator/WebKitExports.def.in
Source/WebKit/mac/ChangeLog
Source/WebKit/mac/WebView/WebFrame.mm
Source/WebKit/mac/WebView/WebFramePrivate.h
Source/WebKit2/ChangeLog
Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.cpp
Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePagePrivate.h
Tools/ChangeLog
Tools/DumpRenderTree/AccessibilityController.cpp
Tools/DumpRenderTree/AccessibilityController.h
Tools/DumpRenderTree/atk/AccessibilityControllerAtk.cpp
Tools/DumpRenderTree/ios/AccessibilityControllerIOS.mm
Tools/DumpRenderTree/mac/AccessibilityControllerMac.mm
Tools/DumpRenderTree/win/AccessibilityControllerWin.cpp
Tools/WebKitTestRunner/InjectedBundle/AccessibilityController.cpp
Tools/WebKitTestRunner/InjectedBundle/AccessibilityController.h
Tools/WebKitTestRunner/InjectedBundle/Bindings/AccessibilityController.idl