Make flex item consider box-sizing when deriving its main size from aspect-ratio
Categories
(Core :: Layout: Flexbox, defect)
Tracking
()
Tracking | Status | |
---|---|---|
firefox86 | --- | fixed |
People
(Reporter: TYLin, Assigned: TYLin)
References
Details
Attachments
(4 files)
Similar to bug 1683424, when we calculate a flex item's main size from its definite cross-size and aspect-ratio, and the aspect-ratio is from style aspect-ratio:<ratio>
[1], the ratio should work with the dimensions of the box specified by box-sizing.
[1] https://drafts.csswg.org/css-sizing-4/#valdef-aspect-ratio-ratio
Assignee | ||
Comment 1•4 years ago
|
||
FlexItem::mIntrinsicRatio caches the AspectRatio from
nsIFrame::GetAspectRatio(), which can either be the natural aspect-ratio
of the element or the aspect-ratio set from style system. Rename it and
its accessors for accuracy.
The comments are revised to match the term "preferred aspect ratio" used
throughout the flexbox spec.
Assignee | ||
Comment 2•4 years ago
|
||
We are going to revise this method in the next part, so this patch
simply moves this method into FlexItem without doing any improvement.
Depends on D100369
Assignee | ||
Comment 3•4 years ago
|
||
Per aspect ratio spec [1], when specifying aspect-ratio:<ratio>, the
size calculations involving the aspect ratio work with the dimensions of
the box specified by box-sizing.
MainSizeFromAspectRatio() doesn't consider box-sizing, so we replace it
with AspectRatio::ComputeRatioDependentSize() which considers
box-sizing.
[1] https://drafts.csswg.org/css-sizing-4/#valdef-aspect-ratio-ratio
Depends on D100370
Assignee | ||
Comment 4•4 years ago
|
||
If the flex container overrides a flex item's block-size, we don't want
to apply aspect-ratio's automatic content-based minimum sizes
https://drafts.csswg.org/css-sizing-4/#aspect-ratio-minimum.
Depends on D100371
Comment 7•4 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/7b3500bc99cd
https://hg.mozilla.org/mozilla-central/rev/2c5d4838ecd8
https://hg.mozilla.org/mozilla-central/rev/d2a613ecea6b
https://hg.mozilla.org/mozilla-central/rev/2ebcdae9c537
Description
•