Open fantasai opened 4 years ago
I propose that we apply text-box-trim
to multi-column fragmentation, but not to paged media for printing. The rationale is:
The spec would say: if the contents of an element with text-box-trim
are fragmented by it or a descendant, then the first or last line (as appropriate to the value specified for text-box-trim
) of all such fragments are trimmed. Trimming is done after fragmentation. This behavior does not apply to paged media.
Note: in other words, text-box-trim
on an element applies to each of the fragments below it individually, but only if text-box-trim
is on a multi-column container or its ancestor.
Note: the second sentence is to avoid a circularity. In terms of implementation, this will require a mechanism to lay out "without trimming" and then adjust layout to take into account trimming, but I think that will be needed anyway in order to detect the "last line to trim" in cases where it isn't clear from markup.
I can see why trimming at the top of a page might be something to avoid in cases where the browser doesn't know how to draw into the page margin/padding area, so it makes sense to allow it. But I doubt it's ideal, because it doesn't allow authors to control things lining up in such cases. We probably want to (eventually) get trimming to work equally on pages and columns.
Also, there's really two questions here:
Either way, we probably need to enable ink overflow of line boxes to spill out of the page content area.
- Do we trim if the first line happens to land at the top of the page/column?
I suggest yes, for the column case.
- Do we trim the line box in the middle of a paragraph if it lands at the top of the page/column?
I suggest no.
The CSS Working Group just discussed [css-inline-3] text-box-trim vs fragmentation
, and agreed to the following:
RESOLUTION: ink-overflow spills out of the page content area into padding and margins, user agents that can't draw paint overflow may shift content down to avoid clipping
RESOLVED: Should text-box-trim apply at fragmentation breaks, depend on the box-decoration-break property
@jensimmons and I discussed the related (but now a bit different) question of what text-box-trim
should do when it's applied to a multi-column container, and as we propose for margin-trim we think it should apply at the top/bottom of each column box. Agenda+ to discuss.
The CSS Working Group just discussed [css-inline-3] text-box-trim vs fragmentation
.
The CSS Working Group just discussed [css-inline-3] text-box-trim vs fragmentation
, and agreed to the following:
RESOLVED: if you apply text-box-trim to a multicol container, it applies to the first formatted line of each column, and analogous for the last
From https://github.com/w3c/csswg-drafts/issues/3240#issuecomment-433628531