Closed Bug 1692116 Opened 3 years ago Closed 3 years ago

Table flex items has wrong flex base size in column flex container

Categories

(Core :: Layout: Flexbox, defect)

defect

Tracking

()

RESOLVED FIXED
88 Branch
Tracking Status
firefox88 --- fixed

People

(Reporter: TYLin, Assigned: TYLin)

References

Details

Attachments

(6 files)

Before bug 1674302, table flex item didn't consider flex-basis properly.

After bug 1674302, table flex item may still returns a wrong flex base size in column flex container if there's a caption on the block-axis or non-zero border & padding with box-sizing: content-box. We also don't get the 'auto' height when measuring the table flex item content because UseAutoBSize doesn't propagate to the inner table.

Attached a testcase adapted from table-as-item-specified-width.html.

See Also: → 1693409
Depends on: 1674302

We already compute both the inner table frame and the caption frame's
block-sizes in InnerTableShrinkWrapSize() and CaptionShrinkWrapSize(),
respectively. Rather than throwing them away, popping them up to
ComputeAutoSize().

This haven't changed the behavior yet.

An inflexible table flex item's hypothetical main size is its final main
size. With Part 1, it's easy to change
nsTableWrapperFrame::ComputeSize() to return the correct block-size.

Depends on D106155

The mIsFlexContainerMeasuringBSize flag serves two purposes:

(1) Tell ReflowInput::ComputeMinMaxValues() to treat min-block-size and
max-block-size like the initial value.

We can just set both sizes after creating the ReflowInput, like this
patch does.

(2) Add ComputeSizeFlag::UseAutoBSize to mComputeSizeFlags.

Similar to the reasoning in Bug 1674302 Part 2
https://hg.mozilla.org/mozilla-central/rev/23aff0f21a1d, the
UseAutoBSize flag is buggy when used on table flex items because it
never propagates to inner table frame. We can fix it by providing an
'auto' mStyleBSize in StyleSizeOverrides.

This fixed table flex item's content block-size measurement. As
described in table-as-item-specified-height.html, the specified height
on <table> now won't count as another min-height anymore.

Depends on D106156

Part 2 fixed table-as-item-specified-height-2.html and
table-as-item-specified-height-3.html.

Part 3 fixed table-as-item-specified-height-1.html

Part 2 and Part 3 are both needed to not break
layout/reftests/flexbox/flexbox-table-flex-items-3.html.

Depends on D106157

Assignee: nobody → aethanyc
Status: NEW → ASSIGNED
Attachment #9204897 - Attachment description: Bug 1692116 Part 1 - Let nsTableWrapperFrame::ComputeAutoSize() return valid block-size. → Bug 1692116 Part 1 - Let nsTableWrapperFrame::ComputeAutoSize() return a resolved block-size.
Pushed by aethanyc@gmail.com:
https://hg.mozilla.org/integration/autoland/rev/0e35951d5ea3
Part 1 - Let nsTableWrapperFrame::ComputeAutoSize() return a resolved block-size. r=dholbert
https://hg.mozilla.org/integration/autoland/rev/2f75ec7fe055
Part 2 - Fix table flex item's flex base size & hypothetical main size in a column flex container. r=dholbert
https://hg.mozilla.org/integration/autoland/rev/a07fe77b2108
Part 3 - Fix table flex item's content block-size measurement by removing mIsFlexContainerMeasuringBSize flag. r=dholbert
https://hg.mozilla.org/integration/autoland/rev/415a2c4c73b3
Part 4 - Add WPT reftests, and adjust test expectations. r=dholbert
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/27782 for changes under testing/web-platform/tests
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: