Skip to content

Commit

Permalink
Bug 1825055 [wpt PR 39247] - Add support for allowing elements with d…
Browse files Browse the repository at this point in the history
…isplay: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
w3c/csswg-drafts#2632 and as discussed a bit
in whatwg/html#1837 and proposed in
whatwg/html#9425 .  Note that this diverges from
Gecko (see https://bugzil.la/1553549, https://bugzil.la/1791648, and
mozilla/standards-positions#772) and WebKit
(see https://bugs.webkit.org/show_bug.cgi?id=255149 and
WebKit/standards-positions#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: 1428419, 1428420
Change-Id: I46a8ad3b6442ce07f440c8f6a07210bac305600e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3910374
Reviewed-by: Mason Freed <masonfchromium.org>
Commit-Queue: David Baron <dbaronchromium.org>
Cr-Commit-Position: refs/heads/main{#1252245}

--

wpt-commits: 83ac63c35c3c699dab5c8ec3b60377f52f59ca11
wpt-pr: 39247

UltraBlame original commit: 750cbf39a61f63ccdf2d1384fdf9c8ef8e7c98ec
  • Loading branch information
marco-c committed Feb 1, 2024
1 parent faf238c commit 1806ff8
Show file tree
Hide file tree
Showing 4 changed files with 1,792 additions and 6 deletions.
Loading

0 comments on commit 1806ff8

Please sign in to comment.