Bug 263081
Summary: | [popover] element within complex shadow DOM breaks light dismiss calculation | ||
---|---|---|---|
Product: | WebKit | Reporter: | Westbrook <westbrook.johnson> |
Component: | DOM | Assignee: | Luke Warlow <lwarlow> |
Status: | RESOLVED FIXED | ||
Severity: | Normal | CC: | karlcow, lwarlow, ntim, stearns, webkit-bug-importer |
Priority: | P2 | Keywords: | BrowserCompat, InRadar |
Version: | Safari 17 | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
URL: | https://codepen.io/Westbrook/pen/JjwVYmr | ||
See Also: | https://github.com/web-platform-tests/wpt/pull/42651 | ||
Bug Depends on: | |||
Bug Blocks: | 148695, 250171 |
Westbrook
This issue is closely related to https://bugs.webkit.org/show_bug.cgi?id=259261 in that I would have expected the flattened tree calculation added there to have prevented this, but here again, we see the light dismiss calculation for a `[popover="auto"]` element going awry.
As seen in https://codepen.io/Westbrook/pen/JjwVYmr Safari 17 and TP both overreach and close the root popover erroneously when opening the child popover.
Steps:
1) Visit https://codepen.io/Westbrook/pen/JjwVYmr
2) Click the "Show" button.
3) See the "outer" [popover] element open at the center of the page.
4) Click the "Show" button within the initial [popover] element.
5) See the "outer" [popover] element closed due to the light dismiss calculation, preventing the "inner" [popover] element from becoming visible.
If you run the same steps in Chrome, you'll see the "inner" [popover] open over the "outer" [popover] as expected.
Attachments | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
Karl Dubost
Firefox Nightly Not working
(after setting dom.element.popover.enabled to true in about:config)
In Safari the second nested showPopover() fails silently.
In chrome we can see it.
Westbrook
It seems that the DSD flag was maybe removed from Firefox nightly, but that feature was only leveraged for simplicity, it wasn't part of the larger issue. This demo exemplifies the issue with imperative Shadow DOM: https://codepen.io/Westbrook/pen/jOXooPB?editors=1010
Radar WebKit Bug Importer
<rdar://problem/117214343>
Tim Nguyen (:ntim)
Here's another place that needs to use the flat tree: https://searchfox.org/wubkat/rev/c64f97a4afc2aa3f73f74f59630410234ca8a659/Source/WebCore/html/HTMLElement.cpp#1286
Luke Warlow
I'm happy to take a look at this. I've got a WPT that covers it so shouldn't take long.
Luke Warlow
Pull request: https://github.com/WebKit/WebKit/pull/19314
EWS
Committed 269596@main (4ab4d8351529): <https://commits.webkit.org/269596@main>
Reviewed commits have been landed. Closing PR #19314 and removing active labels.