gecko-dev/layout/mathml/tests/test_bug827713.html

62 строки
2.2 KiB
HTML

<!DOCTYPE HTML>
<html>
<!--
https://bugzilla.mozilla.org/show_bug.cgi?id=706406
-->
<head>
<title>Test for Bug 706406</title>
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
</head>
<body>
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=827713">Mozilla Bug 827713</a>
<p id="display"></p>
<p><math>
<msub subscriptshift="50px">
<mspace width="50px" height="25px" depth="25px" mathbackground="blue" id ="subbase"></mspace>
<mspace width="50px" height="25px" depth="25px" mathbackground="red" id="subsub"></mspace>
</msub>
</math></p>
<p><math>
<msup superscriptshift="50px">
<mspace width="50px" height="25px" depth="25px" mathbackground="blue" id="supbase"></mspace>
<mspace width="50px" height="25px" depth="25px" mathbackground="green" id="supsup"></mspace>
</msup>
</math></p>
<p><math>
<msubsup subscriptshift="50px" superscriptshift="50px">
<mspace width="50px" height="25px" depth="25px" mathbackground="blue" id="ssbase"></mspace>
<mspace width="50px" height="25px" depth="25px" mathbackground="red" id="sssub"></mspace>
<mspace width="50px" height="25px" depth="25px" mathbackground="green" id="sssup"></mspace>
</msubsup>
</math></p>
<pre id="test">
<script type="application/javascript">
/** Test for the scriptshift aspect of bug 827713 **/
SimpleTest.waitForExplicitFinish();
subBaseRect = $("subbase").getBoundingClientRect();
subSubRect = $("subsub").getBoundingClientRect();
is(subBaseRect.bottom, subSubRect.top, "Bad subscript shift for msub");
supBaseRect = $("supbase").getBoundingClientRect();
supSupRect = $("supsup").getBoundingClientRect();
is(supBaseRect.top, supSupRect.bottom, "Bad superscript shift for msup");
ssBaseRect = $("ssbase").getBoundingClientRect();
ssSubRect = $("sssub").getBoundingClientRect();
ssSupRect = $("sssup").getBoundingClientRect();
is(ssBaseRect.bottom, ssSubRect.top, "Bad subscript shift for msubusp");
is(ssBaseRect.top, ssSupRect.bottom, "Bad superscript shift for msubusp");
SimpleTest.finish();
</script>
</pre>
</body>
</html>