Repository navigation
fix: keep main's heading from naming every unnamed element on the page - #5506
Merged
Merged
Conversation
An element with no name of its own takes the nearest enclosing element's name, short of the document it stands in (`addressableLabel`). #5228 widened that document, `authoredScope`, from `main` to `body`, so the climb now asks `main` itself, and a page whose `main` leads with its `<h1>` lent that title to every unnamed figure, list, div and draft: the `s` hints, the chosen-target announcement and a draft's edit label all read the page title. The climb now also stops at `main`, the page's column, as it did before #5228. Content beside `main` still climbs to `body`. Behavior restored: an unnamed element is named by its own words or a nearer holder, never by the page's title. Refs #5475
This was referenced Nov 5, 2026
Closed
leaf-agent
added a commit
that referenced
this pull request
Nov 7, 2026
`test_design_mode_reads_each_shape_of_control_into_the_anchor_its_routes_carry` has failed on main since #5506. Its "a control's name is its own" subtest asserts that a field's design label carries no neighbouring control's words. The `spoken` section had no heading, so the label's `section:` context came from `main`'s leading `<h1>Settings</h1>`, the climb #5506 deliberately stopped. Since then the unnamed section is named by its own words, `Find settings ×`, and the close button's `×` reaches the field's label through the section's name, not the field's. The test this case came from (`test_design_spoken_context_does_not_borrow_a_neighbours_face`, added in b91b966) gave the section its own `<h2>`. #5409 dropped it when it merged the case into `CONTROL_SHAPES`, and the subtest kept passing only because of the #5228 bug that #5506 fixed. This restores a heading on the section, so the assertion is again about the control's own label, and #5506's naming stays as it is. No product behavior changes, and `CONTROL_SHAPES` has no other reader. **Verification.** The test fails on main `bdc4c03b0` with the issue's message and passes with this change (35 subtests). The issue's second test, `test_render_gate.py::test_scrollbar_clearance_reads_generic_content_and_open_shadow_words`, already passes on `bdc4c03b0` with no change here. That fits #5662, which stopped the resting comment box from standing beside a target that ends short of the column's edge, so the box's `aria-label` no longer collides with the `First choice` role query. `test_an_expanded_diff_file_can_retry_its_failed_chunk_in_place` stays with #5641. Closes #5645 — automated triage Co-authored-by: leaf-agent <[email protected]>
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.
Since #5228, a page whose
mainleads with an<h1>lends that title to every element on the page with no name of its own. Theshints announcediv: Splitfor a wrapper whose words are its two paragraphs, a chosen list is announced by the page title, and a draft's edit button readsEdit “Draft source”instead ofEdit the draft. This restores the pre-#5228 naming.Cause.
addressableLabel(browser/runtime/addressable-names.js) names an unnamed element by the nearest enclosing name, climbing "short of the document it stands in (the page's column, or a message's body)". The climb stops atauthoredScope, which #5228 widened frommaintobodyso content besidemainbelongs to the page. That moved the stop one level up, so the climb now asksmainitself, andmain's leading heading is the page's title.Change. The climb also stops at
main, the direct child ofbody. Content besidemain, such as a site header, still climbs tobody, and a message body is unaffected. The Python side (gesture_words.element_name) doesn't climb, so it needs no change.Tests. These failed on main and pass with the change:
tests/browser/test_render_semantic_selection.py::test_a_boxless_target_is_read_where_it_paintstests/browser/test_render_semantic_selection.py::test_dense_selection_hints_stay_short_and_reach_an_atomic_visualtests/browser/test_render_pages.py::test_ship_review_summary_is_addressable_and_baseline_alignedtests/browser/drafts/test_draft_editing.py::test_a_draft_uses_shared_editing_and_saves_exact_markdown_sourceA new case in
tests/runtime/addressable-name.test.mjsputs a leading<h1>inmainand asserts that it names nothingmainholds. It fails without the fix and passes with it.#5475 lists twelve tests broken by #5228. Together with #5505 (merged, two tests) and the aim test update, this leaves five still under diagnosis there.
Refs #5475 — automated triage