Re: [csswg-drafts] [css-grid] Can the sizing algo be made to deal with this (#2356)

We had some further discussion of this issue after the face-to-face yesterday.  Part of the conclusion is that what grid already does is quite similar to the above.

After some discussion, I suggested that the result from the above algorithm could be narrowed roughly as follows:

Repeat the following until stable (I believe it will converge, but we definitely need to double-check):
1. For each column in the grid/table, examine all cells that are part of the column (i.e., their span includes the column) and compute the smallest excess for all such cells, where the excess of a cell is the sum of the widths assigned to all columns it spans minus the width needed by the cell
2. For each cell in the table whose column has nonzero excess, compute the potential overflow, as the width needed by the cell minus the sum of the widths assign to all columns its spans, plus the excess assigned to each such column.  If this value is greater than zero, then follow the rules for distributing that value as width among the cell's columns, and for each column ensure that the excess reduction value for the column is at least that amount distributed.
3. For each column, subtract (excess - excess reduction) from the width.  (Or does it make sense to do this by colspan number iterations rather than in a single loop?)

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


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

Received on Thursday, 15 February 2024 17:45:16 UTC