Bug 258682
Summary: | Broken autofocus with popover custom element | ||
---|---|---|---|
Product: | WebKit | Reporter: | Jeroen Zwartepoorte <jeroen.zwartepoorte> |
Component: | Layout and Rendering | Assignee: | Nobody <webkit-unassigned> |
Status: | NEW | ||
Severity: | Normal | CC: | bfulgham, ntim, rbuis, rniwa, simon.fraser, webkit-bug-importer, zalan |
Priority: | P2 | Keywords: | InRadar |
Version: | Safari Technology Preview | ||
Hardware: | Unspecified | ||
OS: | Unspecified |
Jeroen Zwartepoorte
https://codepen.io/jpzwarte/pen/abQJgeo
The above codepen has 4 examples of popover usage:
1. <div popover> with <button autofocus> inside it
2. <dialog popover> with <button autofocus> inside it
3. <x-popover> custom element with delegatesFocus: true and <button autofocus> in the shadow root
4. <x-popover> custom element with delegatesFocus: true and <button autofocus> slotted
1, 2 and 4 work fine in STP 173 (4 is broken in Chrome 114 and Chrome Dev 116)
3 is broken in STP 173 (works fine in Chrome).
I expect the <button> in <x-popover> to have focus when the popover is displayed. It hasn't.
It is unclear what does have focus though. The original <button popovertarget> button is not it.
Attachments | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
Jeroen Zwartepoorte
The bug in the Chromium implementation: https://bugs.chromium.org/p/chromium/issues/detail?id=1459293
Rob Buis
I am not sure the expectation that the focus enters the shadow tree is correct. The WPT test for it does not currently expect that:
https://github.com/web-platform-tests/wpt/blob/92454230c3/html/semantics/popovers/popover-shadowhost-focus.html
Radar WebKit Bug Importer
<rdar://problem/111854670>