Re: [csswg-drafts] [css-position-3] Incorrect handling of auto inset properties in absolute positioning (#11242)

>Stop saying that a lone auto inset resolves to zero. Instead, resolve the auto inset to whatever value makes the size of the inset-modified containing block match the fit-content size of the abspos. This fit-content size shrinks-to-fit into the original containing block size minus the non-auto inset, or equivalently, into a tentative inset-modified containing block with the auto offset resolved to 0.

This feels a bit complex to me. Introducing a dependency where the dimensions of the inset-modified containing block (IMCB) depend on the dimensions of the absolutely positioned box (abspos) adds a layer of interaction that doesn’t exist in the current definition. If the abspos overflows the absolute-position containing block, the IMCB would overflow as well, and its position becomes unclear—especially with mixed inset value types. 

What I propose is:

1. Stick with the current behavior of `auto` resolving to `0`.
2. Maintain the current definition of the IMCB as an offset from the edges of the absolute-position containing block.
3. Update section 4 to clarify:
 - Point 2: Width and height are resolved against the definite available space... _when all inset values are non-auto_.
 - Add a new point (5): Define the positioning of the abspos within the IMCB:
   - If one inset value in an axis is `auto`, align the abspos to the IMCB edge corresponding to the inset with the non-auto value.
    - If both inset values for an axis are either `auto` or non-auto, align the abspos to the IMCB edge as follows:
      - `top: auto; bottom: auto;` → align to the top edge.
      - `left: auto; right: auto;` → align to the left edge.

What do you think?

-- 
GitHub Notification of comment by gitspeaks
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/11242#issuecomment-2486611512 using your GitHub account


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

Received on Tuesday, 19 November 2024 19:49:24 UTC