layout/reftests/mathml/maction-dynamic-embellished-op.html
author Frédéric Wang <fwang@igalia.com>
Wed, 14 Aug 2019 18:55:16 +0000
changeset 488187 52aec1da83945cfef108316fc233e0bfd5f622ee
parent 329664 7b434711753b98a87603453caaa0945791ffe12b
permissions -rw-r--r--
Bug 1573831 - Use more reliable text rendering for MathML reftests. r=emilio Do this for a few MathML tests that are marked random: * Use the Ahem font for text rendering. * Replace single-char mi with other token elements that don't use italic characters from the Mathematical Alphanumeric Symbols. Additionally, this fixes invalid markup for maction-dynamic-embellished-op ; the MathML3 spec says the actiontype attribute is required and tests seem to assume actiontype="toggle". https://www.w3.org/TR/MathML3/chapter3.html#presm.maction mtable-align-whitespace.html Differential Revision: https://phabricator.services.mozilla.com/D41958

<!DOCTYPE html>
<html class="reftest-wait">

<head>
<title>dynamic maction and embellished op</title>
<style>
  @font-face
  {
      font-family: Ahem;
      src: url(../fonts/Ahem.ttf);
  }
  p, math {
      font: 25px Ahem;
  }
</style>
</head>

<body>

  <p>É<math><maction actiontype="toggle" id="m1"><mn>X</mn><mo>p</mo></maction></math>É</p>
  <p>É<math><maction actiontype="toggle" id="m2"><mo>p</mo><mn>X</mn></maction></math>É</p>
 
  <p>É<math><maction actiontype="toggle" id="m3"><mn>X</mn><mo>p</mo></maction></math>É</p>
  <p>É<math><maction actiontype="toggle" id="m3bis"><mo>p</mo></maction></math>É</p>

  <p>{<math><maction actiontype="toggle" id="m4"><mo>p</mo><mn>X</mn></maction></math>}</p>
  <p>{<math><maction actiontype="toggle" id="m4bis"><mn>X</mn></maction></math>}</p>

 
  <p>[<math>
    <mstyle id="m5"><maction actiontype="toggle"><mn>X</mn><mo>p</mo></maction></mstyle>
  </math>]</p>
  <p>[<math>
    <mstyle id="m6"><maction actiontype="toggle"><mo>p</mo><mn>X</mn></maction></mstyle>
  </math>]</p>

  <p>(<math id="m7"><maction actiontype="toggle"><mn>X</mn><mo>p</mo></maction></math>)</p>
  <p>(<math id="m8"><maction actiontype="toggle"><mo>p</mo><mn>X</mn></maction></math>)</p>

<script>
function doTest()
{
  document.getElementById("m1").setAttribute("selection", "2");
  document.getElementById("m2").setAttribute("selection", "2");

  var m3 = document.getElementById("m3");
  var m3bis = document.getElementById("m3bis");
  m3bis.insertBefore(m3.removeChild(m3.firstChild), m3bis.firstChild);

  var m4 = document.getElementById("m4");
  var m4bis = document.getElementById("m4bis");
  m4bis.insertBefore(m4.removeChild(m4.firstChild), m4bis.firstChild);

  document.getElementById("m5").setAttribute("selection", "2");
  document.getElementById("m6").setAttribute("selection", "2");

  document.getElementById("m7").setAttribute("selection", "2");
  document.getElementById("m8").setAttribute("selection", "2");

  document.documentElement.removeAttribute("class");
}

window.addEventListener("MozReftestInvalidate", doTest);
</script>

</body>
</html>