File: table-cell-mrow-layout.html

package info (click to toggle)
firefox-esr 140.3.1esr-2
  • links: PTS, VCS
  • area: main
  • in suites: forky
  • size: 4,539,016 kB
  • sloc: cpp: 7,380,478; javascript: 6,388,099; ansic: 3,710,142; python: 1,393,715; xml: 628,165; asm: 426,918; java: 184,025; sh: 65,742; makefile: 19,302; objc: 13,059; perl: 12,912; yacc: 4,583; cs: 3,846; pascal: 3,352; lex: 1,720; ruby: 1,226; exp: 762; php: 436; lisp: 258; awk: 247; sql: 66; sed: 54; csh: 10
file content (74 lines) | stat: -rw-r--r-- 2,583 bytes parent folder | download | duplicates (15)
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
69
70
71
72
73
74
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Table cell mrow layout</title>
<link rel="help" href="https://w3c.github.io/mathml-core/#table-or-matrix-mtable">
<meta name="assert" content="Table cell relies on the mrow layout for their children.">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/mathml/support/feature-detection.js"></script>
<script src="/mathml/support/layout-comparison.js"></script>
<style>
  /* Remove default padding, since there is none on reference mrow element. */
  mtd { padding: 0; }
</style>
</head>
<body>
  <div id="log"></div>
  <p>
    <math>
      <mtable id="mtable">
        <mtr>
          <mtd id="mtd">
            <mspace width="10px" depth="20px" height="20px" style="background: blue"/>
            <mspace width="10px" depth="10px" height="30px" style="background: lightblue"/>
            <mspace width="10px" depth="30px" height="10px" style="background: black"/>
          </mtd>
        </mtr>
      </mtable>
    </math>
  </p>
  <p>
    <math>
      <mrow id="mtd-reference">
        <mspace width="10px" depth="20px" height="20px" style="background: blue"/>
        <mspace width="10px" depth="10px" height="30px" style="background: lightblue"/>
        <mspace width="10px" depth="30px" height="10px" style="background: black"/>
      </mrow>
    </math>
  </p>
  <p>
    <math>
      <mtable id="mtable-reference">
        <mtr>
          <mtd>
            <mrow>
              <mspace width="10px" depth="20px" height="20px" style="background: blue"/>
              <mspace width="10px" depth="10px" height="30px" style="background: lightblue"/>
              <mspace width="10px" depth="30px" height="10px" style="background: black"/>
            </mrow>
          </mtd>
        </mtr>
      </mtable>
    </math>
  </p>
  <script>
    const epsilon = 1;

    test(function() {
      assert_true(MathMLFeatureDetection.has_mspace());
      let mtd = document.getElementById("mtd");
      let reference = document.getElementById("mtd-reference");
      compareLayout(mtd, reference, epsilon);
    }, "<mtd> relies on mrow algorithm to layout its children");

    test(function() {
      assert_true(MathMLFeatureDetection.has_mspace());
      let mtable = document.getElementById("mtable");
      let reference = document.getElementById("mtable-reference");
      compareLayout(mtable, reference, epsilon);
    }, "<mtable> layout does not change if children of <mtd> elements are wrapped in an explicit <mrow>");
  </script>
</body>
</html>