[LFC][Integration] Generalize run iterator for non-text runs
[WebKit-https.git] / LayoutTests / imported / w3c / web-platform-tests / mathml / presentation-markup / tables / table-axis-height.html
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <meta charset="utf-8">
5 <title>table axis height</title>
6 <link rel="help" href="https://mathml-refresh.github.io/mathml-core/#table-or-matrix-mtable">
7 <meta name="assert" content="Element mtable correctly uses the axis height parameter from the MATH table.">
8 <script src="/resources/testharness.js"></script>
9 <script src="/resources/testharnessreport.js"></script>
10 <script src="/mathml/support/feature-detection.js"></script>
11 <style>
12   math, mspace {
13     font-size: 10px;
14   }
15   @font-face {
16     font-family: axisheight5000-verticalarrow14000;
17     src: url("/fonts/math/axisheight5000-verticalarrow14000.woff");
18   }
19 </style>
20 <script>
21   var emToPx = 10 / 1000; // font-size: 10px, font.em = 1000
22   var epsilon = 1;
23
24   function getBox(aId) {
25     return document.getElementById(aId).getBoundingClientRect();
26   }
27
28   setup({ explicit_done: true });
29   window.addEventListener("load", () => { document.fonts.ready.then(runTests); });
30
31   function runTests() {
32     test(function() {
33       assert_true(MathMLFeatureDetection.has_mspace());
34
35       var v1 = 5000 * emToPx;
36       var tableMiddle = (getBox("table").bottom + getBox("table").top) / 2;
37       assert_approx_equals(getBox("baseline").bottom - tableMiddle,
38                            v1, epsilon, "mtable: axis height");
39     }, "AxisHeight");
40
41     done();
42   }
43 </script>
44 </head>
45 <body>
46   <div id="log"></div>
47   <p>
48     <math style="font-family: axisheight5000-verticalarrow14000">
49       <mspace id="baseline" style="background: green" width="50px" height="1px"/>
50       <mtable id="table" style="background: blue"><mtr><mtd><mspace width="100px" height="1px"/></mtd></mtr></mtable>
51     </math>
52   </p>
53 </body>
54 </html>