-
Notifications
You must be signed in to change notification settings - Fork 6k
[web] Move announcement live elements to the end of the DOM and make them divs instead of labels.
#42432
Conversation
…them `div`s instead of `label`s. - Moving them to the end prevents the screen reader from landing on them before the relevant content. - Making them `div`s instead of `label`s prevents some screen readers (ChromeVox in particular) from landing on the live elements when the live elements are empty. Fixes #127862.
| .instance.semanticsHelper | ||
| .prepareAccessibilityPlaceholder(); | ||
|
|
||
| final DomElement announcementsElement = createDomElement('div'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does it literally need to be <div>? For consistency with other top-level elements it would be good for it to have a custom name, such as <flt-announcement-host>.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, updated per your suggestion and also updated the two live elements and confirmed that things still work fine on ChromeVox on our app.
…ouncements. And resolve some warnings.
yjbanov
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
auto label is removed for flutter/engine, pr: 42432, due to This PR has not met approval requirements for merging. You are not a member of flutter-hackers and need 1 more review(s) in order to merge this PR.
|
ditman
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for de-singletonizing this! Very useful for the upcoming multi-view work!!
|
|
||
| shadowRoot.append(accessibilityPlaceholder); | ||
| shadowRoot.append(_sceneHostElement!); | ||
| shadowRoot.append(announcementsElement); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need announcements on every possible view, or can we have a single global instance?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Where would we put that instance if it's not
flutterViewEmbedder? Would that be a separate singleton object? In other words, would you like this to be re-singleton-ified? If so, then the question in the multi-view work is, what can be used to ensure that the live elements end up at/near the end of the DOM? (That being said placing them at the end might be slightly less critical after the two other fixes in this PR and the last.) - AFAIAA, there's also not a strict issue with having multiple live elements. Each live element is already implemented to support multiple announcements at once.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we can have multiple live elements with no problem, let's go with this, that's why it's LGTM'd :)
(Without wanting to derail this PR: since you said that this needs to be near the end of the DOM, we could put it as the "last child" of the "body" tag. And this wouldn't need to be a re-singletonized: instances would need to either create the DOM object in the DOM if it wasn't there already, or reuse the one created by other instance previously, since all they do is adding some elements to the DOM when asked to announce something.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The challenge is that inserting the live element div at the end of the DOM only works if subsequently initialized DOM elements don't also append themselves to document.body, thereby ending up after the live element. Effectively, you'd still need some view-level abstraction that can be used to append more elements to a view without adding them after the accessibility DOM for reliability.
| .instance.semanticsHelper | ||
| .prepareAccessibilityPlaceholder(); | ||
|
|
||
| final DomElement announcementsElement = createDomElement('ftl-announcement-host'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| final DomElement announcementsElement = createDomElement('ftl-announcement-host'); | |
| final DomElement announcementsElement = createDomElement('flt-announcement-host'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, thanks! I'd used the same convention as accessibility.dart, but I guess that was also a typo originally. Fixed both.
|
(Restarted failing checks, they seemed to be an infra problem) |
|
auto label is removed for flutter/engine, pr: 42432, due to - The status or check suite Linux Web Framework tests has failed. Please fix the issues identified (or deflake) before re-applying this label.
|
|
I've re-run the failing tests twice and they have consistently failed with what looks like infrastructural errors:
Why is this PR showing these errors when some of the other PRs I sampled are not? Most of the others don't trigger "Linux Web Framework tests", but some do trigger "Linux Framework Smoke Tests" which seem to be passing for them. |
|
@marcianx you might be stuck on a bad commit or something. I rebased the PR, let's see if things go green now 🤞 |
… and make them `div`s instead of `label`s. (flutter/engine#42432)
…128142) flutter/engine@c6e9383...b4250ac 2023-06-02 [email protected] Manually roll ANGLE (flutter/engine#42169) 2023-06-02 [email protected] [Impeller] Fix a bugprone-unchecked-optional-access warning in SurfaceMTL (flutter/engine#42518) 2023-06-02 [email protected] [web] Move announcement live elements to the end of the DOM and make them `div`s instead of `label`s. (flutter/engine#42432) 2023-06-02 [email protected] Roll Fuchsia Mac SDK from JQRQ1nH1ILNA--N_b... to gcm-vsCu6IPUZZnN0... (flutter/engine#42515) 2023-06-02 [email protected] Add cpu as drone dimension to mac ios build. (flutter/engine#42514) 2023-06-02 [email protected] Move benchmarks no upload to a test. (flutter/engine#42356) 2023-06-02 [email protected] [Android] Change Linux Android Emulator Tests to run on a device running API 33 (flutter/engine#42492) 2023-06-02 [email protected] Roll Skia from 47b0db43f6a4 to daf2219fec54 (1 revision) (flutter/engine#42513) Also rolling transitive DEPS: fuchsia/sdk/core/mac-amd64 from JQRQ1nH1ILNA to gcm-vsCu6IPU If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-engine-flutter-autoroll Please CC [email protected],[email protected],[email protected] on the revert to ensure that a human is aware of the problem. To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md

divs instead oflabels prevents some screen readers (ChromeVox in particular) from landing on the live elements when the live elements are empty.Fixes flutter/flutter#127862.
Pre-launch Checklist
///).