AX: aria-label not being used correctly in accessible name calculation of heading
authorn_wang@apple.com <n_wang@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 21 Jul 2016 23:47:53 +0000 (23:47 +0000)
committern_wang@apple.com <n_wang@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 21 Jul 2016 23:47:53 +0000 (23:47 +0000)
commitfc6da12e8dfa3bd57e34c98f3c572e7b59d134fb
treeb87ee2167492958d82352cd1f92d4d9af256cb5e
parent6ad3e7e8e12037de29ee946a54a0140b05210f06
AX: aria-label not being used correctly in accessible name calculation of heading
https://bugs.webkit.org/show_bug.cgi?id=160009

Reviewed by Chris Fleizach.

Source/WebCore:

Actually we are exposing the correct information for heading objects. On macOS,
VoiceOver should handle the logic that picks the right information to speak.
On iOS, VoiceOver is speaking the static text child instead of the heading object.
So we should set the accessibilityLabel of the static text based on the parent's
alternate label.

Test: accessibility/ios-simulator/heading-with-aria-label.html

* accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
(-[WebAccessibilityObjectWrapper _accessibilityTraitsFromAncestors]):

LayoutTests:

* accessibility/ios-simulator/heading-with-aria-label-expected.txt: Added.
* accessibility/ios-simulator/heading-with-aria-label.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@203538 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/accessibility/ios-simulator/heading-with-aria-label-expected.txt [new file with mode: 0644]
LayoutTests/accessibility/ios-simulator/heading-with-aria-label.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/accessibility/ios/WebAccessibilityObjectWrapperIOS.mm