-
Notifications
You must be signed in to change notification settings - Fork 756
Description
According to css-align, when the overflow alignment mode is safe, "If the size of the alignment subject overflows the alignment container, the alignment subject is instead aligned as if the alignment mode were start."
According to css-position, OOFs are "resolved into a static position by aligning the box into its static-position rectangle, an alignment container derived from the formatting context the box would have participated in if it were position: static (independent of its actual containing block)."
Based on these two statements, this would imply that if an OOF is statically positioned, and is aligned with the safe keyword, we'd position it at the start of the alignment container (i.e. the originating parent container) if the OOF overflows that alignment container.
However, css-align also notes that for abspos elements, the overflow alignment behavior is based on "the default overflow rect" which is "the bounding rectangle of the alignment subject’s inset-modified containing block and its original containing block."
It is not clear to me if this also applies to statically positioned OOFs or not, but if it does, then this would imply that for statically positioned OOFs, we'd look at the default overflow rect when determining safe overflow.
Ignoring this, there is also another issue in assuming that the originating alignment container is used for safe in the case of OOF alignment and overflow, specifically in relation to the OOF available space.
According to css-position, an OOFs "inset-modified containing block is calculated, defining its available space."
If it is true that when an OOF is statically positioned, and is aligned with the safe keyword, we'd position it at the start of the alignment container (i.e. the originating parent container) if the OOF overflows that alignment container, then this would mean that when the item hits the overflow condition, its IMCB (and its available space) would change to match the definition for 'self-start'.
The problem with this is that it would shift the available space midway through, causing a shift in the layout of the item, which breaks the continuity principle. Is this what we want?
An alternative approach is: if an OOF is statically positioned, and is aligned with the safe keyword, we'd position it at the start of the IMCB if the OOF overflows the IMCB. This would prevent the shift in available space, and would likely still be a reasonable result for authors. It would however mean that it wouldn't match the result of an OOF that was start-aligned, but perhaps that is ok?