♿ TetraLogical: P1 components accessibility review#31208
♿ TetraLogical: P1 components accessibility review#31208TetraLogicalHelpdesk wants to merge 18 commits intoampproject:mainfrom TetraLogical:tetralogical-documentation-phase1
Conversation
As menus in the sidebar are not strictly ARIA menus (but can have a variety of content), they should not have menu-like behaviour. #31175 The behaviour also seems to be currently suppressed (I seem to recall an issue from phase 0 that called for it to be removed, if I'm not mistaken)
The HTML markup list seems to suppress rendering of the backtick code markup - see https://amp.dev/documentation/components/amp-selector/#keyboard-select-mode
|
Hey @alanorozco! These files were changed: Hey @ampproject/wg-caching! These files were changed: Hey @gmajoulet! These files were changed: Hey @processprocess, @t0mg! These files were changed: Hey @mszylkowski! These files were changed: Hey @newmuis, @Enriqe! These files were changed: |
|
Note that the find/replace change to add |
|
@caroqliu to kick of the review? |
caroqliu
left a comment
There was a problem hiding this comment.
Thanks for your thorough changes @patrickhlauke! Left a few comments.
| | --> | ||
| | <!doctype html> | ||
| | <html ⚡> | ||
| | <html ⚡lang="en"> |
There was a problem hiding this comment.
Please update all .out files by running gulp validator --update_tests and do not manually modify.
There was a problem hiding this comment.
i'm currently unable to get a working local dev environment up and running for this (some quirk of windows/wsl/ubuntu that's beyond my technical ability to hunt down just now). is it ok to leave these as they are in my PR, and for you to re-update them properly at your end?
extensions/amp-ad-network-fake-impl/0.1/amp-ad-network-fake-impl.js
Outdated
Show resolved
Hide resolved
| <amp-img src="image1" width="200" height="100"></amp-img> | ||
| <amp-img src="image1" width="200" height="100"></amp-img> | ||
| <amp-img src="image1" width="200" height="100"></amp-img> | ||
| <amp-img src="image1" width="200" height="100" alt="Image 1"></amp-img> |
There was a problem hiding this comment.
FMI: Is this type of alt description actually useful?
There was a problem hiding this comment.
Only in this instance where it's a placeholder image, to be honest. Deemed it borderline acceptable, mainly due to the sheer number of these sorts of images without alt at all (and the fact that not all of the instances I spotted were easy to find/replace throughout). This sort of thing is certainly more of a stopgap solution - ideally, all examples should have appropriate/more real-world descriptive alternative text.
| `select`: Tab key gives focus to `<amp-selector>`. The selection changes as the user navigates options with arrow keys. | ||
| </li> | ||
| </ul> | ||
| - `none` (default): The tab key changes focus between items in the `<amp-selector>`. The user must press enter or space to change the selection. Arrow keys are disabled. |
There was a problem hiding this comment.
@CrystalOnScript Is this HTML removal acceptable for amp.dev?
There was a problem hiding this comment.
note that currently, with the html there, it seems amp.dev doesn't then correctly render the backticks and shows them as literal content on the page - see https://amp.dev/documentation/components/amp-selector/#keyboard-select-mode
| @@ -216,10 +216,6 @@ Please see [this example file](https://github.com/ampproject/amphtml/blob/master | |||
|
|
|||
| `<amp-sidebar>` supports drilldown (nested) menus through a child component named [`<amp-nested-menu>`](../../amp-nested-menu/amp-nested-menu.md). With `<amp-nested-menu>`, `<amp-sidebar>` can support nesting one or more layers of submenus (and transition between them) as demonstrated by the following example: | |||
|
|
|||
| [tip type="note"] | |||
There was a problem hiding this comment.
FMI: Does this not actually improve accessibility and keyboard support? Is there anything that needs to be done to improve user supplied content for this component?
There was a problem hiding this comment.
it's unclear to me what actually happens (as i've not reviewed the logic behind amp-nested-menu). I assumed there was some intended menu-like behaviour being tied to <li> (allowing cursor keys to be used), which is what would not be appropriate. what is the actual outcome of doing what the tip suggests?
There was a problem hiding this comment.
bringing up https://playground.amp.dev/?url=https%3A%2F%2Fpreview.amp.dev%2Fdocumentation%2Fcomponents%2Famp-sidebar.example.1.html%3Fformat%3Dwebsites&format=websites and manually removing the <ul> and <li> elements inside that nested menu seems to not have any tangible effect on the outcome (things are still turned into keyboard-focusable role="button" elements regardless.
if there was some intended extra cursor key behaviour, it's not there in the demo/broken?
There was a problem hiding this comment.
I'm not too sure, maybe @nainar can weigh in from having participated in design conversations? I assumed it was encouraging use of semantic HTML for a list of items as opposed to non-meaningful tags i.e. <div>, but if this does not improve UX, we don't need to encourage people to do this.
|
thanks @caroqliu ... yeah, the dangers of find/replace (also, on my Windows system at least, it's really tricky to tell visually when the ⚡ has a space after it or not ... should have caught that though). I'll do a second pass of this tonight to address the cases you spotted there |
banaag
left a comment
There was a problem hiding this comment.
LGTM as per validator related changes.
| <amp-img src="image1" width="200" height="100"></amp-img> | ||
| <amp-img src="image1" width="200" height="100"></amp-img> | ||
| <amp-img src="image1" width="200" height="100"></amp-img> | ||
| <amp-img src="image1" width="200" height="100" alt="Image 1"></amp-img> |
extensions/amp-a4a/0.1/test/testdata/valid_css_at_rules_amp.reserialized.js
Outdated
Show resolved
Hide resolved
caroqliu
left a comment
There was a problem hiding this comment.
Thanks so much for your diligence and thoroughness here! Looks like there are a couple merge conflicts - once those are resolved and tests are healthy I'd be happy to sign off.
they were causing merge conflicts, and not sure if it's all that important for these to have `lang="en"`
I've resolved the merge conflicts by resetting the validator/testdata files (as noted above, I'm currently unable to sort out a working build environment for some reason, with obscure WSL errors, so can't actually run the tests, nor generate the |
caroqliu
left a comment
There was a problem hiding this comment.
I've resolved the merge conflicts by resetting the validator/testdata files (as noted above, I'm currently unable to sort out a working build environment for some reason, with obscure WSL errors, so can't actually run the tests, nor generate the .out files correctly). assuming that the presence or not of lang="en" in the test files is not mission-critical for testing the actual functionality/running the test suite. If you feel these should be changed too, let me know and I can try and craft a more specific change, just affecting the .html files (and leave updating the .out files as an exercise that can hopefully be done at your end?)
With regards to the build environment, what kind of errors are you seeing? Do you mind filing a follow up issue, or would you like help debugging more actively via Slack? cc @rsimha as FYI
As for the validator tests, the validator is stringent down to the character, so the addition of lang=en in an input file and not the output file (or vice versa) will cause tests to fail. For now, I'd recommend to not modify .html validator files if their corresponding.out files cannot be updated according to those change in the same PR. cc @banaag for another look in light of these removals/updates.
| </body></html>`, | ||
|
|
||
| adTemplate: `<!doctype html><html ⚡ lang="en"><head><meta charset="utf-8"><link rel="canonical" href="self.html" /><meta name="viewport" content="width=device-width,minimum-scale=1"><style amp-boilerplate>body{-webkit-animation:-amp-start 8s steps(1,end) 0s 1 normal both;-moz-animation:-amp-start 8s steps(1,end) 0s 1 normal both;-ms-animation:-amp-start 8s steps(1,end) 0s 1 normal both;animation:-amp-start 8s steps(1,end) 0s 1 normal both}@-webkit-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-moz-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-ms-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-o-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}</style><noscript><style amp-boilerplate>body{-webkit-animation:none;-moz-animation:none;-ms-animation:none;animation:none}</style></noscript><script async src="https://cdn.ampproject.org/v0.js"></script><script async custom-template="amp-mustache" src="https://cdn.ampproject.org/v0/amp-mustache-0.1.js"></script> | ||
| adTemplate: `<!doctype html><html ⚡><head><meta charset="utf-8"><link rel="canonical" href="self.html" /><meta name="viewport" content="width=device-width,minimum-scale=1"><style amp-boilerplate>body{-webkit-animation:-amp-start 8s steps(1,end) 0s 1 normal both;-moz-animation:-amp-start 8s steps(1,end) 0s 1 normal both;-ms-animation:-amp-start 8s steps(1,end) 0s 1 normal both;animation:-amp-start 8s steps(1,end) 0s 1 normal both}@-webkit-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-moz-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-ms-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-o-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}</style><noscript><style amp-boilerplate>body{-webkit-animation:none;-moz-animation:none;-ms-animation:none;animation:none}</style></noscript><script async src="https://cdn.ampproject.org/v0.js"></script><script async custom-template="amp-mustache" src="https://cdn.ampproject.org/v0/amp-mustache-0.1.js"></script> |
There was a problem hiding this comment.
Please also reset minifiedTemplateCreative in this same file.
|
Can you try updating tests (.out files) using the instructions at: https://github.com/ampproject/amphtml/tree/master/validator#usage |
|
Sorry, only just revisiting this (as we're working on another phase of these reviews), and I see that this got stalled at the time and is now conflicting. Is anybody able to help get this updated and merged? |
@TetraLogicalHelpdesk I spent some time this morning taking a stab at resolving the merge conflicts -- that led to this change which includes all the intermediary commits. I'm not confident that creating a secondary pull request into this working branch is the best way to go about it, but the most important part is the diff in the last two commits - one (8c14d45) which resolves merge conflicts after merging with fresh master, and the other (545bfba) which persists one of the original changes to the file's new location. Hopefully you can execute the merge with the following recommendations above as reference if needed. Otherwise please please find me (Caroline Liu) on the AMP Slack and we can hopefully resolve this in live time together. Finally, one recommendation going forward could be to break this PR up so the majority of changes aren't stalled by recent changes in the codebase to a few others. The most obvious is to separate the |
|
@patrickkettner not sure if this falls into your area, but wondering if you'd be able to help push this over the line? for context, this was done as part of an audit/review in november, and i've since been on other projects (so had no time allocated to nurse this PR further). i'm also far from being a wizard with git, as evidenced by my "let's just make it one giant PR" approach here. |
|
After wrapping my head around this, I managed to work out what the actual steps required were. thank you @caroqliu for doing the hard work with to resolve the conflicts ... once I worked out that all that was needed was for me to merge that work back into our branch and then push it back up, it all went smoothly. Sorry for sounding the "not a git expert" alarm bell, @patrickkettner. I think this should now be mergeable. |
|
sorry I missed the ping, @patrickhlauke 🤦♂️ - great job! |
kristoferbaxter
left a comment
There was a problem hiding this comment.
That's a whole lot of lang attributes. Thanks for the fixes!
yes, sorry...the joy/pain of doing a fairly global find and replace :) |
|
Looks like this PR has fallen behind a few merge conflicts. Anything I can do to help get this through? @TetraLogicalHelpdesk @patrickhlauke |
Hi @caroqliu, it's probably best at this stage (since the project relating to this was closed quite some time ago) if somebody on your side could shepherd this PR through to completion. Alternatively, we can add some extra time to the next AMP-related project to take care of this? Let us know how you'd like to proceed. |
|
@kristoferbaxter for triage, unclear what should be done with this old PR |
|
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions. |

Suggested changes and additions based on the TetraLogical accessibility review commissioned by @nainar / @caroqliu
x-ref ampproject/amp.dev#4972