Infinity fallback value in anchor() crashes the tab
Categories
(Core :: CSS Parsing and Computation, defect)
Tracking
()
People
(Reporter: nchevobbe, Assigned: dshin)
References
(Blocks 1 open bug)
Details
(Whiteboard: [anchorpositioning:m2], [wptsync upstream])
Crash Data
Attachments
(2 files)
(From https://mastodon.social/@Meyerweb/115489174135492911)
Steps to reproduce
- Open attached document
Actual results
The page crashes
Here's the CSS
.anchor {
anchor-name: --infobox;
}
.positionedElement {
position: absolute;
position-anchor: --infobox;
left: calc(anchor(top, Infinity) + 10px);
}
Comment 1•5 months ago
|
||
It turns out this happens with more than just Infinity. For example, I tested the above but changed line 11 to read:
left: calc(anchor(top, 0) + 10px);
Once more tab still crashed. However, with this change to line 11:
left: calc(anchor(top, 1px) + 10px);
…the tab did not crash. In a limited test of other non-zero length values, I was unable to get another crash. Indeed, even this was rendered without any issue:
left: calc(anchor(top, calc(1em - 1em)) + 10px);
Comment 2•5 months ago
|
||
Just a bit more info: I tried this for line 11, and got a crash:
left: calc(anchor(top, calc(0)) + 10px);
When I added a unit, the crash went away:
left: calc(anchor(top, calc(0px)) + 10px);
I could even change the unit to em or q and still avoid the crash. Fascinating!
Comment 3•5 months ago
|
||
Okay, last one, I swear. This also avoided a crash:
left: anchor(top, 0px);
So the problem is maybe due to a unitless value in the fallback?
| Assignee | ||
Updated•5 months ago
|
| Assignee | ||
Comment 4•5 months ago
|
||
Updated•5 months ago
|
Updated•5 months ago
|
Comment 7•5 months ago
|
||
| bugherder | ||
Updated•5 months ago
|
Updated•5 months ago
|
Comment 10•5 months ago
|
||
Reproducible on a 2025-11-04 Firefox Nightly build on Windows 10.
Verified as fixed on Firefox Nightly 147.0a1 and Firefox 146.02 on Windows 10, Ubuntu 22, macOS 15.
Comment 12•5 months ago
|
||
Copying crash signatures from duplicate bugs.
Description
•