background-origin-008

background-origin - inherit keyword value

WeasyPrint

Reference (good) by WeasyPrint

Reference (good) by this browser

This browser

Assertion
Background-origin with 'inherit' implies to inherit its parent element value to position the background area.

Source

 1 <!DOCTYPE html>
 2 <html><head>
 3     <meta charset="utf-8">
 4     <title>CSS Backgrounds and Borders Test: background-origin - inherit keyword value</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     <link href="http://www.w3.org/TR/css3-background/#the-background-origin" rel="help" title="3.8. Positioning Area: the 'background-origin' property">
 8     <link href="reference/background-origin-005-ref.htm" rel="match">
 9     <link href="http://www.w3.org/TR/css3-background/#value-types" rel="help" title="2.2. Value Types">
10     <!--
11     "
12     all properties defined in this specification also accept
13     the inherit keyword as their property value
14     "
15     CSS Backgrounds and Borders Module Level 3
16     2.2. Value Types
17     http://www.w3.org/TR/css3-background/#value-types
18     -->
19 
20     <meta content="" name="flags">
21     <meta content="Background-origin with 'inherit' implies to inherit its parent element value to position the background area." name="assert">
22     <style>
23         div {
24             position: absolute;
25         }
26         #container {
27             background-origin: content-box;
28         }
29         #ref {
30             background-color: red;
31             height: 60px;
32             left: 30px;
33             top: 30px;
34             width: 60px;
35         }
36         #test {
37             background-image: url(support/60x60-green.png);
38             background-origin: inherit;
39             background-repeat: no-repeat;
40             border: transparent dotted 5px;
41             height: 100px;
42             padding: 25px;
43             width: 100px;
44         }
45     </style>
46   </head>
47   <body>
48     <p>Test passes if there is a filled green square and <strong>no red</strong>.</p>
49     <div id="container">
50       <div id="ref"></div>
51       <div id="test"></div>
52     </div>
53   
54 
55 </body></html>