This repository has been archived by the owner on Apr 3, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 211
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[css-flexbox] Use correct aspect ratio for min-size: auto
https://codereview.chromium.org/1421423005 caused this regression. We never handled aspect ratio correctly in flexbox (that's bug 249112), but that patch made our handling worse because we now distort and enlarge images when a cross axis size is specified that's bigger than the image's intrinsic size. This was tested by imported/csswg-test/css-flexbox-1/flex-minimum-height-flex-items-008.xht which we now pass. I didn't realize the significance of failing that test at the time :( BUG=581361,581535 R=leviw@chromium.org Review URL: https://codereview.chromium.org/1639723003 Cr-Commit-Position: refs/heads/master@{#372000}
- Loading branch information
1 parent
0b271f5
commit eba8fa2
Showing
4 changed files
with
168 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
70 changes: 70 additions & 0 deletions
70
third_party/WebKit/LayoutTests/css3/flexbox/minimum-size-image.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
<!DOCTYPE html> | ||
|
||
<link href="resources/flexbox.css" rel="stylesheet"> | ||
<script src="../../resources/testharness.js"></script> | ||
<script src="../../resources/testharnessreport.js"></script> | ||
<script src="../../resources/check-layout-th.js"></script> | ||
|
||
<body onload="checkLayout('.flexbox')"> | ||
<div id=log></div> | ||
|
||
<div class="flexbox" style="width: 10px;" data-expected-width="10"> | ||
<!-- should use content width, clamped by converted max-height, as minimum width. --> | ||
<img src="../images/resources/green-100.png" style="max-height: 5px;" | ||
data-expected-width="5" data-expected-height="5"> | ||
</div> | ||
|
||
<div class="flexbox" style="width: 10px;" data-expected-width="10"> | ||
<!-- should use min(specified, content width) = 10px as minimum width, | ||
which the image will shrink to due to default flex-shrink. --> | ||
<img src="../images/resources/green-10.png" style="width: 100px;" data-expected-width="10"> | ||
</div> | ||
|
||
|
||
<div class="flexbox" style="width: 10px;" data-expected-width="10"> | ||
<!-- should use content width, clamped by converted min-height, as minimum width. --> | ||
<img src="../images/resources/green-100.png" style="max-height: 5px;" | ||
data-expected-width="5" data-expected-height="5"> | ||
</div> | ||
|
||
<div class="flexbox" style="width: 10px;" data-expected-width="10"> | ||
<!-- should use content width, clamped by converted min-height, as minimum width. --> | ||
<img src="../images/resources/green-100.png" style="max-height: 5px; min-height: 10px;" | ||
data-expected-width="10" data-expected-height="10"> | ||
</div> | ||
|
||
<div class="flexbox" style="width: 10px;" data-expected-width="10"> | ||
<!-- should use min(transferred, content width) = 10px as minimum width, | ||
which the image will shrink to due to default flex-shrink. --> | ||
<img src="../images/resources/green-10.png" style="height: 100px;" data-expected-width="10"> | ||
</div> | ||
|
||
<div class="flexbox column" style="height: 10px;" data-expected-height="10"> | ||
<!-- should use content height, clamped by converted max-width, as minimum height. --> | ||
<img src="../images/resources/green-100.png" style="max-width: 5px;" | ||
data-expected-width="5" data-expected-height="5"> | ||
</div> | ||
|
||
<div class="flexbox column" style="height: 10px;" data-expected-height="10"> | ||
<!-- should use min(specified, content height) = 10px as minimum height, | ||
which the image will shrink to due to default flex-shrink. --> | ||
<img src="../images/resources/green-10.png" style="height: 100px;" data-expected-height="10"> | ||
</div> | ||
|
||
<div class="flexbox" style="height: 10px;" data-expected-height="10"> | ||
<!-- should use content height, clamped by converted min-height, as minimum height. --> | ||
<img src="../images/resources/green-100.png" style="max-height: 5px;" | ||
data-expected-height="5" data-expected-height="5"> | ||
</div> | ||
|
||
<div class="flexbox" style="height: 10px;" data-expected-height="10"> | ||
<!-- should use content height, clamped by converted min-width, as minimum height. --> | ||
<img src="../images/resources/green-100.png" style="max-width: 5px; min-width: 10px;" | ||
data-expected-height="10" data-expected-width="10"> | ||
</div> | ||
|
||
<div class="flexbox column" style="height: 10px;" data-expected-height="10"> | ||
<!-- should use min(transferred, content height) = 10px as minimum height, | ||
which the image will shrink to due to default flex-shrink. --> | ||
<img src="../images/resources/green-10.png" style="width: 100px;" data-expected-height="10"> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters