[csswg-drafts] [css-anchor-position-1] Using a specific box (not your CB) to determine position-fallback (#8724)

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

== [css-anchor-position-1] Using a specific box (not your CB) to determine position-fallback ==
@una brought this case to our attention today: if you use abspos+anchor() to position an element, position fallback uses the abspos containing block (the nearest relpos ancestor) to tell if the positioned element is overflowing and should try a different position. But if you use fixpos or popover, which are *otherwise* strictly more powerful for anchor() purposes, you lose this ability - the CB is now the ICB, and you can't reference anything else.

The problem here is, partially, that the inset properties perform double duty - they adjust the size of the inset-modified containing block *and* position/size the element within the IMCB. Anchoring needs to use them for the latter, but position fallback still needs the former as well.

I suggest that we add a property allowing you to specify a particular anchor to use as your position-fallback overflow bounds, rather than your normal CB. Maybe:

```
position-fallback-bounds: normal | <<dashed-ident>>;
```

`normal` means to use your positioning CB, as specified today. Giving a dashed-ident performs anchor selection (same as what's required for `anchor()`), and uses the resulting element instead.

(In theory one might want to use different elements for each side, or slightly adjust the bounds inward or outward from the bounding element's edge. This grammar is extensible in the future to a four-edge version, if we'd like.)

/cc @xiaochengh 

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


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

Received on Friday, 14 April 2023 19:14:04 UTC