summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/mathml/relations/css-styling/display-contents.html
blob: b18fdd6c8b6198a41b076aa1092b77c4c92f4704 (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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>display: contents</title>
<link rel="help" href="https://w3c.github.io/mathml-core/#css-styling">
<meta name="assert" content="Verify that display: contents computes to display: none">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/mathml/support/mathml-fragments.js"></script>
<script>
  setup({ explicit_done: true });
  window.addEventListener("load", runTests);
  function runTests() {
      var container = document.getElementById("container");
      for (tag in MathMLFragments) {
          container.insertAdjacentHTML("beforeend", `<math>${MathMLFragments[tag]}</math>`);
      }
      test(function() {
          Array.from(document.getElementsByClassName("element")).forEach(element => {
              var style = window.getComputedStyle(element);
              element.setAttribute("style", "display: contents");
              assert_equals(style.getPropertyValue("display"), "none", `${tag}`);
          });
      }, "display: contents computes to display: none");
      done();
  }
</script>
</head>
<body>
  <div id="log"></div>
  <div id="container">
    <math class="element"></math>
  </div>
</body>
</html>