Open frivoal opened 7 years ago
To make things concrete, here's an intentionally contrived example:
https://florian.rivoal.net/csswg/line-grid/line-grid-torture.html
Do the steps in https://drafts.csswg.org/css-line-grid/#alignment-interactions say what to do?
https://drafts.csswg.org/css-line-grid/#alignment-interactions
This section proposes a solution to the problem that snapping lines to the grid may change the size of the element whose lines are being snapped, but changing its size may (depending on the layout mode and various parameters) change it's position, which affects where the lines should snap, which affects the size, causing a loop if we don't break out.
The solution outlined does seem like a step in the right direction, but I am not sure it is complete or well defined. I believe I understand what it does as long as all we're talking about are block level boxes that are also block containers,with no non-block formatting context in between, but if we step out of that, I am not sure I understand the proposal (and therefore cannot either agree or disagree). A few points to that effect:
“An element can have additional block layout constraints” seems to understate the problem. An element may also be a block container without itself being block level, and other layout modes (flexbox, grid...) have inter dependencies between size and position, or between the size of siblings (and their positions).
Relatedly, I am not sure what "Line snap as if the layout constraint does not apply / Apply the layout constraint to the block " means in the general case. Here are a few cases where I am not sure what the steps are supposed to be. Not meant to be exhaustive, just illustrative:
flex
property set to1.5
and the second has it to2.3
. Do the proposed steps say what we're supposed to do?top
isauto
andbottom
is not, first (layout and) line-snap as ifbottom
wasauto
, then shift the whole thing to the placebottom
wants to put it at? That may seem like a good thing to do, but I am not sure it falls out of the proposed steps. If it doesn't, I am not sure what the steps proposed to do, if anything.In step 3 "Adjust exactly one line box shift or space at the beginning or end of the block such that all of the snapping lines meet the line grid while maintaining the block layout constraint. The single adjustment chosen must be the smallest shift needed to achieve the result without causing overflow." Overflow of what in what?
All in all, maybe I am just reading it wrong (but if so, I'd appreciate editorial clarifications), but it seems to me that the section doesn't address the problem in the general case.