Bug 258682

Summary: Broken autofocus with popover custom element
Product: WebKit Reporter: Jeroen Zwartepoorte <jeroen.zwartepoorte>
Component: Layout and RenderingAssignee: 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
Reported 2023-06-29 09:49:37 PDT
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
Jeroen Zwartepoorte
Comment 1 2023-06-29 10:04:57 PDT
Rob Buis
Comment 2 2023-06-30 08:53:11 PDT
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
Comment 3 2023-07-06 09:50:18 PDT
Note You need to log in before you can comment on or make changes to this bug.