Bug 1825055 [wpt PR 39247] - Add support for allowing elements with display:contents...
commitff7a80ae4c8817e3346d085cb3e8fbea12e65761
authorL. David Baron <dbaron@chromium.org>
Sat, 27 Jan 2024 18:00:54 +0000 (27 18:00 +0000)
committermoz-wptsync-bot <wptsync@mozilla.com>
Sun, 28 Jan 2024 09:59:39 +0000 (28 09:59 +0000)
treee8ae9a772e43f7643ca57e0df59849e002098d32
parent0e99fd5158de2e91a303fb6c58c9d3a79bd9692d
Bug 1825055 [wpt PR 39247] - Add support for allowing elements with display:contents to be focused., a=testonly

Automatic update from web-platform-tests
Add support for allowing elements with display:contents to be focused.

Chromestatus: https://chromestatus.com/feature/6237396851228672

This lands support for allowing elements with display:contents to be
focused, behind a feature flag that is created with status:experimental.

This is as concluded (though without a group resolution) in
https://github.com/w3c/csswg-drafts/issues/2632 and as discussed a bit
in https://github.com/whatwg/html/issues/1837 and proposed in
https://github.com/whatwg/html/pull/9425 .  Note that this diverges from
Gecko (see https://bugzil.la/1553549, https://bugzil.la/1791648, and
https://github.com/mozilla/standards-positions/issues/772) and WebKit
(see https://bugs.webkit.org/show_bug.cgi?id=255149 and
https://github.com/WebKit/standards-positions/issues/164).

This makes the <slot> element focusable when it has a tabindex.  Note
that this does not match Gecko and WebKit, which also require that its
'display' value is changed (away from 'contents') to make it focusable.

Note that the <slot> element is still not tabbable in Chrome; this is
https://crbug.com/1428419.  This also does not match Gecko and WebKit,
where it is tabbable whenever it is focusable.  The added test
slot-element-tabbable.tentative.html fails both tests as a result, but
is added anyway.  (Gecko and WebKit pass the display: block test but
fail the default style (display: contents) test.)

The added tests display-contents-focusable-001.html and
slot-element-focusable.tentative.html are partly fixed by this change,
but the style part is still broken due to https://crbug.com/1428420.

Bug: 1366037
Bug: 14284191428420
Change-Id: I46a8ad3b6442ce07f440c8f6a07210bac305600e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3910374
Reviewed-by: Mason Freed <masonf@chromium.org>
Commit-Queue: David Baron <dbaron@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1252245}

--

wpt-commits: 83ac63c35c3c699dab5c8ec3b60377f52f59ca11
wpt-pr: 39247
testing/web-platform/tests/css/css-display/display-contents-focusable-001.html [new file with mode: 0644]
testing/web-platform/tests/html/rendering/non-replaced-elements/flow-content-0/slot-element-focusable.tentative.html [new file with mode: 0644]
testing/web-platform/tests/html/rendering/non-replaced-elements/flow-content-0/slot-element-tabbable.tentative.html [new file with mode: 0644]
testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/canvas-descendants-focusability-003.tentative.html