[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 mstensho@chromium.org
Reviewed-by: Koji Ishii kojii@chromium.org
Cr-Commit-Position: refs/heads/main@{#1373770}