Bug 307171

Summary: Anchor positioning: abspos elements can anchor to viewport-fixedpos elements
Product: WebKit Reporter: David Shin <dshin>
Component: Layout and RenderingAssignee: fantasai <fantasai.bugs>
Status: RESOLVED FIXED    
Severity: Normal CC: bfulgham, fantasai.bugs, kiet.ho, simon.fraser, webkit-bug-importer, zalan
Priority: P2 Keywords: InRadar
Version: Safari Technology Preview   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 291856    
Attachments:
Description Flags
Minimum Reproducible Case none

David Shin
Reported 2026-02-06 08:51:41 PST
Created attachment 478269 [details] Minimum Reproducible Case (Discovered from Firefox bug: https://bugzilla.mozilla.org/show_bug.cgi?id=2014997) Given that: 1. The initial fixed containing block is the parent of the initial containing block in the containing block chain [1], 2. Absolute containing block can have at most the initial containing block as its absolute containing block, 3. And an acceptable anchor should be strictly laid out before the positioned element [2], Strictly spec-wise, fixed elements (Using the initial fixed containing block) should not be a valid anchor for an absolute positioned element in the testcase. Perhaps relatedly - the positioned element doesn't seem to be properly scroll (un?)compensated. [1] https://drafts.csswg.org/css-position-3/#def-cb [2] https://drafts.csswg.org/css-anchor-position-1/#acceptable-anchor-element
Attachments
Minimum Reproducible Case (406 bytes, text/html)
2026-02-06 08:51 PST, David Shin
no flags
Radar WebKit Bug Importer
Comment 1 2026-02-13 08:52:10 PST
pascoe@apple.com
Comment 2 2026-03-12 11:08:50 PDT
David Shin
Comment 3 2026-03-12 11:12:01 PDT
There's a proposed spec change to in fact get rid of the special fixed ICB, which would allow this behaviour: https://github.com/w3c/csswg-drafts/issues/13468
fantasai
Comment 4 2026-06-01 16:31:50 PDT
EWS
Comment 5 2026-06-06 12:54:25 PDT
Committed 314706@main (fe7bcd9ee8c2): <https://commits.webkit.org/314706@main> Reviewed commits have been landed. Closing PR #66208 and removing active labels.
Note You need to log in before you can comment on or make changes to this bug.