Closed Bug 1779645 Opened 11 months ago Closed 9 months ago

Implement CSS named page fragmentation for replaced frames

Categories

(Core :: CSS Parsing and Computation, enhancement, P2)

enhancement

Tracking

()

RESOLVED FIXED
106 Branch
Tracking Status
firefox106 --- fixed

People

(Reporter: alaskanemily, Assigned: alaskanemily)

References

Details

Attachments

(5 files, 1 obsolete file)

No description provided.

This also adds a small post-processing step for frame-construction to ensure
that replaced frames (or more generally frames with content but no children)
have the auto page-name set on them.

When page-name value tracking is switched to be lazy, this post-processing step
should be redundant and can be removed.

WIP: display-none frames are still counted for page-name fragmentation
currently, which causes the single test failure in
layout/reftests/css-page/page-name-display-none-child.html

TODO: It is possible we can simply remove the "ArePageValuesSet" flag from
nsIFrame with this change. I need to double check if this is still the same,
though given how little logic exists in the RAII struct for tracking the auto
page-name value at this point I suspect it can be done without any other
related changes.

Attachment #9286973 - Attachment description: Bug 1779645 WIP - Switch CSS named page fragmentation to happen at reflow instead of frame construction → Bug 1779645 - Switch CSS named page fragmentation to happen at reflow instead of frame construction
Blocks: 1782597
Type: enhancement → defect

The severity field is not set for this bug.
:jwatt, could you have a look please?

For more information, please visit auto_nag documentation.

Flags: needinfo?(jwatt)
Severity: N/A → S4
Flags: needinfo?(jwatt)

Here's the "break test" testcase that I referenced on phabricator here: https://phabricator.services.mozilla.com/D152701#5068339

Chrome only seems to introduce a page-break at the very bottom of this test, for the block container, and nowhere else.

vs. Firefox-with-the-attached-patch fatally aborts as noted in the referenced phabricator comment, when trying to handle a case with page-name-induced fragmentation on children of a grid.

Maybe we can simplify here and only attempt to make this work for block containers for the time being? (which would get us feature parity, it seems)

(Sorry, the first version of testcase 1 had a typo in the first part [display:fleex] which was a temporary tweak I had made to confirm that the page-names worked if I nerfed the flexbox styling. :) I forgot to revert it before posting.)

Here's the testcase 1 that I intended to post.

Attachment #9289754 - Attachment is obsolete: true
Attachment #9289754 - Attachment description: testcase 1 (a "breaktest"), testing page-name-disagreements between various siblings → (ignore; this version of the testcase had a typo)

Here's a test for disagreeing page names between siblings in a block, inside various wrappers.

As above, it looks like Chrome mostly nerfs these. If we wanted to nerf them as well (not sure if we want to), we might need to introduce special suppressions to avoid having the block container in question attempt to fragment.

(Interestingly Chrome does introduce a pagebreak for the "A table cell (in an explicit block inside the cell's anonymous block)" case. But not in any of the other cases; just that one and the last one which is nested-blocks.)

Blocks: 1786399
Attachment #9286973 - Attachment description: Bug 1779645 - Switch CSS named page fragmentation to happen at reflow instead of frame construction → Bug 1779645 Part 1 - Switch CSS named page fragmentation to happen at reflow instead of frame construction
Attachment #9292740 - Attachment description: Bug 1779645 Part 2 - Add CSS named page fragmentation reftests for replaced frames which have block layout → Bug 1779645 Part 2 - Additional CSS named page fragmentation reftests
Type: defect → enhancement
Pushed by emcdonough@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/b626e11a262d
Part 1 - Switch CSS named page fragmentation to happen at reflow instead of frame construction r=dholbert
https://hg.mozilla.org/integration/autoland/rev/3ee5fb016aa0
Part 2 - Additional CSS named page fragmentation reftests r=dholbert

Backed out for causing reftest failures on page-name-zero-height-001.html
Backout link
Push with failures
Link to failure log
Failure line :
REFTEST TEST-UNEXPECTED-FAIL | layout/reftests/css-page/page-name-zero-height-001.html == layout/reftests/css-page/page-name-zero-height-001-ref.html | image comparison, max difference: 251, number of differing pixels: 165

Pushed by emcdonough@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/4ec2a3b38de3
Part 1 - Switch CSS named page fragmentation to happen at reflow instead of frame construction r=dholbert
https://hg.mozilla.org/integration/autoland/rev/db9f646e5a2d
Part 2 - Additional CSS named page fragmentation reftests r=dholbert
Status: NEW → RESOLVED
Closed: 9 months ago
Resolution: --- → FIXED
Target Milestone: --- → 106 Branch
See Also: → 1764437
You need to log in before you can comment on or make changes to this bug.