Regression(r188105): Seems to have caused crashes during PLT on some iPads
[WebKit-https.git] / LayoutTests / fast / css / getPropertyValue-webkit-margin-collapse.html
1 <!DOCTYPE HTML>
2 </html>
3   <head>
4     <title>-webkit-margin-collapse shorthand getPropertyValue test</title>
5     <style>
6       .test {
7         display: inline-block;
8         width: 5em;
9         height: 10em;
10       }
11     </style>
12     <script src="../../resources/js-test-pre.js"></script>
13     <script>
14       if (window.testRunner)
15         testRunner.dumpAsText();
16     </script>
17   </head>
18   <body>
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>
24     <script>
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>");
26
27       function webkitMarginCollapseValue(id) {
28         var element = document.getElementById(id);
29         return element.style.getPropertyValue("-webkit-margin-collapse");
30       }
31
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 the empty string.")
38       shouldBeEqualToString('webkitMarginCollapseValue("margin-collapse5")', "");
39     </script>
40     <script src="../../resources/js-test-post.js"></script>
41   </body>
42 </html>