Closed Bug 1905462 Opened 3 months ago Closed 3 months ago

Clean up in ComputeISizeValue() around the handling of aspect-ratio

Categories

(Core :: Layout, task)

task

Tracking

()

RESOLVED FIXED
129 Branch
Tracking Status
firefox129 --- fixed

People

(Reporter: TYLin, Assigned: TYLin)

Details

Attachments

(3 files)

See the patches for details.

Rename aContainingBlockSize to aCBSize for brevity, which also matches the
parameter naming in ComputeSize() and ComputeAutoSize.

Add a helper lambda GetAvailableISize() to compute the available inline size.

Mark the ComputeISizeValue() resolving LengthPercentage as const.

Assignee: nobody → aethanyc
Status: NEW → ASSIGNED

ComputeISizeValue() used to take StyleSizeOverrides, but

This patch reflects the fact that intrinsic inline size value such as
'min-content', 'max-content', etc. can be resolved via a definite block size and
a preferred aspect-ratio.

For the callers in nsIFrame::ComputeSize() and
nsContainerFrame::ComputeSizeWithIntrinsicDimensions(), we can pass the
styleBSize and aspectRatio that have considered the size overrides.

Also, simplify ComputeISizeValueFromAspectRatio() so that it can be reused in
other places. We'll adapt more callers in the next part. Note that the aFlags
parameter is unused, so it is removed.

This patch doesn't change behavior.

Pushed by aethanyc@gmail.com: https://hg.mozilla.org/integration/autoland/rev/bc9c6a4c6d63 Part 1 - Minor clean up for ComputeISizeValue. r=layout-reviewers,emilio https://hg.mozilla.org/integration/autoland/rev/ee962d6c71e7 Part 2 - Pass a style block size and aspect-ratio into ComputeISizeValue(). r=layout-reviewers,emilio https://hg.mozilla.org/integration/autoland/rev/475b839ecea1 Part 3 - Adapt more code to use ComputeISizeValueFromAspectRatio(). r=layout-reviewers,emilio
Status: ASSIGNED → RESOLVED
Closed: 3 months ago
Resolution: --- → FIXED
Target Milestone: --- → 129 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: