blob: ede7e938b6ae711c4a58ef9a7a05c53ca7e85af3 [file] [log] [blame]
<!DOCTYPE HTML>
<html>
<body>
<script src="../../resources/js-test-pre.js"></script>
<!-- multiscript with one post-script pair -->
<math id="mscript1">
<mmultiscripts>
<mi> A </mi>
<mn> 1 </mn>
<mi> 2 </mi>
</mmultiscripts>
</math>
<!-- multiscript with two post-script pairs, one with an odd number -->
<math id="mscript2">
<mmultiscripts>
<mi> A </mi>
<mn> 1 </mn>
<mi> 2 </mi>
<mn> 3 </mn>
</mmultiscripts>
</math>
<!-- multiscript with one pre-script pair -->
<math id="mscript3">
<mmultiscripts>
<mi> A </mi>
<mprescripts/>
<mn> 4 </mn>
<mi> 5 </mi>
</mmultiscripts>
</math>
<!-- multiscript with two pre-script pairs, one with an odd number -->
<math id="mscript4">
<mmultiscripts>
<mi> A </mi>
<mprescripts/>
<mn> 4 </mn>
<mi> 5 </mi>
<mn> 6 </mn>
</mmultiscripts>
</math>
<!-- multiscript with post-script and pre-script pairs -->
<math id="mscript5">
<mmultiscripts>
<mi> A </mi>
<mn> 1 </mn>
<mi> 2 </mi>
<mn> 3 </mn>
<mprescripts/>
<mn> 4 </mn>
<mi> 5 </mi>
<mn> 6 </mn>
</mmultiscripts>
</math>
<!-- multiscript no post-script or pre-script pairs -->
<math id="mscript6">
<mmultiscripts>
<mi> A </mi>
</mmultiscripts>
</math>
<!-- multiscript using <none> tag -->
<math id="mscript7">
<mmultiscripts>
<mi> A </mi>
<mn> 1 </mn>
<none/>
<mn> 3 </mn>
<mprescripts/>
<none/>
<mi> 5 </mi>
<mn> 6 </mn>
</mmultiscripts>
</math>
<div id="console"></div>
<script>
description("This tests checks that mmultiscript tags will create the correct accessibility math hierarchy.")
if (window.testRunner && window.accessibilityController) {
var mscript = accessibilityController.accessibleElementById("mscript1").childAtIndex(0);
shouldBe("mscript.role", "'AXRole: AXGroup'");
shouldBe("mscript.subrole", "'AXSubrole: AXMathMultiscript'");
debug("\nCheck multiscript with one post-script pair");
debug("Postscripts:\n" + mscript.mathPostscriptsDescription);
debug("Prescripts:\n" + mscript.mathPrescriptsDescription);
debug("\nCheck multiscript with odd number of post-script pairs");
mscript = accessibilityController.accessibleElementById("mscript2").childAtIndex(0);
debug("Postscripts:\n" + mscript.mathPostscriptsDescription);
debug("Prescripts:\n" + mscript.mathPrescriptsDescription);
debug("\nCheck multiscript with a prescript pair");
mscript = accessibilityController.accessibleElementById("mscript3").childAtIndex(0);
debug("Postscripts:\n" + mscript.mathPostscriptsDescription);
debug("Prescripts:\n" + mscript.mathPrescriptsDescription);
debug("\nCheck multiscript with odd number of pre-script pairs");
mscript = accessibilityController.accessibleElementById("mscript4").childAtIndex(0);
debug("Postscripts:\n" + mscript.mathPostscriptsDescription);
debug("Prescripts:\n" + mscript.mathPrescriptsDescription);
debug("\nCheck multiscript with pre and post script pairs.");
mscript = accessibilityController.accessibleElementById("mscript5").childAtIndex(0);
debug("Postscripts:\n" + mscript.mathPostscriptsDescription);
debug("Prescripts:\n" + mscript.mathPrescriptsDescription);
debug("\nCheck multiscript with no prescript or postscript pairs.");
mscript = accessibilityController.accessibleElementById("mscript6").childAtIndex(0);
debug("Postscripts:\n" + mscript.mathPostscriptsDescription);
debug("Prescripts:\n" + mscript.mathPrescriptsDescription);
debug("\nCheck multiscript with 'none' tags.");
mscript = accessibilityController.accessibleElementById("mscript7").childAtIndex(0);
debug("Postscripts:\n" + mscript.mathPostscriptsDescription);
debug("Prescripts:\n" + mscript.mathPrescriptsDescription);
}
</script>
<script src="../../resources/js-test-post.js"></script>
</body>
</html>