Re: [csswg-drafts] [css-grid] Replaced elements canvas, img, etc should behave as expected when styled with relative sizes in grid, transferred size should not affect them unless specifically asked to (#6278)

> Overall it looks good, but I don't get why the clamping happens for the transferred size suggestion, and then for all size suggestions. Wouldn't the latter alone suffice?

The transferred size (and only the transferred size) always has its percentages resolved against zero for clamping.

The other sizes only have percentages resolved against zero if the item is a compressible element.

> Also, I had to reread it because the wording is a bit confusing, first checking "whichever are definite", but then saying that indefinite percentages are considered definite 0.

Yeah, agreed it was worded in a slightly confusing way. We reworded to match the transferred size clamping text more closely:

```diff
        In all cases, the size suggestion is additionally clamped by the [=maximum size=] in the affected axis,
-       if it's definite.
+       if it's [=definite=].
        If the item is a [[css-sizing-3#min-content-zero|compressible replaced element]],
-       the size suggestion is clamped
-       by both the [=maximum size=] and the [=preferred size=], whichever are definite,
-       with their indefinite percentages resolved for this purpose against zero
-       (and therefore considered definite).
+       and has a [=definite=] [=preferred size=] or [=maximum size=]
+       in the relevant axis,
+       the size suggestion is capped by those sizes;
+       for this purpose, any indefinite percentages in these sizes
+       are resolved against zero (and considered [=definite=]).
```


> The wording for clamping the transferred size suggestion seems easier to understand to me. Well, except for "If the item’s has a preferred size", the preferred size can't be none so there's always one. Not sure if this wants to exclude auto or also min-content, etc.

Yes, it definitely wants to exclude intrinsic sizes. New text (also with very slight editorial rewording, to be perfectly parallel with the preceding clamping text):
    
```diff
-                       If the item’s has a [=preferred size=] or [=maximum size=]
+                       If the item’s has a [=definite=] [=preferred size=] or [=maximum size=]
                        in the relevant axis,
-                       the [=transferred size suggestion=] is capped by those sizes,
-                       resolving any indefinite percentages in these sizes
-                       against zero for this purpose.
+                       the [=transferred size suggestion=] is capped by those sizes;
+                       for this purpose, any indefinite percentages in these sizes
+                       are resolved against zero (and considered [=definite=]).
```

/cc @Loirooriol ?

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


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

Received on Monday, 14 March 2022 17:06:31 UTC