Closed Bug 1744062 Opened 2 years ago Closed 2 years ago

[wpt-sync] Sync PR 31846 - If a block fits, put some content inside before breaking.

Categories

(Core :: Layout, task, P4)

task

Tracking

()

RESOLVED FIXED
97 Branch
Tracking Status
firefox97 --- fixed

People

(Reporter: mozilla.org, Unassigned)

References

()

Details

(Whiteboard: [wptsync downstream])

Sync web-platform-tests PR 31846 into mozilla-central (this bug is closed when the sync is complete).

PR: https://github.com/web-platform-tests/wpt/pull/31846
Details from upstream follow.

Morten Stenshorne <mstensho@chromium.org> wrote:

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

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/3310887
WPT-Export-Revision: d3583931839788a241d9e959aeeb0a526a110aae

Component: web-platform-tests → Layout
Product: Testing → Core

CI Results

Ran 11 Firefox configurations based on mozilla-central, and Firefox, Chrome, and Safari on GitHub CI

Total 5 tests

Status Summary

Firefox

PASS: 5

Chrome

FAIL: 5

Safari

FAIL: 5

Links

Gecko CI (Treeherder)
GitHub PR Head
GitHub PR Base

Pushed by wptsync@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/b9281d3ca0e1
[wpt PR 31846] - If a block fits, put some content inside before breaking., a=testonly
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 97 Branch
You need to log in before you can comment on or make changes to this bug.