summaryrefslogtreecommitdiffstats
path: root/layout/mathml/tests/stretchy-and-large-operators.html
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-28 14:29:10 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-28 14:29:10 +0000
commit2aa4a82499d4becd2284cdb482213d541b8804dd (patch)
treeb80bf8bf13c3766139fbacc530efd0dd9d54394c /layout/mathml/tests/stretchy-and-large-operators.html
parentInitial commit. (diff)
downloadfirefox-2aa4a82499d4becd2284cdb482213d541b8804dd.tar.xz
firefox-2aa4a82499d4becd2284cdb482213d541b8804dd.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/stretchy-and-large-operators.html')
-rw-r--r--layout/mathml/tests/stretchy-and-large-operators.html88
1 files changed, 88 insertions, 0 deletions
diff --git a/layout/mathml/tests/stretchy-and-large-operators.html b/layout/mathml/tests/stretchy-and-large-operators.html
new file mode 100644
index 0000000000..13fe14aa71
--- /dev/null
+++ b/layout/mathml/tests/stretchy-and-large-operators.html
@@ -0,0 +1,88 @@
+<!-- -*- mode: HTML; tab-width: 2; indent-tabs-mode: nil; -*- -->
+<!-- vim: set tabstop=2 expandtab shiftwidth=2 textwidth=80: -->
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Test Stretchy and Large Operators</title>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
+<!-- This Source Code Form is subject to the terms of the Mozilla Public
+ - License, v. 2.0. If a copy of the MPL was not distributed with this
+ - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
+ <script type="text/javascript"
+ src="stretchy-and-large-operators.js"></script>
+ <script type="text/javascript">
+
+ var mathml = "http://www.w3.org/1998/Math/MathML";
+
+ function createMo(aOperator, aForm)
+ {
+ var mo = document.createElementNS(mathml, "mo");
+ mo.appendChild(document.createTextNode(aOperator));
+ mo.setAttribute("form", aForm);
+ return mo;
+ }
+
+ function createTest(aEntry)
+ {
+ var opname = aEntry[0];
+ var operator = aEntry[1];
+ var type = aEntry[2];
+ var form = aEntry[3];
+
+ var div = document.createElement("div");
+ div.appendChild(document.createTextNode(opname));
+
+ var math = document.createElementNS(mathml, "math");
+
+ switch (type)
+ {
+ case "l": // largeop
+ math.appendChild(createMo(operator, form));
+ var mstyle = document.createElementNS(mathml, "mstyle");
+ mstyle.setAttribute("displaystyle", "true");
+ mstyle.appendChild(createMo(operator, form));
+ math.appendChild(mstyle);
+ break;
+
+ case "v": // vertical
+ for (var i = 1; i < 10; i+=2) {
+ var mo = createMo(operator, form);
+ mo.setAttribute("minsize", (.5 * i) + "em");
+ math.appendChild(mo);
+ }
+ break;
+
+ case "h": // horizontal
+ for (var i = 1; i < 10; i+=2) {
+ var mo = createMo(operator, form);
+ var mspace = document.createElementNS(mathml, "mspace");
+ mspace.setAttribute("width", (.5 * i) + "em");
+ var mover = document.createElementNS(mathml, "mover");
+ mover.setAttribute("accent", "false");
+ mover.appendChild(mspace);
+ mover.appendChild(mo);
+ math.appendChild(mover);
+ }
+ break;
+
+ default:
+ break;
+ }
+
+ div.appendChild(math);
+ document.body.appendChild(div);
+ }
+
+ function init()
+ {
+ for (var i in stretchy_and_large_operators) {
+ createTest(stretchy_and_large_operators[i]);
+ }
+ }
+ </script>
+ </head>
+
+ <body onload="init()">
+
+ </body>
+</html>