Closed Bug 1564726 Opened 5 years ago Closed 2 years ago

Content are drawn onto the bottom border of a container across columns with "box-decoration-break: clone"

Categories

(Core :: Layout: Block and Inline, defect, P3)

defect

Tracking

()

RESOLVED FIXED
99 Branch
Tracking Status
firefox99 --- fixed

People

(Reporter: TYLin, Assigned: TYLin)

Details

Attachments

(3 files)

See the attached columns-box-decoration-break.html. The container having box-decoration-break:clone are fragmented into two columns, and its child block shouldn't being drawn onto the container's bottom border in the first column.

I think the code that leads to this result is in [1] or somewhere in nsBlockFrame::ComputeFinalBSize().

[1] https://searchfox.org/mozilla-central/rev/40ef22080910c2e2c27d9e2120642376b1d8b8b2/layout/generic/nsBlockFrame.cpp#7411-7412

Priority: P1 → P3

If a block container has box-decoration-break:clone, its block-end border and
padding (BP) are usually drawn at the block-end edge in the current
column/page. Thus, when computing the available block-size for its children, we
should subtract its block-end border BP from it.

BlockReflowInput::ContentBSize() is the correct content-box block-size the
block container precomputed in BlockReflowInput's constructor. See
https://searchfox.org/mozilla-central/rev/c12a59323ee46b29b90c9917a3a7a70ea714ffec/layout/generic/BlockReflowInput.cpp#118-126

The remove hunk was a hack, working only for ColumnSetWrapper with
box-decoration-break:clone. It's no longer needed.

When I claim the block-end BP are usually drawn at the block-end edge, the
exception is that the block container with a definite block-size runs out of its
block-size in a column/page. In this case, the block-end BP is drawn at the
block-end edge of its content-box. The sub-tests having
box-decoration-break:clone border in box-decoration-break-bug-1249913.html
is such examples. It may seem strange that the overflowing lime boxes cannot
extend to the block-end edge of the first column, but this is expected as of
this patch because we subtract the block-end BP from the available block-size.

Depends on D138366

Assignee: nobody → aethanyc
Status: NEW → ASSIGNED
Attachment #9263180 - Attachment description: Bug 1564726 Part 2 - Fix available block-size block children for block container with box-decoration-break:clone. → Bug 1564726 Part 2 - Fix available block-size for block children in block container with box-decoration-break:clone.
Pushed by aethanyc@gmail.com:
https://hg.mozilla.org/integration/autoland/rev/51cb3ac09506
Part 1 - Make BlockReflowInput::ComputeBlockAvailSpace return the result rect. r=emilio
https://hg.mozilla.org/integration/autoland/rev/aeaea91a4f58
Part 2 - Fix available block-size for block children in block container with box-decoration-break:clone. r=dholbert,emilio
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/32827 for changes under testing/web-platform/tests
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 99 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: