When a [popover] element that is a descendant of an open [popover] element exists within a shadow DOM, the topmost clicked [popover] element (https://html.spec.whatwg.org/multipage/popover.html#topmost-clicked-popover) calculation is no done with the composed path which causes the descendant [popover] element to close the ancestor [popover] element at open time. You can repro this here: https://codepen.io/Westbrook/pen/BaGrdoq With the following code: <button popovertarget="popover" popovertargetaction="toggle">Toggle</button> <div id="popover" popover> <template shadowrootmode="open"> Outter <button popovertarget="popover-2" popovertargetaction="toggle">Toggle</button> <div id="popover-2" popover> Inner </div> </template> </div>
https://searchfox.org/wubkat/rev/3ae98fa2c02b272e3e55c4e0c324d01da17cb5dc/Source/WebCore/dom/Document.cpp#8903 should probably iterate using `parentElementInComposedTree()`.
<rdar://problem/112410375>
Pull request: https://github.com/WebKit/WebKit/pull/16234
Submitted web-platform-tests pull request: https://github.com/web-platform-tests/wpt/pull/41251
Committed 266457@main (9336846dfe3b): <https://commits.webkit.org/266457@main> Reviewed commits have been landed. Closing PR #16234 and removing active labels.
@ntim Tim, I noticed the result of the introduced test at https://wpt.fyi/results/html/semantics/popovers/popover-light-dismiss-flat-tree.html?label=master&label=experimental&aligned. Gecko has the same error report too (with popover enabled). Any idea?