Open fantasai opened 1 month ago
In consideration of https://github.com/w3c/csswg-drafts/issues/10904 I think we should go with the third option for the text-box
properties: make text-box-edge
apply to the sides indicated by text-box-trim
on the inline box, and use that to draw the box decorations.
I'm still unsure how we should interact with line-fit-edge
, but I think if we go with the principle that the edge used for painting and the edge used for layout should match in the new line layout model, then that means drawing to the line-fit-edge
when not trimming.
In other words, the proposal is to go with option 3.
The CSS Working Group just discussed [css-inline-3] inline boxes and line-fit-edge vs text-box-trim/edge
, and agreed to the following:
RESOLVED: text-box-trim trims inline to the text-box-edge; otherwise use the line-fit-edge; both for sizing and for painting
Now that we've split
line-fit-edge
(inherited) andtext-box-edge
(non-inherited), there's an interesting question of how these two features interact when applied to inline boxes, particularly if they have conflicting "opinions".Inline boxes currently have two sizes:
In the existing line height model, these two are not the same: block-axis margin/padding/borders are ignored completely for sizing, in favor of
line-height
.In the newer line-height model, as part of making inline layout more controllable, we want to use the margin box for sizing. That means
line-fit-edge
has to trim down the content box, not an imaginary other box, otherwise it's confusing (to size by applying margin/padding to one set of edges, but draw by applying it to a different set of edges). Thus by default, we need to apply trimming to inline boxes.The initial value of
text-box-trim
isnone
. Should we:text-box-edge
ignored by inline boxes and always trim to theline-fit-edge
?line-fit-edge
to control the sizing of an inline box; butline-fit-edge
inherits and might not be appropriate if they want to change the value on one item in order to draw its border differently.text-box-edge
apply to inline boxes regardless oftext-box-trim
? (Its initial value already defers toline-fit-edge
.)?text-box-edge
apply to the sides indicated bytext-box-trim
only, usingline-fit-edge
otherwise?What would be useful and understandable?