AX: When navigating the elements of a scrollable element with VoiceOver, the scrollTo...
authorcfleizach@apple.com <cfleizach@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 29 Aug 2015 07:41:46 +0000 (07:41 +0000)
committercfleizach@apple.com <cfleizach@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 29 Aug 2015 07:41:46 +0000 (07:41 +0000)
commit0da11dac6f2c2f19892eaf9ae755184368fea029
treef911db53a0189b3ad08df9cf8d74cfdeb188e72a
parent96b9d1ef47e952e9b426e861ce1956b06c2c83a1
AX: When navigating the elements of a scrollable element with VoiceOver, the scrollTop() position of the element does not permanently change
https://bugs.webkit.org/show_bug.cgi?id=125720

Reviewed by Daniel Bates.

Source/WebCore:

The scrollToVisible code did not account for scrollable elements that are larger than their viewports.
First, we need to pass the sub-focus up the scroll chain (otherwise we'll scroll some parent to y=0).
Second, we should try to center the focus within the viewport, rather than positioning at the bottom for a
better experience.

This change was adapted from Blink r183926:
https://src.chromium.org/viewvc/blink?view=rev&revision=183926

Tests: accessibility/scroll-to-global-point-iframe-nested.html
       accessibility/scroll-to-global-point-iframe.html
       accessibility/scroll-to-global-point-main-window.html
       accessibility/scroll-to-global-point-nested.html
       accessibility/scroll-to-make-visible-div-overflow.html
       accessibility/scroll-to-make-visible-iframe.html
       accessibility/scroll-to-make-visible-nested-2.html
       accessibility/scroll-to-make-visible-nested.html
       accessibility/scroll-to-make-visible-with-subfocus.html

* accessibility/AccessibilityObject.cpp:
(WebCore::computeBestScrollOffset):
(WebCore::AccessibilityObject::isOnscreen):
(WebCore::AccessibilityObject::scrollToMakeVisibleWithSubFocus):
(WebCore::AccessibilityObject::scrollToGlobalPoint):
* accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
(-[WebAccessibilityObjectWrapper accessibilityScrollToVisible]):
(-[WebAccessibilityObjectWrapper _accessibilityScrollToMakeVisibleWithSubFocus:]):
(-[WebAccessibilityObjectWrapper _accessibilityScrollToGlobalPoint:]):
(-[WebAccessibilityObjectWrapper accessibilityPerformAction:]):

Tools:

Add support for scrollToMakeVisibleWithSubFocus and scrollToGlobalPoint.

* DumpRenderTree/AccessibilityUIElement.cpp:
(pressCallback):
(scrollToMakeVisibleWithSubFocusCallback):
(scrollToGlobalPointCallback):
(scrollToMakeVisibleCallback):
(AccessibilityUIElement::getJSClass):
* DumpRenderTree/ios/AccessibilityUIElementIOS.mm:
(AccessibilityUIElement::scrollToMakeVisible):
(AccessibilityUIElement::scrollToMakeVisibleWithSubFocus):
(AccessibilityUIElement::scrollToGlobalPoint):
(AccessibilityUIElement::selectedTextRange):
* DumpRenderTree/mac/AccessibilityUIElementMac.mm:
(AccessibilityUIElement::AccessibilityUIElement):
(AccessibilityUIElement::mathPrescriptsDescription):
(AccessibilityUIElement::scrollToMakeVisible):
(AccessibilityUIElement::scrollToMakeVisibleWithSubFocus):
(AccessibilityUIElement::scrollToGlobalPoint):
* WebKitTestRunner/InjectedBundle/AccessibilityUIElement.cpp:
(WTR::AccessibilityUIElement::isTextMarkerValid):
(WTR::AccessibilityUIElement::textMarkerForIndex):
(WTR::AccessibilityUIElement::scrollToMakeVisible):
(WTR::AccessibilityUIElement::scrollToGlobalPoint):
(WTR::AccessibilityUIElement::scrollToMakeVisibleWithSubFocus):
(WTR::AccessibilityUIElement::supportedActions):
(WTR::AccessibilityUIElement::mathPostscriptsDescription):
(WTR::AccessibilityUIElement::mathPrescriptsDescription):
* WebKitTestRunner/InjectedBundle/AccessibilityUIElement.h:
* WebKitTestRunner/InjectedBundle/Bindings/AccessibilityUIElement.idl:
* WebKitTestRunner/InjectedBundle/ios/AccessibilityUIElementIOS.mm:
(WTR::AccessibilityUIElement::scrollToMakeVisible):
(WTR::AccessibilityUIElement::scrollToGlobalPoint):
(WTR::AccessibilityUIElement::scrollToMakeVisibleWithSubFocus):
(WTR::AccessibilityUIElement::selectedTextRange):
* WebKitTestRunner/InjectedBundle/mac/AccessibilityUIElementMac.mm:
(WTR::AccessibilityUIElement::scrollToMakeVisible):
(WTR::AccessibilityUIElement::scrollToGlobalPoint):
(WTR::AccessibilityUIElement::scrollToMakeVisibleWithSubFocus):
(WTR::AccessibilityUIElement::selectedTextRange):

LayoutTests:

* accessibility/scroll-to-global-point-iframe-expected.txt: Added.
* accessibility/scroll-to-global-point-iframe-nested-expected.txt: Added.
* accessibility/scroll-to-global-point-iframe-nested.html: Added.
* accessibility/scroll-to-global-point-iframe.html: Added.
* accessibility/scroll-to-global-point-main-window-expected.txt: Added.
* accessibility/scroll-to-global-point-main-window.html: Added.
* accessibility/scroll-to-global-point-nested-expected.txt: Added.
* accessibility/scroll-to-global-point-nested.html: Added.
* accessibility/scroll-to-make-visible-div-overflow-expected.txt: Added.
* accessibility/scroll-to-make-visible-div-overflow.html: Added.
* accessibility/scroll-to-make-visible-iframe-expected.txt: Added.
* accessibility/scroll-to-make-visible-iframe.html: Added.
* accessibility/scroll-to-make-visible-nested-2-expected.txt: Added.
* accessibility/scroll-to-make-visible-nested-2.html: Added.
* accessibility/scroll-to-make-visible-nested-expected.txt: Added.
* accessibility/scroll-to-make-visible-nested.html: Added.
* accessibility/scroll-to-make-visible-with-subfocus-expected.txt: Added.
* accessibility/scroll-to-make-visible-with-subfocus.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@189149 268f45cc-cd09-0410-ab3c-d52691b4dbfc
32 files changed:
LayoutTests/ChangeLog
LayoutTests/accessibility/scroll-to-global-point-iframe-expected.txt [new file with mode: 0644]
LayoutTests/accessibility/scroll-to-global-point-iframe-nested-expected.txt [new file with mode: 0644]
LayoutTests/accessibility/scroll-to-global-point-iframe-nested.html [new file with mode: 0644]
LayoutTests/accessibility/scroll-to-global-point-iframe.html [new file with mode: 0644]
LayoutTests/accessibility/scroll-to-global-point-main-window-expected.txt [new file with mode: 0644]
LayoutTests/accessibility/scroll-to-global-point-main-window.html [new file with mode: 0644]
LayoutTests/accessibility/scroll-to-global-point-nested-expected.txt [new file with mode: 0644]
LayoutTests/accessibility/scroll-to-global-point-nested.html [new file with mode: 0644]
LayoutTests/accessibility/scroll-to-make-visible-div-overflow-expected.txt [new file with mode: 0644]
LayoutTests/accessibility/scroll-to-make-visible-div-overflow.html [new file with mode: 0644]
LayoutTests/accessibility/scroll-to-make-visible-iframe-expected.txt [new file with mode: 0644]
LayoutTests/accessibility/scroll-to-make-visible-iframe.html [new file with mode: 0644]
LayoutTests/accessibility/scroll-to-make-visible-nested-2-expected.txt [new file with mode: 0644]
LayoutTests/accessibility/scroll-to-make-visible-nested-2.html [new file with mode: 0644]
LayoutTests/accessibility/scroll-to-make-visible-nested-expected.txt [new file with mode: 0644]
LayoutTests/accessibility/scroll-to-make-visible-nested.html [new file with mode: 0644]
LayoutTests/accessibility/scroll-to-make-visible-with-subfocus-expected.txt [new file with mode: 0644]
LayoutTests/accessibility/scroll-to-make-visible-with-subfocus.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/accessibility/AccessibilityObject.cpp
Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm
Tools/ChangeLog
Tools/DumpRenderTree/AccessibilityUIElement.cpp
Tools/DumpRenderTree/ios/AccessibilityUIElementIOS.mm
Tools/DumpRenderTree/mac/AccessibilityUIElementMac.mm
Tools/WebKitTestRunner/InjectedBundle/AccessibilityUIElement.cpp
Tools/WebKitTestRunner/InjectedBundle/AccessibilityUIElement.h
Tools/WebKitTestRunner/InjectedBundle/Bindings/AccessibilityUIElement.idl
Tools/WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp
Tools/WebKitTestRunner/InjectedBundle/ios/AccessibilityUIElementIOS.mm
Tools/WebKitTestRunner/InjectedBundle/mac/AccessibilityUIElementMac.mm