Closed Bug 1584683 Opened 10 months ago Closed 10 months ago

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

Categories

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

task

Tracking

()

RESOLVED FIXED
mozilla71
Tracking Status
firefox71 --- fixed

People

(Reporter: mozilla.org, Unassigned)

References

()

Details

(Whiteboard: [wptsync downstream])

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

PR: https://github.com/web-platform-tests/wpt/pull/19383
Details from upstream follow.

Aleks Totic <atotic@chromium.org> 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
Reviewed-on: https://chromium-review.googlesource.com/1830326
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 wptsync@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/3e9b74acb717
[wpt PR 19383] - [LayoutNG] Fix replaced abspos with no intrinsic size, a=testonly
Status: NEW → RESOLVED
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.