Open Bug 1692366 Opened 4 years ago Updated 3 years ago

visibility:collapse flex items should not influence the main size of their flex container

Categories

(Core :: Layout: Flexbox, defect)

defect

Tracking

()

People

(Reporter: dholbert, Unassigned)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

Attached file testcase 1

STR:

  1. Load attached testcase.

EXPECTED RESULTS:
The black box should be only as wide as its "Hello" text.

ACTUAL RESULTS:
The black box is 400px wider than its "Hello" text. It adds in the main-size contribution of its visibility:collapse collapsed-flex-item to determine its own size, and it probably should not do that, as discussed in https://github.com/w3c/csswg-drafts/issues/5985

The authoritative spec text here is section 9.9.1 at https://drafts.csswg.org/css-flexbox-1/#intrinsic-main-sizes (which we don't exactly implement yet, per bug 1055887). That section doesn't explicitly include or exclude collapsed flex items right now, but it probably should, per my github spec issue noted above, because the spec-section 4.4 about collapsed items has a side-comment that expects these items to be excluded from the flex container's main-size intrinsic-sizing.[1]

Note: Chromium doesn't implement collapsed flex items right now (they just treat visibility:collapse as an alias for visibility:hidden). That's tracked in https://bugs.chromium.org/p/chromium/issues/detail?id=336604 . So, we shouldn't use them as a reference for correct-behavior on this.

[1] section 4.4 (https://drafts.csswg.org/css-flexbox-1/#collapsed-flex-item) says "...collapsing or uncollapsing items may change the flex container’s main size"

(In reply to Daniel Holbert [:dholbert] from comment #0)

The authoritative spec text here is section 9.9.1 at https://drafts.csswg.org/css-flexbox-1/#intrinsic-main-sizes (which we don't exactly implement yet, per bug 1055887). That section doesn't explicitly include or exclude collapsed flex items right now, but it probably should, per my github spec issue noted above

Minor update: the spec has now been updated (closing https://github.com/w3c/csswg-drafts/issues/5985 ) to explicitly require comment 0's EXPECTED RESULTS now.

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

Attachment

General

Created:
Updated:
Size: