Bug 299742

Summary: [css-anchor-position-1] Style resolution repeats indefinitely when position-try box is in a display: none tree
Product: WebKit Reporter: davidm
Component: CSSAssignee: Kiet Ho <kiet.ho>
Status: RESOLVED FIXED    
Severity: Major CC: davidm, kiet.ho, koivisto, me, ntim, simon.fraser, webkit-bug-importer, zalan
Priority: P2 Keywords: InRadar
Version: Safari 26   
Hardware: All   
OS: iOS 26   
See Also: https://github.com/web-platform-tests/wpt/pull/55738
Attachments:
Description Flags
Minimal Case to trigger the popover crash none

davidm
Reported 2025-09-29 07:24:13 PDT
Created attachment 476893 [details] Minimal Case to trigger the popover crash When using `position-try-fallbacks` on a popover element if the container of the popover is to become hidden via `display: none` (even if the popover is not currently visible) the browser tab will hang, and cause a spike in CPU usage. On iOS this causes the device to become hot if the tab is left open. Note if the popover container's initial state is set to `display: none` then there is no issue. It only happens if the container later becomes `display: none`. Minimal reproduction case is attached This affects existing websites, that have been using popovers with fallbacks before Safari 26.
Attachments
Minimal Case to trigger the popover crash (748 bytes, text/html)
2025-09-29 07:24 PDT, davidm
no flags
Alexey Proskuryakov
Comment 1 2025-09-29 08:07:49 PDT
Thank you for the report, I can reproduce. Looks like updateStyleIfNeeded() is calling Style::TreeResolver::resolve() in a tight loop.
Radar WebKit Bug Importer
Comment 2 2025-09-29 08:08:47 PDT
Kiet Ho
Comment 3 2025-10-23 18:22:51 PDT
Perhaps dupe of bug 301310
Kiet Ho
Comment 4 2025-10-24 05:14:20 PDT
EWS
Comment 5 2025-10-28 12:38:07 PDT
Committed 302254@main (2826fcdebc5b): <https://commits.webkit.org/302254@main> Reviewed commits have been landed. Closing PR #52953 and removing active labels.
Kiet Ho
Comment 6 2025-10-28 14:36:24 PDT
Submitted web-platform-tests pull request: https://github.com/web-platform-tests/wpt/pull/55738
Daniel J
Comment 7 2025-11-12 23:26:10 PST
Still broken in Safari 26.1 (Mac OS) - has this been released?
Note You need to log in before you can comment on or make changes to this bug.