Skip to content
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

If a block fits, put some content inside before breaking. #31846

Merged
merged 1 commit into from Dec 3, 2021

Conversation

chromium-wpt-export-bot
Copy link
Collaborator

@chromium-wpt-export-bot chromium-wpt-export-bot commented Dec 2, 2021

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}

Copy link
Collaborator

@wpt-pr-bot wpt-pr-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The review process for this patch is being conducted in the Chromium project.

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}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants