[text-box-trim] Handle widows correctly.
Any text-box end trimming has to be applied before calculating widows.
Widow calculation means that we may deliberately overflow the container
in a measure pass, in order to count widows, and then re-layout and
break before the line we need to in order to honor widows. We cannot do
this before we have determined the effect of text box trimming. The two
relayout types didn't play well together, but this is now fixed.
Add tests for widows. Also add tests for orphans, although orphans were
already handled correctly.
Bug: 41494433
Change-Id: I53db4d283c489b14eddd81259348495590008d6a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5961323
Reviewed-by: Koji Ishii kojii@chromium.org
Commit-Queue: Morten Stenshorne mstensho@chromium.org
Cr-Commit-Position: refs/heads/main@{#1373776}