background-clip-010

background-clip - content-box with background-color

WeasyPrint

Reference (good) by WeasyPrint

Reference (good) by this browser

This browser

Assertion
When 'background-clip' is set to 'content-box', then the background painting area is clipped at the edges of the content of the element. In this test, height is 'auto', therefore its used value is '0px'; width is 'auto', therefore its used value is as wide as the body element. So, the content box is 0px tall and as wide as the body element; therefore, red should not be visible.

Source

 1 <!DOCTYPE html>
 2 <html><head>
 3 
 4   <meta charset="UTF-8">
 5 
 6   <title>CSS Background and Borders Test: background-clip - content-box with background-color</title>
 7 
 8   <link href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" rel="author" title="Gérard Talbot">
 9   <link href="http://www.w3.org/TR/css3-background/#the-background-clip" rel="help" title="3.7. Painting Area: the 'background-clip' property">
10   <link href="reference/ref-if-there-is-no-red.htm" rel="match">
11 
12   <meta content="" name="flags">
13   <meta content="When 'background-clip' is set to 'content-box', then the background painting area is clipped at the edges of the content of the element. In this test, height is 'auto', therefore its used value is '0px'; width is 'auto', therefore its used value is as wide as the body element. So, the content box is 0px tall and as wide as the body element; therefore, red should not be visible." name="assert">
14 
15   <style type="text/css">
16   div
17   {
18   background-clip: content-box;
19   background-color: red;
20   border: transparent solid 20px;
21   height: auto;
22   padding: 30px;
23   width: auto;
24   }
25   </style>
26 
27  </head>
28 
29  <body>
30 
31   <p>Test passes if there is <strong>no red</strong>.</p>
32 
33   <div></div>
34 
35  
36 
37 </body></html>