background-intrinsic-001

Background Intrinsic Sizes: No intrinsic size

WeasyPrint

Reference (good) by WeasyPrint

Reference (good) by this browser

This browser

Flags
svg
Assertion
A background image with no intrinsic size covers the entire padding box.

Source

 1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
 2 <html>
 3  <head>
 4   <title>CSS Test: Background Intrinsic Sizes: No intrinsic size</title>
 5   <link rel="author" title="Elika J. Etemad" href="http://fantasai.inkedblade.net/contact">
 6   <link rel="help" href="http://www.w3.org/TR/CSS21/colors.html#background-properties">
 7   <link rel="help" href="http://www.w3.org/TR/css3-background/#the-background-size">
 8   <link rel="match" href="reference/background-intrinsic-ref.htm">
 9   <meta name="flags" content="svg">
10   <meta name="assert" content="A background image with no intrinsic size covers     the entire padding box.">
11   <style type="text/css">
12     /* Setup. Use 5:6 ratio because it's weird and unlikely to be hard-coded anywhere. */
13     div {
14       position: relative;
15     }
16     .cover, .limit {
17       width: 120px;
18       height: 120px;
19       margin: 0.5em;
20       background: green; /* Used to match reference; remove for debugging. */
21     }
22     .control {
23       position: absolute;
24       top: 10px; bottom: 10px;
25       left: 10px; right: 30px;
26     }
27     .cover .control {
28       background: red;
29     }
30     .limit .control {
31       background: green;
32     }
33     .test {
34       /* 80x100 bgpos area */
35       height: 80px;
36       width: 60px;
37       padding: 10px;
38       /* 100 x 120 bgpaint area */
39       border: 10px solid transparent;
40     }
41 
42     /* Test */
43     .cover .test {
44       background: no-repeat url(support/green-intrinsic-none.svg);
45     }
46     .limit .test {
47       background: no-repeat url(support/red-intrinsic-none.svg);
48     }
49   </style>
50  </head>
51  <body>
52   <p>There must be two green boxes below and no red.</p>
53 
54   <div class="cover">
55     <div class="control"></div>
56     <div class="test"></div>
57   </div>
58 
59   <div class="limit">
60     <div class="test"></div>
61     <div class="control"></div>
62   </div>
63 
64  </body>
65 </html>