Skip to content

WebKit export of https://bugs.webkit.org/show_bug.cgi?id=321874 - #64173

Open
annevk wants to merge 1 commit into
web-platform-tests:masterfrom
annevk:wpt-export-for-webkit-321874
Open

annevk wants to merge 1 commit into
web-platform-tests:masterfrom
annevk:wpt-export-for-webkit-321874

Conversation

@annevk

@annevk annevk commented Oct 25, 2026

Copy link
Copy Markdown
Member

WebKit export from bug: Accessible name of a display: contents element includes text from its siblings

Accessible name of a display: contents element includes text from its siblings

Name from contents walks the element's children by taking its first child and then repeatedly the next
sibling. A display: contents element has no box for its children to hang off, so the object after its last
child is one of the element's own siblings, and the walk carries on into it. The check meant to stop this only
did so when the next object had a display: contents parent of its own that differed, which the siblings do
not have, so nothing stopped it. Ask instead whether the next object is still a child of the element we
started from.

Chrome and Firefox name all of the cases in the test "x". Whether the leak was visible depended on what
followed in the markup, which is why the div at line 66 of
css/css-display/accessibility/display-contents-role-and-label.html reported "x x x x" while the same shape
with the link role a hundred lines later reported "x": the latter is followed by a display: contents list
whose item did trip the old check, and the two objects it had already walked into were whitespace only.

WebKit-Bug: https://bugs.webkit.org/show_bug.cgi?id=321874
WebKit-Canonical-Link: https://commits.webkit.org/319287@main

… siblings

Name from contents walks the element's children by taking its first child and then repeatedly the next
sibling. A display: contents element has no box for its children to hang off, so the object after its last
child is one of the element's own siblings, and the walk carries on into it. The check meant to stop this only
did so when the next object had a display: contents parent of its own that differed, which the siblings do
not have, so nothing stopped it. Ask instead whether the next object is still a child of the element we
started from.

Chrome and Firefox name all of the cases in the test "x". Whether the leak was visible depended on what
followed in the markup, which is why the div at line 66 of
css/css-display/accessibility/display-contents-role-and-label.html reported "x x x x" while the same shape
with the link role a hundred lines later reported "x": the latter is followed by a display: contents list
whose item did trip the old check, and the two objects it had already walked into were whitespace only.

WebKit-Bug: https://bugs.webkit.org/show_bug.cgi?id=321874
WebKit-Canonical-Link: https://commits.webkit.org/319287@main

@wpt-pr-bot wpt-pr-bot left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The review process for this patch is being conducted in the WebKit project.

@annevk
annevk enabled auto-merge (rebase) October 25, 2026 08:54

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants