Repository navigation
Fix sizing of replaced elements with min/max sizes - #32777
Conversation
97477c2 to
6615533
Compare
|
🔨 Triggering try run (#9942861470) for Linux WPT |
If there are not already test cases covering this behavior in the official WPT suite, we should add one to it. |
|
Ah, so should I just wait for the WPT run to complete and see if anything turns green? |
Yep! Let's do that. That will also give you a pointer to which tests you can run locally to continue testing your changes, if necessary. |
|
Test results for linux-wpt-layout-2020 from try job (#9942861470): Flaky unexpected result (22)
Stable unexpected results that are known to be intermittent (17)
Stable unexpected results (18)
|
|
|
b92e311 to
6a221be
Compare
|
Fixed what was causing the last set of tests to fail; let's see how it does now |
|
🔨 Triggering try run (#9945014811) for Linux WPT |
|
|
6a221be to
9b79469
Compare
|
🔨 Triggering try run (#9945398555) for Linux WPT |
|
Test results for linux-wpt-layout-2020 from try job (#9945398555): Flaky unexpected result (31)
Stable unexpected results that are known to be intermittent (9)
Stable unexpected results (7)
|
|
|
9b79469 to
64f1a33
Compare
|
Looks like this fixes several WPT tests! |
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 <[email protected]>
64f1a33 to
0b50f03
Compare
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 <[email protected]>
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.
Now, we clamp to the maximum size and redo the calculations, then do the same with the minimum size.
I'm not sure if we need to do it in two steps, as the CSS spec does, or if we can just clamp between the min and max sizes in one step (possibly even before calculating the tentative size in the first place), but to avoid any unforeseen edge cases, I've opted to take the spec literally here.
./mach build -ddoes not report any errors./mach test-tidydoes not report any errors<img>elements withwidthandheightattributes have incorrect aspect ratio withheight: auto; max-height: [...]#32776 (GitHub issue number if applicable)(What kind of test should I add? The automated testing section of the book mentions wpt, but am I supposed to put "home-grown" tests in there too, or is it supposed to be just for the official wpt test suite?)