Open Bug 1637016 Opened 5 years ago Updated 5 years ago

Support pushing the flex item to the next page/column if it's desired size exceeds the remaining available block-size

Categories

(Core :: Layout: Flexbox, defect)

defect

Tracking

()

People

(Reporter: TYLin, Unassigned)

References

(Depends on 1 open bug)

Details

Attachments

(1 file, 1 obsolete file)

Per bug 1622935 comment 11, some data in a flex item can be lost in printing if the flex item contains some unbreakable content taller than the remaining available block-size allocated to it. See Attachment 9146697 [details] for an example.

Per bug 1622935 comment 14, we can fix the bug by push it to the next page/column if it's desired size exceeds the remaining available block-size.

The way this is supposed to work is that the flex item should have returned "BreakBefore" status if it didn't fit and can't break, on the condition that it's not already at the "top of the page" (mIsTopOfPage). Did that not happen for some reason? What frame type was this item?

Flags: needinfo?(aethanyc)
Attached file break-flex-item.html (deleted) —

Re-attach Daniel's Attachment 9146697 [details] in bug 1622935 comment 11 here. I add a second example where the block containing "def" has break-inside: avoid, and the multicols now use column-fill:auto.

(In reply to Mats Palmgren (:mats) from comment #1)

The way this is supposed to work is that the flex item should have returned "BreakBefore" status if it didn't fit and can't break, on the condition that it's not already at the "top of the page" (mIsTopOfPage). Did that not happen for some reason? What frame type was this item?

Part of the reason is that we haven't properly set mIsTopOfPage for flex items yet when we create the child reflow input in ReflowFlexItem, and we haven't considered in flex container's ReflowChildren to push the flex item to next-in-flow if it returns "BreakBefore" status. We should fix it in this bug. So currently, the mIsTopOfPage always true for a flex container is in multicol; the bit inherits from parent's reflow input all the way from nsColumnSetFrame.

However, even if I force set the mIsTopOfPage to false for flex item's reflow input, the block containing "def" in the first flex container (attached in comment 2) is still not returned "BreakBefore" status, unless the "def" block has "break-avoid:inside" (in the second flex container). Is this expected or a known bug?

Flags: needinfo?(aethanyc) → needinfo?(mats)
Attached patch block frame break-before fix? (obsolete) (deleted) — Splinter Review

Yeah, I think it's a long-standing bug in block layout. This might fix it.

Flags: needinfo?(mats)
Comment on attachment 9151101 [details] [diff] [review] block frame break-before fix? Thanks! Change this to a patch form. I can test this patch after I get to this bug. So this fix makes the block returning break-before status if its first line cannot fit. Looks good to me.
Attachment #9151101 - Attachment is patch: true
Depends on: 1640621
Comment on attachment 9151101 [details] [diff] [review] block frame break-before fix? (I filed bug 1640621 to fix this separately.)
Attachment #9151101 - Attachment is obsolete: true
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: