background-size-021

background-size '100% 100%' with background-origin 'content-box'

WeasyPrint

Reference (good) by WeasyPrint

Reference (good) by this browser

This browser

Flags
image
Assertion
Check if 'background-size' is '100% 100%' that it rescales the background image independently in both dimensions to completely cover the background positioning area (it is 100px by 100px as background-origin is 'content-box'). In this test, the background-image should be scaled from 40px wide and 20px tall to become 100px by 100px.

Source

 1 <!DOCTYPE html>
 2 <html><head>
 3     <meta charset="utf-8">
 4     <title>CSS Backgrounds and Borders Test: background-size '100% 100%' with background-origin 'content-box'</title>
 5     <link href="http://www.intel.com" rel="author" title="Intel">
 6     <link href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" rel="reviewer" title="Gérard Talbot"> <!-- 2012-11-09 -->
 7     <!--
 8     http://www.gtalbot.org/BrowserBugsSection/review/background-size-021-review.html
 9     -->
10     <link href="http://www.w3.org/TR/css3-background/#the-background-size" rel="help" title="3.9. Sizing Images: the 'background-size' property">
11     <link href="reference/background-size-021-ref.htm" rel="match">
12     <link href="http://www.w3.org/TR/css3-background/#the-background-origin" rel="help">
13     <meta content="image" name="flags">
14     <meta content="Check if 'background-size' is '100% 100%' that it rescales the background image independently in both dimensions to completely cover the background positioning area (it is 100px by 100px as background-origin is 'content-box'). In this test, the background-image should be scaled from 40px wide and 20px tall to become 100px by 100px." name="assert">
15 
16     <style>
17         #ref-overlapped-red {
18             background-color: red;
19             left: 30px;
20             height: 100px;
21             position: relative;
22             top: 30px;
23             width: 100px;
24         }
25         #test-overlapping-green {
26             background-image: url("support/40px-wide-20px-tall-green-rect.png");
27             background-origin: content-box;
28             background-repeat: no-repeat;
29             background-size: 100% 100%;
30             border: transparent dotted 5px;
31             bottom: 100px;
32             height: 100px;
33             padding: 25px;
34             position: relative;
35             width: 100px;
36 
37             /*
38             Background positioning area is 100px wide by 100px tall.
39             So, the image should be scaled to 100px by 100px.
40             */
41         }
42     </style>
43   </head>
44   <body>
45     <p>Test passes if there is a filled green square and <strong>no red</strong>.</p>
46     <div id="ref-overlapped-red"></div>
47     <div id="test-overlapping-green"></div>
48   
49 
50 </body></html>