Closed Bug 1665327 Opened 6 months ago Closed 4 months ago

max-height affects the inline-size computed through an aspect ratio for non-replaced elements

Categories

(Core :: Layout, defect, P3)

All
Unspecified
defect

Tracking

()

RESOLVED FIXED
84 Branch
Tracking Status
firefox84 --- fixed

People

(Reporter: boris, Assigned: boris)

References

(Blocks 1 open bug, )

Details

Attachments

(2 files, 2 obsolete files)

This bug should address the size constraints when using aspect-ratio property.
See https://drafts.csswg.org/css-sizing-4/#aspect-ratio:

Additionally, sizing constraints in either axis (the origin axis) are transferred through the preferred aspect ratio to the other axis (the destination axis) as follows:

  • First, any definite minimum size is converted and transferred from the origin to destination axis. This transferred minimum is capped by any definite preferred or maximum size in the destination axis.
  • Then, any definite maximum size is converted and transferred from the origin to destination. This transferred maximum is floored by any definite preferred or minimum size in the destination axis as well as by the transferred minimum, if any.

The relevant wpts are:
css-sizing/aspect-ratio/block-aspect-ratio-020.tentative.html
to
css-sizing/aspect-ratio/block-aspect-ratio-028.tentative.html

Assignee: nobody → boris.chiou
Status: NEW → ASSIGNED

Just move the computation of min and max block sizes into a static function,
so we may merge the implemntation with that in ReflowInput::ComputeMinMaxValues.

Attachment #9184119 - Attachment description: Bug 1665327 - Support transferred {min|max}-inline-size when using aspect-ratio on non-replaced elements. → Bug 1665327 - Support transferred {min|max} size when using aspect-ratio on non-replaced elements in inline axis.

It seems we always calculate the inline size first, and so we know the block size through aspect-ratio, so transferred min/max block size may not take effect. Perhaps this is a potential bug. For now, I'd like to handle the inline case in this bug.

Summary: max-height(max-width) affects the inline-size(block-size) computed through an aspect ratio → max-height affects the inline-size computed through an aspect ratio for non-replaced elements
Attachment #9184118 - Attachment is obsolete: true
Attachment #9184650 - Attachment is obsolete: true
Attachment #9184119 - Attachment description: Bug 1665327 - Support transferred {min|max} size when using aspect-ratio on non-replaced elements in inline axis. → Bug 1665327 - Support transferred {min|max} inline-size by using definite {min|max} block-size and aspect-ratio for non-replaced elements.
Attachment #9185786 - Attachment description: Bug 1665327 - Some minor refactoring to avoid duplicate code. → Bug 1665327 - The minor refactoring to avoid duplicate code when checking if the {min|max} block-size is auto.
Pushed by bchiou@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/806282a39a35
Support transferred {min|max} inline-size by using definite {min|max} block-size and aspect-ratio for non-replaced elements. r=TYLin
https://hg.mozilla.org/integration/autoland/rev/3fdcc3ca998a
The minor refactoring to avoid duplicate code when checking if the {min|max} block-size is auto. r=TYLin
Status: ASSIGNED → RESOLVED
Closed: 4 months ago
Resolution: --- → FIXED
Target Milestone: --- → 84 Branch
You need to log in before you can comment on or make changes to this bug.