Bug 304551

Summary: CSS anchor positioning with a fixed-positioned anchored element works incorrectly in the top layer
Product: WebKit Reporter: Pavel Pomerantsev <pomerantsevp>
Component: Layout and RenderingAssignee: Nobody <webkit-unassigned>
Status: NEW    
Severity: Normal CC: bfulgham, fantasai.bugs, karlcow, kiet.ho, simon.fraser, webkit-bug-importer, zalan
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Mac (Apple Silicon)   
OS: macOS 26   
Attachments:
Description Flags
Chrome (correct) and Safari (incorrect) layouts side by side none

Pavel Pomerantsev
Reported 2025-12-20 11:26:42 PST
Created attachment 477806 [details] Chrome (correct) and Safari (incorrect) layouts side by side An element is positioned incorrectly if all of the following are true: * It's anchor-positioned (has a `position-anchor` set to an existing element). * It has `position: fixed`. * Both the element and its anchor are in the top layer. See example with a modal dialog and a fullscreen element (both examples of top layer usage): https://codepen.io/pavelp/pen/ByzBKrE Compare layout in latest Chrome (appears to be correct) vs latest Safari TP (appears incorrect). Note: this may or may not be a duplicate of https://bugs.webkit.org/show_bug.cgi?id=289743. Top layer is mentioned there, but it looks like currently all the top-layer tests in https://wpt.fyi/results/css/css-anchor-position?label=experimental&label=master&aligned are passing in Safari TP, so this might be a case for which a web platform test doesn't exist yet.
Attachments
Chrome (correct) and Safari (incorrect) layouts side by side (410.18 KB, image/png)
2025-12-20 11:26 PST, Pavel Pomerantsev
no flags
Radar WebKit Bug Importer
Comment 1 2025-12-27 11:27:12 PST
Note You need to log in before you can comment on or make changes to this bug.