RESOLVED CONFIGURATION CHANGED315704
[anchor-position-1] anchor referencing an anchor of the same name does not resolve to the previous one.
https://bugs.webkit.org/show_bug.cgi?id=315704
Summary [anchor-position-1] anchor referencing an anchor of the same name does not re...
Vincent Bernat
Reported 2026-05-27 14:16:05 PDT
Created attachment 479847 [details] Reproducer When using something like this: ``` anchor-name: --note; top: max(anchor(top), calc(anchor(--note bottom, -1em) + 1em)); ``` It looks like anchor(--note) is not resolved to the previous instance. I have attached a simple reproducer where we see containers overlapping while they should stack vertically. It works on Firefox and Chrome and fails with WebKit 2.52.3.
Attachments
Reproducer (1.92 KB, text/html)
2026-05-27 14:16 PDT, Vincent Bernat
no flags
rendering in safari, firefox, chrome (245.60 KB, image/png)
2026-06-03 01:30 PDT, Karl Dubost
no flags
Vincent Bernat
Comment 1 2026-05-30 06:25:20 PDT
Karl Dubost
Comment 2 2026-06-03 01:30:57 PDT
Created attachment 479968 [details] rendering in safari, firefox, chrome Thanks for the report. The test https://wpt.live/css/css-anchor-position/anchor-function-chain.html passes for me in Safari Technology Preview Release 244 (WebKit 22625.1.17.19.1) https://developer.apple.com/safari/technology-preview/ It says so on https://wpt.fyi/results/css/css-anchor-position/anchor-function-chain.html?label=experimental&label=master&aligned on macOS I do not reproduce, was it on a specific platform?
Radar WebKit Bug Importer
Comment 3 2026-06-03 14:17:10 PDT
Kiet Ho
Comment 4 2026-06-03 14:48:55 PDT
Hello, thank you for the report. What's happening here I think is the second .note anchors to the first .note, but the second .note fails to resolve the first .note. I fixed some of these anchor position creating a dependency chain in: bug 301919, bug 311365. These fixes should be included in latest Safari Technology Preview and macOS 26.5, can you give them a try to see if the bug still reproduces?
Vincent Bernat
Comment 5 2026-06-03 22:53:41 PDT
I am testing on Linux, with WebkitGTK. I just tested with 2.52.4 and the bug is still present. I can try 2.53.3. I'll also ask a colleague to test on macOS 26.5.
Vincent Bernat
Comment 6 2026-06-05 11:21:08 PDT
I can confirm this is fixed on macOS 26.5. It's also fixed on WebKitGTK 2.53.3. Thanks!
Kiet Ho
Comment 7 2026-06-05 11:22:53 PDT
Thank you, I'll close this as configuration changed then.
Note You need to log in before you can comment on or make changes to this bug.