Changeset 244061 in webkit
- Timestamp:
- Apr 8, 2019, 5:58:19 PM (7 years ago)
- Location:
- trunk
- Files:
-
- 4 added
- 11 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/accessibility/mac/apple-pay-labels-expected.txt (added)
-
LayoutTests/accessibility/mac/apple-pay-labels.html (added)
-
LayoutTests/accessibility/mac/apple-pay-session-v4-expected.txt (added)
-
LayoutTests/accessibility/mac/apple-pay-session-v4.html (added)
-
LayoutTests/platform/mac-wk1/TestExpectations (modified) (1 diff)
-
LayoutTests/platform/mac-wk2/TestExpectations (modified) (2 diffs)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/accessibility/AccessibilityNodeObject.cpp (modified) (1 diff)
-
Source/WebCore/accessibility/AccessibilityNodeObject.h (modified) (1 diff)
-
Source/WebCore/accessibility/AccessibilityRenderObject.cpp (modified) (3 diffs)
-
Source/WebCore/accessibility/AccessibilityRenderObject.h (modified) (2 diffs)
-
Source/WebCore/en.lproj/Localizable.strings (modified) (8 diffs)
-
Source/WebCore/platform/LocalizedStrings.cpp (modified) (1 diff)
-
Source/WebCore/platform/LocalizedStrings.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r244054 r244061 1 2019-04-08 Chris Fleizach <cfleizach@apple.com> 2 3 AX: Automatically compute accessibility labels for Apple Pay buttons 4 https://bugs.webkit.org/show_bug.cgi?id=196661 5 6 Reviewed by Joanmarie Diggs. 7 8 * accessibility/mac/apple-pay-labels-expected.txt: Added. 9 * accessibility/mac/apple-pay-labels.html: Added. 10 * accessibility/mac/apple-pay-session-v4-expected.txt: Added. 11 * accessibility/mac/apple-pay-session-v4.html: Added. 12 1 13 2019-04-08 Youenn Fablet <youenn@apple.com> 2 14 -
trunk/LayoutTests/platform/mac-wk1/TestExpectations
r243763 r244061 62 62 # ShouldOpenExternalURLs not yet supported in WK1 63 63 loader/navigation-policy [ Skip ] 64 65 [ Sierra ] accessibility/mac/apple-pay-labels.html [ Skip ] 66 [ HighSierra ] accessibility/mac/apple-pay-session-v4.html [ Skip ] 64 67 65 68 # <a download> is not supported in WK1 yet. -
trunk/LayoutTests/platform/mac-wk2/TestExpectations
r244045 r244061 34 34 [ Sierra ] http/tests/ssl/applepay/ApplePayRequestShippingContactV3.https.html [ Skip ] 35 35 [ Sierra ] http/tests/ssl/applepay/ApplePayShippingAddressChangeEventErrorsV3.https.html [ Skip ] 36 [ Sierra ] accessibility/mac/apple-pay-labels.html [ Skip ] 36 37 [ HighSierra ] http/tests/ssl/applepay/ApplePayButtonV4.html [ Skip ] 37 38 [ HighSierra ] http/tests/ssl/applepay/ApplePaySessionV4.html [ Skip ] 38 39 [ HighSierra ] http/tests/ssl/applepay/ApplePaySessionV5.html [ Skip ] 40 [ HighSierra ] accessibility/mac/apple-pay-session-v4.html [ Skip ] 39 41 40 42 fast/visual-viewport/rubberbanding-viewport-rects.html [ Pass ] … … 776 778 [ HighSierra+ ] http/tests/ssl/applepay/ApplePayRequestShippingContactV3.https.html [ Pass ] 777 779 [ HighSierra+ ] http/tests/ssl/applepay/ApplePayShippingAddressChangeEventErrorsV3.https.html [ Pass ] 780 [ HighSierra+ ] accessibility/mac/apple-pay-labels.html [ Pass ] 781 [ Mojave+ ] accessibility/mac/apple-pay-session-v4.html [ Pass ] 778 782 # <rdar://problem/31634451> 779 783 [ HighSierra+ ] http/tests/resourceLoadStatistics/cookies-with-and-without-user-interaction.html [ Pass ] -
trunk/Source/WebCore/ChangeLog
r244059 r244061 1 2019-04-08 Chris Fleizach <cfleizach@apple.com> 2 3 AX: Automatically compute accessibility labels for Apple Pay buttons 4 https://bugs.webkit.org/show_bug.cgi?id=196661 5 6 Reviewed by Joanmarie Diggs. 7 8 Detect Apple Pay buttons and return a standard role and label for them based on their type. 9 10 Test: accessibility/mac/apple-pay-labels.html 11 accessibility/mac/apple-pay-session-v4.html 12 13 * accessibility/AccessibilityNodeObject.cpp: 14 (WebCore::AccessibilityNodeObject::isControl const): 15 * accessibility/AccessibilityNodeObject.h: 16 * accessibility/AccessibilityRenderObject.cpp: 17 (WebCore::AccessibilityRenderObject::applePayButtonDescription const): 18 (WebCore::AccessibilityRenderObject::titleElementText const): 19 (WebCore::AccessibilityRenderObject::determineAccessibilityRole): 20 (WebCore::AccessibilityRenderObject::isApplePayButton const): 21 (WebCore::AccessibilityRenderObject::applePayButtonType const): 22 * accessibility/AccessibilityRenderObject.h: 23 * en.lproj/Localizable.strings: 24 * platform/LocalizedStrings.cpp: 25 (WebCore::AXApplePayPlainLabel): 26 (WebCore::AXApplePayBuyLabel): 27 (WebCore::AXApplePaySetupLabel): 28 (WebCore::AXApplePayDonateLabel): 29 (WebCore::AXApplePayCheckOutLabel): 30 (WebCore::AXApplePayBookLabel): 31 (WebCore::AXApplePaySubscribeLabel): 32 * platform/LocalizedStrings.h: 33 1 34 2019-04-08 Chris Fleizach <cfleizach@apple.com> 2 35 -
trunk/Source/WebCore/accessibility/AccessibilityNodeObject.cpp
r242713 r244061 887 887 return false; 888 888 889 return is<HTMLFormControlElement>(*node) || AccessibilityObject::isARIAControl(ariaRoleAttribute()) ;889 return is<HTMLFormControlElement>(*node) || AccessibilityObject::isARIAControl(ariaRoleAttribute()) || roleValue() == AccessibilityRole::Button; 890 890 } 891 891 -
trunk/Source/WebCore/accessibility/AccessibilityNodeObject.h
r241321 r244061 178 178 AccessibilityObject* menuButtonForMenu() const; 179 179 AccessibilityObject* captionForFigure() const; 180 virtual void titleElementText(Vector<AccessibilityText>&) const; 180 181 181 182 private: 182 183 bool isAccessibilityNodeObject() const final { return true; } 183 184 void accessibilityText(Vector<AccessibilityText>&) const override; 184 virtual void titleElementText(Vector<AccessibilityText>&) const;185 185 void alternativeText(Vector<AccessibilityText>&) const; 186 186 void visibleText(Vector<AccessibilityText>&) const; -
trunk/Source/WebCore/accessibility/AccessibilityRenderObject.cpp
r244029 r244061 1076 1076 return true; 1077 1077 } 1078 1079 #if ENABLE(APPLE_PAY) 1080 String AccessibilityRenderObject::applePayButtonDescription() const 1081 { 1082 switch (applePayButtonType()) { 1083 case ApplePayButtonType::Plain: 1084 return AXApplePayPlainLabel(); 1085 case ApplePayButtonType::Buy: 1086 return AXApplePayBuyLabel(); 1087 case ApplePayButtonType::SetUp: 1088 return AXApplePaySetupLabel(); 1089 case ApplePayButtonType::Donate: 1090 return AXApplePayDonateLabel(); 1091 #if ENABLE(APPLE_PAY_SESSION_V4) 1092 case ApplePayButtonType::CheckOut: 1093 return AXApplePayCheckOutLabel(); 1094 case ApplePayButtonType::Book: 1095 return AXApplePayBookLabel(); 1096 case ApplePayButtonType::Subscribe: 1097 return AXApplePaySubscribeLabel(); 1098 #endif 1099 } 1100 } 1101 #endif 1102 1103 void AccessibilityRenderObject::titleElementText(Vector<AccessibilityText>& textOrder) const 1104 { 1105 #if ENABLE(APPLE_PAY) 1106 if (isApplePayButton()) { 1107 textOrder.append(AccessibilityText(applePayButtonDescription(), AccessibilityTextSource::Alternative)); 1108 return; 1109 } 1110 #endif 1111 1112 AccessibilityNodeObject::titleElementText(textOrder); 1113 } 1078 1114 1079 1115 AccessibilityObject* AccessibilityRenderObject::titleUIElement() const … … 2673 2709 return AccessibilityRole::Unknown; 2674 2710 2711 #if ENABLE(APPLE_PAY) 2712 if (isApplePayButton()) 2713 return AccessibilityRole::Button; 2714 #endif 2715 2675 2716 // Sometimes we need to ignore the attribute role. Like if a tree is malformed, 2676 2717 // we want to ignore the treeitem's attribute role. … … 3630 3671 } 3631 3672 3673 #if ENABLE(APPLE_PAY) 3674 bool AccessibilityRenderObject::isApplePayButton() const 3675 { 3676 if (!m_renderer) 3677 return false; 3678 return m_renderer->style().appearance() == ApplePayButtonPart; 3679 } 3680 3681 ApplePayButtonType AccessibilityRenderObject::applePayButtonType() const 3682 { 3683 if (!m_renderer) 3684 return ApplePayButtonType::Plain; 3685 return m_renderer->style().applePayButtonType(); 3686 } 3687 #endif 3688 3632 3689 bool AccessibilityRenderObject::hasSameFontColor(RenderObject* renderer) const 3633 3690 { -
trunk/Source/WebCore/accessibility/AccessibilityRenderObject.h
r242051 r244061 201 201 202 202 String passwordFieldValue() const override; 203 void titleElementText(Vector<AccessibilityText>&) const override; 203 204 204 205 protected: … … 284 285 bool shouldGetTextFromNode(AccessibilityTextUnderElementMode) const; 285 286 287 #if ENABLE(APPLE_PAY) 288 bool isApplePayButton() const; 289 ApplePayButtonType applePayButtonType() const; 290 String applePayButtonDescription() const; 291 #endif 292 286 293 RenderObject* targetElementForActiveDescendant(const QualifiedName&, AccessibilityObject*) const; 287 294 bool canHavePlainText() const; -
trunk/Source/WebCore/en.lproj/Localizable.strings
r243173 r244061 104 104 "Align Right (Undo action name)" = "Align Right"; 105 105 106 /* Allow Storage Access API */ 107 "Allow" = "Allow"; 108 109 /* Title for Allow button label in the Storage Access API request dialog */ 106 /* Button title in Storage Access API prompt */ 110 107 "Allow (cross-site cookie and website data access)" = "Allow"; 111 108 112 /* Storage Access API request validation (iOS phrasing)*/109 /* Message for requesting cross-site cookie and website data access. */ 113 110 "Allow \"%@\" to use cookies and website data while browsing \"%@\"?" = "Allow \"%@\" to use cookies and website data while browsing \"%@\"?"; 114 111 … … 116 113 "An unknown error occurred" = "An unknown error occurred"; 117 114 115 /* Label for the plain Apple Pay button. */ 116 "Apple Pay" = "Apple Pay"; 117 118 118 /* Malware confirmation dialog title */ 119 119 "Are you sure you wish to go to this site?" = "Are you sure you wish to go to this site?"; … … 140 140 "Bold (Undo action name)" = "Bold"; 141 141 142 /* Label for the book with Apple Pay button. */ 143 "Book with Apple Pay" = "Book with Apple Pay"; 144 142 145 /* Option in segmented control for inserting a bulleted list in text editing */ 143 146 "Bulleted list" = "Bulleted list"; 144 147 148 /* Label for the buy with Apple Pay button. */ 149 "Buy with Apple Pay" = "Buy with Apple Pay"; 150 145 151 /* Cancel */ 146 152 "Cancel" = "Cancel"; … … 167 173 "Check Spelling While Typing" = "Check Spelling While Typing"; 168 174 175 /* Label for the check out with Apple Pay button. */ 176 "Check out with Apple Pay" = "Check out with Apple Pay"; 177 169 178 /* title for a single file chooser button used in HTML forms */ 170 179 "Choose File" = "Choose File"; … … 257 266 "Dictation (Undo action name)" = "Dictation"; 258 267 259 /* Storage Access API request validation (macOS phrasing)*/268 /* Message for requesting cross-site cookie and website data access. */ 260 269 "Do you want to allow \"%@\" to use cookies and website data while browsing \"%@\"?" = "Do you want to allow \"%@\" to use cookies and website data while browsing \"%@\"?"; 261 270 262 /* Storage Access API deny access */ 263 "Don't Allow" = "Don't Allow"; 264 265 /* Title for Don't Allow button label in the Storage Access API request dialog */ 271 /* Button title in Storage Access API prompt */ 266 272 "Don't Allow (cross-site cookie and website data access)" = "Don't Allow"; 273 274 /* Label for the donate with Apple Pay button. */ 275 "Donate with Apple Pay" = "Donate with Apple Pay"; 267 276 268 277 /* Title of the Done button for zoomed form controls. */ … … 665 674 "Set Writing Direction (Undo action name)" = "Set Writing Direction"; 666 675 676 /* Label for the set up with Apple Pay button. */ 677 "Set up with Apple Pay" = "Set up with Apple Pay"; 678 667 679 /* Title for Share action button */ 668 680 "Share…" = "Share…"; … … 746 758 "Submit (input element)" = "Submit"; 747 759 760 /* Label for the subcribe with Apple Pay button. */ 761 "Subscribe with Apple Pay" = "Subscribe with Apple Pay"; 762 748 763 /* Undo action name */ 749 764 "Subscript (Undo action name)" = "Subscript"; … … 821 836 "This website may try to trick you into installing software that harms your browsing experience, like changing your settings without your permission or showing you unwanted ads. Once installed, it may be difficult to remove." = "This website may try to trick you into installing software that harms your browsing experience, like changing your settings without your permission or showing you unwanted ads. Once installed, it may be difficult to remove."; 822 837 823 /* Storage Access API tracking warning*/838 /* Informative text for requesting cross-site cookie and website data access. */ 824 839 "This will allow \"%@\" to track your activity." = "This will allow \"%@\" to track your activity."; 825 840 -
trunk/Source/WebCore/platform/LocalizedStrings.cpp
r242920 r244061 628 628 return "select"; 629 629 } 630 631 #if ENABLE(APPLE_PAY) 632 String AXApplePayPlainLabel() 633 { 634 return WEB_UI_STRING("Apple Pay", "Label for the plain Apple Pay button."); 635 } 636 637 String AXApplePayBuyLabel() 638 { 639 return WEB_UI_STRING("Buy with Apple Pay", "Label for the buy with Apple Pay button."); 640 } 641 642 String AXApplePaySetupLabel() 643 { 644 return WEB_UI_STRING("Set up with Apple Pay", "Label for the set up with Apple Pay button."); 645 } 646 647 String AXApplePayDonateLabel() 648 { 649 return WEB_UI_STRING("Donate with Apple Pay", "Label for the donate with Apple Pay button."); 650 } 651 652 String AXApplePayCheckOutLabel() 653 { 654 return WEB_UI_STRING("Check out with Apple Pay", "Label for the check out with Apple Pay button."); 655 } 656 657 String AXApplePayBookLabel() 658 { 659 return WEB_UI_STRING("Book with Apple Pay", "Label for the book with Apple Pay button."); 660 } 661 662 String AXApplePaySubscribeLabel() 663 { 664 return WEB_UI_STRING("Subscribe with Apple Pay", "Label for the subcribe with Apple Pay button."); 665 } 666 #endif 630 667 631 668 String AXAutoFillCredentialsLabel() -
trunk/Source/WebCore/platform/LocalizedStrings.h
r242920 r244061 214 214 #endif 215 215 #endif 216 216 #if ENABLE(APPLE_PAY) 217 String AXApplePayPlainLabel(); 218 String AXApplePayBuyLabel(); 219 String AXApplePaySetupLabel(); 220 String AXApplePayDonateLabel(); 221 String AXApplePayCheckOutLabel(); 222 String AXApplePayBookLabel(); 223 String AXApplePaySubscribeLabel(); 224 #endif 225 217 226 String AXAutoFillCredentialsLabel(); 218 227 String AXAutoFillContactsLabel();
Note:
See TracChangeset
for help on using the changeset viewer.