Repository navigation
fix: make the chrome's foreground layer a plain div instead of a dialog - #5360
Merged
Merged
Conversation
The foreground held the panel, hints and chrome dialogs in an open nonmodal <dialog>. ARIA in HTML permits a dialog no generic role, and a focusable element's role="presentation" is ignored, so the layer was exposed as an unnamed dialog around the panel. Nothing still relied on it being a dialog: the native layers opened inside it stand in the top layer whatever holds them, and the modal posture it once took is gone. A div is generic natively. It keeps tabindex="-1": no Tab stop (the Firefox stop #5039 removed stays gone), and a press between the panel's controls still focuses the layer. The rules that undid the browser's dialog face go with the dialog.
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
The chrome's foreground layer (it holds the floating panel, hint layers and the chrome's own dialogs) is now a plain
divwithtabindex="-1". Before, it was an open nonmodal<dialog>. #5336 gave that dialogrole="generic"so Chrome would stop exposing it as an unnamed dialog around the panel, but ARIA in HTML permits no such role ondialog, as max-sixty pointed out on #5336. Adivis generic natively, so it needs no role.Nothing still needed the element to be a dialog:
show/showModal/closeon the layer. Its old modal posture (Unify clock presentation and native panel ownership #2006) is gone.closest("dialog, [popover]")reader (focus.js,leftClosedLayer) gets the same answer, since an open dialog there already counted as "still standing".tabindex="-1"stays, so Tab order and focus are unchanged. The layer has no Tab stop, so the Firefox stop removed in #5039 stays gone. A press between the panel's controls still focuses the layer instead of dropping focus to the body. Paint order doesn't change: the layer keeps its place in the chrome and itsposition: absolutebox at the origin. The CSS that cancelled the browser's dialog styling (border, padding, max size, background) goes with the dialog. A stale comment inleaf.jsabout the hints' "native modal ancestor" goes too.Verification, on current main:
test_borrowed_scroll_stops_leave_code_selection_and_marks_with_their_owners: all three cases pass. It fails when the layer is exposed as a dialog.tests/browser/controls/test_focus.pypasses, including the Tab-order test in Chromium and Firefox. So doestests/browser/widgets/test_code_and_documents.py, which includes the zero-dialog check.pnpm run test:runtimeandpnpm run checkpass.Refs #5126 and #5336.