Closed Bug 1584683 Opened 10 months ago Closed 10 months ago

[wpt-sync] Sync PR 19383 - [LayoutNG] Fix replaced abspos with no intinsic size


(Core :: CSS Parsing and Computation, task, P4)




Tracking Status
firefox71 --- fixed


(Reporter:, Unassigned)




(Whiteboard: [wptsync downstream])

Sync web-platform-tests PR 19383 into mozilla-central (this bug is closed when the sync is complete).

Details from upstream follow.

Aleks Totic <> wrote:

[LayoutNG] Fix replaced abspos with no intinsic size

One more abspos edge case:
Replaced element, with no intrinsic size, but with
intrinsic aspect ratio.

The example problem here is an SVG with aspect ratio,
but no intinsic size. According to the spec, its
inline size should fill container, and block size
should be derived from inline size and aspect ratio.

Existing code did not handle this case. If element
had no size, its size would be computed and get clamped
by minmax.

A replaced element with no size gets a default minmax of
300x150, so elements would effectively get clamped to minmax.

My fix is a bit of a hack. It uses absence of minmax as a signal
that size should not be clamped.

The intrinsic size handling is surprisingly complex for replaced
elements. I wonder if there are any other parts of NG that
need a close look in how replaced with aspect ratio/no size
are handled.

FF handles this correctly. Legacy does not.

Bug: 1003545
Change-Id: I1510611ff84a99a26bcade74cace2855e022f997
WPT-Export-Revision: d7e2eba767bbc80d97b28781ae787631cb9c5d20

Component: web-platform-tests → CSS Parsing and Computation
Product: Testing → Core
Ran 1 tests and 38 subtests
OK     : 1
PASS   : 38
Pushed by
[wpt PR 19383] - [LayoutNG] Fix replaced abspos with no intrinsic size, a=testonly
Closed: 10 months ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla71
You need to log in before you can comment on or make changes to this bug.