Skip to content

Commit

Permalink
Bug 1624143 [wpt PR 22381] - Update MathML tests for embellished oper…
Browse files Browse the repository at this point in the history
…ators., a=testonly

Automatic update from web-platform-tests
Update MathML tests for embellished operators. (#22381)

This commit updates tests after [1] [2]:

* merror, mprescripts, none, unknown are now treated as other mrow-like
  elements.
* maction and semantics are moved into a separate file and new tests
  added now that they are mrow-like elements with some hidden children.

[1] w3c/mathml#182
[2] w3c/mathml#183
--

wpt-commits: c38ae4ac2e0af285deb06f33c75e1699d0718942
wpt-pr: 22381

UltraBlame original commit: 8e8fe19364e1c1ddc7d7ce589aa2fd8d8e23572c
  • Loading branch information
marco-c committed Mar 31, 2020
1 parent d2a635c commit cc3633d
Show file tree
Hide file tree
Showing 3 changed files with 608 additions and 118 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
var epsilon = 1;
var emToPx = 25;

["mrow", "mstyle", "mphantom", "mpadded"].forEach(tag => {
["mrow", "mstyle", "mphantom", "mpadded", "merror", "mprescripts", "none", "unknown"].forEach(tag => {
test(function() {
assert_true(MathMLFeatureDetection.has_operator_spacing());
assert_approx_equals(spaceBeforeElement(`${tag}-op-1`), 2 * emToPx, epsilon);
Expand Down Expand Up @@ -305,5 +305,217 @@
<mn class="oof1">0</mn><mn class="oof2">1</mn><mn class="nobox">2</mn>
</math>
</p>


<p>
<math>
<mn>X</mn>
<merror id="merror-op-1" class="testedElement">
<mo lspace="2em" rspace="0em">X</mo>
</merror>
<mn>X</mn>
</math>
</p>
<p>
<math>
<mn>X</mn>
<merror id="merror-nonop-1" class="testedElement">
<mo lspace="2em" rspace="0em">X</mo>
<mn>X</mn>
</merror>
<mn>X</mn>
</math>
</p>
<p>
<math>
<mn class="oof1">0</mn><mn class="oof2">1</mn><mn class="nobox">2</mn>
<mn>X</mn>
<mn class="oof1">0</mn><mn class="oof2">1</mn><mn class="nobox">2</mn>
<merror id="merror-op-2" class="testedElement">
<mn class="oof1">0</mn><mn class="oof2">1</mn><mn class="nobox">2</mn>
<mo lspace="2em" rspace="0em">X</mo>
<mn class="oof1">0</mn><mn class="oof2">1</mn><mn class="nobox">2</mn>
</merror>
<mn class="oof1">0</mn><mn class="oof2">1</mn><mn class="nobox">2</mn>
<mn>X</mn>
<mn class="oof1">0</mn><mn class="oof2">1</mn><mn class="nobox">2</mn>
</math>
</p>
<p>
<math>
<mn class="oof1">0</mn><mn class="oof2">1</mn><mn class="nobox">2</mn>
<mn>X</mn>
<mn class="oof1">0</mn><mn class="oof2">1</mn><mn class="nobox">2</mn>
<merror id="merror-nonop-2" class="testedElement">
<mn class="oof1">0</mn><mn class="oof2">1</mn><mn class="nobox">2</mn>
<mo lspace="2em" rspace="0em">X</mo>
<mn class="oof1">0</mn><mn class="oof2">1</mn><mn class="nobox">2</mn>
<mn>X</mn>
<mn class="oof1">0</mn><mn class="oof2">1</mn><mn class="nobox">2</mn>
</merror>
<mn class="oof1">0</mn><mn class="oof2">1</mn><mn class="nobox">2</mn>
<mn>X</mn>
<mn class="oof1">0</mn><mn class="oof2">1</mn><mn class="nobox">2</mn>
</math>
</p>


<p>
<math>
<mn>X</mn>
<mprescripts id="mprescripts-op-1" class="testedElement">
<mo lspace="2em" rspace="0em">X</mo>
</mprescripts>
<mn>X</mn>
</math>
</p>
<p>
<math>
<mn>X</mn>
<mprescripts id="mprescripts-nonop-1" class="testedElement">
<mo lspace="2em" rspace="0em">X</mo>
<mn>X</mn>
</mprescripts>
<mn>X</mn>
</math>
</p>
<p>
<math>
<mn class="oof1">0</mn><mn class="oof2">1</mn><mn class="nobox">2</mn>
<mn>X</mn>
<mn class="oof1">0</mn><mn class="oof2">1</mn><mn class="nobox">2</mn>
<mprescripts id="mprescripts-op-2" class="testedElement">
<mn class="oof1">0</mn><mn class="oof2">1</mn><mn class="nobox">2</mn>
<mo lspace="2em" rspace="0em">X</mo>
<mn class="oof1">0</mn><mn class="oof2">1</mn><mn class="nobox">2</mn>
</mprescripts>
<mn class="oof1">0</mn><mn class="oof2">1</mn><mn class="nobox">2</mn>
<mn>X</mn>
<mn class="oof1">0</mn><mn class="oof2">1</mn><mn class="nobox">2</mn>
</math>
</p>
<p>
<math>
<mn class="oof1">0</mn><mn class="oof2">1</mn><mn class="nobox">2</mn>
<mn>X</mn>
<mn class="oof1">0</mn><mn class="oof2">1</mn><mn class="nobox">2</mn>
<mprescripts id="mprescripts-nonop-2" class="testedElement">
<mn class="oof1">0</mn><mn class="oof2">1</mn><mn class="nobox">2</mn>
<mo lspace="2em" rspace="0em">X</mo>
<mn class="oof1">0</mn><mn class="oof2">1</mn><mn class="nobox">2</mn>
<mn>X</mn>
<mn class="oof1">0</mn><mn class="oof2">1</mn><mn class="nobox">2</mn>
</mprescripts>
<mn class="oof1">0</mn><mn class="oof2">1</mn><mn class="nobox">2</mn>
<mn>X</mn>
<mn class="oof1">0</mn><mn class="oof2">1</mn><mn class="nobox">2</mn>
</math>
</p>


<p>
<math>
<mn>X</mn>
<none id="none-op-1" class="testedElement">
<mo lspace="2em" rspace="0em">X</mo>
</none>
<mn>X</mn>
</math>
</p>
<p>
<math>
<mn>X</mn>
<none id="none-nonop-1" class="testedElement">
<mo lspace="2em" rspace="0em">X</mo>
<mn>X</mn>
</none>
<mn>X</mn>
</math>
</p>
<p>
<math>
<mn class="oof1">0</mn><mn class="oof2">1</mn><mn class="nobox">2</mn>
<mn>X</mn>
<mn class="oof1">0</mn><mn class="oof2">1</mn><mn class="nobox">2</mn>
<none id="none-op-2" class="testedElement">
<mn class="oof1">0</mn><mn class="oof2">1</mn><mn class="nobox">2</mn>
<mo lspace="2em" rspace="0em">X</mo>
<mn class="oof1">0</mn><mn class="oof2">1</mn><mn class="nobox">2</mn>
</none>
<mn class="oof1">0</mn><mn class="oof2">1</mn><mn class="nobox">2</mn>
<mn>X</mn>
<mn class="oof1">0</mn><mn class="oof2">1</mn><mn class="nobox">2</mn>
</math>
</p>
<p>
<math>
<mn class="oof1">0</mn><mn class="oof2">1</mn><mn class="nobox">2</mn>
<mn>X</mn>
<mn class="oof1">0</mn><mn class="oof2">1</mn><mn class="nobox">2</mn>
<none id="none-nonop-2" class="testedElement">
<mn class="oof1">0</mn><mn class="oof2">1</mn><mn class="nobox">2</mn>
<mo lspace="2em" rspace="0em">X</mo>
<mn class="oof1">0</mn><mn class="oof2">1</mn><mn class="nobox">2</mn>
<mn>X</mn>
<mn class="oof1">0</mn><mn class="oof2">1</mn><mn class="nobox">2</mn>
</none>
<mn class="oof1">0</mn><mn class="oof2">1</mn><mn class="nobox">2</mn>
<mn>X</mn>
<mn class="oof1">0</mn><mn class="oof2">1</mn><mn class="nobox">2</mn>
</math>
</p>


<p>
<math>
<mn>X</mn>
<unknown id="unknown-op-1" class="testedElement">
<mo lspace="2em" rspace="0em">X</mo>
</unknown>
<mn>X</mn>
</math>
</p>
<p>
<math>
<mn>X</mn>
<unknown id="unknown-nonop-1" class="testedElement">
<mo lspace="2em" rspace="0em">X</mo>
<mn>X</mn>
</unknown>
<mn>X</mn>
</math>
</p>
<p>
<math>
<mn class="oof1">0</mn><mn class="oof2">1</mn><mn class="nobox">2</mn>
<mn>X</mn>
<mn class="oof1">0</mn><mn class="oof2">1</mn><mn class="nobox">2</mn>
<unknown id="unknown-op-2" class="testedElement">
<mn class="oof1">0</mn><mn class="oof2">1</mn><mn class="nobox">2</mn>
<mo lspace="2em" rspace="0em">X</mo>
<mn class="oof1">0</mn><mn class="oof2">1</mn><mn class="nobox">2</mn>
</unknown>
<mn class="oof1">0</mn><mn class="oof2">1</mn><mn class="nobox">2</mn>
<mn>X</mn>
<mn class="oof1">0</mn><mn class="oof2">1</mn><mn class="nobox">2</mn>
</math>
</p>
<p>
<math>
<mn class="oof1">0</mn><mn class="oof2">1</mn><mn class="nobox">2</mn>
<mn>X</mn>
<mn class="oof1">0</mn><mn class="oof2">1</mn><mn class="nobox">2</mn>
<unknown id="unknown-nonop-2" class="testedElement">
<mn class="oof1">0</mn><mn class="oof2">1</mn><mn class="nobox">2</mn>
<mo lspace="2em" rspace="0em">X</mo>
<mn class="oof1">0</mn><mn class="oof2">1</mn><mn class="nobox">2</mn>
<mn>X</mn>
<mn class="oof1">0</mn><mn class="oof2">1</mn><mn class="nobox">2</mn>
</unknown>
<mn class="oof1">0</mn><mn class="oof2">1</mn><mn class="nobox">2</mn>
<mn>X</mn>
<mn class="oof1">0</mn><mn class="oof2">1</mn><mn class="nobox">2</mn>
</math>
</p>
</body>
</html>
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
var emToPx = 25;

["msub", "msup", "msubsup", "munder", "mover", "munderover",
"mmultiscripts", "mfrac", "maction", "semantics"].forEach(tag => {
"mmultiscripts", "mfrac"].forEach(tag => {
test(function() {
assert_true(MathMLFeatureDetection.has_operator_spacing());
var element = document.getElementsByTagName(tag)[0];
Expand Down Expand Up @@ -174,27 +174,6 @@
<mn>X</mn>
</math>
</p>
<p>
<math>
<mn>X</mn>
<maction class="testedElement" actiontype="statusline">
<mo lspace="2em" rspace="0em">X</mo>
<mn>STATUS MESSAGE</mn>
</maction>
<mn>X</mn>
</math>
</p>
<p>
<math>
<mn>X</mn>
<semantics class="testedElement">
<mo lspace="2em" rspace="0em">X</mo>
<annotation>TEXT ANNOTATION</annotation>
<mn>X</mn>
</semantics>
<mn>X</mn>
</math>
</p>


<p>
Expand Down Expand Up @@ -341,40 +320,6 @@
<mn class="oof1">0</mn><mn class="oof2">1</mn><mn class="nobox">2</mn>
</math>
</p>
<p>
<math>
<mn class="oof1">0</mn><mn class="oof2">1</mn><mn class="nobox">2</mn>
<mn>X</mn>
<mn class="oof1">0</mn><mn class="oof2">1</mn><mn class="nobox">2</mn>
<maction class="testedElement" actiontype="statusline">
<mo lspace="2em" rspace="0em">X</mo>
<mn class="oof1">0</mn><mn class="oof2">1</mn><mn class="nobox">2</mn>
<mn>STATUS MESSAGE</mn>
<mn class="oof1">0</mn><mn class="oof2">1</mn><mn class="nobox">2</mn>
</maction>
<mn class="oof1">0</mn><mn class="oof2">1</mn><mn class="nobox">2</mn>
<mn>X</mn>
<mn class="oof1">0</mn><mn class="oof2">1</mn><mn class="nobox">2</mn>
</math>
</p>
<p>
<math>
<mn class="oof1">0</mn><mn class="oof2">1</mn><mn class="nobox">2</mn>
<mn>X</mn>
<mn class="oof1">0</mn><mn class="oof2">1</mn><mn class="nobox">2</mn>
<semantics class="testedElement">
<mo lspace="2em" rspace="0em">X</mo>
<mn class="oof1">0</mn><mn class="oof2">1</mn><mn class="nobox">2</mn>
<annotation>TEXT ANNOTATION</annotation>
<mn class="oof1">0</mn><mn class="oof2">1</mn><mn class="nobox">2</mn>
<mn>X</mn>
<mn class="oof1">0</mn><mn class="oof2">1</mn><mn class="nobox">2</mn>
</semantics>
<mn class="oof1">0</mn><mn class="oof2">1</mn><mn class="nobox">2</mn>
<mn>X</mn>
<mn class="oof1">0</mn><mn class="oof2">1</mn><mn class="nobox">2</mn>
</math>
</p>



Expand Down Expand Up @@ -463,29 +408,6 @@
<mn>X</mn>
</math>
</p>
<p>
<math>
<mn>X</mn>
<maction class="testedElement" actiontype="statusline">
<mn>X</mn>
<mo lspace="2em" rspace="0em">STATUS MESSAGE</mo>
</maction>
<mn>X</mn>
</math>
</p>
<p>
<math>
<mn>X</mn>
<semantics class="testedElement">
<mrow>
<mn>X</mn>
<mo lspace="2em" rspace="0em">X</mo>
</mrow>
<annotation>TEXT ANNOTATION</annotation>
</semantics>
<mn>X</mn>
</math>
</p>


<p>
Expand Down Expand Up @@ -632,44 +554,6 @@
<mn class="oof1">0</mn><mn class="oof2">1</mn><mn class="nobox">2</mn>
</math>
</p>
<p>
<math>
<mn class="oof1">0</mn><mn class="oof2">1</mn><mn class="nobox">2</mn>
<mn>X</mn>
<mn class="oof1">0</mn><mn class="oof2">1</mn><mn class="nobox">2</mn>
<maction class="testedElement" actiontype="statusline">
<mn>X</mn>
<mn class="oof1">0</mn><mn class="oof2">1</mn><mn class="nobox">2</mn>
<mo lspace="2em" rspace="0em">STATUS MESSAGE</mo>
<mn class="oof1">0</mn><mn class="oof2">1</mn><mn class="nobox">2</mn>
</maction>
<mn class="oof1">0</mn><mn class="oof2">1</mn><mn class="nobox">2</mn>
<mn>X</mn>
<mn class="oof1">0</mn><mn class="oof2">1</mn><mn class="nobox">2</mn>
</math>
</p>
<p>
<math>
<mn class="oof1">0</mn><mn class="oof2">1</mn><mn class="nobox">2</mn>
<mn>X</mn>
<mn class="oof1">0</mn><mn class="oof2">1</mn><mn class="nobox">2</mn>
<semantics class="testedElement">
<mrow>
<mn class="oof1">0</mn><mn class="oof2">1</mn><mn class="nobox">2</mn>
<mn>X</mn>
<mn class="oof1">0</mn><mn class="oof2">1</mn><mn class="nobox">2</mn>
<mo lspace="2em" rspace="0em">X</mo>
<mn class="oof1">0</mn><mn class="oof2">1</mn><mn class="nobox">2</mn>
</mrow>
<mn class="oof1">0</mn><mn class="oof2">1</mn><mn class="nobox">2</mn>
<annotation>TEXT ANNOTATION</annotation>
<mn class="oof1">0</mn><mn class="oof2">1</mn><mn class="nobox">2</mn>
</semantics>
<mn class="oof1">0</mn><mn class="oof2">1</mn><mn class="nobox">2</mn>
<mn>X</mn>
<mn class="oof1">0</mn><mn class="oof2">1</mn><mn class="nobox">2</mn>
</math>
</p>

</body>
</html>
Loading

0 comments on commit cc3633d

Please sign in to comment.