Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / css / all-shorthand-css-text.html
blob6c5fe15d8ecc3cee9a00de9000263575039145bb
1 <!DOCTYPE html>
2 <script src="../../resources/js-test.js"></script>
3 <style>
4 div { all: initial; }
5 div { all: initial; color: red; }
6 div { color: red; all: initial; }
7 div { all: initial !important; color: red; }
8 div { all: initial; color: red !important; }
10 div { all: inherit; }
11 div { all: inherit; color: red; }
12 div { color: red; all: inherit; }
13 div { all: inherit !important; color: red; }
14 div { all: inherit; color: red !important; }
16 div { all: red; all: none; all: 10px; all: auto; all: url(about:blank); }
18 div { direction: ltr; all: initial; direction: rtl; }
19 div { direction: ltr; unicode-bidi: bidi-override; all: initial !important; }
20 div { direction: ltr; all: initial; color: red; }
22 div { all: initial; font-size: 10px; }
24 div { all: initial; width: inherit; }
26 div { all: unset; }
27 div { all: unset; color: red; }
28 </style>
29 <script>
30 description('Test for crbug.com/172051: all shorthand property.');
32 function contains(cssText, property) {
33 return cssText.indexOf(property) == 0 || cssText.indexOf(' ' + property) != -1;
36 var cssRules = document.styleSheets[1].cssRules;
38 shouldBe('cssRules.length', '18');
39 shouldBe('cssRules[0].cssText', '"div { all: initial; }"');
40 shouldNotBe('cssRules[1].cssText', '"div { all: initial; color: red; }"');
41 shouldBeTrue('contains(cssRules[1].cssText, "color: red;")');
42 shouldBeTrue('contains(cssRules[1].cssText, "background: initial;")');
43 shouldBeFalse('contains(cssRules[1].cssText, "direction: ")');
44 shouldBeFalse('contains(cssRules[1].cssText, "unicode-bidi: ")');
45 shouldBe('cssRules[2].cssText', '"div { all: initial; }"');
46 shouldBe('cssRules[3].cssText', '"div { all: initial !important; }"');
47 shouldNotBe('cssRules[4].cssText', '"div { all: initial; color: red !important; }"');
48 shouldBeTrue('contains(cssRules[4].cssText, "color: red !important;")');
49 shouldBeTrue('contains(cssRules[4].cssText, "background: initial;")');
50 shouldBeFalse('contains(cssRules[4].cssText, "direction: ")');
51 shouldBeFalse('contains(cssRules[4].cssText, "unicode-bidi: ")');
53 shouldBe('cssRules[5].cssText', '"div { all: inherit; }"');
54 shouldNotBe('cssRules[6].cssText', '"div { all: inherit; color: red; }"');
55 shouldBeTrue('contains(cssRules[6].cssText, "color: red;")');
56 shouldBeFalse('contains(cssRules[6].cssText, "direction: ")');
57 shouldBeFalse('contains(cssRules[6].cssText, "unicode-bidi: ")');
58 shouldBe('cssRules[7].cssText', '"div { all: inherit; }"');
59 shouldBe('cssRules[8].cssText', '"div { all: inherit !important; }"');
60 shouldNotBe('cssRules[9].cssText', '"div { all: inherit; color: red !important; }"');
61 shouldBeTrue('contains(cssRules[9].cssText, "color: red !important")');
62 shouldBeTrue('contains(cssRules[9].cssText, "background: inherit;")');
63 shouldBeFalse('contains(cssRules[9].cssText, "direction: ")');
64 shouldBeFalse('contains(cssRules[9].cssText, "unicode-bidi: ")');
66 shouldBe('cssRules[10].cssText', '"div { }"');
68 shouldBe('cssRules[11].cssText', '"div { all: initial; direction: rtl; }"');
70 shouldBe('cssRules[12].cssText', '"div { direction: ltr; unicode-bidi: bidi-override; all: initial !important; }"');
72 shouldBeFalse('contains(cssRules[13].cssText, "all: initial;")');
73 shouldBeFalse('contains(cssRules[13].cssText, "-internal-")');
74 shouldBeTrue('contains(cssRules[13].cssText, "direction: ltr;")');
75 shouldBeTrue('contains(cssRules[13].cssText, "color: red;")');
77 shouldBeFalse('contains(cssRules[14].cssText, "all: initial;")');
78 shouldBeFalse('contains(cssRules[14].cssText, "-internal-")');
79 shouldBeFalse('contains(cssRules[14].cssText, "font: initial;")');
80 shouldBeTrue('contains(cssRules[14].cssText, "font-family: initial;")');
82 shouldBeFalse('contains(cssRules[15].cssText, "all: initial;")');
83 shouldBeFalse('contains(cssRules[15].cssText, "-internal-")');
84 shouldBeFalse('contains(cssRules[14].cssText, "font: initial;")');
85 shouldBeFalse('contains(cssRules[14].cssText, "marker: initial;")');
86 shouldBeTrue('contains(cssRules[15].cssText, "width: inherit;")');
87 shouldBeTrue('contains(cssRules[15].cssText, "min-width: initial;")');
88 shouldBeTrue('contains(cssRules[15].cssText, "max-width: initial;")');
89 shouldBeTrue('contains(cssRules[15].cssText, "marker-start: initial;")');
90 shouldBeTrue('contains(cssRules[15].cssText, "marker-mid: initial;")');
91 shouldBeTrue('contains(cssRules[15].cssText, "marker-end: initial;")');
93 shouldBe('cssRules[16].cssText', '"div { all: unset; }"');
94 shouldBeFalse('contains(cssRules[17].cssText, "all: unset;")');
95 shouldBeTrue('contains(cssRules[17].cssText, "color: red;")');
96 shouldBeTrue('contains(cssRules[17].cssText, "display: unset;")');
97 </script>