The MathML Acid3 test essentially relies on the classical Acid3 and just modifies the Javascript tests in order to verify some MathML features. Thus the requirement to pass the MathML Acid3 is the same:

To pass the test, a browser must use its default settings, the animation has to be smooth, the score has to end on 100/100, and the final page has to look exactly, pixel for pixel, like this reference rendering

The strategy
of the MathML Acid3 test is to let the browser layout MathML expressions
and to determine positions and sizes of elements via the
`getBoundingClientRect`

Javascript function. This does not allow to
test features like colors or links, but these are already verified in the
MathML Acid2 test. In general, the MathML specification gives some freedom and
so the corresponding tests are not too strict: for example one test just
verifies that in an <mfrac> element, the numerator is above a
denumerator, not precise coordinates or sizes.

Sometimes, a more accurate measurement is necessary. For that purpose,
the MathML Acid3 test uses a special Acid3MathML family that is
made available as Web fonts. These fonts contain characters used in the tests:
ASCII letters, mathematical alphanumeric Symbols (to test
`mathvariant`

) and some operators from the MathML Operator
Dictionary. Their sizes are given by the table below. Test 0 verifies that
these Web fonts are downloaded and retry several times if necessary.

Style | Width | Height | $\frac{\mathrm{Width}}{\mathrm{Height}}$ |
---|---|---|---|

bold-italic | 256 | 1024 | 1/4 |

sans-serif-bold-italic | 384 | 1024 | 3/8 |

bold | 512 | 1024 | 1/2 |

bold script | 576 | 1024 | 9/16 |

bold-fraktur | 640 | 1024 | 5/8 |

sans-serif-bold | 704 | 1024 | 11/16 |

italic | 768 | 1024 | 3/4 |

sans-serif-italic | 832 | 1024 | 13/16 |

monospace | 896 | 1024 | 7/8 |

normal | 1024 | 1024 | 1 |

script | 1088 | 1024 | 17/16 |

fraktur | 1152 | 1024 | 9/8 |

sans-serif | 1216 | 1024 | 19/16 |

double-struck | 1280 | 1024 | 5/4 |

However, this is still not enough to get perfect measure and results might
depend on some screen resolution, default font size, whether the page is zoom
in/out, whether automatic screen resizing is used on some mobile platforms etc
The MathML Acid3 test uses only relative `em`

measures. In test 0,
a $\mathrm{baseSize}$ value is determined for the current
font size of the page, which may vary according to zoom level or automatic
screen resizing. Next, the following approximate comparison functions are
used:

where $\epsilon =0.1$.
Hence
$\mathrm{almostLessThanAbs}(x,y)$
means that $x<y$ modulo a small error.
This error is "absolute" once the $\mathrm{baseSize}$ is fixed.
$\mathrm{almostLessThanRel}$
is "relative" in the sense that the tolerance grows with the magnitude of
$x,y$.
As a rule of thumb,
$\mathrm{almostLessThanAbs}$ is used to compare coordinates
(the tolerance should not depend on these coordinates)
while
$\mathrm{almostLessThanRel}$ is used to compare
sizes or distances (the tolerance is larger for big or far away objects).
Of course, we assume that
$\left|x\right|+\left|y\right|$
is nonzero (e.g. the objects have nonzero sizes) and even at least
`baseSize`

.
Rationale for the $2$: if
$x,y$ are objects of size
$S$ then
$\mathrm{almostLessThanRel}(x,y)\iff x-y<\epsilon \times S$ and this is equivalent to
$\mathrm{almostLessThanAbs}(x,y)$
for the base size.
The value compared to $\epsilon $ is inspired from
the
approximation
errors but we accomodate the fact that the document base size
may vary (absolute case) or that we can not distinguish between the exact and
approximative values (relative case).
For convenience the following approximate equality functions are
also defined:

Sometimes we want to tolerate even more errors
(e.g. tests to verify support for stretchy operators, which are not
always stretched perfectly by the classical TeX method) or want to
be sure that two values are really distinct (e.g. the bottom coordinate of
a base and exponent in `msup`

). The MathML Acid3 test uses a
parameter $\u1e9f=0.25$ for that purpose
which should be understood as a fraction of some size (e.g. the base size).

Finally, the MathML tests are contained in a div of width 1000em and this is assumed to be large enough so that automatic line breaking does not happen by default. Of course, tests for line breaking use narrower containers.

- Test 10 contains invalid markup: this is on purpose and intended to check error handling!
- From the above discussion about the test approximation, the description below will use "lower than", "smaller than", "nonzero" etc to mean with a nonnegligible difference (expressed in term of $\u1e9f$) while "at most as low", "at most as large", "zero" etc will mean modulo some small error (expressed in term of $\epsilon $)

This is a very simple test to start with:

- The "JS required" message is removed.
- Web fonts availability is verified (perhaps several times).
- The $\mathrm{baseSize}$ is computed.
- The namespace URI on a
`<math>`

is tested and should be`http://www.w3.org/1998/Math/MathML`

. - Test that inline math (default)
does not break (bottom of X and Y are aligned):
$\text{X}$ $\text{Y}$

- Test that display math (
`display="block"`

) breaks (bottom of X is at most as low as top of Y):$\text{X}$ $$\text{Y}$$

These are tests for `<mrow>`

, `<msub>`

,
`<msup>`

, `<msubsup>`

,
`<mover>`

, `<munder>`

and `<munderover>`

(left to right):

$\text{BASE}$ ${\text{BASE}}_{\text{X}}$ ${\text{BASE}}^{\text{X}}$ ${\text{BASE}}_{\text{X}}^{\text{X}}$ $\stackrel{\text{X}}{\text{BASE}}$ $\underset{\text{X}}{\text{BASE}}$ $\underset{\text{X}}{\overset{\text{X}}{\text{BASE}}}$

Test 1 verifies some sizes:

- The height of the
`<mrow>`

is less than the heights of the elements that have scripts attached to the BASE. The height of elements with one script is less than the height of the corresponding element with two scripts. - When the scripts are positioned on the right of the
base (
`<msub>`

,`<msup>`

,`<msubsup>`

), the width of these elements should be larger than the one of the`<mrow>`

. -
When the scripts are positioned above or
below the base (
`<mover>`

,`<munder>`

and`<munderover>`

) the width of these elements should be the same as the width of the`<mrow>`

.

Test 2: verifies some positions:

- The subscripts of
`<msub>`

and`<msubsup>`

should be lower than the base. This is verified by testing that the top of the subscripts are lower than the top of the base. Similarly, the test checks that the supscripts of`<msup>`

and`<msubsup>`

are higher than the base. - The sub/super scripts of
`<msub>`

,`<msup>`

,`<msubsup>`

should be placed on the right of the base. The test verifies that the right coordinate of the base is at most the left coordinate of the scripts. - The under/over scripts of
`<mover>`

,`<munder>`

and`<munderover>`

should be placed between the left and right coordinates of the base. The test verifies that the left coordinate of base is at most the left coordinate of the scripts and similarly for the right coordinates. - The under/over scripts of
`<mover>`

,`<munder>`

and`<munderover>`

should be placed above/below the base. The test verifies that the top of the base is at most as low as the bottom of the overscripts. Similarly for the underscripts.

A simple test for the `<mfrac>`

element, where
numerator and denumerator have the same size.

$\frac{\text{X}}{\text{Y}}$

- Numerator and denumerator should be vertically aligned: the test verifies that the left coordinate of the numerator (respectively right coordinate) matches the left coordinate of the denumerator (respectively right coordinate).
- Numerator should be above denumerator. The test verifies that the bottom of the numerator is at most as low as the top of the denumerator.

This test verifies some properties of the `<msqrt>`

element:

- The square root should be placed on the left. For that purpose we
verify that the space on the left (the left coordinate of the
child minus the left coordinate of the
`<msqrt>`

) is nonzero. - The child should be inside the square root. The test verifies that the bottom of the child is at most at low as the bottom of the square root and similarly for the other coordinates.

$\sqrt{\text{X}}$

This test verifies the following properties of the `<mroot>`

element:

- The index should be higher than the base. The test checks that the bottom of the index is higher than the bottom of the child.
- The index should be on the left of the base. The test checks that the right coordinate of the index is at most the left coordinate of the child.

$\sqrt[\text{X}]{\text{Y}}$

This is a simple test to verify the support for the box and circle notations
of menclose. The test contains some nested `<menclose>`

elements: an `<mtext>`

element,
framed with an `<menclose>`

"box",
circled by a `<menclose>`

"circle",
framed, and finally circled again.

We assume here that the notations are drawn with
rectangle and ellipse whose axis are the horizontal/vertical axis of the text
and
that the notations do not overlap. Hence the width and height of an
`<menclose>`

"box" should be at least those its content. Simple math shows that the width and
height of the `<menclose>`

"circle" should be at least
$\sqrt{2}$ times as large as its content.
With the previous nesting, the outermost `<menclose>`

is
${\sqrt{2}}^{2}=2$
times as large as the inner `<mtext>`

. Hence
the test verifies the following properties:

- The
`<mtext>`

should be inside the`<menclose>`

. This is verified by comparing the top, bottom, left and right coordinates. - The outermost
`<menclose>`

should be at least twice as large as the child. This is verified by comparing the width.

$\overline{)\overline{)\overline{)\overline{)\text{XXX}}}}}$

This test verifies a couple of equivalence for menclose constructions:

- "radical" should be equivalent to the
`<msqrt>`

element. - "box" should be equivalent to "left right top bottom"
- "actuarial" should be equivalent to "top right"

The test only verifies that the size of equivalent constructions are equal.
This is a bit lax and thus a rendering engine that does not implement
`<menclose>`

at all might actually pass the test. Hence an additional
verification is done to exclude this case:
the width of an `<msqrt>`

element should not be equal to
the width of its content.

$\sqrt{\text{XXX}}$ $\sqrt{\text{XXX}}$

$\overline{)\text{XXX}}$ $\overline{)\text{XXX}}$

$\overline{)\text{XXX}}$ $\overline{\text{XXX}\hspace{.2em}|}$

This test contains a `<semantics>`

element with an `<mtext>`

child annotated
by `<annotation>`

and `<annotation-xml>`

elements of encoding `"application/x-tex"`

and `"application/xhtml+xml"`

.
It is assumed that a MathML rendering engine
will just display the annotated `<mtext>`

and hide the others. Hence the
test verifies that the `<semantics>`

size is the same as
the `<mtext>`

child.

$XXXXX$

This is similar to test 8, except that `<maction>`

elements are used with
actiontype tooltip, statusline and toggle. In the two first cases, only the
first element must be visible. In the last case, the selection attribute is
used to display only the second element. As in test 8, we compare the size
of the expected visible child with the size of the maction element.

$\text{X}\text{tooltip}$

$\text{X}\text{statusline}$

$\text{X}\text{selection}$

This test contains a trivial verification about the mrow, mstyle and mphantom elements. Basically, they should have the same size as their content:

_$\text{TEXT}$_

_$\text{TEXT}$_

_$\phantom{\text{TEXT}}$_

These are combined with a somewhat
less easy verification so that the whole test
won't pass in browsers without MathML support. Basically we check that
an msub with three `<mtext>`

children generates an invalid markup message but
not when the two first are grouped into an `<mrow>`

element.
Again, we verify the
difference by width comparison. We assume that the width of the text in
the error message is negligible compared to the width of the
`<mtext>`

element.
For that purpose, the actual test contains long
`<mtext>`

string, rather than
just one "X" as below.

${\text{X}\text{X}}_{\text{}}$

${\text{X}}_{\text{X}}$

These are basic tests on an `<mtable>`

of 3 rows and 3
columns. Test 11 verifies metrics of `<mtr>`

elements:

- mtable rows should have same height.
- mtable rows should be aligned, that is the left/right coordinates of mtr elements should match.
- each row should be above its successor, that is the bottom of an mtr element should be at most the top of its successor.

Test 12 verifies metrics of mtd elements:

- The cells of a given column should be aligned, that is the left/right coordinates of mtd elements should match.
- The cells of a given row should be aligned, that is the top/bottom coordinates of mtd elements should match.
- Each column should be on the left of the next column. The test verifies that the right coordinate of one cell in the column is at most the left coordinate of one cell in the next column.
- Similarly for rows, using the bottom/top coordinates

$\begin{array}{ccc}\text{1}& \text{2}& \text{3}\\ \text{4}& \text{5}& \text{6}\\ \text{7}& \text{8}& \text{9}\end{array}$

This test contains an `<mmultiscripts>`

element with
4 prescripts and 4 postscripts. The prescript at the top and right
as well as the postscript at the bottom right are
`<none>`

elements. All
the other scripts have the same size. The test verifies that:

- The <none> elements have zero size. This is done by checking that height times width is zero.
- All the other scripts have the same size.
- The horizontal positions of nonempty scripts are correct, that is the test verify the left to right positioning of scripts. For example that the right coordinate of the base is at most the left coordinate of a postscript.
- The vertical alignment of nonempty scripts, that is the left coordinates of some scripts should match.
- The horizontal alignment of nonempty scripts. That is the top coordinate of some scripts should match.
- subscripts should be above supscripts, that is the bottom coordinate of a subscript is at most the top coordinate of a supscript.
- subscripts/supscripts should be lower/higher than the base. Same as in test 2.

${}_{\text{X}}{}^{\text{X}}{}_{\text{X}}\text{X}_{\text{X}}^{\text{X}}{}^{\text{X}}$

This test contains two spaces of em dimensions (width, height, depth) given by (5, 3, 2) and (15, 4, 6). The test verifies that

- The widths of the spaces are given by 5 and 15 respectively.
- The (CSS) height is the sum of the (mspace) height and depth, that is 5 and 10 respectively.
- The baseline alignement is correct. The test verifies the bottom of the second space minus the bottom of the first space is the depth of the second minus the depth of the first, that is 4.

$\phantom{\rule[-2em]{5em}{3em}}\phantom{\rule[-6em]{15em}{4em}}$

This test contains four `<mpadded>`

elements of em
dimensions
(width, height, depth) given by (5, 3, 2), (15, 4, 6), (10, 20, 10) and
(3, 1.5, 1). The fourth is included in the third, with em shift
(lspace, voffset) given by (2, 2.5). The test verifies that:

- The sizes of the mpadded elements are correct
- The first and second mpadded elements are correctly aligned (as in test 14).
- The position of the fourth mpadded inside the third is correct. That is the left coordinate of the inner mpadded minus the left coordinate of the outer mpadded should be the lspace value. The top coordinate of the inner mpadded minus the top coordinate of the outer mpadded should be the difference of (mspace) height minus the voffset.

$$ $$

This test contains the following token elements: <mtext>X</mtext>, <ms lquote="XXX" rquote="XX">X</ms>, <mi>X</mi>, <mi>XX</mi> and <mn>X</mn>. The test verifies that:

- The width of the ms is 5 times the one of the
`<mtext>`

(three X's for`rquote`

, one inner X and two X's for the`lquote`

). - The width of the
`ms`

and`<mtext>`

are the same. - The width of the "XX"
`mi`

is twice the one of the`<mtext>`

(an`mi`

with several characters is not slanted) - The width of the "X"
`mi`

is $\frac{3}{4}$ the one of the`<mtext>`

(an`mi`

with one character is italic, the ratio is from the table about Acid3MathML fonts)

$\text{X}$ $XXXXXX$ $X$ $\mathrm{XX}$ $\mathrm{X}$

A first test contains an mfrac element with linethickness="2em". It verifies that the total mfrac height is at least the sum of the height of the numerator, denumerator and linethickness and that the bottom of the numerator and the top of the denumerator are separated by at least the linethickness.

$\genfrac{}{}{2em}{}{\text{X}}{\text{X}}$

An mfrac element with numerator and denumerator of different sizes is aligned with numalign="left" (respectively an denomalign="right"). The widest child is the denumerator (respectively numerator) so that the test is nontrivial. The test verifies the alignement with respect to the mfrac element.

$\frac{\text{X}\hfill}{\text{XXX}}$ $\frac{\text{XXX}}{\hfill \text{X}}$

Finally, an mfrac with bevelled="true" is tested. In that case, the right of the numerator is at most the left of the denumerator and the top of the numerator is higher than the top of the denumerator.

$\raisebox{1ex}{$\text{X}$}\!\left/ \!\raisebox{-1ex}{$\text{X}$}\right.$

This test verifies the subscriptshift/superscriptshift attributes for the msub, msup and msubsup elements. The base is a square of size 4em and the shift is 6em. Hence the test verifies that the vertical gap between the base and the script is at least 2em.

${\phantom{\rule[-2em]{4em}{2em}}}_{\phantom{\rule[-2em]{4em}{2em}}}$

${\phantom{\rule[-2em]{4em}{2em}}}^{\phantom{\rule[-2em]{4em}{2em}}}$

${\phantom{\rule[-2em]{4em}{2em}}}_{\phantom{\rule[-2em]{4em}{2em}}}^{\phantom{\rule[-2em]{4em}{2em}}}$

This test verifies the align attribute of the munder/mover/munderover, that is whether the base and scripts are aligned with respect to their left, center or right. Additionally, the base is checked to be at most three times larger than the scripts, so that the test is nontrivial.

$\underset{\text{X}}{\text{XXX}}$ $\underset{\text{X}}{\text{XXX}}$ $\underset{\text{X}}{\text{XXX}}$

$\stackrel{\text{X}}{\text{XXX}}$ $\stackrel{\text{X}}{\text{XXX}}$ $\stackrel{\text{X}}{\text{XXX}}$

$\underset{\text{X}}{\overset{\text{X}}{\text{XXX}}}$ $\underset{\text{X}}{\overset{\text{X}}{\text{XXX}}}$ $\underset{\text{X}}{\overset{\text{X}}{\text{XXX}}}$

This test verifies the effect of the accent and accentunder attributes. Here, the test verifies that an accent script is drawn closer to the base than a normal script. See also test 33 for the size comparison. A small verification is done to check that the distance between the base and script is nonzero.

$\underset{\text{X}}{\text{X}}$ $\underset{\text{X}}{\text{X}}$

$\stackrel{\text{X}}{\text{X}}$ $\stackrel{\text{X}}{\text{X}}$

$\underset{\text{X}}{\overset{\text{X}}{\text{X}}}$ $\underset{\text{X}}{\overset{\text{X}}{\text{X}}}$

This test verifies the alignement of mtable with respect to the baseline when the align attribute is (from left to right) top, bottom, the bottom of the second row and the top of the penultimate row.

$\phantom{\rule[-1px]{100px}{1px}}\begin{array}{c}\text{X}\end{array}\begin{array}{c}\text{X}\end{array}\begin{array}{c}\text{X}\\ \text{X}\\ \text{X}\\ \text{X}\end{array}\begin{array}{c}\text{X}\\ \text{X}\\ \text{X}\\ \text{X}\end{array}\phantom{\rule[-1px]{100px}{1px}}$

This test verifies the effect of `rowalign/columnalign`

on
`mtable`

, `mtr`

and `mtd`

elements. We have a table of 2 rows and 2 columns whose alignment
value on cells is (from left to right and top to bottom):
rowalign=bottom, columnalign=left ;
rowalign=bottom, columnalign=right,
rowalign=top, columnalign=left ; and rowalign=top, columnalign=right. The
cells contain spaces of different sizes and thus a small test ensures that
those spaces have nonzero sizes.

$\begin{array}{rl}\phantom{\rule[-0em]{1em}{3em}}& \phantom{\rule[-0em]{15em}{15em}}\\ \phantom{\rule[-0em]{1.5em}{3em}}\hfill & \hfill \phantom{\rule[-0em]{4em}{4.5em}}\end{array}$

This test contains a with two columns whose width is set by the columnwidth attribute to "1em" and "2em".

$\begin{array}{cc}\text{X}& \text{X}\end{array}$

This test contains a table with a single cell. The width attribute is used to set the width of the table to "5em".

$\begin{array}{c}\text{X}\end{array}$

This test contains two almost identical mtable elements with four rows and four columns. Their (rowspacing, columnspacing) attributes are set to ("1em 1.5em 2em", "1.5em 2.5em 3em") and ("3em 4.5em 2em", "3.5em 5.5em 7em") respectively. The test verifies that height of the first table minus the height of the second table is the difference of the sum of rowspacing values. Similarly for the width and columnspacing values.

$\begin{array}{c}\text{X}\text{X}\text{X}\text{X}\\ \text{X}\text{X}\text{X}\text{X}\\ \text{X}\text{X}\text{X}\text{X}\\ \text{X}\text{X}\text{X}\text{X}\end{array}$ $\begin{array}{c}\text{X}\text{X}\text{X}\text{X}\\ \text{X}\text{X}\text{X}\text{X}\\ \text{X}\text{X}\text{X}\text{X}\\ \text{X}\text{X}\text{X}\text{X}\end{array}$

This test contains a mlabeledtr element with a LABEL and an EQUATION. The
parent `mtable`

contains a
`side="right"`

attribute so the LABEL should be
displayed on the right of the EQUATION.

$\begin{array}{}\text{LABEL}& \text{EQUATION}\end{array}$

This test contains a mlabeledtr element with a LABEL and an EQUATION. The minlabelspacing on the parent table is "2em" so the test verifies that the distance between the LABEL and the EQUATION is at most that wide.

$\begin{array}{}\text{LABEL}& \text{EQUATION}\end{array}$

As in test 25, we have two almost identical tables and compare the difference of size between the two tables. The tables have different framespacing values and the difference should match the difference of height/width of the two tables.

$\begin{array}{|c|}\hline \text{X}\\ \hline\end{array}$ $\begin{array}{|c|}\hline \text{X}\\ \hline\end{array}$

As in test 22, this is a table of four cells of different sizes and a small test verifies that the mspace element used is indeed supported. The table has equalrow and equalcolumns set to true and so the actual test measures that this is the case.

$\begin{array}{cc}\phantom{\rule[-0em]{10em}{10em}}& \phantom{\rule[-0em]{8em}{5em}}\\ \phantom{\rule[-0em]{2em}{3em}}& \phantom{\rule[-0em]{4em}{2em}}\end{array}$

This test contains a table with two cells that have rowspan="2" and columnspan="2" respectively. The test verifies that these cells have same height/width as the adjacents cells.

$\begin{array}{ccc}\text{X}& \multicolumn{2}{c}{\text{X}}\\ \text{X}& \text{X}\end{array}$

This is just a fragment of text with mathsize="2em" and thus the test verifies that its size is as expected twice as large as the base size.

$\text{XXX}$

This test contains some text with different mathvariant values. The widths are measured and verified to match the values indicated in the table about Acid3MathML fonts:

$\text{0}\mathbf{A}\mathcal{B}\mathfrak{C}\mathit{D}\mathcal{E}\mathfrak{F}\mathsf{G}\mathbb{H}\mathsf{I}\mathsf{J}\mathsf{K}\mathtt{L}\mathit{M}$

Note that it should render exactly the same as if the corresponding Unicode code points were used instead of mathvariant:

$\text{0}\text{\mathbf{A}}\text{\mathcal{B}}\text{\u212d}\text{\bm{D}}\text{\U0001d4d4}\text{\U0001d571}\text{\U0001d5a6}\text{\mathbb{H}}\text{\U0001d5dc}\text{\U0001d611}\text{\U0001d646}\text{\U0001d67b}\text{\mathit{M}}$

This is the same as test 20, but we verify that an accent script is larger than a normal script, because the scriptlevel is not incremented.

This test contains mover/munder elements with movablelimits="true". The first has displaystyle="true" and so the script should be above the base while the second has displaystyle="false" and so the script should be next to the base. The test verifies positions as in test 2.

$\stackrel{\text{X}}{XXX}$ $\underset{\text{X}}{X}$

This contains two tests. The first one is an mfrac with mathsize="10em" with scriptsizemultiplier=".5" and since the scriptlevel is increased by one in the numerator/denumerator, the size becomes "5em". We assume that the scriptminsize is not reached.

$\frac{\text{X}}{\text{X}}$

The second is an mfrac in displaystyle="true". Using the technique of test 34 with movablelimits, we verify that the displaystyle is reset in the numerator/denumerator: the munder/mover elements should have their scripts on the right.

$\frac{\underset{\text{X}}{X}}{\stackrel{\text{X}}{X}}$

This is similar to test 35 for mroot. We verify that displaystyle is reset within the mroot index and that scriptlevel is increased by 2

$\sqrt[\stackrel{\text{X}}{X}]{\text{BASE}}$

This is similar to test 35 for msub. We verify that displaystyle is reset within the msup script and that scriptlevel is increased by 1.

$\text{BASE}}^{\stackrel{\text{X}}{X}$

This is similar to test 35 for munder. We verify that displaystyle is reset within the munder script and that scriptlevel is increased by 1.

$\underset{\stackrel{\text{X}}{X}}{\text{BASE}}$

This is similar to test 38 with an accent script. In that case, the scriptlevel should not increase.

$\stackrel{X}{\text{BASE}}$

This test contains three summation symbols. One in displaystyle="true" and (and largeop="true" per the operator dictionary). A second one in displaystyle="true" but largeop="false". And a third one with displaystyle="false". The first should be larger than the others and the two last symbols should have the same size.

$\sum}{\displaystyle \sum}\sum $

This test contains a text with mathsize="8em" and scriptsizemultiplier=".5". A scriptlevel="2" attribute is used to force the scriptlevel and thus the final size should be 2em.

${\scriptscriptstyle \text{X}}$

This is similar to test 41: the initial size is 32em, the scriptsizemultiplier is .5 and the scriptlevel is set to 5. In theory, the size should become 1em. However, the scriptminsize is set to 8em, so this should be the value used instead.

${\scriptscriptstyle \text{X}}$

This is a simple "X" operator with lspace="3.5em" and rspace="4em". Hence the total distance between the previous and next element should be 10.5em

$\text{X}X\text{X}$

This contains two parenthesis next to space of total height 6em. The first has stretchy="false" and should not stretch while the second has stretchy="true" and should stretch.

$(\phantom{\rule[-3em]{1px}{3em}}$ $(\phantom{\rule[-3em]{1px}{3em}}$

This is similar to test 44, but the space has height 9em and depth 1em. Instead of largeop, we test symmetric. When it is true, the parenthesis symmetrically (height=18em) otherwise it should not (height=10em).

$(\phantom{\rule[-1em]{1px}{9em}}$ $(\phantom{\rule[-1em]{1px}{9em}}$

Again we have an mspace element of total height 20em and check the height of an adjacent stretchy operator. maxsize is set to "10em" so the operator should stretch, but at most to that size.

$(\phantom{\rule[-10em]{1px}{10em}}$

This is similar to test 46, but with an mspace element of total height 2em and an operator with minsize="10em". Hence the operator should stretch to that size.

$(\phantom{\rule[-1em]{1px}{1em}}$

This test contains two minus operators with form attribute set to infix and prefix respectively. Per the operator dictionary, the (rspace, lspace) values should be (mediummathspace, mediummathspace) and (0, veryverythinmathspace) respectively. We perform a verification similar to the one of test 43.

$0-1$ ; $2-3$

This test is similar to test 48, except that we let the rendering engine determines the default value of the form attribute. The four rules given in the MathML specification are verified.

This test contains various embellished operators near an mspace element of size 20em. Hence the operator at the core should stretch to that size.

$\phantom{\rule[-10em]{0ex}{10em}}|{|}^{\mathrm{X}}{|}_{\mathrm{X}}{|}_{\mathrm{X}}^{\mathrm{X}}\underset{\mathrm{X}}{|}\stackrel{\mathrm{X}}{|}\underset{\mathrm{X}}{\overset{\mathrm{X}}{|}}{}_{\mathrm{X}}{}^{\mathrm{X}}|_{\mathrm{X}}^{\mathrm{X}}||\phantom{|}|\mathrm{NOTSELECTED}||$

This test contains various mrow elements with an operator and a space-like element. Hence these mrow elements are embellished operators and we use a verification similar to the one of test 50.

$\phantom{\rule[-10em]{0ex}{10em}}|\text{S}|\phantom{\rule{0ex}{0ex}}|\phantom{\rule{0ex}{0ex}}\text{S}|\phantom{\phantom{\rule{0ex}{0ex}}\text{S}}|\phantom{\rule{0ex}{0ex}}\text{S}|\phantom{\rule{0ex}{0ex}}\text{S}|X\phantom{\rule{0ex}{0ex}}||$

This test contains
an msqrt element with tall mspace elements and stretchy operators inside.
The test verifies vertical stretching inside the implicit mrow child of
the `<msqrt>`

element.

$\sqrt{\phantom{\rule[-1.5em]{0ex}{1.5em}}\left|\phantom{\rule[-5em]{0ex}{5em}}\right()}$

This test vertical stretching in mtd elements. The cells have vertical stretchy operators or tall mspace elements and the operators should stretch to the size of the largest mspace element in the same row.

$\begin{array}{cccc}\phantom{\rule[-1.5em]{1px}{1.5em}}& |& \phantom{\rule[-5em]{1px}{5em}}& \phantom{\rule[-2.5em]{1px}{2.5em}}\\ \phantom{\rule[-1.5em]{1px}{1.5em}}& |& \phantom{\rule[-5em]{1px}{5em}}& \phantom{\rule[-2.5em]{1px}{2.5em}}\\ \phantom{\rule[-1.5em]{1px}{1.5em}}& |& \phantom{\rule[-5em]{1px}{5em}}& |\end{array}$

This is similar to tests 54 and 45. Basically, we verify that the rule for symmetric stetching applies when rowalign is "baseline" but not when it is "bottom".

$\begin{array}{cc}(& \phantom{\rule[-2em]{1px}{4em}}\\ (& \phantom{\rule[-2em]{1px}{4em}}\end{array}$

In this test, a vertical stretchy operator is contained inside a cell with rowspan="2". The second column is a cell of rowspan="3" and is ignored. So the stretchy operator should stretch to cover the height of the two first cells in the third column.

$\begin{array}{ccc}|& \phantom{\rule[-3em]{0ex}{3em}}& \phantom{\rule[-1em]{0ex}{1em}}\\ \phantom{\rule[-1em]{0ex}{1em}}\\ \text{(3,1)}& \text{(3,3)}\end{array}$

This test verifies stretching of horizontal arrows inside an munder/mover/munderover element.

$\underrightarrow{\phantom{\rule{5em}{1px}}}\overrightarrow{\phantom{\rule{5em}{1px}}}\overrightarrow{\underrightarrow{\phantom{\rule{5em}{1px}}}}\underrightarrow{\phantom{\rule{5em}{1px}}}$

This is the counterpart of test 53 for horizontal stretching.

$\begin{array}{ccc}\phantom{\rule{3em}{1px}}& \phantom{\rule{3em}{1px}}& \phantom{\rule{3em}{1px}}\\ \to & \to & \to \\ \phantom{\rule{10em}{1px}}& \phantom{\rule{10em}{1px}}& \phantom{\rule{10em}{1px}}\\ \phantom{\rule{5em}{1px}}& \phantom{\rule{5em}{1px}}& \to \end{array}$

This is the counterpart of test 55 for horizontal stretching.

This is similar to previous tests, but combines columnspan, rowspan, vertical stretching and horizontal stretching.

$\begin{array}{ccccc}X& \multicolumn{3}{c}{\to}& X\\ \downarrow & & & & \downarrow \\ & \phantom{\rule[-3em]{6em}{3em}}& \\ & & \\ X& \multicolumn{3}{c}{\to}& X\end{array}$

This is similar to tests 50 and 51 but combined in a more complex way. The horizontal arrow and vertical bar should stretch.

$\phantom{\rule{0ex}{10em}}{}_{\mathrm{X}}{}^{\mathrm{X}}\phantom{\text{X}\text{Y}\phantom{\rule{0ex}{0ex}}\text{S}|\phantom{\rule{0ex}{0ex}}\text{Y}XX\phantom{\rule{0ex}{0ex}}}_{\mathrm{X}}^{\mathrm{X}}\stackrel{\underset{B}{\text{A}{\to}^{\text{Z}}}}{\text{XXXXX}}$

This is similar to test 40, but using the default largeop value from the operator dictionary.

$$\text{\u220f}\prod \coprod \sum \int \iint \iiint \oint \u222f\u2230\u2231\u2232\u2233\bigwedge \bigvee \bigcap \bigcup \u2a06\u2a0b\u2a0c\u2a0d\u2a0e\u2a0f\u2a10\u2a11\u2a12\u2a13\u2a14\u2a15\u2a16\u2a17\u2a18\u2a19\u2a1a\u2a1b\u2a1c$$

This is similar to test 44. The test verifies the stretchiness of various horizontal operators from the operator dictionary

$\underset{\_}{\phantom{\rule{5em}{0ex}}}\underset{\xaf}{\phantom{\rule{5em}{0ex}}}\underset{\u203e}{\phantom{\rule{5em}{0ex}}}\underleftarrow{\phantom{\rule{5em}{0ex}}}\underrightarrow{\phantom{\rule{5em}{0ex}}}\underleftrightarrow{\phantom{\rule{5em}{0ex}}}\underset{\u21a4}{\phantom{\rule{5em}{0ex}}}\underset{\mapsto}{\phantom{\rule{5em}{0ex}}}\underset{\hookleftarrow}{\phantom{\rule{5em}{0ex}}}\underset{\hookrightarrow}{\phantom{\rule{5em}{0ex}}}\underset{\leftharpoonup}{\phantom{\rule{5em}{0ex}}}\underset{\rightharpoonup}{\phantom{\rule{5em}{0ex}}}\underset{\rightharpoondown}{\phantom{\rule{5em}{0ex}}}\underset{\Leftarrow}{\phantom{\rule{5em}{0ex}}}\underset{\Rightarrow}{\phantom{\rule{5em}{0ex}}}\underset{\iff}{\phantom{\rule{5em}{0ex}}}\underset{\u23b4}{\phantom{\rule{5em}{0ex}}}\underset{\u23b5}{\phantom{\rule{5em}{0ex}}}\underset{\u23dc}{\phantom{\rule{5em}{0ex}}}\underset{\u23dd}{\phantom{\rule{5em}{0ex}}}\underset{\u23de}{\phantom{\rule{5em}{0ex}}}\underset{\u23df}{\phantom{\rule{5em}{0ex}}}\underset{\u27f5}{\phantom{\rule{5em}{0ex}}}\underset{\u27f6}{\phantom{\rule{5em}{0ex}}}\underset{\u27f7}{\phantom{\rule{5em}{0ex}}}\underset{\u294e}{\phantom{\rule{5em}{0ex}}}\underset{\u2950}{\phantom{\rule{5em}{0ex}}}\underset{\u295b}{\phantom{\rule{5em}{0ex}}}\underset{\u295f}{\phantom{\rule{5em}{0ex}}}\underset{\ufe35}{\phantom{\rule{5em}{0ex}}}\underset{\ufe36}{\phantom{\rule{5em}{0ex}}}$

This is similar to test 44. The test verifies the stretchiness of various vertical operators from the operator dictionary

$\phantom{\rule[-5em]{0ex}{5em}}\left(\right)\left[\right]\left\{\right|\}\Vert \uparrow \downarrow \updownarrow \Uparrow \Downarrow \Updownarrow \surd \lceil \rceil \lfloor \rfloor \u27e8\u27e9$

This is similar to test 43. This test verifies the spacing around various operators from the operator dictionary for a given form.

This test verifies that various mrow-like elements are layout from right to left when dir="rtl" is used. The test compares the coordinates of the "X" and "Y" children and the "Y" should be on the left of the "X".

$\text{X}\text{Y}$ $\text{X}\text{Y}$ $\sqrt{\text{X}\text{Y}}$ $\text{X}\text{Y}$ $\text{X}\text{Y}$ $\text{X}\text{Y}$ $\phantom{\text{X}\text{Y}}$ $\overline{)\text{X}\text{Y}}$ $\begin{array}{c}\text{X}\text{Y}\end{array}$

This is the counterpart of test 2 in RTL mode. The only difference should be that the scripts of the msub/msup/msubsup elements are now on the left of the base.

$\text{BASE}$

${\text{BASE}}_{\text{X}}$

${\text{BASE}}^{\text{X}}$

${\text{BASE}}_{\text{X}}^{\text{X}}$

$\stackrel{\text{X}}{\text{BASE}}$

$\underset{\text{X}}{\text{BASE}}$

$\underset{\text{X}}{\overset{\text{X}}{\text{BASE}}}$

This is similar to test 17 but in RTL mode. The behavior of the numalign/denomalign attributes should not change but a bevelled fraction should be drawn from right to left.

$\frac{\text{X}\hfill}{\text{XXX}}$

$\frac{\text{XXX}}{\hfill \text{X}}$

$\raisebox{1ex}{$\text{X}$}\!\left/ \!\raisebox{-1ex}{$\text{X}$}\right.$

This is the counterpart of test 13 in RTL mode. The only difference is that scripts are now positioned from right to left.

${}_{\text{X}}{}^{\text{X}}{}_{\text{X}}\text{X}_{\text{X}}^{\text{X}}{}^{\text{X}}$

This is a test for mpadded in RTL mode. Basically, we only check that lspace="5em" is the space between the X and Y.

$\text{X}\text{Y}\text{Z}$

This is the counterpart of test 4 in RTL mode. The square root symbol should now be on the right.

$\sqrt{\text{X}}$

This is the counterpart of test 5 in RTL mode. The index is now placed on the right of the base.

$\sqrt[\text{X}]{\text{Y}}$

This is the counterpart of tests 11, 12 in RTL mode. The cells in a row should be layout from right to left.

$\begin{array}{ccc}\text{1}& \text{2}& \text{3}\\ \text{4}& \text{5}& \text{6}\\ \text{7}& \text{8}& \text{9}\end{array}$

This test contains a formula given by an mtext of width 6em, an operator of width 1em and an mtext of width 6em. The operator is a plus and so has linebreakstyle=before in the operator dictionary. The width of the parent div is 10.5em, so the formula should break before the operator. The test done is similar to the one in test 0.

$\text{ABC}+\text{DEF}$

This is similar to test 73, but the operator is a comma and so has linebreakstyle=after. Hence the formula should break after the operator.

$\text{ABC},\text{DEF}$

This is similar to test 73, but the mtext elements have only width of 1em and so no break should happen. However, the operator has linebreak="newline" and so the formula should break before the operator.

$\text{A}+\text{B}$

This test contains an `<mtext>`

of width 6em, a plus operator of width 2em,
an `<mtext>`

of width 8em, a comma operator of width 2em and
an `<mtext>`

of width 8em. The width of the parent div is
20.5em.
In theory, the
formula may break after the comma but since this one has linebreak="nobreak",
the formula should break before the plus.

$\text{ABC}+\text{DEFG},\text{HIJK}$

This is similar to test 76, except that the plus has
`linebreak="goodbreak"`

and the comma has
`linebreak="badbreak"`

. Hence the formula should break before
the plus.

$\text{ABC}+\text{DEFG},\text{HIJK}$

This test contains an mtext of width 6em, a plus of width 2em and an mtext of width 6em. The parent div has width 8.5em and so the formula should break before the plus. Moreover, the operator has lineleading="5em", so the space between the bottom of the first mtext and the top of the plus should be 5em.

$\text{ABC}+\text{DEF}$

This is similar to test 73 but the mo element has indentalign="right" instead. Hence the indent before the plus should at least be 2em.

$\text{ABC}+\text{DEF}$

This is similar to test 79, but with indentshift="2em" instead. Again, the indent before the plus should at least be 2em.

$\text{ABC}+\text{DEF}$

This table contains two rows, each one with one cell. The first cell is "ABC" with malignmark edge="right" at the end and the second cell is "DEF" with malignmark edge="left". The two marks should be aligned, like this:

ABC| |DEF

$\begin{array}{c}\text{ABC}\\ \text{DEF}\end{array}$

This is similar to test 81, the first cell has maligngroup groupalign="right" and the second maligngroup groupalign="left" so the table should again render like this:

ABC| |DEF

$\begin{array}{c}\text{ABC}\\ \text{DEF}\end{array}$

Here, the first cell is "ABCDEF" with groupalign="center" and the second has "1234" with malignmark on the middle, so the table should render like

ABC|DEF 12|34

$\begin{array}{l}\text{ABCDEF}\\ \text{1234}\end{array}$

Here, the first align group is "ABC.EF" with groupalign=decimalpoint and the second is "1234" with malignmark edge="left" on the middle and another malignmark (this one should be ignored). The table should render like this:

ABC|.FG 12|34

$\begin{array}{r}\text{ABC.EF}\\ \text{1234}\end{array}$

This is similar to test 81 but with several groupalign elements and malignmark at different places. The table should render like this:

|ABCD A|BCD AB|CD ABC|D ABCD|

$\begin{array}{c}\text{ABCD}\\ \text{ABCD}\\ \text{ABCD}\\ \text{ABCD}\\ \text{ABCD}\end{array}$

This is similar to test 82 but with several maligngroup elements in each cell. The groupalign attribute is used on the mtd elements to specify the alignment. The table should render like this:

|[ABC][E|F] [GHIJ]| [01]| |[234] [56]|[78]

$\begin{array}{c}\text{ABC}\text{EF}\text{GHIJ}\\ \text{01}\text{234}\text{5678}\end{array}$

This is similar to test 86, but the groupalign attribute is specified on the first mtr element.

$\begin{array}{c}\text{ABC}\text{EF}\text{GHIJ}\\ \text{01}\text{234}\text{5678}\end{array}$

This is similar to test 86, but the groupalign attribute is specified on the mtable element.

$\begin{array}{c}\text{ABC}\text{EF}\text{GHIJ}\\ \text{01}\text{234}\text{5678}\end{array}$

This is a simple test for the mstack and msrow elements that should render like this:

424 + 33

The test verifies that the bottom of "424" is at most the top of the "+", that the "+" and "33" are horizontally aligned and that the left (respectively right) of "424" is vertically aligned with the "+" (respectively "33").

$424+33$

This is a simple test for the mstack and msline elements, that should render like this:

123 --- 456

The test verifies that the bottom first line is at most as low as the top of the last line and that their left/right coordinates are aligned.

$123456$

This is a simple test for the msgroup element and shift attribute, that should render like this:

123 456 456 789

The test verifies that the two first lines are aligned and that the two last lines are aligned. The two last lines should be shifted to the left with respect to the two first lines.

$123456456789$

This is a simple test for the leftoverhang, rightoverhang and mslinethickness attributes of the msline element, that should render like this:

012 =======

The test measures the extra amount that the line overhangs on the right of the 012 (rightoverhang="5em"), the extra amount that the line overhangs on the left of the 012 (leftoverhang="2.5em") and the linethickness of the line (mslinethickness="3em")

$012$

This is a simple test for the mstack@stackalign attribute, that should render like this:

1 111 1 111 1 111

The test verifies that a line with a "111" is indeed wider than a line with a "1" (to avoid making the test trivial) and that the pairs of lines are aligned left, center and right.

$111111111111$

This test verifies that the mscarries element increments scriptlevel by 1 and change the default value of scriptsizemultiplier to 0.6em. The initial size is set to 10em so the size inside mscarry should be 6em.

$11$

This is a simple test for mlongdiv, that should render like this:

16 ------ 64) 1024 0000

The test verifies that "64" is on the right of "16" and "1024", that 16 is above "1024" and that "64" and "1024" are aligned. It verifies that "1024" and "0000" have same width, are aligned and that "1024" is above "0000".

$641610240000$

This is similar to test 95, but with a couple of alternative notations:

stackedrightright left/\right stackedleftleft 1024 | 64 64 / 1024 \ 16 64 | 1024 |----- -----| | 16 16 |

$641610246416102464161024$

This test verifies compatibility of MathML with Javascript. Initially, we have an empty mstyle element:

<math> <mstyle id="test97"> </mstyle> </math>

Then, the test performs the following operations:

- create an mo element
- set the
`textContent`

of the mo to "|" - create an mi element
- create an mtext element
- create an mrow element
- append the mo, mi and mtext in the mrow in that order. At that step, you get

At that step, you get the following structure:

<mrow> <mo>|</mo> <mi></mi> <mtext></mtext> </mrow>

Then the test performs the following operations:

- create an mspace element
- set the height attribute of the mspace to "4em"
- set the depth attribute of the mspace to "4em"
- create an mpadded element
- set the height attribute of the mspace to "0"
- set the depth attribute of the mspace to "0"
- insert the mspace element into the mpadded

At that step, you get the following structure:

<mpadded height="0" depth="0"> <mspace depth="4em" height="4em"/> </mpadded>

Then the test performs the following operations:

- create an mstyle element
- append the mpadded
- append the mrow
- remove the mi from the mrow
- remove the depth and height attributes from the mpadded

At that step, you get the following structure:

<math> <mstyle id="test97"> <mrow> <mo>|</mo> <mtext></mtext> </mrow> <mpadded> <mspace depth="4em" height="4em"/> </mpadded> </mstyle> </math>

Finally, the mrow becomes an embellished operator. The height of the mpadded is the height of the mspace, that is 8em. Hence the test verifies that the mo bar stretches to that size.

$$

This test verifies compatibility of MathML with SVG and HTML. A MathML
root is inserted inside an SVG image, rotated by 180°. The MathML element
contains an mover element, an `<mtext>`

with embedded SVG and a semantics with
embedded HTML. The test checks:

- That the script of the mover element is below the base (
*not*above, the image is rotated by 180°!) - A total width obtained by summing those of the embedded SVG and HTML fragment.

Another test verifies the compatibility of MathML line breaking with the CSS one. An inline formula is placed inside a table cell. This HTML table is itself contained in a div of width 5em. Hence this will also be the cell width and thus the one used by the MathML line breaking algorithm. The formula contains an mtext "ABC" (3em), a plus mo (1em) and an mtext "DEF" (3em) and so should break. The test checks that the bottom of "ABC" is at most as low as the top of "DEF".

$\text{ABC}+\text{DEF}$ |

This test verifies compatibility of MathML with CSS using basic rules that modify the font-size:

- The size of the X is set by
`math.test99 :first-child { font-size: 2em; }`

- The size of the Y by a
`style="font-size: 3em"`

attribute. -
The size of the Z by
`#test99 > mn { font-size: 4em; }`

Note that is really a pure CSS test (albeit nodes are MathML) and so should even pass in browsers without MathML support.

$\text{X}\text{Y}\mathrm{Z}$