Part 2 - Use nsIFrame::GetAspectRatio() to query aspect-ratio rather than obtaining it from style.
GetAspectRatio()
considers both the aspect-ratio
property and the intrinsic
aspect-ratio of replaced elements.
Changing just nsIFrame::ComputeISizeValueFromAspectRatio()
fixed the intrinsic
size for replaced elements when there is a definite height. However, it doesn't
pass any tests on wpt, so I wrote intrinsic-size-017.html to
intrinsic-size-019.html to cover this.
Modifying nsLayoutUtils::IntrinsicForAxis()
fixed the intrinsic size
contribution for replaced elements. We already have the logic to use inline size
from aspect ratio in AddIntrinsicSizeOffset()
and GetIntrinsicCoord()
. We
just need to compute it when sizes in the inline axis have intrinsic keywords.
intrinsic-size-020.html to intrinsic-size-025.html cover this.
grid-auto-min-sizing-min-content-min-size-{001,002}-ref.html are also modified
to reflect this new behavior. The modified subtests are:
- 001.html: Test 1, 2, 3, 6, 8, 9
- 002.html: Test 1, 2, 3, 6, 7, 9
In these modified subtests, before this patch, our rendering was all different
from Google Chrome's. After this patch, our behavior aligns with Google Chrome,
except for Test 7 and 9 in 002.html.
Differential Revision: https://phabricator.services.mozilla.com/D212716
bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1670151
gecko-commit: cb56506b10a7405525aa475d42fb21591bf0b08c
gecko-reviewers: dholbert