Closed Bug 1651776 Opened 4 years ago Closed 3 years ago

[css-sizing-4] Should aspect-ratio be used for abspos `top: 0; bottom: 0;`?

Categories

(Core :: Layout, defect)

defect

Tracking

()

RESOLVED FIXED
85 Branch
Tracking Status
firefox85 --- fixed

People

(Reporter: mozilla-apprentice, Assigned: boris)

References

Details

Attachments

(3 files, 1 obsolete file)

A resolution was made for csswg-drafts/#5151.

[css-sizing-4] Should aspect-ratio be used for abspos `top: 0; bottom: 0;`?

  • RESOLVED: Accept proposal

Discussion.

Blocks: aspect-ratio
Depends on: 1639963

OK. I think we should fix all the absolute postion issues when we apply aspect-ratio: https://drafts.csswg.org/css-position/#abspos-auto-size in this bug.

First, we have to handle zero width (e.g. width:auto or width:0) case properly
for aspect-ratio. We shouldn't resolve the block size when inline size
is 0 by a finite-ratio aspect-ratio becasue it doesn't make sense.

However, this may have impact for width:auto on the absolute position
element, which may resolve the auto inline size as 0.
IMO, we shouldn't resolve the block size by zero inline-size and a
finite aspect-ratio. This may fail the condition check
(i.e. computedSize.BSize(cbwm) == NS_UNCONSTRAINEDSIZE) in ReflowInput
when resolving the auto block size by insets.

Based on https://github.com/w3c/csswg-drafts/issues/5151,
if the block size is auto, we still can use the insets to resolve the auto
block size on absoluate position elements, so we still can use this resolved
block size to calculate the inline size through aspect-ratio.

Those if-checks and computation could be factored out as a common function.
Besied, I use the "inline" term for the current element, instead of
the containing block.

Assignee: nobody → boris.chiou
Status: NEW → ASSIGNED
Attachment #9186407 - Attachment is obsolete: true

I'd like to handle aspect-ratio in those code block, so it'd be better
to always handle unconstrained block-size on the writing mode of the current
block. Besides, we move it as a method of ReflowInput.

Pushed by bchiou@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/7a0000c0272f
Move Compute{Inline|Block}SizeFromAspectRatio() into AspectRatio struct. r=TYLin
https://hg.mozilla.org/integration/autoland/rev/0f9d01688ca8
Refine the terminology of writing modes when handling unconstrained block-size on out-of-flow boxes. r=TYLin
https://hg.mozilla.org/integration/autoland/rev/e65987e878dc
aspect-ratio should be used for abspos when insets on the block axis are specified. r=TYLin
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/26600 for changes under testing/web-platform/tests
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 85 Branch
Upstream PR merged by moz-wptsync-bot
Regressions: 1679471
Regressions: 1679794
Regressions: 1682032
Regressions: 1699263
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: