Bug 196661 - AX: Automatically compute accessibility labels for Apple Pay buttons
Summary: AX: Automatically compute accessibility labels for Apple Pay buttons
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Accessibility (show other bugs)
Version: Other
Hardware: All All
: P2 Normal
Assignee: chris fleizach
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2019-04-05 15:25 PDT by chris fleizach
Modified: 2019-04-08 17:58 PDT (History)
11 users (show)

See Also:


Attachments
patch (17.05 KB, patch)
2019-04-05 19:38 PDT, chris fleizach
ews-watchlist: commit-queue-
Details | Formatted Diff | Diff
Archive of layout-test-results from ews103 for mac-highsierra (2.47 MB, application/zip)
2019-04-05 20:42 PDT, EWS Watchlist
no flags Details
Archive of layout-test-results from ews104 for mac-highsierra-wk2 (2.67 MB, application/zip)
2019-04-05 20:57 PDT, EWS Watchlist
no flags Details
Archive of layout-test-results from ews112 for mac-highsierra (2.26 MB, application/zip)
2019-04-05 21:25 PDT, EWS Watchlist
no flags Details
patch (18.38 KB, patch)
2019-04-06 19:09 PDT, chris fleizach
ews-watchlist: commit-queue-
Details | Formatted Diff | Diff
Archive of layout-test-results from ews103 for mac-highsierra (2.47 MB, application/zip)
2019-04-06 20:13 PDT, EWS Watchlist
no flags Details
Archive of layout-test-results from ews107 for mac-highsierra-wk2 (2.62 MB, application/zip)
2019-04-06 20:27 PDT, EWS Watchlist
no flags Details
Archive of layout-test-results from ews117 for mac-highsierra (2.28 MB, application/zip)
2019-04-06 20:56 PDT, EWS Watchlist
no flags Details
patch (19.61 KB, patch)
2019-04-08 09:01 PDT, chris fleizach
ews-watchlist: commit-queue-
Details | Formatted Diff | Diff
Archive of layout-test-results from ews100 for mac-highsierra (2.59 MB, application/zip)
2019-04-08 09:55 PDT, EWS Watchlist
no flags Details
Archive of layout-test-results from ews105 for mac-highsierra-wk2 (2.62 MB, application/zip)
2019-04-08 10:22 PDT, EWS Watchlist
no flags Details
Archive of layout-test-results from ews115 for mac-highsierra (2.39 MB, application/zip)
2019-04-08 10:42 PDT, EWS Watchlist
no flags Details
patch (19.78 KB, patch)
2019-04-08 12:12 PDT, chris fleizach
ews-watchlist: commit-queue-
Details | Formatted Diff | Diff
Archive of layout-test-results from ews100 for mac-highsierra (2.86 MB, application/zip)
2019-04-08 13:09 PDT, EWS Watchlist
no flags Details
patch (20.75 KB, patch)
2019-04-08 13:56 PDT, chris fleizach
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description chris fleizach 2019-04-05 15:25:43 PDT
If a merchant doesn’t specify an aria-label on their Apple Pay buttons, WebKit should make a better effort at computing a good default accessibility label. For instance, it could take the -apple-pay-button-type CSS property into account to decide whether the button represents “buy”, “subscribe”, “book”, etc.

<rdar://problem/49646423>
Comment 1 chris fleizach 2019-04-05 19:38:24 PDT
Created attachment 366868 [details]
patch
Comment 2 EWS Watchlist 2019-04-05 20:42:37 PDT
Comment on attachment 366868 [details]
patch

Attachment 366868 [details] did not pass mac-ews (mac):
Output: https://webkit-queues.webkit.org/results/11787746

New failing tests:
accessibility/mac/apple-pay-labels.html
Comment 3 EWS Watchlist 2019-04-05 20:42:39 PDT
Created attachment 366871 [details]
Archive of layout-test-results from ews103 for mac-highsierra

The attached test failures were seen while running run-webkit-tests on the mac-ews.
Bot: ews103  Port: mac-highsierra  Platform: Mac OS X 10.13.6
Comment 4 EWS Watchlist 2019-04-05 20:57:42 PDT
Comment on attachment 366868 [details]
patch

Attachment 366868 [details] did not pass mac-wk2-ews (mac-wk2):
Output: https://webkit-queues.webkit.org/results/11787759

New failing tests:
accessibility/mac/apple-pay-labels.html
Comment 5 EWS Watchlist 2019-04-05 20:57:44 PDT
Created attachment 366873 [details]
Archive of layout-test-results from ews104 for mac-highsierra-wk2

The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews.
Bot: ews104  Port: mac-highsierra-wk2  Platform: Mac OS X 10.13.6
Comment 6 EWS Watchlist 2019-04-05 21:25:15 PDT
Comment on attachment 366868 [details]
patch

Attachment 366868 [details] did not pass mac-debug-ews (mac):
Output: https://webkit-queues.webkit.org/results/11787780

New failing tests:
accessibility/mac/apple-pay-labels.html
Comment 7 EWS Watchlist 2019-04-05 21:25:17 PDT
Created attachment 366874 [details]
Archive of layout-test-results from ews112 for mac-highsierra

The attached test failures were seen while running run-webkit-tests on the mac-debug-ews.
Bot: ews112  Port: mac-highsierra  Platform: Mac OS X 10.13.6
Comment 8 chris fleizach 2019-04-06 19:09:20 PDT
Created attachment 366896 [details]
patch
Comment 9 EWS Watchlist 2019-04-06 20:13:09 PDT
Comment on attachment 366896 [details]
patch

Attachment 366896 [details] did not pass mac-ews (mac):
Output: https://webkit-queues.webkit.org/results/11795001

New failing tests:
accessibility/mac/apple-pay-labels.html
Comment 10 EWS Watchlist 2019-04-06 20:13:11 PDT
Created attachment 366898 [details]
Archive of layout-test-results from ews103 for mac-highsierra

The attached test failures were seen while running run-webkit-tests on the mac-ews.
Bot: ews103  Port: mac-highsierra  Platform: Mac OS X 10.13.6
Comment 11 EWS Watchlist 2019-04-06 20:27:50 PDT
Comment on attachment 366896 [details]
patch

Attachment 366896 [details] did not pass mac-wk2-ews (mac-wk2):
Output: https://webkit-queues.webkit.org/results/11795012

New failing tests:
accessibility/mac/apple-pay-labels.html
Comment 12 EWS Watchlist 2019-04-06 20:27:52 PDT
Created attachment 366899 [details]
Archive of layout-test-results from ews107 for mac-highsierra-wk2

The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews.
Bot: ews107  Port: mac-highsierra-wk2  Platform: Mac OS X 10.13.6
Comment 13 EWS Watchlist 2019-04-06 20:56:39 PDT
Comment on attachment 366896 [details]
patch

Attachment 366896 [details] did not pass mac-debug-ews (mac):
Output: https://webkit-queues.webkit.org/results/11795037

New failing tests:
accessibility/mac/apple-pay-labels.html
Comment 14 EWS Watchlist 2019-04-06 20:56:41 PDT
Created attachment 366901 [details]
Archive of layout-test-results from ews117 for mac-highsierra

The attached test failures were seen while running run-webkit-tests on the mac-debug-ews.
Bot: ews117  Port: mac-highsierra  Platform: Mac OS X 10.13.6
Comment 15 chris fleizach 2019-04-08 09:01:37 PDT
Created attachment 366938 [details]
patch
Comment 16 EWS Watchlist 2019-04-08 09:55:36 PDT
Comment on attachment 366938 [details]
patch

Attachment 366938 [details] did not pass mac-ews (mac):
Output: https://webkit-queues.webkit.org/results/11806516

New failing tests:
accessibility/mac/apple-pay-session-v4.html
Comment 17 EWS Watchlist 2019-04-08 09:55:38 PDT
Created attachment 366944 [details]
Archive of layout-test-results from ews100 for mac-highsierra

The attached test failures were seen while running run-webkit-tests on the mac-ews.
Bot: ews100  Port: mac-highsierra  Platform: Mac OS X 10.13.6
Comment 18 EWS Watchlist 2019-04-08 10:22:56 PDT
Comment on attachment 366938 [details]
patch

Attachment 366938 [details] did not pass mac-wk2-ews (mac-wk2):
Output: https://webkit-queues.webkit.org/results/11806704

New failing tests:
accessibility/mac/apple-pay-session-v4.html
Comment 19 EWS Watchlist 2019-04-08 10:22:58 PDT
Created attachment 366947 [details]
Archive of layout-test-results from ews105 for mac-highsierra-wk2

The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews.
Bot: ews105  Port: mac-highsierra-wk2  Platform: Mac OS X 10.13.6
Comment 20 EWS Watchlist 2019-04-08 10:42:18 PDT
Comment on attachment 366938 [details]
patch

Attachment 366938 [details] did not pass mac-debug-ews (mac):
Output: https://webkit-queues.webkit.org/results/11806644

New failing tests:
accessibility/mac/apple-pay-session-v4.html
Comment 21 EWS Watchlist 2019-04-08 10:42:20 PDT
Created attachment 366953 [details]
Archive of layout-test-results from ews115 for mac-highsierra

The attached test failures were seen while running run-webkit-tests on the mac-debug-ews.
Bot: ews115  Port: mac-highsierra  Platform: Mac OS X 10.13.6
Comment 22 chris fleizach 2019-04-08 12:12:41 PDT
Created attachment 366964 [details]
patch
Comment 23 EWS Watchlist 2019-04-08 13:09:10 PDT
Comment on attachment 366964 [details]
patch

Attachment 366964 [details] did not pass mac-ews (mac):
Output: https://webkit-queues.webkit.org/results/11808750

New failing tests:
accessibility/mac/apple-pay-session-v4.html
Comment 24 EWS Watchlist 2019-04-08 13:09:12 PDT
Created attachment 366972 [details]
Archive of layout-test-results from ews100 for mac-highsierra

The attached test failures were seen while running run-webkit-tests on the mac-ews.
Bot: ews100  Port: mac-highsierra  Platform: Mac OS X 10.13.6
Comment 25 chris fleizach 2019-04-08 13:56:46 PDT
Created attachment 366976 [details]
patch
Comment 26 Andy Estes 2019-04-08 15:28:28 PDT
Comment on attachment 366976 [details]
patch

I wonder if we would get the same accessibility label, without having to keep our own set of localized strings, by calling +[PKPaymentButton buttonWithType:style:] and then querying its accessibility label?
Comment 27 Joanmarie Diggs 2019-04-08 15:48:13 PDT
(In reply to chris fleizach from comment #0)
> If a merchant doesn’t specify an aria-label on their Apple Pay buttons,
> WebKit should make a better effort at computing a good default accessibility
> label. For instance, it could take the -apple-pay-button-type CSS property
> into account to decide whether the button represents “buy”, “subscribe”,
> “book”, etc.

Aside: I trust you reported this issue to the Apple Pay folks, and this is perhaps an interim fix?

Accessibility is, of course, my number one priority. That said, ideally either merchants would be strongly encouraged (e.g. through validation failures) to name their buttons and/or Apple Pay itself would provide the fallback.

(Disclaimer: I'm admittedly unfamiliar with being an Apple Pay merchant and what means Apple Pay has to validate and/or correct merchant failures.)
Comment 28 chris fleizach 2019-04-08 16:43:30 PDT
(In reply to Andy Estes from comment #26)
> Comment on attachment 366976 [details]
> patch
> 
> I wonder if we would get the same accessibility label, without having to
> keep our own set of localized strings, by calling +[PKPaymentButton
> buttonWithType:style:] and then querying its accessibility label?

it's a bit risky. I'm not sure anything happens on Mac (At all right now) to provide the right labels. 

On iOS, those buttons only get their AX information if an AT is running, which will probably run into some issue

Feel safer having these labels unambiguously set here
Comment 29 chris fleizach 2019-04-08 16:44:35 PDT
(In reply to Joanmarie Diggs (irc: joanie) from comment #27)
> (In reply to chris fleizach from comment #0)
> > If a merchant doesn’t specify an aria-label on their Apple Pay buttons,
> > WebKit should make a better effort at computing a good default accessibility
> > label. For instance, it could take the -apple-pay-button-type CSS property
> > into account to decide whether the button represents “buy”, “subscribe”,
> > “book”, etc.
> 
> Aside: I trust you reported this issue to the Apple Pay folks, and this is
> perhaps an interim fix?
> 

I'm the same folks in this case. 

> Accessibility is, of course, my number one priority. That said, ideally
> either merchants would be strongly encouraged (e.g. through validation
> failures) to name their buttons and/or Apple Pay itself would provide the
> fallback.

Since all of these buttons are named (there's not any free form buttons for Apple Pay), I feel better having WebKit always provide the label, just like it's always providing the image and text. That way we can be assured of

1) consistency of naming
2) correct localization

> 
> (Disclaimer: I'm admittedly unfamiliar with being an Apple Pay merchant and
> what means Apple Pay has to validate and/or correct merchant failures.)
Comment 30 Joanmarie Diggs 2019-04-08 17:50:04 PDT
Comment on attachment 366976 [details]
patch

r+ = You know what's best in the particular case, but the little standards-centric voice inside me still thinks it feels a bit weird.
Comment 31 chris fleizach 2019-04-08 17:51:58 PDT
(In reply to Joanmarie Diggs (irc: joanie) from comment #30)
> Comment on attachment 366976 [details]
> patch
> 
> r+ = You know what's best in the particular case, but the little
> standards-centric voice inside me still thinks it feels a bit weird.

Thanks! if it makes you feel better, -apple-pay buttons are not in any spec =)
Comment 32 WebKit Commit Bot 2019-04-08 17:58:26 PDT
Comment on attachment 366976 [details]
patch

Clearing flags on attachment: 366976

Committed r244061: <https://trac.webkit.org/changeset/244061>
Comment 33 WebKit Commit Bot 2019-04-08 17:58:28 PDT
All reviewed patches have been landed.  Closing bug.