Repository navigation
[web] Preserve DOM focus on role update and honor isAccessibilityFocusBlocked - #192963
Conversation
…ityFocusBlocked - Preserve active DOM focus across SemanticsObject._updateRole DOM reparenting (Fixes flutter#192792). - Honor SemanticsFlags.isAccessibilityFocusBlocked on leaf and container semantics nodes while preserving LiveRegion announcements (Fixes flutter#191484).
…e tabindex on stopManaging
There was a problem hiding this comment.
Code Review
This pull request introduces support for blocking accessibility focus on semantics nodes by checking isAccessibilityFocusBlocked and updating ARIA attributes, roles, and focusability accordingly. It also preserves active DOM focus when reparenting elements during semantics updates and prevents deactivating text editing on blur events during active semantics updates. The review feedback suggests moving the blocking logic from GenericRole.update to the base class SemanticRole.update() to ensure all specific semantic roles correctly inherit this behavior and are hidden when blocked.
flutter-zl
left a comment
There was a problem hiding this comment.
Both fixes work in the demos. Unblocking loses the label, which needs the one-line fix and a test.
1. A text node loses its label after it is unblocked. In the /#/unblock demo, "Status ready" disappears from the accessibility tree when blocked. It never comes back after unblocking.
I tested it with two demos. Both are the same app on the same local engine, and the only difference is this PR:
https://flutter-demo-68-before.web.app/#/unblock
https://flutter-demo-68-after.web.app/#/unblock
|
Thanks @flutter-zl! Fixed in |
flutter-zl
left a comment
There was a problem hiding this comment.
Thanks for the quick fix! I rebuilt the after demo with e95f13c, and unblocking now works. On https://flutter-demo-68-after.web.app/#/unblock, "Status ready" is hidden while blocked and readable again after unblocking.
|
autosubmit label was removed for flutter/flutter/192963, because - The status or check suite Dashboard Checks has failed. Please fix the issues identified (or deflake) before re-applying this label. |
|
@flutter-zl Pushed a 2-line |
flutter/flutter@e89fd0a...d03768e 2026-10-02 [email protected] Roll Skia from 7b7326917e77 to 9e88bf828078 (8 revisions) (flutter/flutter#193694) 2026-10-02 [email protected] [Widget Preview] Provide descriptive error when widget preview is unconstrained (flutter/flutter#193005) 2026-10-02 [email protected] Roll Dart SDK from 0e7642b85457 to ac1a97aae47d (26 revisions) (flutter/flutter#193692) 2026-10-02 [email protected] Remove unused Fuchsia sysmem header files (flutter/flutter#193244) 2026-10-02 [email protected] [Windows] Preserve composing extent in setEditingState (flutter/flutter#189968) 2026-10-02 [email protected] [docs] Make Border.symmetric docs more explicit about their arguments (flutter/flutter#193222) 2026-10-02 [email protected] [Embedder] Support render texture for vulkan (flutter/flutter#188855) 2026-10-02 [email protected] Updated Remaining Engine Defaults to SDK 37 (flutter/flutter#190429) 2026-10-02 [email protected] Document that enableSuggestions: false can disable keyboard languages on Android (flutter/flutter#192714) 2026-10-02 [email protected] [flutter_tools] Explicitly track host CPU architecture in command result analytics (flutter/flutter#191836) 2026-10-02 [email protected] [web] Preserve DOM focus on role update and honor isAccessibilityFocusBlocked (flutter/flutter#192963) 2026-10-02 [email protected] [flutter_tools] Include base href in web hot reload script paths (flutter/flutter#193678) 2026-10-02 [email protected] [Impeller] Deduplicate GLES render pass state (flutter/flutter#193427) 2026-10-02 [email protected] Roll Skia from f2d68e0b8863 to 7b7326917e77 (16 revisions) (flutter/flutter#193676) 2026-10-01 [email protected] Fix analysis failures due to missing `const` (flutter/flutter#193685) 2026-10-01 [email protected] Removes a11y_assessment app (flutter/flutter#193671) 2026-10-01 [email protected] test: configure Xvfb and openbox for windowing_test (flutter/flutter#193529) 2026-10-01 [email protected] Sync CHANGELOG.md from stable (flutter/flutter#193666) 2026-10-01 [email protected] Avoid using relative path in Process.start (flutter/flutter#193664) 2026-10-01 [email protected] [AGP 9.1.0 Migration #6] Deliver Flutter assets as a generated assets source directory on the app path (flutter/flutter#192488) 2026-10-01 [email protected] ci(bringup): android_java17_build_android_host_app_with_module_aar is green (flutter/flutter#193580) 2026-10-01 [email protected] [flutter_tools] Fix Use dependency graph to determine plugin initialization order (flutter/flutter#191591) 2026-10-01 [email protected] [flutter_tools] Migrate DaemonCommand and Daemon domains to constructor DI (flutter/flutter#193542) If this roll has caused a breakage, revert this CL and set the roller to dry run mode using the controls here: https://autoroll.skia.org/r/flutter-packages Please CC [email protected],[email protected] on the revert to ensure that a human is aware of the problem. To file a bug in Packages: 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
Description
Fixes two web accessibility focus and modal-blocking regressions in
lib/web_ui:#192792): When a focusedSemanticsObjectundergoes a semantic role transition (_updateRole(), e.g., when a button transitions between enabled and disabled states),SemanticsRole.initState()creates a replacement<flt-semantics>DOM element (replacesExistingElement: true) and replaces the old element in the DOM viaparent.replaceChild(...). Previously, replacing a focused<flt-semantics>element caused the browser to dropdocument.activeElementto<body>, breaking screen reader and keyboard focus retention._updateRole()now checks whether the old element helddocument.activeElementbefore disposal and restoreselement.focusWithoutScroll()when the node remains focusable.isAccessibilityFocusBlocked(BlockSemantics/ modal barriers,#191484): WhenSemanticsFlags.isAccessibilityFocusBlockedis true on a node (set byBlockSemantics/ModalBarrierfor nodes behind an active dialog or bottom sheet),SemanticsObjectnow exposesaria-hidden="true"and omitsaria-labelinLabelAndValue.update()when no interactive child nodes exist, preventing screen readers and automated accessibility scanners from reading background nodes behind a modal barrier.Fixes #192792
Fixes #191484
Pre-launch Checklist
///).