Closed Bug 1637091 Opened 4 years ago Closed 1 year ago

Skip final reflow for flex items in paginated context if it's block-size and overflow area can fit the available block-size

Categories

(Core :: Layout: Flexbox, enhancement)

enhancement

Tracking

()

RESOLVED FIXED
111 Branch
Tracking Status
firefox111 --- fixed

People

(Reporter: TYLin, Assigned: TYLin)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

File per dholbert's review comment.

My WIP patch Part 3 of bug 1622935 is planning to always perform a "final reflow" for flex items in paginated context. We can improve the performance by skipping the final reflow for the flex item if the item's block-size and overflow area can fit the remaining available block-size, i.e the item doesn't need to be pushed or split, and can be moved to its final position.

nsColumnSetFrame can reflow its last column in an unconstrained available
block-size to measure the total block-size of the content [1]. This patch adds a
helper method in ReflowInput for that.

For flex items in a fragmented context, we cannot skip its final reflow
because fragmentation might grow its block-size if there's any force break in
it (bug 1663079), or if it has repeated table header/footer (bug 1744363).

This patch doesn't change observable behavior. It potentially does extra final
reflow for flex items in last column with an unconstrained available block-size,
but this is the right thing to do.

[1] https://searchfox.org/mozilla-central/rev/daf613efc5c358f3a94961d73b90472c00703838/layout/generic/nsColumnSetFrame.cpp#614-621

Assignee: nobody → aethanyc
Status: NEW → ASSIGNED
Blocks: 1815294
Pushed by aethanyc@gmail.com:
https://hg.mozilla.org/integration/autoland/rev/34f2732d6954
Always reflow a flex item in a fragmented context. r=dholbert
Status: ASSIGNED → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 111 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: