Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- This WPT test may be referenced by the following Test IDs:
- /css/css-backgrounds/background-size-041.html - WPT Dashboard Interop Dashboard
<!DOCTYPE html>
<meta charset="UTF-8">
<title>CSS Backgrounds and Borders Test: background-size with <length> value and 'auto' and image with no intrinsic size and no intrinsic ratio</title>
<!--
Credit should go to Henrik Andersson
for originally reporting this issue.
-->
<link rel="author" title="GĂ©rard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/">
<!--
[css-backgrounds] [css-images] Interop for sizing gradients with only width
Issue 935057: background-size with only one [ <length | <percent> ] value with SVG image with no intrinsic ratio incorrect
Bug 170834: background-size with 2nd value is 'auto' and the image has no intrinsic size and no intrinsic ratio incorrectly rendered
-->
<link rel="match" href="reference/background-size-041-ref.html">
<meta content="This test checks that when one 'background-size' is 'auto' and the image has no intrinsic size and no intrinsic ratio, then it should use 100%. In this test, the 'auto' value should use 100% of the height of the background positioning area of the div, which is 400px." name="assert">
<style>
div
{
background-clip: border-box;
background-image: linear-gradient(orange, blue);
background-origin: content-box;
background-position: center;
background-repeat: no-repeat;
background-size: 200px auto;
border: solid 40px;
border-color: transparent black;
height: 400px;
width: 400px;
}
</style>
<div></div>