background-clip-001

background-clip - initial and supported values

WeasyPrint

This browser

Flags
dom, script
Assertion
Check if background-clip initial value is border-box and supports values border-box, padding-box and content-box

Source

 1 <!DOCTYPE html>
 2 <html><head>
 3     <title>CSS Backgrounds and Borders Test: background-clip - initial and supported values</title>
 4     <link href="http://www.intel.com" rel="author" title="Intel">
 5     <link href="http://www.w3.org/TR/css3-background/#the-background-clip" rel="help">
 6     <meta content="dom" name="flags">
 7     <meta content="Check if background-clip initial value is border-box and supports values border-box, padding-box and content-box" name="assert">
 8     <script src="/resources/testharness.js"></script>
 9     <script src="/resources/testharnessreport.js"></script>
10   </head>
11   <body>
12     <div id="log"></div>
13     <div id="test"></div>
14     <script>
15         test(function() {
16             assert_equals(getComputedStyle(document.getElementById("test"), null).getPropertyValue("background-clip"),
17                 "border-box", "background-clip initial value");
18         }, "background-clip_initial");
19 
20         document.getElementById("test").style.backgroundClip = "border-box";
21         test(function() {
22             assert_equals(getComputedStyle(document.getElementById("test"), null).getPropertyValue("background-clip"),
23                 "border-box", "background-clip supporting value");
24         }, "background-clip_border-box");
25 
26         document.getElementById("test").style.backgroundClip = "padding-box";
27         test(function() {
28             assert_equals(getComputedStyle(document.getElementById("test"), null).getPropertyValue("background-clip"),
29                 "padding-box", "background-clip supporting value");
30         }, "background-clip_padding-box");
31 
32         document.getElementById("test").style.backgroundClip = "content-box";
33         test(function() {
34             assert_equals(getComputedStyle(document.getElementById("test"), null).getPropertyValue("background-clip"),
35                 "content-box", "background-clip supporting value");
36         }, "background-clip_content-box");
37     </script>
38   
39 
40 </body></html>