4 <title>-webkit-margin-collapse shorthand getPropertyValue test
</title>
12 <script src=
"../../resources/js-test.js"></script>
14 if (window
.testRunner
)
15 testRunner
.dumpAsText();
19 <div id=
"margin-collapse1" class=
"test" style=
"-webkit-margin-collapse: collapse separate;"></div>
20 <div id=
"margin-collapse2" class=
"test" style=
"-webkit-margin-collapse: discard;"></div>
21 <div id=
"margin-collapse3" class=
"test" style=
"-webkit-margin-before-collapse: discard; -webkit-margin-after-collapse: separate;"></div>
22 <div id=
"margin-collapse4" class=
"test" style=
"-webkit-margin-collapse: foo;"></div>
23 <div id=
"margin-collapse5" class=
"test" style=
"-webkit-margin-before-collapse: collapse;"></div>
25 description("<a href=\"https://bugs.webkit.org/show_bug.cgi?id=110903\">Bug 110903: getPropertyValue for -webkit-margin-collapse returns null, should compute the shorthand value</a>");
27 function webkitMarginCollapseValue(id
) {
28 var element
= document
.getElementById(id
);
29 return element
.style
.getPropertyValue("-webkit-margin-collapse");
32 shouldBe('webkitMarginCollapseValue("margin-collapse1")', "'collapse separate'");
33 shouldBe('webkitMarginCollapseValue("margin-collapse2")', "'discard discard'");
34 shouldBe('webkitMarginCollapseValue("margin-collapse3")', "'discard separate'");
35 debug("NOTE: 'foo' is an illegal CSS value for '-webkit-margin-collapse'.");
36 shouldBeEqualToString('webkitMarginCollapseValue("margin-collapse4")', "");
37 debug("NOTE: If only few longhand properties are specified, getPropertyValue for shorthand property returns empty string.")
38 shouldBeEqualToString('webkitMarginCollapseValue("margin-collapse5")', "");