summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/fast/multicol/columns-shorthand-parsing-2.html
blob: a88e4f4222eb9c97c2224efa90cbfc2e419ed516 (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>'columns' property with 'auto' and something else</title>
    <script src="../../resources/js-test.js"></script>
    <script>
      description("Test the behavior when 'auto' is part of the 'columns' property value. See http://www.w3.org/TR/css3-multicol/#columns");
      if (window.testRunner)
        testRunner.dumpAsText();

      function runTests() {
          var tests = [["-webkit-columns:auto 3;", "auto", "3", "auto 3"],
                       ["-webkit-columns:auto 10em;", "10em", "auto", "10em auto"],
                       ["-webkit-columns:3 auto;", "auto", "3", "auto 3"],
                       ["-webkit-columns:10em auto;", "10em", "auto", "10em auto"],
                       ["-webkit-columns:7 7em; -webkit-columns:auto auto auto;", "7em", "7", "7em 7"],
                       ["-webkit-columns:7 7em; -webkit-columns:10em auto auto;", "7em", "7", "7em 7"],
                       ["-webkit-columns:7 7em; -webkit-columns:auto;", "auto", "auto", "auto auto"],
                       ["-webkit-columns:7 7em; -webkit-columns:auto auto;",  "auto", "auto", "auto auto"],
                       ["-webkit-columns:auto; -webkit-columns:initial;", "initial", "initial", "initial"],
                       ["-webkit-columns:auto; -webkit-columns:initial initial;", "auto", "auto", "auto auto"],
                       ["-webkit-columns:auto; -webkit-columns:inherit;", "inherit", "inherit", "inherit"],
                       ["-webkit-columns:auto; -webkit-columns:inherit inherit;", "auto", "auto", "auto auto"],
                       ["-webkit-columns:7;", "auto", "7", "auto 7"],
                       ["-webkit-columns:7em;", "7em", "auto", "7em auto"]];

          tests.forEach(function(test) {
              element.style.cssText = test[0];
              shouldBeEqualToString("element.style.WebkitColumnWidth", test[1]);
              shouldBeEqualToString("element.style.WebkitColumnCount", test[2]);
              shouldBeEqualToString("element.style.WebkitColumns", test[3]);
          });
      }
    </script>
  </head>
  <body>
      <div id="element"></div>
      <script>
          runTests();
      </script>
  </body>
</html>