Fix sizing of replaced elements with min/max sizes (#32777)

If a (min/max)-(height/width) property is set, we still need to respect
the intrinsic ratio of the element if it exists. The previous code was
simply clamping the element size after doing the sizing calculations
once, but this leads to an incorrect aspect ratio.

Signed-off-by: valadaptive <valadaptive@protonmail.com>
This commit is contained in:
valadaptive 2024-07-18 03:07:13 -04:00 committed by GitHub
parent 1b1f79305e
commit f6c9714286
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 232 additions and 200 deletions

View file

@ -1,2 +0,0 @@
[inline-replaced-height-010.xht]
expected: FAIL

View file

@ -1,2 +0,0 @@
[inline-replaced-height-011.xht]
expected: FAIL

View file

@ -1,2 +0,0 @@
[inline-replaced-width-016.xht]
expected: FAIL

View file

@ -1,2 +0,0 @@
[inline-replaced-width-017.xht]
expected: FAIL

View file

@ -1,2 +0,0 @@
[flex-aspect-ratio-img-column-005.html]
expected: FAIL

View file

@ -20,12 +20,6 @@
[Computed style test: canvas with {"width":"10%","height":"20"}]
expected: FAIL
[Canvas width and height attributes are used as the surface size with contain:size]
expected: FAIL
[Canvas width and height attributes are used as the surface size]
expected: FAIL
[Computed style test: canvas with {"width":null,"height":null}]
expected: FAIL

View file

@ -109,12 +109,3 @@
[Computed style test: input with {"type":"submit","width":"10%","height":"20"}]
expected: FAIL
[Loaded images test: <img> without width height attributes]
expected: FAIL
[Loaded images test: <img> with width and height attributes, but conflicting to the original aspect ratio]
expected: FAIL
[Loaded images test: <img> with width and height attributes, but not equal to the original aspect ratio]
expected: FAIL