Closed Bug 1833238 Opened 1 year ago Closed 1 year ago

Float element doesn't render in nested balancing multi-column containers

Categories

(Core :: Layout: Floats, defect)

defect

Tracking

()

RESOLVED FIXED
115 Branch
Tracking Status
firefox115 --- fixed

People

(Reporter: TYLin, Assigned: TYLin)

References

(Blocks 1 open bug)

Details

Attachments

(3 files)

Steps to reproduce:
Load the attached testcases, and see the blue box.

Expected result:
The text ABC should appear in the blue box.

Actual result:
The page is blank.

Here is the partial frame tree dump of the outer multicol's second column. As you can see, Block(footer)(3)@7efd79267978 is a float's continuation, and it is still in PushedFloatsList, which is wrong in the final rendering. The float should be in FloatsList.

Block(article)(2)@7efd79267cb0 parent=7efd79266e68 prev-in-flow=7efd79266cd0 (x=3480, y=0, w=2520, h=0) [content=7efd75c045e0] [cs=7efd79294118:-moz-column-content] <
  OverflowContainersList@7efd79267d78 <
    ColumnSetWrapper(main)(1)@7efd79267bd0 parent=7efd79267cb0 prev-in-flow=7efd79267028 (x=0, y=0, w=2520, h=0) [content=7efd75c04670] [cs=7efd7aec6b58] <
      OverflowContainersList@7efd79267ca0 <
        ColumnSet(main)(1)@7efd79267b18 parent=7efd79267bd0 prev-in-flow=7efd792670f8 (x=0, y=0, w=1, h=0) [content=7efd75c04670] [cs=7efd792942f8:-moz-column-set] <
          Block(main)(1)@7efd79267a40 parent=7efd79267b18 next=7efd79267d88 prev-in-flow=7efd792678b0 next-in-flow=7efd79267d88 (x=0, y=0, w=1, h=0) [content=7efd75c04670] [cs=7efd792943e8:-moz-column-content] <
          >
          Block(main)(1)@7efd79267d88 parent=7efd79267b18 prev-in-flow=7efd79267a40 (x=961, y=0, w=1, h=0) [content=7efd75c04670] [cs=7efd792943e8:-moz-column-content] <
            PushedFloatsList@7efd79267b08 <
              Block(footer)(3)@7efd79267978 parent=7efd79267d88 prev-in-flow=7efd792673a8 (x=0, y=0, w=2151, h=2100) ink-overflow=(x=-30, y=0, w=2181, h=2100) [content=7efd75c04790] [cs=7efd7aec6d38] <
                line@7efd792676a8 count=1 state=block,clean,prevmarginclean,not-impacted,not-wrapped,no-break,clear-before:none,clear-after:none(x=0, y=960, w=2151, h=1140) ink-overflow=(x=-30, y=960, w=2181, h=1140) scr-overflow=(x=0, y=960, w=2151, h=1140) <
                  Block(div)(1)@7efd792674f0 parent=7efd79267978 (x=0, y=960, w=2151, h=1140) ink-overflow=(x=-30, y=0, w=2181, h=1140) scr-overflow=(x=0, y=0, w=2151, h=1140) [content=7efd75c04820] [cs=7efd7aec6e28] <
                    line@7efd79267658 count=1 state=inline,clean,prevmarginclean,not-impacted,not-wrapped,no-break,clear-before:none,clear-after:none(x=0, y=0, w=2151, h=1140) ink-overflow=(x=-30, y=0, w=2181, h=1140) scr-overflow=(x=0, y=0, w=2151, h=1140) <
                      Text(0)"ABC"@7efd792675b8 parent=7efd792674f0 (x=0, y=0, w=2151, h=1140) ink-overflow=(x=-30, y=0, w=2181, h=1140) [content=7efd75c07500] [cs=7efd79294898:-moz-text] [run=7efd9f7ebd30][0,3,T] 

This patch shouldn't change the behavior.

  • Use nsIFrame::PresShell() helper directly.
  • Rewrite the loop, and rename next to prevSibling for clarity.

When balancing columns, if a block frame doesn't have enough available
block-size for a float's continuation, we move the float continuation into the
block's pushed floats list.

Typically, the float's continuation is expected to be pulled by the block's next
continuation and reflow there. However, if the block happens to be in the last
column, the float continuation will stay in the pushed float list until we
reflow its block again in the next column balancing loop. In this case, we
should pull it from the pushed floats list regardless of whether the
continuation has a previous continuation or not. Otherwise, it will not be
reflowed if it remains in the pushed floats list.

Depends on D178140

Assignee: nobody → aethanyc
Status: NEW → ASSIGNED
Pushed by aethanyc@gmail.com:
https://hg.mozilla.org/integration/autoland/rev/173ab2e33a06
Part 1 - Minor refactor in nsBlockFrame::DrainSelfPushedFloats(). r=emilio
https://hg.mozilla.org/integration/autoland/rev/edcd9312d82d
Part 2 - Always pull back floats from pushed floats list to floats list when reflowing a block. r=emilio
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/40044 for changes under testing/web-platform/tests
Status: ASSIGNED → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 115 Branch
Upstream PR merged by moz-wptsync-bot
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: