Repository navigation
fix: keep the external-link description span out of the page's body - #5444
Merged
Merged
Conversation
The hidden "opens in a new tab" description that every external link's aria-describedby names was appended to document.body. Since #5228 body's children are the page's own elements, so the span stood beside main and changed what the page's structural rules (main:last-child, main + *) match. The render gate's apparatus-among-authored probe failed on every corpus page with an external link (github-discoveries, pr-walkthrough, rust-sort and others in scheduled run 41816958231). The span now waits in the chrome root, in the same document, so the link's accessible description is unchanged. A shadow root still holds its own copy. Refs #4225
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.
Every external link's
aria-describedbypoints at one hidden "opens in a new tab" span, anddeclared-words.jsappended that span todocument.body. Since #5228,body's children are the page's own elements (pageDocument()returnsbody), so the span sat besidemainand changed what the page's structural selectors match, such asmain:last-childormain + *. The render gate'sapparatusAmongAuthoredprobe caught this on every corpus page with an external link. In scheduled run 41816958231 it reported<span>, which Leaf adds, stands among the page's own elements inside <body>for github-discoveries, pr-walkthrough, rust-sort and others. The span now lives in the chrome root (chromeRoot, mounted afterbodyin both the live and the export boot paths). It is in the same document, so the link's accessible description doesn't change. Inside a shadow root the span still lives in that root.Verification on Linux:
test_page_fixture_renders[github-discoveries],[pr-walkthrough],[rust-sort]and[alert-review]fromtests/journeys/test_render_gate.py(run with--run-nightly) pass. Without this change, github-discoveries fails with the finding above; the debug output showed the offending element as<span data-lf-gen="1" id="lf-external-description-1" hidden data-lf-runtime>.reader_statechange. Without it these cases also fail withg opened no go-to, which Read the page's controls from the root element in two test readers #5439 owns.test_a_render_of_an_external_links_words_keeps_its_treatmentandtest_an_external_link_says_and_opens_where_it_goespass.pnpm run test:runtime(810) andpnpm run checkpass.One pr-walkthrough run also ended with a teardown error,
ResizeObserver loop completed with undelivered notificationsonversions/v1.html. The same error appears in run 41816958231 before this change, on pr-walkthrough, notification-playground and thread-panel-gallery, so it is a separate cause.Refs #4225 — automated triage