Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update space-like tests. #21568

Merged
merged 1 commit into from
Feb 4, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions mathml/presentation-markup/spaces/space-like-001.html
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 is space-like when it contains only space-like elements. -->
<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 is not space-like when it contains a non space-like element
such as "mn". -->
<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>
12 changes: 6 additions & 6 deletions mathml/presentation-markup/spaces/space-like-002.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
12 changes: 0 additions & 12 deletions mathml/presentation-markup/spaces/space-like-003.html
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