summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/mathml/presentation-markup/scripts/empty-underover.html
blob: b5fcc9c4caefae7b3bbd42b059031f8499875fcb (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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Test Script and Limit Schemata</title>
<link rel="help" href="https://w3c.github.io/mathml-core/#script-and-limit-schemata">
<meta name="assert" content="Script and Limit Schemata should not render anything when empty.">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/mathml/support/feature-detection.js"></script>
<script src="/mathml/support/fonts.js"></script>
<script>
  var epsilon = 1;

  function getBox(aId) {
    return document.getElementById(aId).getBoundingClientRect();
  }

  setup({ explicit_done: true });
  window.addEventListener("load", () => { loadAllFonts().then(runTests); });

  function runTests() {
    test(function() {
      ["over", "under", "underover", "sub", "sup", "subsup", "multiscripts"].forEach(function(name) {
        assert_true(MathMLFeatureDetection.has_mspace());
        assert_approx_equals(getBox(name).width, 0, epsilon, "width of empty " + name);
        assert_approx_equals(getBox(name).height, 0, epsilon, "height of empty " + name);
      });
    }, "Size of empty script elements");

    done();
  }
</script>
</head>
<body>
  <div id="log"></div>
    <p>
      <math>
        <munderover id="underover">
        </munderover>
      </math>
      <math>
        <munder id="under">
        </munder>
      </math>
      <math>
        <mover id="over">
        </mover>
      </math>
      <math>
        <msub id="sub">
        </msub>
      </math>
      <math>
        <msup id="sup">
        </msup>
      </math>
      <math>
        <msubsup id="subsup">
        </msubsup>
      </math>
      <math>
        <mmultiscripts id="multiscripts">
        </mmultiscripts>
      </math>
    </p>
</body>
</html>