Skip to content

Commit

Permalink
Add tests for MathML features that we might remove from Core / unship…
Browse files Browse the repository at this point in the history
  • Loading branch information
fred-wang authored Oct 1, 2019
1 parent 86b568c commit d9e0e15
Show file tree
Hide file tree
Showing 6 changed files with 187 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>fractions bevelled (reference)</title>
</head>
<body>
<p>Test passes is you see a blue rectangle <em>above</em> a green rectangle, separated by a horizontal bar.</p>
<p>
<math>
<mfrac>
<mspace width="100px" height="30px" style="background: lightblue"></mspace>
<mspace width="100px" height="30px" style="background: lightgreen"></mspace>
</mfrac>
</math>
</p>
</body>
</html>
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>fractions bevelled</title>
<link rel="help" href="https://www.w3.org/TR/MathML3/chapter3.html#presm.mfrac">
<link rel="help" href="https://mathml-refresh.github.io/mathml-core/#fractions-mfrac">
<link rel="help" href="https://github.com/mathml-refresh/mathml/issues/29">
<meta name="assert" content="Verify that the MathML3 bevelled attribute is ignored.">
<link rel="match" href="frac-legacy-bevelled-attribute.tentative-ref.html">
</head>
<body>
<p>Test passes is you see a blue rectangle <em>above</em> a green rectangle, separated by a horizontal bar.</p>
<p>
<math>
<mfrac bevelled="true">
<mspace width="100px" height="30px" style="background: lightblue"></mspace>
<mspace width="100px" height="30px" style="background: lightgreen"></mspace>
</mfrac>
</math>
</p>
<script src="/mathml/support/feature-detection.js"></script>
<script>
MathMLFeatureDetection.ensure_for_match_reftest("has_mspace");
MathMLFeatureDetection.ensure_for_match_reftest("has_mfrac");
</script>
</body>
</html>
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>mfenced element</title>
</head>
<body>
<p>Test passes if you see 6 green squares and no red.</p>
<p>
<math>
<mrow>
<mspace width="30px" height="30px" style="background: green"></mspace>
<mspace width="30px" height="30px" style="background: lightgreen"></mspace>
<mspace width="30px" height="30px" style="background: green"></mspace>
</mrow>
<mrow>
<mspace width="30px" height="30px" style="background: lightgreen"></mspace>
<mspace width="30px" height="30px" style="background: green"></mspace>
<mspace width="30px" height="30px" style="background: lightgreen"></mspace>
</mrow>
</math>
</p>
</body>
</html>
34 changes: 34 additions & 0 deletions mathml/presentation-markup/mrow/legacy-mfenced-element-001.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>mfenced element</title>
<link rel="help" href="https://www.w3.org/TR/MathML3/chapter3.html#presm.mfenced">
<link rel="help" href="https://mathml-refresh.github.io/mathml-core/#new-display-math-value">
<link rel="help" href="https://mathml-refresh.github.io/mathml-core/#mathml-elements">
<link rel="help" href="https://mathml-refresh.github.io/mathml-core/#horizontally-group-sub-expressions-mrow">
<meta name="assert" content="Verify that the mfenced element is not supported.">
<link rel="match" href="legacy-mfenced-element-001-ref.html">
</head>
<body>
<p>Test passes if you see 6 green squares and no red.</p>
<p>
<math style="color: red">
<mfenced>
<mspace width="30px" height="30px" style="background: green"></mspace>
<mspace width="30px" height="30px" style="background: lightgreen"></mspace>
<mspace width="30px" height="30px" style="background: green"></mspace>
</mfenced>
<mfenced open="{" close="]" separators="?!">
<mspace width="30px" height="30px" style="background: lightgreen"></mspace>
<mspace width="30px" height="30px" style="background: green"></mspace>
<mspace width="30px" height="30px" style="background: lightgreen"></mspace>
</mfenced>
</math>
</p>
<script src="/mathml/support/feature-detection.js"></script>
<script>
MathMLFeatureDetection.ensure_for_match_reftest("has_mspace");
</script>
</body>
</html>
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>msub/msup/msubsup/mmultiscripts subscriptshift and superscriptshift attributes (reference)</title>
</head>
<body>
<p>Test passes if the green squares are not about 300px away from the blue squares.</p>
<p>
<math>
<mmultiscripts>
<mspace width="30px" height="30px" style="background: blue;"></mspace>
<mspace width="10px" height="10px" style="background: lightgreen;"></mspace>
<mspace width="10px" height="10px" style="background: lightgreen;"></mspace>
<mprescripts/>
<mspace width="10px" height="10px" style="background: lightgreen;"></mspace>
<mspace width="10px" height="10px" style="background: lightgreen;"></mspace>
</mmultiscripts>
<msub>
<mspace width="30px" height="30px" style="background: blue;"></mspace>
<mspace width="10px" height="10px" style="background: lightgreen;"></mspace>
</msub>
<msup>
<mspace width="30px" height="30px" style="background: blue;"></mspace>
<mspace width="10px" height="10px" style="background: lightgreen;"></mspace>
</msup>
<msubsup>
<mspace width="30px" height="30px" style="background: blue;"></mspace>
<mspace width="10px" height="10px" style="background: lightgreen;"></mspace>
<mspace width="10px" height="10px" style="background: lightgreen;"></mspace>
</msubsup>
</math>
</p>
</body>
</html>
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>msub/msup/msubsup/mmultiscripts subscriptshift and superscriptshift attributes</title>
<link rel="help" href="https://www.w3.org/TR/MathML3/chapter3.html#presm.msub">
<link rel="help" href="https://www.w3.org/TR/MathML3/chapter3.html#presm.msup">
<link rel="help" href="https://www.w3.org/TR/MathML3/chapter3.html#presm.msunsup">
<link rel="help" href="https://www.w3.org/TR/MathML3/chapter3.html#presm.mmultiscripts">
<link rel="help" href="https://mathml-refresh.github.io/mathml-core/#subscripts-and-superscripts-msub-msup-msubsup">
<link rel="help" href="https://mathml-refresh.github.io/mathml-core/#prescripts-and-tensor-indices-mmultiscripts">
<link rel="match" href="subsup-legacy-scriptshift-attributes-001.tentative-ref.html">
</head>
<body>
<p>Test passes if the green squares are not about 300px away from the blue squares.</p>
<p>
<math>
<mmultiscripts subscriptshift="300px" superscriptshift="300px">
<mspace width="30px" height="30px" style="background: blue;"></mspace>
<mspace width="10px" height="10px" style="background: lightgreen;"></mspace>
<mspace width="10px" height="10px" style="background: lightgreen;"></mspace>
<mprescripts/>
<mspace width="10px" height="10px" style="background: lightgreen;"></mspace>
<mspace width="10px" height="10px" style="background: lightgreen;"></mspace>
</mmultiscripts>
<msub subscriptshift="300px">
<mspace width="30px" height="30px" style="background: blue;"></mspace>
<mspace width="10px" height="10px" style="background: lightgreen;"></mspace>
</msub>
<msup superscriptshift="300px">
<mspace width="30px" height="30px" style="background: blue;"></mspace>
<mspace width="10px" height="10px" style="background: lightgreen;"></mspace>
</msup>
<msubsup subscriptshift="300px" superscriptshift="300px">
<mspace width="30px" height="30px" style="background: blue;"></mspace>
<mspace width="10px" height="10px" style="background: lightgreen;"></mspace>
<mspace width="10px" height="10px" style="background: lightgreen;"></mspace>
</msubsup>
</math>
</p>
<script src="/mathml/support/feature-detection.js"></script>
<script>
MathMLFeatureDetection.ensure_for_match_reftest("has_mspace");
MathMLFeatureDetection.ensure_for_match_reftest("has_msubsup");
MathMLFeatureDetection.ensure_for_match_reftest("has_mmultiscripts");
</script>
</body>
</html>

0 comments on commit d9e0e15

Please sign in to comment.