summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/fast/css/getPropertyValue-webkit-margin-collapse.html
blob: 17f2ed82b0d3be32bef39e73be8f2134fa162cb5 (plain)
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
<!DOCTYPE HTML>
</html>
  <head>
    <title>-webkit-margin-collapse shorthand getPropertyValue test</title>
    <style>
      .test {
        display: inline-block;
        width: 5em;
        height: 10em;
      }
    </style>
    <script src="../js/resources/js-test-pre.js"></script>
    <script>
      if (window.testRunner)
        testRunner.dumpAsText();
    </script>
  </head>
  <body>
    <div id="margin-collapse1" class="test" style="-webkit-margin-collapse: collapse separate;"></div>
    <div id="margin-collapse2" class="test" style="-webkit-margin-collapse: discard;"></div>
    <div id="margin-collapse3" class="test" style="-webkit-margin-before-collapse: discard; -webkit-margin-after-collapse: separate;"></div>
    <div id="margin-collapse4" class="test" style="-webkit-margin-collapse: foo;"></div>
    <div id="margin-collapse5" class="test" style="-webkit-margin-before-collapse: collapse;"></div>
    <script>
      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>");

      function webkitMarginCollapseValue(id) {
        var element = document.getElementById(id);
        return element.style.getPropertyValue("-webkit-margin-collapse");
      }

      shouldBe('webkitMarginCollapseValue("margin-collapse1")', "'collapse separate'");
      shouldBe('webkitMarginCollapseValue("margin-collapse2")', "'discard discard'");
      shouldBe('webkitMarginCollapseValue("margin-collapse3")', "'discard separate'");
      debug("NOTE: 'foo' is an illegal CSS value for '-webkit-margin-collapse'.");
      shouldBe('webkitMarginCollapseValue("margin-collapse4")', "null");
      debug("NOTE: If only few longhand properties are specified, getPropertyValue for shorthand property returns null.")
      shouldBe('webkitMarginCollapseValue("margin-collapse5")', "null");
    </script>
    <script src="../js/resources/js-test-post.js"></script>
  </body>
</html>