mathscript-2.html 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <!DOCTYPE html>
  2. <html class="reftest-wait">
  3. <head>
  4. <title>Dynamic OpenType 'math' script tests</title>
  5. <!-- See mathscript-1-ref.html for an explanation of this font -->
  6. <style type="text/css" media="screen, print">
  7. @font-face {
  8. font-family: "mathssty";
  9. src: url("mathssty.woff");
  10. }
  11. </style>
  12. </head>
  13. <body>
  14. <!-- Demonstrate that it has no effect outside MathML -->
  15. <div style="font-family: 'mathssty';
  16. font-feature-settings: 'ssty' " id="div0">A</div>
  17. <!-- Demonstrate that it works within MathML -->
  18. <math>
  19. <mstyle style="font-family: 'mathssty'; font-feature-settings: 'ssty' 2">
  20. <mo id="mo0">A</mo>
  21. </mstyle>
  22. </math>
  23. <script>
  24. function doTest()
  25. {
  26. // Does nothing to non-MathML
  27. document.getElementById("div0").appendChild(document.createTextNode("A"));
  28. // Does something to MathML
  29. document.getElementById("mo0").appendChild(document.createTextNode("A"));
  30. document.documentElement.removeAttribute("class");
  31. }
  32. window.addEventListener("MozReftestInvalidate", doTest, false);
  33. </script>
  34. </body>
  35. </html>