w3c / secure-payment-confirmation

Secure Payment Confirmation (SPC)
https://w3c.github.io/secure-payment-confirmation/
Other
110 stars 39 forks source link

Alt for icon #156

Closed ianbjacobs closed 2 years ago

ianbjacobs commented 2 years ago

To improve accessibility and address #127, a proposal add an optional "alt" to instrument details when displayName is not sufficient to describe the icon.

P.S. I named the pull request 217 instead of 127. Sorry!


Preview | Diff

rsolomakhin commented 2 years ago

Good start. A couple of thoughts and one question from my side:

  1. If SPC ever has multiple icons (e.g., network, bank, card-art), then multiple alt fields would be needed. Should the icon field be optionally a dictionary that contains one field for src and one field for alt?
  2. As we found out in PaymentRequest API, the screen reader needs to know the language of the text that it's going to read. Should the icon dictionary contain a lang field?
  3. Do any i18n folks know whether dir field is required for alt text?
ianbjacobs commented 2 years ago

@r12a and @aphillips, please indicate whether dir/lang are required for an "alt" attribute.

Also, would it suffice to have dir/lang at the level of the dictionary that would apply to both displayName and alt?

r12a commented 2 years ago

I have certainly seen instances in the past where lang and/or dir were needed (but unavailable) in HTML for an alt (or title) because the alt text in a different language or had direction sensitive text that differed from the element text. We were unable to convince the HTML5 folks to change the HTML approach because they just wanted to pave the cowpaths (and so the ITS spec explains a workaround for dealing with such an eventuality in HTML/XML). That was unfortunate, because we had not long before convinced the XHTML2 folks to use an element instead of an attribute for user-readable types of text (including alt).

Also, would it suffice to have dir/lang at the level of the dictionary that would apply to both displayName and alt?

So, no. That won't cut it for all cases.

ianbjacobs commented 2 years ago

Closing this one in favor of #162.