AX: Not able to use arrow keys to read text in a WK2 app
authorbdakin@apple.com <bdakin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 9 Aug 2013 19:58:51 +0000 (19:58 +0000)
committerbdakin@apple.com <bdakin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 9 Aug 2013 19:58:51 +0000 (19:58 +0000)
commitac482e7b89e7a7014c619e1eea0892a7e53d667b
tree46a5b094f37656ef045b1bdfbfd7dca141a59304
parent556eeb566184f53702c749f29841f8cc96fcf23b
AX: Not able to use arrow keys to read text in a WK2 app
https://bugs.webkit.org/show_bug.cgi?id=119605
-and corresponding-
<rdar://problem/14281275>

Reviewed by Darin Adler.

Source/WebCore:

This code from defaultKeyboardEventHandler() is the magic that makes this AX
functionality work. This patch moves that into a separate function so that we can
call it from WK2.
* WebCore.exp.in:
* page/EventHandler.cpp:
(WebCore::EventHandler::handleKeyboardSelectionMovementForAccessibility):
(WebCore::EventHandler::defaultKeyboardEventHandler):
* page/EventHandler.h:

Source/WebKit2:

Make all of these scrolling functions actually return the WebCore bools that
indicate whether or not scrolling happened.
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::scroll):
(WebKit::WebPage::logicalScroll):
(WebKit::WebPage::scrollBy):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/mac/WebPageMac.mm:
(WebKit::WebPage::executeKeypressCommandsInternal):

This function now gives accessibility a chance to handle the event too. And it
also actually tracks whether or not the event was handled by scrolling instead of
assuming that it was and universally returning true.
(WebKit::WebPage::performNonEditingBehaviorForSelector):

Tools:

New test verifies that didNotHandleKeyEvent will be called when there is nothing
to scroll.
* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebKit2/DidNotHandleKeyDown.cpp: Added.
(TestWebKitAPI::didFinishLoadForFrame):
(TestWebKitAPI::didNotHandleKeyEventCallback):
(TestWebKitAPI::TEST):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@153907 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/WebCore.exp.in
Source/WebCore/page/EventHandler.cpp
Source/WebCore/page/EventHandler.h
Source/WebKit2/ChangeLog
Source/WebKit2/WebProcess/WebPage/WebPage.cpp
Source/WebKit2/WebProcess/WebPage/WebPage.h
Source/WebKit2/WebProcess/WebPage/mac/WebPageMac.mm
Tools/ChangeLog
Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj
Tools/TestWebKitAPI/Tests/WebKit2/DidNotHandleKeyDown.cpp [new file with mode: 0644]