Skip to content

Commit

Permalink
Bug 1613049 [wpt PR 21568] - Update space-like tests., a=testonly
Browse files Browse the repository at this point in the history
Automatic update from web-platform-tests
Update space-like tests. (#21568)

w3c/mathml#183
--

wpt-commits: 56c5d893f8a3fc6cf2a889d1c42616098ac7959b
wpt-pr: 21568

UltraBlame original commit: 83194ea778725b67db177ae0c1333449101e6e00
  • Loading branch information
marco-c committed Feb 12, 2020
1 parent a7c4466 commit 566b16f
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,18 @@
assert_approx_equals(spaceAfter("mpadded2"), 2 * emToPx, epsilon);
}, "non-space-like mpadded");

test(function() {
assert_true(MathMLFeatureDetection.has_operator_spacing());
assert_approx_equals(spaceBefore("merror1"), emToPx, epsilon);
assert_approx_equals(spaceAfter("merror1"), emToPx, epsilon);
}, "space-like merror");

test(function() {
assert_true(MathMLFeatureDetection.has_operator_spacing());
assert_approx_equals(spaceBefore("merror2"), 0, epsilon);
assert_approx_equals(spaceAfter("merror2"), 2 * emToPx, epsilon);
}, "non-space-like merror");

done();
}
</script>
Expand Down Expand Up @@ -253,5 +265,34 @@
<mn>X</mn>
</math>
</p>
<p>
<math>
<mn>X</mn>
<mrow>

<merror id="merror1" class="testedElement">
<mtext>X</mtext>
<mspace width="25px" height="10px"></mspace>
</merror>
<mo lspace="1em" rspace="0em">X</mo>
</mrow>
<mn>X</mn>
</math>
</p>
<p>
<math>
<mn>X</mn>
<mrow>


<merror id="merror2" class="testedElement">
<mn>X</mn>
<mspace width="25px" height="10px"></mspace>
</merror>
<mo lspace="1em" rspace="0em">X</mo>
</mrow>
<mn>X</mn>
</math>
</p>
</body>
</html>
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,9 @@

test(function() {
assert_true(MathMLFeatureDetection.has_operator_spacing());
assert_approx_equals(spaceBefore("maction2"), 0, epsilon);
assert_approx_equals(spaceAfter("maction2"), 2 * emToPx, epsilon);
}, "non-space like maction (no first child)");
assert_approx_equals(spaceBefore("maction2"), emToPx, epsilon);
assert_approx_equals(spaceAfter("maction2"), emToPx, epsilon);
}, "space-like maction (no first child)");

test(function() {
assert_approx_equals(spaceBefore("maction3"), 0, epsilon);
Expand All @@ -74,9 +74,9 @@

test(function() {
assert_true(MathMLFeatureDetection.has_operator_spacing());
assert_approx_equals(spaceBefore("semantics2"), 0, epsilon);
assert_approx_equals(spaceAfter("semantics2"), 2 * emToPx, epsilon);
}, "non-space like semantics (no first child)");
assert_approx_equals(spaceBefore("semantics2"), emToPx, epsilon);
assert_approx_equals(spaceAfter("semantics2"), emToPx, epsilon);
}, "space-like semantics (no first child)");

test(function() {
assert_true(MathMLFeatureDetection.has_operator_spacing());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,18 +60,6 @@
</head>
<body>
<div id="log"></div>
<p>
<math>
<mn>X</mn>
<mrow>
<merror class="testedElement">
<mtext>X</mtext>
</merror>
<mo lspace="1em" rspace="0em">X</mo>
</mrow>
<mn>X</mn>
</math>
</p>
<p>
<math>
<mn>X</mn>
Expand Down

0 comments on commit 566b16f

Please sign in to comment.