You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[css-anchor-position-1] "determine position fallback styles" algorithm doesn't consider not using an option #12890
Assert: The previous step finished without finding a position option that avoids overflow.
Return current styles.
It appears that the algorithm forgets to consider the case when no option is used?
For example, consider a box with three position options:
Initially, the box doesn't overflow with the original style, so no position option is applied
Then, something happened (style changes or scrolling) that makes the box overflow, so it tried the position option and option 2 works.
Later on, some other thing happened that makes the box overflow. If following the algorithm above, it'd only consider option 1/2/3 and not the original style, even though the original style could've worked.
From my experimentation, the following order seems to pass most (maybe all?) WPT tests:
Try the last successful position option first
Then try the original style without option
Then try the options in the position option list except the last successful position option.
Yes, the base styles are meant to be part of the list. I suspect the current wording mistake is a leftover from when that temporarily wasn't the case (at some earlier point, if you used position-try at all, you just didn't set any relevant base styles at all; the position-try-options list gave all the possibilities).
Activity
fantasai commentedon Oct 2, 2025
I think we should define the "position options list" as including the original style. That it doesn't is really confusing, actually.
tabatkins commentedon Nov 5, 2025
Yes, the base styles are meant to be part of the list. I suspect the current wording mistake is a leftover from when that temporarily wasn't the case (at some earlier point, if you used position-try at all, you just didn't set any relevant base styles at all; the
position-try-optionslist gave all the possibilities).[css-anchor-position-1] Put the element's base styles in as the first…