Skip to content

[css-inline-3] text-box-trim vs fragmentation #5335

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
fantasai opened this issue Jul 19, 2020 · 7 comments
Closed

[css-inline-3] text-box-trim vs fragmentation #5335

fantasai opened this issue Jul 19, 2020 · 7 comments

Comments

@fantasai
Copy link
Collaborator

From #3240 (comment)

Fragmentation is an interesting case. It's quite reasonable to want the text-trim to take effect at fragmentation breaks in multicol. But for pages, we'd end up trimming any ink that leaks over. We'll either need to adjust css-page-3 to not trim [ink] overflow at fragmentation boundaries or add a page-padding property similar to scroll-padding or something. This is actually necessary for ruby to work properly in Japanese, and many other effects that require the top of the text to line up across fragmentainers but allows some lines to contain content that overflows that visual line.

@fantasai fantasai added the css-inline-3 Current Work label Jul 19, 2020
@chrishtr chrishtr changed the title [css-inline-3] leading-trim vs fragmentation [css-inline-3] text-box-trim vs fragmentation Dec 21, 2023
@chrishtr
Copy link
Contributor

I propose that we apply text-box-trim to multi-column fragmentation, but not to paged media for printing. The rationale is:

  • We know of good use cases to trim leading for text in the presence of multi-column (e.g. two columns next to an image that both want vertical centering), but I don't know of any for printing.
  • Implementing ink overflow into the padding area of paged media is not so easy to implement in Blink as compared to multi-column (and I assume in other browser engines as well).

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.

@fantasai
Copy link
Collaborator Author

fantasai commented Jan 9, 2024

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:

  1. Do we trim if the first line happens to land at the top of the page/column?
  2. Do we trim the line box in the middle of a paragraph if it lands at the top of the page/column?

Either way, we probably need to enable ink overflow of line boxes to spill out of the page content area.

@chrishtr
Copy link
Contributor

  • 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.

@css-meeting-bot
Copy link
Member

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
The full IRC log of that discussion <Frances> github-bot #335
<Frances> fantasai: One consideration is when requesting text-box:trim, if it lands at the top of the page, we have ink spilling out of the page. Currently gets clipped out. If specifying cap height and land at the top of the page, accent marks will get clipped.
<Frances> fantasai: Do we want to specify that ink-overflow can spill onto the padding area and if so do we want to allow implementations to pull content. How to approach the problem of clipping?
<Frances> fantasai: Trim at the bottom of the page or at the next page? We need some way to control it and make it happen, with a consistent top edge.
<bradk> +1 to allowing ink to spill over, similar to box-shadow
<Rossen_> q?
<Frances> fantasai: Need a way to handle text-box-trim for the correct padding and border of content. Two issues: clipping and separate control for fragmentation breaks.
<fantasai> s/Need a way to handle text-box-trim for the correct padding and border of content./If using text-box-trim for correct spacing between content and border, don't necessarily want to trim at fragmentation breaks/
<Frances> chris h: Bbecause it is more difficult to implement with more complexities, text-box-trim does not apply for printing
<Frances> Rossen: Allows for additive behavior in the future. Need to specify it correctly.
<fantasai> s/Trim at the bottom/Other question is, if the paragraphs fragments in the middle, do we trim at the bottom/
<astearns> -1 to not applying to print. Would there be a way to allow it in print except for at page breaks?
<Frances> Florian: Need to define cleanly the boundary. In typography such as using css to make printed material or like printing. About fragmentation, should not say print, possibly relevant.
<Frances> Florian: Needs to work for printing. We need to work on this and not call the compat trap.
<Frances> fantasai: Shouldn't disable trim for printing, need to spec the ideal behavior to the extent that it can be printed. Might allow user agents that can't do that, shift it down the page to use the text glyphs.
<Rossen_> ack fantasai
<Frances> chris h: The two together sound fine.
<Frances> PROPOSAL: 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.
<fantasai> s/paint overflow/ink overflow/
<fantasai> +1
<Frances> rossen: objections?
<Frances> 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
<Frances> fantasai: A question around text-box-trim taking affect. Should be a separate property to control them indepdently.
<Frances> Chris H: Specify in the property, not overflow between columns.
<Rossen_> s/RESOLUTION/RESOLVED/
<dbaron> s/Specify in the property/just operates at the top of the first fragment and the bottom of the last fragment/
<dbaron> fantasai: I'd want it to follow box-decoration-break
<Frances> PROPOSAL: Should text-box-trim apply at fragmentation breaks, depends on the box-decoration-break property
<Frances> Rossen: Objections?
<Frances> RESOLVED: Should text-box-trim apply at fragmentation breaks, depend on the box-decoration-break property
<chrishtr> Thanks all!
<Frances> fantasai: fragmentation case possibly need an independent control. Could be a separate feature.
<Rossen_> Zakim, end meeting

chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this issue May 24, 2024
The `text-box-trim` should apply only to the top of the first
fragment and the bottom of the last fragment, resolved at
w3c/csswg-drafts#5335.

This patch adds tests for this, `001` for when the
`text-box-trim` is applied to the multicol container, and
`002` for when a box with `text-box-trim` is block fragmented
by ancestor multicol.

Bug: 40254880
Change-Id: Ice29f39cbef0c20284edd809942754176a395d23
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5564105
Reviewed-by: Kent Tamura <[email protected]>
Commit-Queue: Kent Tamura <[email protected]>
Auto-Submit: Koji Ishii <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1305545}
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this issue May 24, 2024
The `text-box-trim` should apply only to the top of the first
fragment and the bottom of the last fragment, resolved at
w3c/csswg-drafts#5335.

This patch adds tests for this, `001` for when the
`text-box-trim` is applied to the multicol container, and
`002` for when a box with `text-box-trim` is block fragmented
by ancestor multicol.

Bug: 40254880
Change-Id: Ice29f39cbef0c20284edd809942754176a395d23
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5564105
Reviewed-by: Kent Tamura <[email protected]>
Commit-Queue: Kent Tamura <[email protected]>
Auto-Submit: Koji Ishii <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1305545}
moz-v2v-gh pushed a commit to mozilla/gecko-dev that referenced this issue Jun 3, 2024
… a=testonly

Automatic update from web-platform-tests
[text-box-trim] Add tests for multi-col

The `text-box-trim` should apply only to the top of the first
fragment and the bottom of the last fragment, resolved at
w3c/csswg-drafts#5335.

This patch adds tests for this, `001` for when the
`text-box-trim` is applied to the multicol container, and
`002` for when a box with `text-box-trim` is block fragmented
by ancestor multicol.

Bug: 40254880
Change-Id: Ice29f39cbef0c20284edd809942754176a395d23
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5564105
Reviewed-by: Kent Tamura <[email protected]>
Commit-Queue: Kent Tamura <[email protected]>
Auto-Submit: Koji Ishii <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1305545}

--

wpt-commits: 592dc0a3df19c530baec9079edce72a2625b798e
wpt-pr: 46470
i3roly pushed a commit to i3roly/firefox-dynasty that referenced this issue Jun 14, 2024
… a=testonly

Automatic update from web-platform-tests
[text-box-trim] Add tests for multi-col

The `text-box-trim` should apply only to the top of the first
fragment and the bottom of the last fragment, resolved at
w3c/csswg-drafts#5335.

This patch adds tests for this, `001` for when the
`text-box-trim` is applied to the multicol container, and
`002` for when a box with `text-box-trim` is block fragmented
by ancestor multicol.

Bug: 40254880
Change-Id: Ice29f39cbef0c20284edd809942754176a395d23
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5564105
Reviewed-by: Kent Tamura <[email protected]>
Commit-Queue: Kent Tamura <[email protected]>
Auto-Submit: Koji Ishii <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1305545}

--

wpt-commits: 592dc0a3df19c530baec9079edce72a2625b798e
wpt-pr: 46470
@fantasai
Copy link
Collaborator Author

fantasai commented Aug 20, 2024

@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.

@css-meeting-bot
Copy link
Member

The CSS Working Group just discussed [css-inline-3] text-box-trim vs fragmentation .

The full IRC log of that discussion <astearns> q+
<andreubotella> fantasai: I was chatting with Jen Simmons about how text-box-trim interacts with fragmentation. We have a discussion about setting text-box-trim in a box in the flow that gets fragment, but not on the multicol element. There's a lot of column boxes inside it, should it apply to any of them?
<andreubotella> Probably makes sense to apply to the first and last line box in each column
<andreubotella> assuming there's no intervening padding or borders
<chrishtr> +1
<miriam> +1
<andreubotella> frivoal: makes sense to me
<andreubotella> astearns: I know of a use case where we'd want to trim all of the top and bottom (?) of a column except for the very first and last. But we can handle that with the :column element
<andreubotella> frivoal: I'm aware of that for trimming margins, but this issue is about trimming the top and bottom of lines. Is that correct as well?
<andreubotella> astearns: You might be right that it might apply only to margins. There might also be a usefulness for lines. But yes, it should apply only to the top and bottom if it applies to multicolumn
<andreubotella> bfgeek: My concern is that if applied to the end, it might shorten the column box, which might change the fragmentation point
<andreubotella> fantasai: When fragmenting, you'd have to be aware of whether the line box to add to a page is trimmed or not
<astearns> ack astearns
<andreubotella> bfgeek: It's more complex, because of interactions with collapsing margins at the end
<andreubotella> I dont' know if this is implementable for end trimming
<andreubotella> frivoal: In this issue we're talking about trimming leading in lines, does that also affect?
<dholbert> q+
<andreubotella> astearns: We might need some make-forward-progress algorithm where you decide where the fragmentation break is, then apply the trimming, and not reconsider the break
<andreubotella> fantasai: It's similar to when trying to see if something fits, you truncate the margins. If there are borders or padding, you already cannot trim. It's different between line boxes and at the end of the element, so when you evaluate whether you fit, you trim the line box
<andreubotella> if additional content fits, then you move forwards
<andreubotella> frivoal: it's clear it's desirable, but not clear how doable. Can we edit it later if it's too hard?
<andreubotella> fantasai: I think that's reasonable. Because margins are invisible, it doesn't matter whether you consider the box trim or not. It's only when placing the content and checking wherther it fits before the end of the page is when you need to consider trimming
<andreubotella> bfgeek: What is the behavior with empty elements that are after this?
<andreubotella> If there's a subsequent empty element. That's not considered (?) if there's an empty element afterwards
<andreubotella> That's complex because we don't want to arbitrarily look forwards to see if this is the last
<andreubotella> fantasai: If the bottom edge of my box is 1em from the bottom of the page, but it has a bottom-margin of 2em
<andreubotella> we truncate the margin to the extent necessary to make it fit
<astearns> ack dholbert
<andreubotella> dholbert: when fantasai was talking about how it works in practice, discounting the text-box-trim for the purposes of seeing if the element fits, should it also make the element draw a smaller border box if it happens to fit when this is taken into account?
<andreubotella> should the border box extend to the bottom of the column?
<andreubotella> s/border box/background/
<andreubotella> fantasai: do you mean a block background or an inline background?
<andreubotella> dholbert: if the line of text has a background, i'm thinking of a span that has a background
<andreubotella> ...
<andreubotella> fantasai: as an author, you don't want to combine text-box-trim with a block background
<andreubotella> in the long term, we might want to have a control for this, similar to margin-trim for margins, but this would be the default
<fantasai> s/margin-trim/margin-break/
<andreubotella> astearns: should we specify the behavior as florian suggested, and reopen the issue if there are implementability concerns? or do we take it back to the issue for now?
<andreubotella> fantasai: I think this is what people would want if they set text-box-trim on multicolumn. The alternative is it doesn't apply at all
<andreubotella> frivoal: If it applies only to the first column, it's worse because you have unbalanced columns
<andreubotella> astearns: any objections, dholbert and bfgeek?
<andreubotella> bfgeek; there's some complexity because, the way it works we'd need to backtrack. For example, you place a line box, there's 10px of space remaining. You need to lay out the next line box, because it might only be 8px
<andreubotella> But if it's 12px high, you need to backtrack and go to the previous line box, and then trim it, which is a bit scary
<andreubotella> you don't know if it's the last line box until you lay out the next line
<andreubotella> frivoal: Having it only apply to the first column and not the others will be ugly. In general, for the problem, if we only trim at the first column it's bad
<andreubotella> same for printing and pagination, if you have a multi-page document, you want the top and bottom to match
<andreubotella> bfgeek: At the minimum we'd want trim-top. I'll talk to Morten to see how feasible is trimming the bottom if we have to backtrack
<andreubotella> fantasai: Once you've decided that the line box fits, you can forget about whether you trimmed it. It only matters if you drew a background, and if you do, you have the question of where it ends
<andreubotella> You have to make sure the background doesn't go beyond the fragmentainer edge
<andreubotella> bfgeek: It affects more things than that
<andreubotella> astearns: We should table the discussion of how it should work for now. bfgeek, are you okay having the conversation with Morten before resolving?
<andreubotella> bfgeek: yeah
<andreubotella> frivoal: Can we resolve to do it on the start side and leave the end side open?
<andreubotella> astearns: We'll discuss that next time
<dholbert> fwiw the "in what ways is the column-end-trimming observable [and how do we need to tidy up after ourselves after placing that line]"is the bit that I'm wondering about too

@css-meeting-bot
Copy link
Member

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
The full IRC log of that discussion <dholbert> fantasai: this issue is the same, but now for text-box-trim
<dholbert> fantasai: 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
<astearns> q?
<dholbert> PROPOSED RESOLUTION: 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
<dholbert> 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

aarongable pushed a commit to chromium/chromium that referenced this issue Oct 25, 2024
There are now two types of text box trimming: The already existing one,
trimming at the start or end of a node. And the new one, trimming at the
start or end of a fragmentainer. We need to distinguish between these,
since they aren't active at the same times. Therefore, the old "should
text box trim start/end" flags are now qualified with "node" (e.g.
ShouldTextBoxTrimNodeStart()), and the new ones are qualified with
"fragmentainer" (e.g. ShouldTextBoxTrimFragmentainerStart()).

When text-box-trim is specified inside a fragmentation context, it
should not cause trimming at fragmentainer breaks, unless
box-decoration-break is 'clone'. See
w3c/csswg-drafts#5335 (comment)

When text-box-trim is specified on a multicol container (i.e. NOT inside
the fragmentation context that the multicol container establishes), it
should cause trimming at fragmentainer breaks. See
w3c/csswg-drafts#5335 (comment)

Update text-box-trim-multicol-001.html, since we now trim at
fragmentainer boundaries. Also make the multicol container slightly
shorter, to demonstrate that we also trim at the end of columns.

Make the multicol container in text-box-trim-multicol-002.html slightly
taller, to demonstrate that there's trimming at the end of columns in
that case (trimming is specified on a multicol descendant, and
box-decoration-break is not 'clone').

Also add more tests for trimming at column boundaries, and also some
basic printing tests that simply test that text-box trimming still
works, at least when they're not next to a page boundary. Blink (and all
other browsers, I think) cannot paint outside the page area, so trimming
is disabled at page boundaries. There will be an internal WPT test for
that in an upcoming CL.

Set widows and orphans to 1 in the tests. They are not meant to be
affected by orphans / widows requirements anyway, but our widows
calculation code is currently causing trouble for text box trimming (two
different types of relayout not getting along too well), so just set it
to 1 for now. A follow-up CL will fix this.

Bug: 41494433
Change-Id: Ic4fc97ecf4cce3f52d5c3d8d44c3188c53970002
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5961725
Commit-Queue: Morten Stenshorne <[email protected]>
Reviewed-by: Koji Ishii <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1373770}
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this issue Oct 25, 2024
There are now two types of text box trimming: The already existing one,
trimming at the start or end of a node. And the new one, trimming at the
start or end of a fragmentainer. We need to distinguish between these,
since they aren't active at the same times. Therefore, the old "should
text box trim start/end" flags are now qualified with "node" (e.g.
ShouldTextBoxTrimNodeStart()), and the new ones are qualified with
"fragmentainer" (e.g. ShouldTextBoxTrimFragmentainerStart()).

When text-box-trim is specified inside a fragmentation context, it
should not cause trimming at fragmentainer breaks, unless
box-decoration-break is 'clone'. See
w3c/csswg-drafts#5335 (comment)

When text-box-trim is specified on a multicol container (i.e. NOT inside
the fragmentation context that the multicol container establishes), it
should cause trimming at fragmentainer breaks. See
w3c/csswg-drafts#5335 (comment)

Update text-box-trim-multicol-001.html, since we now trim at
fragmentainer boundaries. Also make the multicol container slightly
shorter, to demonstrate that we also trim at the end of columns.

Make the multicol container in text-box-trim-multicol-002.html slightly
taller, to demonstrate that there's trimming at the end of columns in
that case (trimming is specified on a multicol descendant, and
box-decoration-break is not 'clone').

Also add more tests for trimming at column boundaries, and also some
basic printing tests that simply test that text-box trimming still
works, at least when they're not next to a page boundary. Blink (and all
other browsers, I think) cannot paint outside the page area, so trimming
is disabled at page boundaries. There will be an internal WPT test for
that in an upcoming CL.

Set widows and orphans to 1 in the tests. They are not meant to be
affected by orphans / widows requirements anyway, but our widows
calculation code is currently causing trouble for text box trimming (two
different types of relayout not getting along too well), so just set it
to 1 for now. A follow-up CL will fix this.

Bug: 41494433
Change-Id: Ic4fc97ecf4cce3f52d5c3d8d44c3188c53970002
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5961725
Commit-Queue: Morten Stenshorne <[email protected]>
Reviewed-by: Koji Ishii <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1373770}
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this issue Oct 25, 2024
There are now two types of text box trimming: The already existing one,
trimming at the start or end of a node. And the new one, trimming at the
start or end of a fragmentainer. We need to distinguish between these,
since they aren't active at the same times. Therefore, the old "should
text box trim start/end" flags are now qualified with "node" (e.g.
ShouldTextBoxTrimNodeStart()), and the new ones are qualified with
"fragmentainer" (e.g. ShouldTextBoxTrimFragmentainerStart()).

When text-box-trim is specified inside a fragmentation context, it
should not cause trimming at fragmentainer breaks, unless
box-decoration-break is 'clone'. See
w3c/csswg-drafts#5335 (comment)

When text-box-trim is specified on a multicol container (i.e. NOT inside
the fragmentation context that the multicol container establishes), it
should cause trimming at fragmentainer breaks. See
w3c/csswg-drafts#5335 (comment)

Update text-box-trim-multicol-001.html, since we now trim at
fragmentainer boundaries. Also make the multicol container slightly
shorter, to demonstrate that we also trim at the end of columns.

Make the multicol container in text-box-trim-multicol-002.html slightly
taller, to demonstrate that there's trimming at the end of columns in
that case (trimming is specified on a multicol descendant, and
box-decoration-break is not 'clone').

Also add more tests for trimming at column boundaries, and also some
basic printing tests that simply test that text-box trimming still
works, at least when they're not next to a page boundary. Blink (and all
other browsers, I think) cannot paint outside the page area, so trimming
is disabled at page boundaries. There will be an internal WPT test for
that in an upcoming CL.

Set widows and orphans to 1 in the tests. They are not meant to be
affected by orphans / widows requirements anyway, but our widows
calculation code is currently causing trouble for text box trimming (two
different types of relayout not getting along too well), so just set it
to 1 for now. A follow-up CL will fix this.

Bug: 41494433
Change-Id: Ic4fc97ecf4cce3f52d5c3d8d44c3188c53970002
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5961725
Commit-Queue: Morten Stenshorne <[email protected]>
Reviewed-by: Koji Ishii <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1373770}
aarongable pushed a commit to chromium/chromium that referenced this issue Oct 25, 2024
In our implementation, we will not apply text box trimming at page
boundaries, since we're unable to paint document contents outside the
page area. Since this is an implementation-specific thing (but still
spec-compliant), add an internal test.

See
w3c/csswg-drafts#5335 (comment)

Bug: 41494433
Change-Id: Ibb5e585228b2430b0fb779b64d80bcbb2d97df39
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5962276
Commit-Queue: Morten Stenshorne <[email protected]>
Reviewed-by: Rune Lillesveen <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1373792}
moz-v2v-gh pushed a commit to mozilla/gecko-dev that referenced this issue Oct 27, 2024
… columns., a=testonly

Automatic update from web-platform-tests
[text-box-trim] Trim at the start/end of columns.

There are now two types of text box trimming: The already existing one,
trimming at the start or end of a node. And the new one, trimming at the
start or end of a fragmentainer. We need to distinguish between these,
since they aren't active at the same times. Therefore, the old "should
text box trim start/end" flags are now qualified with "node" (e.g.
ShouldTextBoxTrimNodeStart()), and the new ones are qualified with
"fragmentainer" (e.g. ShouldTextBoxTrimFragmentainerStart()).

When text-box-trim is specified inside a fragmentation context, it
should not cause trimming at fragmentainer breaks, unless
box-decoration-break is 'clone'. See
w3c/csswg-drafts#5335 (comment)

When text-box-trim is specified on a multicol container (i.e. NOT inside
the fragmentation context that the multicol container establishes), it
should cause trimming at fragmentainer breaks. See
w3c/csswg-drafts#5335 (comment)

Update text-box-trim-multicol-001.html, since we now trim at
fragmentainer boundaries. Also make the multicol container slightly
shorter, to demonstrate that we also trim at the end of columns.

Make the multicol container in text-box-trim-multicol-002.html slightly
taller, to demonstrate that there's trimming at the end of columns in
that case (trimming is specified on a multicol descendant, and
box-decoration-break is not 'clone').

Also add more tests for trimming at column boundaries, and also some
basic printing tests that simply test that text-box trimming still
works, at least when they're not next to a page boundary. Blink (and all
other browsers, I think) cannot paint outside the page area, so trimming
is disabled at page boundaries. There will be an internal WPT test for
that in an upcoming CL.

Set widows and orphans to 1 in the tests. They are not meant to be
affected by orphans / widows requirements anyway, but our widows
calculation code is currently causing trouble for text box trimming (two
different types of relayout not getting along too well), so just set it
to 1 for now. A follow-up CL will fix this.

Bug: 41494433
Change-Id: Ic4fc97ecf4cce3f52d5c3d8d44c3188c53970002
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5961725
Commit-Queue: Morten Stenshorne <[email protected]>
Reviewed-by: Koji Ishii <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1373770}

--

wpt-commits: 35a534039299fb6e3e3e27056eaf5e22342be458
wpt-pr: 48817
i3roly pushed a commit to i3roly/firefox-dynasty that referenced this issue Oct 27, 2024
… columns., a=testonly

Automatic update from web-platform-tests
[text-box-trim] Trim at the start/end of columns.

There are now two types of text box trimming: The already existing one,
trimming at the start or end of a node. And the new one, trimming at the
start or end of a fragmentainer. We need to distinguish between these,
since they aren't active at the same times. Therefore, the old "should
text box trim start/end" flags are now qualified with "node" (e.g.
ShouldTextBoxTrimNodeStart()), and the new ones are qualified with
"fragmentainer" (e.g. ShouldTextBoxTrimFragmentainerStart()).

When text-box-trim is specified inside a fragmentation context, it
should not cause trimming at fragmentainer breaks, unless
box-decoration-break is 'clone'. See
w3c/csswg-drafts#5335 (comment)

When text-box-trim is specified on a multicol container (i.e. NOT inside
the fragmentation context that the multicol container establishes), it
should cause trimming at fragmentainer breaks. See
w3c/csswg-drafts#5335 (comment)

Update text-box-trim-multicol-001.html, since we now trim at
fragmentainer boundaries. Also make the multicol container slightly
shorter, to demonstrate that we also trim at the end of columns.

Make the multicol container in text-box-trim-multicol-002.html slightly
taller, to demonstrate that there's trimming at the end of columns in
that case (trimming is specified on a multicol descendant, and
box-decoration-break is not 'clone').

Also add more tests for trimming at column boundaries, and also some
basic printing tests that simply test that text-box trimming still
works, at least when they're not next to a page boundary. Blink (and all
other browsers, I think) cannot paint outside the page area, so trimming
is disabled at page boundaries. There will be an internal WPT test for
that in an upcoming CL.

Set widows and orphans to 1 in the tests. They are not meant to be
affected by orphans / widows requirements anyway, but our widows
calculation code is currently causing trouble for text box trimming (two
different types of relayout not getting along too well), so just set it
to 1 for now. A follow-up CL will fix this.

Bug: 41494433
Change-Id: Ic4fc97ecf4cce3f52d5c3d8d44c3188c53970002
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5961725
Commit-Queue: Morten Stenshorne <[email protected]>
Reviewed-by: Koji Ishii <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1373770}

--

wpt-commits: 35a534039299fb6e3e3e27056eaf5e22342be458
wpt-pr: 48817
jamienicol pushed a commit to jamienicol/gecko that referenced this issue Oct 30, 2024
… columns., a=testonly

Automatic update from web-platform-tests
[text-box-trim] Trim at the start/end of columns.

There are now two types of text box trimming: The already existing one,
trimming at the start or end of a node. And the new one, trimming at the
start or end of a fragmentainer. We need to distinguish between these,
since they aren't active at the same times. Therefore, the old "should
text box trim start/end" flags are now qualified with "node" (e.g.
ShouldTextBoxTrimNodeStart()), and the new ones are qualified with
"fragmentainer" (e.g. ShouldTextBoxTrimFragmentainerStart()).

When text-box-trim is specified inside a fragmentation context, it
should not cause trimming at fragmentainer breaks, unless
box-decoration-break is 'clone'. See
w3c/csswg-drafts#5335 (comment)

When text-box-trim is specified on a multicol container (i.e. NOT inside
the fragmentation context that the multicol container establishes), it
should cause trimming at fragmentainer breaks. See
w3c/csswg-drafts#5335 (comment)

Update text-box-trim-multicol-001.html, since we now trim at
fragmentainer boundaries. Also make the multicol container slightly
shorter, to demonstrate that we also trim at the end of columns.

Make the multicol container in text-box-trim-multicol-002.html slightly
taller, to demonstrate that there's trimming at the end of columns in
that case (trimming is specified on a multicol descendant, and
box-decoration-break is not 'clone').

Also add more tests for trimming at column boundaries, and also some
basic printing tests that simply test that text-box trimming still
works, at least when they're not next to a page boundary. Blink (and all
other browsers, I think) cannot paint outside the page area, so trimming
is disabled at page boundaries. There will be an internal WPT test for
that in an upcoming CL.

Set widows and orphans to 1 in the tests. They are not meant to be
affected by orphans / widows requirements anyway, but our widows
calculation code is currently causing trouble for text box trimming (two
different types of relayout not getting along too well), so just set it
to 1 for now. A follow-up CL will fix this.

Bug: 41494433
Change-Id: Ic4fc97ecf4cce3f52d5c3d8d44c3188c53970002
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5961725
Commit-Queue: Morten Stenshorne <[email protected]>
Reviewed-by: Koji Ishii <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1373770}

--

wpt-commits: 35a534039299fb6e3e3e27056eaf5e22342be458
wpt-pr: 48817
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified-and-comments-removed that referenced this issue Nov 1, 2024
… columns., a=testonly

Automatic update from web-platform-tests
[text-box-trim] Trim at the start/end of columns.

There are now two types of text box trimming: The already existing one,
trimming at the start or end of a node. And the new one, trimming at the
start or end of a fragmentainer. We need to distinguish between these,
since they aren't active at the same times. Therefore, the old "should
text box trim start/end" flags are now qualified with "node" (e.g.
ShouldTextBoxTrimNodeStart()), and the new ones are qualified with
"fragmentainer" (e.g. ShouldTextBoxTrimFragmentainerStart()).

When text-box-trim is specified inside a fragmentation context, it
should not cause trimming at fragmentainer breaks, unless
box-decoration-break is 'clone'. See
w3c/csswg-drafts#5335 (comment)

When text-box-trim is specified on a multicol container (i.e. NOT inside
the fragmentation context that the multicol container establishes), it
should cause trimming at fragmentainer breaks. See
w3c/csswg-drafts#5335 (comment)

Update text-box-trim-multicol-001.html, since we now trim at
fragmentainer boundaries. Also make the multicol container slightly
shorter, to demonstrate that we also trim at the end of columns.

Make the multicol container in text-box-trim-multicol-002.html slightly
taller, to demonstrate that there's trimming at the end of columns in
that case (trimming is specified on a multicol descendant, and
box-decoration-break is not 'clone').

Also add more tests for trimming at column boundaries, and also some
basic printing tests that simply test that text-box trimming still
works, at least when they're not next to a page boundary. Blink (and all
other browsers, I think) cannot paint outside the page area, so trimming
is disabled at page boundaries. There will be an internal WPT test for
that in an upcoming CL.

Set widows and orphans to 1 in the tests. They are not meant to be
affected by orphans / widows requirements anyway, but our widows
calculation code is currently causing trouble for text box trimming (two
different types of relayout not getting along too well), so just set it
to 1 for now. A follow-up CL will fix this.

Bug: 41494433
Change-Id: Ic4fc97ecf4cce3f52d5c3d8d44c3188c53970002
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5961725
Commit-Queue: Morten Stenshorne <mstenshochromium.org>
Reviewed-by: Koji Ishii <kojiichromium.org>
Cr-Commit-Position: refs/heads/main{#1373770}

--

wpt-commits: 35a534039299fb6e3e3e27056eaf5e22342be458
wpt-pr: 48817

UltraBlame original commit: bf38d089a241450f904e3a1bd082db60c87e348f
gecko-dev-updater pushed a commit to marco-c/gecko-dev-comments-removed that referenced this issue Nov 1, 2024
… columns., a=testonly

Automatic update from web-platform-tests
[text-box-trim] Trim at the start/end of columns.

There are now two types of text box trimming: The already existing one,
trimming at the start or end of a node. And the new one, trimming at the
start or end of a fragmentainer. We need to distinguish between these,
since they aren't active at the same times. Therefore, the old "should
text box trim start/end" flags are now qualified with "node" (e.g.
ShouldTextBoxTrimNodeStart()), and the new ones are qualified with
"fragmentainer" (e.g. ShouldTextBoxTrimFragmentainerStart()).

When text-box-trim is specified inside a fragmentation context, it
should not cause trimming at fragmentainer breaks, unless
box-decoration-break is 'clone'. See
w3c/csswg-drafts#5335 (comment)

When text-box-trim is specified on a multicol container (i.e. NOT inside
the fragmentation context that the multicol container establishes), it
should cause trimming at fragmentainer breaks. See
w3c/csswg-drafts#5335 (comment)

Update text-box-trim-multicol-001.html, since we now trim at
fragmentainer boundaries. Also make the multicol container slightly
shorter, to demonstrate that we also trim at the end of columns.

Make the multicol container in text-box-trim-multicol-002.html slightly
taller, to demonstrate that there's trimming at the end of columns in
that case (trimming is specified on a multicol descendant, and
box-decoration-break is not 'clone').

Also add more tests for trimming at column boundaries, and also some
basic printing tests that simply test that text-box trimming still
works, at least when they're not next to a page boundary. Blink (and all
other browsers, I think) cannot paint outside the page area, so trimming
is disabled at page boundaries. There will be an internal WPT test for
that in an upcoming CL.

Set widows and orphans to 1 in the tests. They are not meant to be
affected by orphans / widows requirements anyway, but our widows
calculation code is currently causing trouble for text box trimming (two
different types of relayout not getting along too well), so just set it
to 1 for now. A follow-up CL will fix this.

Bug: 41494433
Change-Id: Ic4fc97ecf4cce3f52d5c3d8d44c3188c53970002
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5961725
Commit-Queue: Morten Stenshorne <mstenshochromium.org>
Reviewed-by: Koji Ishii <kojiichromium.org>
Cr-Commit-Position: refs/heads/main{#1373770}

--

wpt-commits: 35a534039299fb6e3e3e27056eaf5e22342be458
wpt-pr: 48817

UltraBlame original commit: bf38d089a241450f904e3a1bd082db60c87e348f
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified that referenced this issue Nov 1, 2024
… columns., a=testonly

Automatic update from web-platform-tests
[text-box-trim] Trim at the start/end of columns.

There are now two types of text box trimming: The already existing one,
trimming at the start or end of a node. And the new one, trimming at the
start or end of a fragmentainer. We need to distinguish between these,
since they aren't active at the same times. Therefore, the old "should
text box trim start/end" flags are now qualified with "node" (e.g.
ShouldTextBoxTrimNodeStart()), and the new ones are qualified with
"fragmentainer" (e.g. ShouldTextBoxTrimFragmentainerStart()).

When text-box-trim is specified inside a fragmentation context, it
should not cause trimming at fragmentainer breaks, unless
box-decoration-break is 'clone'. See
w3c/csswg-drafts#5335 (comment)

When text-box-trim is specified on a multicol container (i.e. NOT inside
the fragmentation context that the multicol container establishes), it
should cause trimming at fragmentainer breaks. See
w3c/csswg-drafts#5335 (comment)

Update text-box-trim-multicol-001.html, since we now trim at
fragmentainer boundaries. Also make the multicol container slightly
shorter, to demonstrate that we also trim at the end of columns.

Make the multicol container in text-box-trim-multicol-002.html slightly
taller, to demonstrate that there's trimming at the end of columns in
that case (trimming is specified on a multicol descendant, and
box-decoration-break is not 'clone').

Also add more tests for trimming at column boundaries, and also some
basic printing tests that simply test that text-box trimming still
works, at least when they're not next to a page boundary. Blink (and all
other browsers, I think) cannot paint outside the page area, so trimming
is disabled at page boundaries. There will be an internal WPT test for
that in an upcoming CL.

Set widows and orphans to 1 in the tests. They are not meant to be
affected by orphans / widows requirements anyway, but our widows
calculation code is currently causing trouble for text box trimming (two
different types of relayout not getting along too well), so just set it
to 1 for now. A follow-up CL will fix this.

Bug: 41494433
Change-Id: Ic4fc97ecf4cce3f52d5c3d8d44c3188c53970002
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5961725
Commit-Queue: Morten Stenshorne <mstenshochromium.org>
Reviewed-by: Koji Ishii <kojiichromium.org>
Cr-Commit-Position: refs/heads/main{#1373770}

--

wpt-commits: 35a534039299fb6e3e3e27056eaf5e22342be458
wpt-pr: 48817

UltraBlame original commit: bf38d089a241450f904e3a1bd082db60c87e348f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Friday afternoon
Development

No branches or pull requests

4 participants