[csswg-drafts] [css-anchor-position-1] position-visibility: anchors-visible should be clear about when is visibility determined (#12732)

emilio has just created a new issue for https://github.com/w3c/csswg-drafts:

== [css-anchor-position-1] position-visibility: anchors-visible should be clear about when is visibility determined ==
https://drafts.csswg.org/css-anchor-position-1/#valdef-position-visibility-anchors-visible says:

> If the box has a [default anchor box](https://drafts.csswg.org/css-anchor-position-1/#default-anchor-box) but that [anchor box](https://drafts.csswg.org/css-anchor-position-1/#anchor-box) is [invisible](https://www.w3.org/TR/css-display-3/#invisible) or [clipped by intervening boxes](https://drafts.csswg.org/css-anchor-position-1/#clipped-by-intervening-boxes), the box’s [visibility](https://drafts.csswg.org/css-display-4/#propdef-visibility) property computes to [force-hidden](https://drafts.csswg.org/css-display-4/#valdef-visibility-force-hidden).

There are multiple problems with that definition:

 * Is the box's `visibility` property really intended to _compute to_ `force-hidden`? There's no test for this, and I think it would make more sense to be a used-value time thing. In fact, at least that's how WebKit implements it (and Blink probably, too, given there's no test for `force-hidden` at all in all of WPT). Computes to would imply that you need to update the style in the whole subtree, because `visibility` is inherited, which seems rather unfortunate. It also has bigger ramifications (affects style container queries and so on...).

 * There's nothing that says _when_ the visibility is checked. I'm assume, given the definition, the idea is that you check it every layout? If so I think that makes an even stronger case for it being used-value time tbh...

I guess the idea is that #10182 allowed you to trigger enter / exit transitions (not clear to me how... I guess transitioning position-visibility + container-queries or something)?

Maybe a more sensible approach is to use the same timing we use to evaluate fallbacks (ResizeObserver timing)?

cc @fantasai @tabatkins @dshin-moz

Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/12732 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Thursday, 4 September 2025 18:37:38 UTC