background-origin-001

background-origin - initial and supported values

WeasyPrint

This browser

Flags
dom, script
Assertion
Check if background-origin initial value is padding-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-origin - 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-origin" rel="help">
 6     <meta content="dom" name="flags">
 7     <meta content="Check if background-origin initial value is padding-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-origin"),
17                 "padding-box", "background-origin initial value");
18         }, "background-origin_initial");
19 
20         document.getElementById("test").style.backgroundOrigin = "border-box";
21         test(function() {
22             assert_equals(getComputedStyle(document.getElementById("test"), null).getPropertyValue("background-origin"),
23                 "border-box", "background-origin supporting value");
24         }, "background-origin_border-box");
25 
26         document.getElementById("test").style.backgroundOrigin = "padding-box";
27         test(function() {
28             assert_equals(getComputedStyle(document.getElementById("test"), null).getPropertyValue("background-origin"),
29                 "padding-box", "background-origin supporting value");
30         }, "background-origin_padding-box");
31 
32         document.getElementById("test").style.backgroundOrigin = "content-box";
33         test(function() {
34             assert_equals(getComputedStyle(document.getElementById("test"), null).getPropertyValue("background-origin"),
35                 "content-box", "background-origin supporting value");
36         }, "background-origin_content-box");
37     </script>
38   
39 
40 </body></html>