diff options
Diffstat (limited to 'testing/web-platform/tests/mathml/presentation-markup/operators/mo-minsize-maxsize-001.html')
-rw-r--r-- | testing/web-platform/tests/mathml/presentation-markup/operators/mo-minsize-maxsize-001.html | 60 |
1 files changed, 41 insertions, 19 deletions
diff --git a/testing/web-platform/tests/mathml/presentation-markup/operators/mo-minsize-maxsize-001.html b/testing/web-platform/tests/mathml/presentation-markup/operators/mo-minsize-maxsize-001.html index 3e7e5c9bcc..c07f64327a 100644 --- a/testing/web-platform/tests/mathml/presentation-markup/operators/mo-minsize-maxsize-001.html +++ b/testing/web-platform/tests/mathml/presentation-markup/operators/mo-minsize-maxsize-001.html @@ -20,6 +20,10 @@ mo { font-family: operators; } + @font-face { + font-family: stretchy; + src: url("/fonts/math/stretchy.woff"); + } </style> <script> setup({ explicit_done: true }); @@ -48,17 +52,27 @@ test(function() { assert_approx_equals(document.getElementById("percent_minsize").getBoundingClientRect().height, 12 * emToPx, epsilon, "percent minsize"); assert_approx_equals(document.getElementById("percent_maxsize").getBoundingClientRect().height, 3 * emToPx, epsilon, "percent maxsize"); - }, `minsize/maxsize percentages are relative to the target size`); + }, `minsize/maxsize percentages are relative to the unstretched size`); test(function() { - // These tests are not really strong: - // - The smallest glyph for this stretchy operator is a 1em square so - // it can't go under a minsize of 1em anyway. - // - The maxsize is theorically infinite, this only tests that a large - // value of 300em is clamped. - assert_approx_equals(document.getElementById("default_minsize").getBoundingClientRect().height, 1 * emToPx, epsilon, "default minsize is 1em"); + // - The unstretched size is a lower bound for the stretched size, so + // specifying a lower minsize has no effect. This test only verifies + // that the default minsize is at most 100% the unstretched size. + const unstretched_size = 1 * emToPx; + assert_approx_equals(document.getElementById("default_minsize").getBoundingClientRect().height, unstretched_size, epsilon, "default minsize is 100%"); + + // Previous version of MathML Core were defining minsize as 1em rather + // than 100% the unstretched size. So try the same test with a .5em + // unstretched size. + const unstretched_size_2 = .5 * emToPx; + assert_approx_equals(document.getElementById("default_minsize_2").getBoundingClientRect().height, unstretched_size_2, epsilon, "default minsize is not 1em"); + + // - The target size is an upper bound for the stretched size, so + // specifying a larger maxsize has no effect. This test only + // verifies that the default maxsize is at least 300 times the + // unstretched size. assert_approx_equals(document.getElementById("default_maxsize").getBoundingClientRect().height, 300 * emToPx, epsilon, "default maxsize is infinity"); - }, `default minsize/maxsize percentages`); + }, `default minsize/maxsize values`); done(); } @@ -71,7 +85,7 @@ <mrow> <mspace width="1em" height="5em" style="background: blue"/> <mo id="negative_minsize" minsize="-10em" stretchy="true" symmetric="false">⥯</mo> - <mn><!-- not space like --></mn> + <mpadded height="0" depth="0"><mn><!-- not space like --></mn></mpadded> </mrow> </math> </p> @@ -80,7 +94,7 @@ <mrow> <mspace width="1em" height="5em" style="background: blue"/> <mo id="maxsize_less_than_minsize" minsize="7em" maxsize="2em" stretchy="true" symmetric="false">⥯</mo> - <mn><!-- not space like --></mn> + <mpadded height="0" depth="0"><mn><!-- not space like --></mn></mpadded> </mrow> </math> </p> @@ -89,7 +103,7 @@ <mrow> <mspace width="1em" height="5em" style="background: blue"/> <mo id="minsize_less_than_negative_maxsize" minsize="-2em" maxsize="-1em" stretchy="true" symmetric="false">⥯</mo> - <mn><!-- not space like --></mn> + <mpadded height="0" depth="0"><mn><!-- not space like --></mn></mpadded> </mrow> </math> </p> @@ -98,7 +112,7 @@ <mrow> <mspace id="zero_target_size_with_minsize_math_axis" width="1em" height="0em" style="background: blue"/> <mo id="zero_target_size_with_minsize" minsize="2em" stretchy="true" symmetric="true">⥯</mo> - <mn><!-- not space like --></mn> + <mpadded height="0" depth="0"><mn><!-- not space like --></mn></mpadded> </mrow> </math> </p> @@ -106,8 +120,8 @@ <math> <mrow> <mspace width="1em" height="6em" style="background: blue"/> - <mo id="percent_minsize" minsize="200%" stretchy="true" symmetric="false">⥯</mo> - <mn><!-- not space like --></mn> + <mo id="percent_minsize" minsize="1200%" stretchy="true" symmetric="false">⥯</mo> + <mpadded height="0" depth="0"><mn><!-- not space like --></mn></mpadded> </mrow> </math> </p> @@ -115,8 +129,8 @@ <math> <mrow> <mspace width="1em" height="6em" style="background: blue"/> - <mo id="percent_maxsize" maxsize="50%" stretchy="true" symmetric="false">⥯</mo> - <mn><!-- not space like --></mn> + <mo id="percent_maxsize" maxsize="300%" stretchy="true" symmetric="false">⥯</mo> + <mpadded height="0" depth="0"><mn><!-- not space like --></mn></mpadded> </mrow> </math> </p> @@ -125,7 +139,16 @@ <mrow> <mspace width="1em" height=".5em" style="background: blue"/> <mo id="default_minsize" stretchy="true" symmetric="false">⥯</mo> - <mn><!-- not space like --></mn> + <mpadded height="0" depth="0"><mn><!-- not space like --></mn></mpadded> + </mrow> + </math> + </p> + <p> + <math> + <mrow> + <mspace width="1em" height=".25em" style="background: blue"/> + <mo style="font-family: stretchy" id="default_minsize_2" stretchy="true" symmetric="false">↨</mo> + <mpadded height="0" depth="0"><mn><!-- not space like --></mn></mpadded> </mrow> </math> </p> @@ -134,10 +157,9 @@ <mrow> <mspace width="1em" height="300em" style="background: blue"/> <mo id="default_maxsize" stretchy="true" symmetric="false">⥯</mo> - <mn><!-- not space like --></mn> + <mpadded height="0" depth="0"><mn><!-- not space like --></mn></mpadded> </mrow> </math> </p> - </body> </html> |