Flex item with 'width: -moz-available' (or 'stretch') and wide content ends up too wide (failing to consider specified-size suggestion)
Categories
(Core :: Layout: Flexbox, defect)
Tracking
()
People
(Reporter: dholbert, Unassigned)
References
(Blocks 1 open bug)
Details
Attachments
(1 file)
580 bytes,
text/html
|
Details |
STR:
- Load attached testcase.
EXPECTED RESULTS:
Cyan area should exactly fill the width of the black-bordered box.
ACTUAL RESULTS:
Cyan area overshoots and is as wide as the text.
This is a bug in this code in nsFlexContainerFrame::PartiallyResolveAutoMinSize
:
https://searchfox.org/mozilla-central/rev/a5e04104f9c6cfd69f9c855f0b0f665afd444c74/layout/generic/nsFlexContainerFrame.cpp#1570-1577
if (aAxisTracker.IsRowOriented()) {
if (mainStyleSize.IsLengthPercentage()) {
// NOTE: We ignore extremum inline-size. This is OK because the caller is
// responsible for computing the min-content inline-size and min()'ing it
// with the value we return.
specifiedSizeSuggestion = aFlexItem.Frame()->ComputeISizeValue(
cbWM, PercentageBasisForItem(), boxSizingAdjust,
mainStyleSize.AsLengthPercentage());
In this case where we use -moz-available
, it's not enough to trust the caller to resolve our min-content size, because that's not what our -moz-available
size actually computes to. It's essentially 100%
and should be handled similarly to the IsLengthPercentage case.
This is relevant for stretch
(the standardized keyword for this behavior) but it's already reproducible with -moz-available
.
Chrome gives EXPECTED RESULTS (they use -webkit-fill-available
and/or stretch
which mean the same thing as -moz-available
in the inline axis).
Reporter | ||
Updated•10 months ago
|
Description
•