haikuwebkit/LayoutTests/accessibility/mac/apple-pay-session-v4.html

27 lines
1.1 KiB
HTML
Raw Permalink Normal View History

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. Canonical link: https://commits.webkit.org/210997@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244061 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2019-04-09 00:58:19 +00:00
<html>
<html>
<head>
<script src='../../resources/js-test-pre.js'></script>
</head>
<body id='body'>
<div id="book" style="-webkit-appearance: -apple-pay-button; -apple-pay-button-type: book;"></div>
<div id="checkout" style="-webkit-appearance: -apple-pay-button; -apple-pay-button-type: check-out;"></div>
<div id="subscribe" style="-webkit-appearance: -apple-pay-button; -apple-pay-button-type: subscribe;"></div>
<script>
if (window.accessibilityController) {
var book = accessibilityController.accessibleElementById("book");
var checkout = accessibilityController.accessibleElementById("checkout");
var subscribe = accessibilityController.accessibleElementById("subscribe");
shouldBe("book.description", "'AXDescription: Book with Apple Pay'");
shouldBe("checkout.description", "'AXDescription: Check out with Apple Pay'");
shouldBe("subscribe.description", "'AXDescription: Subscribe with Apple Pay'");
}
</script>
<script src='../../resources/js-test-post.js'></script>
</body>
</html>