AX: Automatically compute accessibility labels for Apple Pay buttons
authorcfleizach@apple.com <cfleizach@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 9 Apr 2019 00:58:19 +0000 (00:58 +0000)
committercfleizach@apple.com <cfleizach@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 9 Apr 2019 00:58:19 +0000 (00:58 +0000)
commit0c6b791858602c398981d3e98ef72218420d5c1b
tree029a054d219ff7ebc55844fb3628478d2218ac89
parenta559f53afa121c85099375a8edaca24309257983
AX: Automatically compute accessibility labels for Apple Pay buttons
https://bugs.webkit.org/show_bug.cgi?id=196661

Reviewed by Joanmarie Diggs.

Source/WebCore:

Detect Apple Pay buttons and return a standard role and label for them based on their type.

Test: accessibility/mac/apple-pay-labels.html
      accessibility/mac/apple-pay-session-v4.html

* accessibility/AccessibilityNodeObject.cpp:
(WebCore::AccessibilityNodeObject::isControl const):
* accessibility/AccessibilityNodeObject.h:
* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::applePayButtonDescription const):
(WebCore::AccessibilityRenderObject::titleElementText const):
(WebCore::AccessibilityRenderObject::determineAccessibilityRole):
(WebCore::AccessibilityRenderObject::isApplePayButton const):
(WebCore::AccessibilityRenderObject::applePayButtonType const):
* accessibility/AccessibilityRenderObject.h:
* en.lproj/Localizable.strings:
* platform/LocalizedStrings.cpp:
(WebCore::AXApplePayPlainLabel):
(WebCore::AXApplePayBuyLabel):
(WebCore::AXApplePaySetupLabel):
(WebCore::AXApplePayDonateLabel):
(WebCore::AXApplePayCheckOutLabel):
(WebCore::AXApplePayBookLabel):
(WebCore::AXApplePaySubscribeLabel):
* platform/LocalizedStrings.h:

LayoutTests:

* accessibility/mac/apple-pay-labels-expected.txt: Added.
* accessibility/mac/apple-pay-labels.html: Added.
* accessibility/mac/apple-pay-session-v4-expected.txt: Added.
* accessibility/mac/apple-pay-session-v4.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244061 268f45cc-cd09-0410-ab3c-d52691b4dbfc
15 files changed:
LayoutTests/ChangeLog
LayoutTests/accessibility/mac/apple-pay-labels-expected.txt [new file with mode: 0644]
LayoutTests/accessibility/mac/apple-pay-labels.html [new file with mode: 0644]
LayoutTests/accessibility/mac/apple-pay-session-v4-expected.txt [new file with mode: 0644]
LayoutTests/accessibility/mac/apple-pay-session-v4.html [new file with mode: 0644]
LayoutTests/platform/mac-wk1/TestExpectations
LayoutTests/platform/mac-wk2/TestExpectations
Source/WebCore/ChangeLog
Source/WebCore/accessibility/AccessibilityNodeObject.cpp
Source/WebCore/accessibility/AccessibilityNodeObject.h
Source/WebCore/accessibility/AccessibilityRenderObject.cpp
Source/WebCore/accessibility/AccessibilityRenderObject.h
Source/WebCore/en.lproj/Localizable.strings
Source/WebCore/platform/LocalizedStrings.cpp
Source/WebCore/platform/LocalizedStrings.h