1 <!DOCTYPE html>
2 <html><head>
3 <title>CSS Backgrounds and Borders Test: background shorthand - all values specified</title>
4 <link href="http://www.intel.com" rel="author" title="Intel">
5 <link href="http://www.w3.org/TR/css3-background/#the-background" rel="help">
6 <meta content="dom image" name="flags">
7 <meta content="Check that given a valid declaration, for each layer the shorthand 'backgound' first sets the corresponding layer of each of 'background-image', 'background-position', 'background-size', 'background-repeat', 'background-origin', 'background-clip' and 'background-attachment' to that property's initial value, then assigns any explicit values specified for this layer in the declaration" name="assert">
8 <style>
9 #test {
10 background: url("support/60x60-green.png") 40% / 10em gray round fixed border-box;
11 }
12 </style>
13 <script src="/resources/testharness.js"></script>
14 <script src="/resources/testharnessreport.js"></script>
15 </head>
16 <body>
17 <div id="log"></div>
18 <div id="test"></div>
19 <script>
20 var cs = getComputedStyle(document.getElementById("test"), null);
21
22 test(function() {
23 assert_equals(cs.getPropertyValue("background-image"),
24 "url(support/60x60-green.png)", "background specified value for background-image");
25 }, "background_specified_image");
26
27 test(function() {
28 assert_equals(cs.getPropertyValue("background-position"),
29 "40% 50%", "background specified value for background-position");
30 }, "background_specified_position");
31
32 test(function() {
33 assert_equals(cs.getPropertyValue("background-size"),
34 "10em 10em", "background specified value for background-size");
35 }, "background_specified_size");
36
37 test(function() {
38 assert_equals(cs.getPropertyValue("background-repeat"),
39 "round round", "background specified value for background-repeat");
40 }, "background_specified_repeat");
41
42 test(function() {
43 assert_equals(cs.getPropertyValue("background-attachment"),
44 "fixed", "background specified value for background-attachment");
45 }, "background_specified_attachment");
46
47 test(function() {
48 assert_equals(cs.getPropertyValue("background-origin"),
49 "border-box", "background specified value for background-origin");
50 }, "background_specified_origin");
51
52 test(function() {
53 assert_equals(cs.getPropertyValue("background-clip"),
54 "border-box", "background specified value for background-clip");
55 }, "background_specified_clip");
56
57 test(function() {
58 assert_equals(cs.getPropertyValue("background-color"),
59 "gray", "background specified value for background-color");
60 }, "background_specified_color");
61 </script>
62
63
64 </body></html>