Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / css / background-serialize.html
blob6395af2d94dba9e764ec651af09e1de86e722316
1 <!doctype html>
2 <html>
3 <head>
4 <script src="../../resources/js-test.js"></script>
5 </head>
6 <body>
7 <pre id='console'></pre>
8 </body>
9 <script>
10 var style = document.createElement('style');
11 document.head.appendChild(style);
13 function test(text) {
14 style.textContent = text;
15 return style.sheet.cssRules[0].cssText;
18 description("Test background properties obtained by using cssText when the properties are set by using style element's textContent.");
20 shouldBeEqualToString("test('.test { background: none; }')", ".test { background: none; }");
21 shouldBeEqualToString("test('.test { background: none; background-color: black;}')", ".test { background: none black; }");
22 shouldBeEqualToString("test('.test { background: none; background-color: initial !important;}')", ".test { background-image: none; background-attachment: initial; background-color: initial !important; background-size: initial; background-origin: initial; background-clip: initial; background-position: initial; background-repeat: initial; }");
23 shouldBeEqualToString("test('.test { background: initial; }')", ".test { background: initial; }");
24 shouldBeEqualToString("test('.test { background: initial; background-color: black; }')", ".test { background-image: initial; background-attachment: initial; background-color: black; background-size: initial; background-origin: initial; background-clip: initial; background-position: initial; background-repeat: initial; }");
25 shouldBeEqualToString("test('.test { background: inherit; }')", ".test { background: inherit; }");
26 shouldBeEqualToString("test('.test { background: inherit; background-color: black; }')", ".test { background-image: inherit; background-attachment: inherit; background-color: black; background-size: inherit; background-origin: inherit; background-clip: inherit; background-position: inherit; background-repeat: inherit; }");
27 shouldBeEqualToString("test('.test { background: none; background-repeat: repeat-x !important;}')", ".test { background-image: none; background-attachment: initial; background-color: initial; background-size: initial; background-origin: initial; background-clip: initial; background-position: initial; background-repeat: repeat-x !important; }");
28 shouldBeEqualToString("test('.test { background: none; background-repeat: repeat-x;}')", ".test { background: none repeat-x; }");
29 shouldBeEqualToString("test('.test { background: none; background-position-x: 0%;}')", ".test { background: none 0%; }");
30 shouldBeEqualToString("test('.test { background: none; background-position: 20% 80%;}')", ".test { background: none 20% 80%; }");
31 shouldBeEqualToString("test('.test { background-position-x: 5%; }')", ".test { background-position-x: 5%; }");
32 shouldBeEqualToString("test('.test { background-position-y: 5%; }')", ".test { background-position-y: 5%; }");
33 shouldBeEqualToString("test('.test { background-position-x: 5%; background-position-y: 10%; }')", ".test { background-position: 5% 10%; }");
34 shouldBeEqualToString("test('.test { background-position-x: 5%; background-position-y: 10% !important; }')", ".test { background-position-x: 5%; background-position-y: 10% !important; }");
35 shouldBeEqualToString("test('.test { background: url(dummy://test.png); }')", ".test { background: url(dummy://test.png); }");
36 shouldBeEqualToString("test('.test { background: url(dummy://test.png); background-color: black; }')", ".test { background: url(dummy://test.png) black; }");
38 </script>
39 <script src="../js/resources/js-test-post.js"></script>
40 </html>