diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-28 14:29:10 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-28 14:29:10 +0000 |
commit | 2aa4a82499d4becd2284cdb482213d541b8804dd (patch) | |
tree | b80bf8bf13c3766139fbacc530efd0dd9d54394c /layout/mathml/tests/test_bug330964.html | |
parent | Initial commit. (diff) | |
download | firefox-upstream.tar.xz firefox-upstream.zip |
Adding upstream version 86.0.1.upstream/86.0.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'layout/mathml/tests/test_bug330964.html')
-rw-r--r-- | layout/mathml/tests/test_bug330964.html | 98 |
1 files changed, 98 insertions, 0 deletions
diff --git a/layout/mathml/tests/test_bug330964.html b/layout/mathml/tests/test_bug330964.html new file mode 100644 index 0000000000..84da15194e --- /dev/null +++ b/layout/mathml/tests/test_bug330964.html @@ -0,0 +1,98 @@ +<!DOCTYPE HTML> +<html> +<!-- +https://bugzilla.mozilla.org/show_bug.cgi?id=330964 +--> +<head> + <title>Test for Bug 706406</title> + <script src="/tests/SimpleTest/SimpleTest.js"></script> + <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/> +</head> +<body> +<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=330964">Mozilla Bug 330964</a> +<p id="display"></p> + +<math> + <mtable framespacing="7px 20px" frame="solid" rowspacing="11px 27px" columnspacing="5px 16px" + style="border-width: 2px;" id="mtable0"> + <mtr> + <mtd id="mtd0"> + <mn>X</mn> + </mtd> + <mtd id="mtd1"> + <mn>X</mn> + </mtd> + <mtd id="mtd2"> + <mn>X</mn> + </mtd> + </mtr> + <mtr> + <mtd id="mtd3"> + <mn>X</mn> + </mtd> + <mtd id="mtd4"> + <mn>X</mn> + </mtd> + <mtd id="mtd5"> + <mn>X</mn> + </mtd> + </mtr> + <mtr> + <mtd id="mtd6"> + <mn>X</mn> + </mtd> + <mtd id="mtd7"> + <mn>X</mn> + </mtd> + <mtd id="mtd8"> + <mn>X</mn> + </mtd> + </mtr> + </mtable> +</math> + +<pre id="test"> +<script type="application/javascript"> + + var epsilon = 2; + function almostEqual(x, y) { return Math.abs(x - y) < epsilon; } + + rectTable = $("mtable0").getBoundingClientRect(); + rect0 = $("mtd0").getBoundingClientRect(); + rect1 = $("mtd1").getBoundingClientRect(); + rect2 = $("mtd2").getBoundingClientRect(); + rect3 = $("mtd3").getBoundingClientRect(); + rect4 = $("mtd4").getBoundingClientRect(); + rect5 = $("mtd5").getBoundingClientRect(); + rect6 = $("mtd6").getBoundingClientRect(); + rect7 = $("mtd7").getBoundingClientRect(); + rect8 = $("mtd8").getBoundingClientRect(); + ok(almostEqual(rect1.left - rect0.right, 5), "columnspacing wonky"); + ok(almostEqual(rect2.left - rect1.right, 16), "columnspacing wonky"); + ok(almostEqual(rect4.left - rect3.right, 5), "columnspacing wonky"); + ok(almostEqual(rect5.left - rect4.right, 16), "columnspacing wonky"); + ok(almostEqual(rect7.left - rect6.right, 5), "columnspacing wonky"); + ok(almostEqual(rect8.left - rect7.right, 16), "columnspacing wonky"); + ok(almostEqual(rect3.top - rect0.bottom, 11), "rowspacing wonky"); + ok(almostEqual(rect4.top - rect1.bottom, 11), "rowspacing wonky"); + ok(almostEqual(rect5.top - rect2.bottom, 11), "rowspacing wonky"); + ok(almostEqual(rect6.top - rect3.bottom, 27), "rowspacing wonky"); + ok(almostEqual(rect7.top - rect4.bottom, 27), "rowspacing wonky"); + ok(almostEqual(rect8.top - rect5.bottom, 27), "rowspacing wonky"); + // Remember to subtract border + ok(almostEqual(rect0.left - rectTable.left - 2, 7), "framespacing left wonky"); + ok(almostEqual(rect3.left - rectTable.left - 2, 7), "framespacing left wonky"); + ok(almostEqual(rect6.left - rectTable.left - 2, 7), "framespacing left wonky"); + ok(almostEqual(rect0.top - rectTable.top - 2, 20), "framespacing top wonky"); + ok(almostEqual(rect1.top - rectTable.top - 2, 20), "framespacing top wonky"); + ok(almostEqual(rect2.top - rectTable.top - 2, 20), "framespacing top wonky"); + ok(almostEqual(rectTable.bottom - rect6.bottom - 2, 20), "framespacing bottom wonky"); + ok(almostEqual(rectTable.bottom - rect7.bottom - 2, 20), "framespacing bottom wonky"); + ok(almostEqual(rectTable.bottom - rect8.bottom - 2, 20), "framespacing bottom wonky"); + ok(almostEqual(rectTable.right - rect2.right - 2, 7), "framespacing right wonky"); + ok(almostEqual(rectTable.right - rect5.right - 2, 7), "framespacing right wonky"); + ok(almostEqual(rectTable.right - rect8.right - 2, 7), "framespacing right wonky"); +</script> +</pre> +</body> +</html> |