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.
The bug in the Chromium implementation: https://bugs.chromium.org/p/chromium/issues/detail?id=1459293
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
<rdar://problem/111854670>