If a block fits, put some content inside before breaking. #31846
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
If a block fits in the current fragmentainer, don't let overflowing
children pull it over to the next fragmentainer because of less
appealing breaks inside. Instead overflow the fragmentainer.
This is a special rule that is required in order to print Google Docs
correctly (maybe there are other reasons too). Gecko also does this.
EdgeHTML also does something similar. See crbug.com/507972
The legacy block fragmentation engine also had a workaround for Google
Docs, although simpler and weirder (if a line doesn't fit in the current
fragmentainer, but won't fit in the next one either, just leave it where
it is, even if we had already made some progress in the current
fragmentainer).
In a way, crbug.com/178742#c8 is related, which is about overflow inside
monolithic content, and how we let it overflow the fragmentainer.
The logic in IsNodeFullyGrown() was very similar to what we needed here,
so remove it and share code and logic.
Bug: 1242348
Change-Id: Ibc26576d3096f59b629e1ef8c5f725621d8094e9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3310887
Reviewed-by: Ian Kilpatrick <ikilpatrick@chromium.org>
Commit-Queue: Morten Stenshorne <mstensho@chromium.org>
Cr-Commit-Position: refs/heads/main@{#947906}