-
Notifications
You must be signed in to change notification settings - Fork 6k
[web] use semantic tags for headings (h1, h2, etc), and fix missing secondary roles #53703
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 |
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.
nit: the -> then
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.
Done.
| void addHeadingRole() { | ||
| setAriaRole('heading'); | ||
| } | ||
| DomElement createElement() => createDomElement('h${semanticsObject.headingLevel}'); |
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.
What happens if the headingLevel changes? Does the update automatically create a new element and call this method?
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.
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).
harryterkelsen
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.
LGTM
… missing secondary roles (flutter/engine#53703)
… missing secondary roles (flutter/engine#53703)
…151352) 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
…lutter#151352) 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
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)