Closed Bug 1651776 Opened 3 years ago Closed 3 years ago

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


(Core :: Layout, defect)




85 Branch
Tracking Status
firefox85 --- fixed


(Reporter: mozilla-apprentice, Assigned: boris)


(Blocks 1 open bug)



(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


Blocks: aspect-ratio
Depends on: 1639963

OK. I think we should fix all the absolute postion issues when we apply aspect-ratio: 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,
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
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
Move Compute{Inline|Block}SizeFromAspectRatio() into AspectRatio struct. r=TYLin
Refine the terminology of writing modes when handling unconstrained block-size on out-of-flow boxes. r=TYLin
aspect-ratio should be used for abspos when insets on the block axis are specified. r=TYLin
Created web-platform-tests PR for changes under testing/web-platform/tests
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.