Closed Bug 1282821 Opened 8 years ago Closed 6 years ago

[css-flexbox] Flex items that are sized to content should use max-content size (not fit-content)

Categories

(Core :: Layout, defect, P3)

defect

Tracking

()

RESOLVED DUPLICATE of bug 1374540
Tracking Status
firefox50 --- affected

People

(Reporter: dholbert, Unassigned)

References

(Blocks 1 open bug, )

Details

(Keywords: dev-doc-complete)

Attachments

(1 file)

Attached file testcase 1
Right now, for content-sized flex items (with default values "flex-basis:auto; width:auto"), we give them a flex base size of "fit-content", basically. I think this is what the spec used to require.

But now, we should use "max-content", per this chunk of current spec:
 # Otherwise, size the item into the available space
 # using its used flex basis in place of its main size,
 # treating a value of 'content' as 'max-content'

('content' there is a value we don't explicitly support, but it's the value that corresponds to the "flex-basis:auto; width:auto" behavior)
 https://drafts.csswg.org/css-flexbox/#hypothetical-main-size


See also this Chrome bug, where Chrome's behavior is actually correct and we're wrong, I believe:
 https://bugs.chromium.org/p/chromium/issues/detail?id=623504
(Edge matches Chrome on this, too.)
Opera 12.16 and Safari 9 matches Chrome on this, too.
Daniel, do you think http://codepen.io/anon/pen/KbEzC is the same issue? The four flex items should not have the same size because flex-basis: auto and a different max-content size should lead to different flexing being applied.

(from https://bugs.chromium.org/p/chromium/issues/detail?id=414197)
Yes.
Priority: -- → P3
(I think this is a prereq for bug 1377253 -- to be able to accurately cache/reuse content measurements across multiple reflows, as I'd like to do there, it will be important that these measurements aren't influenced by the size of the container.)
Blocks: 1377253
Actually I think this is a dupe of bug 1374540 (whose fix landed a few days ago) -- and the attached testcase and comment 2 each give EXPECTED RESULTS in Nightly.

(Comment 0's spec-text-quote is the same as bug 1374540 comment 3.)

--> duping and transferring blocking relationship
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → DUPLICATE
No longer blocks: 1377253
The note reviewed here: https://github.com/mdn/browser-compat-data/pull/2151 is now live on MDN: https://developer.mozilla.org/en-US/docs/Web/CSS/flex, so I'm marking this dev-doc-complete.
(In reply to Will Bamberg [:wbamberg] from comment #6)
> The note reviewed here: https://github.com/mdn/browser-compat-data/pull/2151
> is now live on MDN: https://developer.mozilla.org/en-US/docs/Web/CSS/flex,
> so I'm marking this dev-doc-complete.

Rel note added: https://developer.mozilla.org/en-US/Firefox/Releases/61#CSS
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: