This repository was archived by the owner on Feb 25, 2025. It is now read-only.
[web] use semantic tags for headings (h1, h2, etc), and fix missing secondary roles#53703
Merged
auto-submit[bot] merged 3 commits intoflutter:mainfrom Jul 5, 2024
Merged
Conversation
| /// | ||
| /// Normally, heading elements are not focusable as they do not receive | ||
| /// keyboard input. However, when a route is pushed (e.g. a dialog pops up), | ||
| /// the it may be desirable to move the screen reader focus to the heading |
| void addHeadingRole() { | ||
| setAriaRole('heading'); | ||
| } | ||
| DomElement createElement() => createDomElement('h${semanticsObject.headingLevel}'); |
Contributor
There was a problem hiding this comment.
What happens if the headingLevel changes? Does the update automatically create a new element and call this method?
Contributor
Author
There was a problem hiding this comment.
Heading level should not change. It confuses screen readers. Web crawlers snapshot the heading at its default value too, so changing has no effect either. We could issue a warning, but I'd rather such warnings are issued by the framework, and the engine will just do a graceful degradation of functionality (in this case the heading level stays the same forever).
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/flutter
that referenced
this pull request
Jul 5, 2024
…issing secondary roles (flutter/engine#53703)
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/flutter
that referenced
this pull request
Jul 5, 2024
…issing secondary roles (flutter/engine#53703)
auto-submit bot
pushed a commit
to flutter/flutter
that referenced
this pull request
Jul 5, 2024
flutter/engine@4ee09d3...e6b0969 2024-07-05 [email protected] Roll Skia from 4a27ce0f92d4 to 172eb4ee4cb3 (1 revision) (flutter/engine#53740) 2024-07-05 [email protected] [web] use semantic tags for headings (h1, h2, etc), and fix missing secondary roles (flutter/engine#53703) 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://issues.skia.org/issues/new?component=1389291&template=1850622 Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
victorsanni
pushed a commit
to victorsanni/flutter
that referenced
this pull request
Jul 8, 2024
…1352) flutter/engine@4ee09d3...e6b0969 2024-07-05 [email protected] Roll Skia from 4a27ce0f92d4 to 172eb4ee4cb3 (1 revision) (flutter/engine#53740) 2024-07-05 [email protected] [web] use semantic tags for headings (h1, h2, etc), and fix missing secondary roles (flutter/engine#53703) 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://issues.skia.org/issues/new?component=1389291&template=1850622 Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Switch to using semantic heading tags (h1, h2, etc).
Fix missing secondary roles: focus, live region, route name, and label.
Improves indexability (flutter/flutter#46789)