/
inherit-initial-shorthand-values.html
70 lines (68 loc) · 1.56 KB
/
inherit-initial-shorthand-values.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
<script src="../../resources/js-test-pre.js"></script>
<script>
if (window.testRunner)
testRunner.dumpAsText();
</script>
<style>
#test {
}
</style>
<body>
</body>
<p>
Test that e matched declaration cache handles explicitly inherited properties correctly.
<p>
<script>
var shorthandNames = [
"background",
"background-position",
"background-repeat",
"border",
"border-bottom",
"border-color",
// getPropertyValue() functionality not supported, see http://webkit.org/b/103245.
// "border-image",
"border-left",
"border-radius",
"border-right",
"border-spacing",
"border-style",
"border-top",
"border-width",
"list-style",
"font",
"margin",
"outline",
"overflow",
"padding",
"webkit-animation",
"webkit-border-after",
"webkit-border-before",
"webkit-border-end",
"webkit-border-start",
"webkit-columns",
"webkit-column-rule",
"flex-flow",
"flex",
"webkit-marginCollapse",
"webkit-mask",
"webkit-mask-position",
"webkit-mask-repeat",
"webkit-text-emphasis",
"webkit-text-stroke",
"webkit-transition",
"webkit-transform-origin"
];
var style = document.styleSheets[0].rules[0].style;
function test(shorthand) {
var result = [];
style[shorthand] = "inherit";
result.push(style[shorthand]);
style[shorthand] = "initial";
result.push(style[shorthand]);
return result.join(", ");
}
for (var i = 0; i < shorthandNames.length; ++i) {
shouldBeEqualToString("test('" + shorthandNames[i] + "')", "inherit, initial");
}
</script>