Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- This WPT test may be referenced by the following Test IDs:
- /mathml/fonts/dtls-3.html - WPT Dashboard Interop Dashboard
<!DOCTYPE html>
<html class="reftest-wait">
<link rel="match" href="dtls-3-ref.html"/>
<style type="text/css" media="screen, print">
@font-face {
font-family: "dtls-1";
src: url(dtls-1.otf);
}
</style>
</head>
<body>
<math>
<mstyle style="font-family: 'dtls-1';">
<mover accent="true" id="mover0">
<mo mathvariant="fraktur">a</mo>
</mover>
</mstyle>
</math>
<p>
<math>
<mstyle style="font-family: 'dtls-1';">
<mover accent="true">
<mo mathvariant="fraktur">a</mo>
<mo mathvariant="fraktur" id="mo0"></mo>
</mover>
</mstyle>
</math>
<p>
<math>
<mstyle style="font-family: 'dtls-1';">
<mover accent="true">
<mo mathvariant="fraktur">a</mo>
<mo mathvariant="fraktur" id="mo1">a</mo>
</mover>
</mstyle>
</math>
<p>
<math>
<mstyle style="font-family: 'dtls-1';" id="mstyle0">
</mstyle>
</math>
<p>
<math>
<mstyle id="mstyle1">
<mover accent="true">
<mover accent="true">
<mn mathvariant="fraktur">a</mn>
<mn mathvariant="fraktur">a</mn>
</mover>
<mover accent="true">
<mn mathvariant="fraktur">a</mn>
<mn mathvariant="fraktur">a</mn>
</mover>
</mover>
</mstyle>
</math>
<p>
<math>
<mstyle style="font-family: 'dtls-1';">
<mover accent="true">
<mrow>
<mrow>
<mrow id="mrow0">
</mrow>
</mrow>
</mrow>
<mo mathvariant="fraktur">a</mo>
</mover>
</mstyle>
</math>
<p>
<math>
<mstyle id="mstyle4" style ="font-family: 'dtls-1'; font-feature-settings: 'dtls' 0">
<mover accent="true">
<mover accent="true">
<mo mathvariant="fraktur">a</mo>
<mo mathvariant="fraktur">a</mo>
</mover>
<mover accent="true">
<mo mathvariant="fraktur">a</mo>
<mo mathvariant="fraktur">a</mo>
</mover>
</mover>
</mstyle>
</math>
<p>
<math>
<mstyle id="mstyle5" style ="font-family: 'dtls-1';">
<mover accent="true">
<mover accent="true">
<mo mathvariant="fraktur">a</mo>
<mo mathvariant="fraktur">a</mo>
</mover>
<mover accent="true">
<mo mathvariant="fraktur">a</mo>
<mo mathvariant="fraktur">a</mo>
</mover>
</mover>
</mstyle>
</math>
<p>
<math>
<mstyle style="font-family: 'dtls-1';">
<mover id="mover1">
<mo mathvariant="fraktur">a</mo>
<mo mathvariant="fraktur">a</mo>
</mover>
</mstyle>
</math>
<p>
<math>
<mstyle style="font-family: 'dtls-1';">
<mover accent="true" id="mover2">
<mo mathvariant="fraktur">a</mo>
<mo mathvariant="fraktur">a</mo>
</mover>
</mstyle>
</math>
<p>
<math>
<mstyle style="font-family: 'dtls-1';">
<mover accent="true" id="mover3">
<mo mathvariant="fraktur">a</mo>
<mo mathvariant="fraktur">a</mo>
</mover>
</mstyle>
</math>
<p>
<math>
<mstyle style="font-family: 'dtls-1';">
<mover accent="true">
<mo id="mo2">a</mo>
<mo>a</mo>
</mover>
</mstyle>
</math>
<p>
<math>
<mstyle style="font-family: 'dtls-1';">
<mover accent="true">
<mo mathvariant="fraktur" id="mo3">a</mo>
<mo>a</mo>
</mover>
</mstyle>
</math>
<script>
function doTest()
{
mo.innerHTML = "a";
mo.setAttribute("mathvariant", "fraktur");
// An added child gets dtls font feature
document.getElementById("mover0").appendChild(mo);
// A child with changed text gets dtls font feature
document.getElementById("mo0").innerHTML = "a";
// A relocated child loses dtls font feature setting
document.getElementById("mstyle0").appendChild(document.getElementById("mo1"));
// A change in style
document.getElementById("mstyle1").setAttribute("style", "font-family: 'dtls-1';");
// dtls gets added to descendants as well
mo1.innerHTML = "a";
mo1.setAttribute("mathvariant", "fraktur");
document.getElementById("mrow0").appendChild(mo1);
// removing explicit dtls setting works
document.getElementById("mstyle4").setAttribute(
"style", "font-family: 'dtls-1';")
// setting an explicit dtls font feature
document.getElementById("mstyle5").setAttribute(
"style" , "font-family: 'dtls-1'; font-feature-settings: 'dtls' 0");
// Adding accent="true" applies dtls font feature
document.getElementById("mover1").setAttribute("accent", "true");
// Changing accent="true" to false removes dtls font feature
document.getElementById("mover2").setAttribute("accent", "false");
// Removing accent="true" removes dtls font feature
document.getElementById("mover3").removeAttribute("accent");
// dtls applies when mathvariant is set
document.getElementById("mo2").setAttribute("mathvariant", "fraktur");
// dtls still applies when mathvariant is removed
document.getElementById("mo3").removeAttribute("mathvariant");
document.documentElement.removeAttribute("class");
}
document.documentElement.addEventListener("TestRendered", doTest);
</script>
</body>
</html>