-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Map the aspect ratio from width/height to CSS
Instead of having special code in image layout, map the aspect ratio that's computed from the width and height attributes to the aspect-ratio property. As a side-effect, this patch will also make the aspect-ratio property work when contain: size is specified in an image (as well as error images when no alt text is specified). As specified in whatwg/html#6032. R=masonfreed@chromium.org, xiaochengh@chromium.org Bug: 1137004 Change-Id: I1253fa2ecf1e176711d3c4d7bd4159f466656ae8
- Loading branch information
1 parent
bd2ff65
commit 5222e4d
Showing
2 changed files
with
18 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<!DOCTYPE html> | ||
<meta charset="utf-8"> | ||
<title>CSS Containment Test: Size containment replaced elements intrinsic size</title> | ||
<link rel="help" href="https://drafts.csswg.org/css-contain-1/#containment-size"> | ||
<link rel="help" href="https://html.spec.whatwg.org/multipage/rendering.html#attributes-for-embedded-content-and-images"> | ||
<link rel="match" href="../reference/ref-filled-green-100px-square.xht"> | ||
<meta name=assert content="This test checks that an aspect ratio computed from width and height attributes is used even with contain: size."> | ||
|
||
<p>Test passes if there is a filled green square and <strong>no red</strong>.</p> | ||
<img src="support/60x60-green.png" width="60" height="60" style="width: 100px; height: auto; contain: size;"> |
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