Bug 259261
Summary: | [popover] element within shadow DOM breaks light dismiss calculation | ||
---|---|---|---|
Product: | WebKit | Reporter: | Westbrook <westbrook.johnson> |
Component: | DOM | Assignee: | Tim Nguyen (:ntim) <ntim> |
Status: | RESOLVED FIXED | ||
Severity: | Normal | CC: | cdumez, ntim, rniwa, webkit-bug-importer, zsun |
Priority: | P2 | Keywords: | InRadar |
Version: | Safari Technology Preview | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
See Also: | https://github.com/web-platform-tests/wpt/pull/41251 | ||
Bug Depends on: | |||
Bug Blocks: | 148695, 250171 |
Westbrook
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>
Attachments | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
Tim Nguyen (:ntim)
https://searchfox.org/wubkat/rev/3ae98fa2c02b272e3e55c4e0c324d01da17cb5dc/Source/WebCore/dom/Document.cpp#8903
should probably iterate using `parentElementInComposedTree()`.
Radar WebKit Bug Importer
<rdar://problem/112410375>
Tim Nguyen (:ntim)
Pull request: https://github.com/WebKit/WebKit/pull/16234
Tim Nguyen (:ntim)
Submitted web-platform-tests pull request: https://github.com/web-platform-tests/wpt/pull/41251
EWS
Committed 266457@main (9336846dfe3b): <https://commits.webkit.org/266457@main>
Reviewed commits have been landed. Closing PR #16234 and removing active labels.
zsun
@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?