Open Bug 1998818 Opened 1 month ago Updated 1 month ago

Percentage block-size for abspos under multicol does not resolve correctly

Categories

(Core :: Layout: Positioned, defect)

defect

Tracking

()

People

(Reporter: TYLin, Unassigned)

Details

Attachments

(2 files)

<div style="columns:2; column-fill:auto; gap:0; width:100px; height:100px; background:red;">
  <div id="container" style="position:relative; height:200px;">
    <div style="position:absolute; top:0; left:0; width:100%; height:100%; background:green;"></div>
  </div>
</div>

For this testcase, container should have 200px block-size, and the abspos child's should resolve its block-size to 200px, too. Both blink and webkit render this correctly.

We seem to resolve the abspos's block-size to 100px, based on block-size of the container's first fragment.

Summary: Percentage block-size for abspos → Percentage block-size for abspos under multicol does not resolve correctly
Attachment #9525195 - Attachment description: Testcase #1: both abs cb and abspos with percentage block-size → Testcase #1: abspos with percentage block-size

Testcase #2 is a in-flow element with a percentage block-size. We resolve its percentage block-size correctly as 200px.

I think the root cause is that the containing-block size passing into AbsoluteContaingBlock::Reflow() [1] is the size of the current fragment, which is OK to resolve insect and other positioning properties, but is wrong for resolving percentage block-size.

[1] https://searchfox.org/firefox-main/rev/e613f4df351a21871cfeadf7d5b4043ffad157b1/layout/generic/nsBlockFrame.cpp#1723-1727

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: