1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167
|
<!DOCTYPE html>
<html class="reftest-wait">
<head>
<meta charset="utf-8">
<title>Dynamic radical: paint invalidation</title>
<link rel="help" href="https://w3c.github.io/mathml-core/#radicals-msqrt-mroot">
<meta name="assert" content="">
<link rel="match" href="dynamic-radical-paint-invalidation-001-ref.html">
<style>
@font-face {
font-family: RadicalFont;
src: url("/fonts/math/radical-displaystyleverticalgap7000-rulethickness1000.woff");
}
@font-face {
font-family: RadicalFont2;
src: url("/fonts/math/radical-kernbeforedegree4000-rulethickness1000.woff");
}
math {
font-family: RadicalFont;
font-size: 10px;
}
#container > div {
height: 80px;
border-top: solid;
}
.withPaddingBorderAndMargin {
padding: 5px;
border: 5px solid yellow;
margin: 5px;
}
</style>
<script src="/mathml/support/fonts.js"></script>
<script>
window.addEventListener("load", () => { loadAllFonts().then(runTests); });
function runTests() {
// force initial layout so we're sure what we're testing against
document.documentElement.getBoundingClientRect();
var mroot = document.getElementsByTagName("mroot");
var msqrt = document.getElementsByTagName("msqrt");
// Modify base's width.
msqrt[0].firstElementChild.setAttribute("width", "60px")
mroot[0].firstElementChild.setAttribute("width", "60px")
// Modify base's ascent.
msqrt[1].firstElementChild.setAttribute("height", "20px")
mroot[1].firstElementChild.setAttribute("height", "20px")
// Modify base's descent.
msqrt[2].firstElementChild.setAttribute("depth", "40px")
mroot[2].firstElementChild.setAttribute("depth", "40px")
// Modify the radical's font family.
msqrt[3].parentNode.removeAttribute("style");
mroot[3].parentNode.removeAttribute("style");
// Modify radical's margin/border/padding
msqrt[4].setAttribute("class", "withPaddingBorderAndMargin");
mroot[4].setAttribute("class", "withPaddingBorderAndMargin");
document.documentElement.classList.remove('reftest-wait');
};
</script>
</head>
<body>
<div id="container">
<div>
<math>
<mspace width="20px" height="10px" depth="10px" style="background: gray"/>
<msqrt>
<mspace width="20px" height="10px" depth="10px" style="background: blue"/>
</msqrt>
<mspace width="20px" height="10px" depth="10px" style="background: gray"/>
</math>
</div>
<div>
<math>
<mspace width="20px" height="10px" depth="10px" style="background: gray"/>
<mroot>
<mspace width="20px" height="10px" depth="10px" style="background: blue"/>
<mspace width="20px" height="10px" depth="10px" style="background: lightblue"/>
</mroot>
<mspace width="20px" height="10px" depth="10px" style="background: gray"/>
</math>
</div>
<div>
<math>
<mspace width="20px" height="10px" depth="10px" style="background: gray"/>
<msqrt>
<mspace width="20px" height="10px" depth="10px" style="background: blue"/>
</msqrt>
<mspace width="20px" height="10px" depth="10px" style="background: gray"/>
</math>
</div>
<div>
<math>
<mspace width="20px" height="10px" depth="10px" style="background: gray"/>
<mroot>
<mspace width="20px" height="10px" depth="10px" style="background: blue"/>
<mspace width="20px" height="10px" depth="10px" style="background: lightblue"/>
</mroot>
<mspace width="20px" height="10px" depth="10px" style="background: gray"/>
</math>
</div>
<div>
<math>
<mspace width="20px" height="10px" depth="10px" style="background: gray"/>
<msqrt>
<mspace width="20px" height="10px" depth="10px" style="background: blue"/>
</msqrt>
<mspace width="20px" height="10px" depth="10px" style="background: gray"/>
</math>
</div>
<div>
<math>
<mspace width="20px" height="10px" depth="10px" style="background: gray"/>
<mroot>
<mspace width="20px" height="10px" depth="10px" style="background: blue"/>
<mspace width="20px" height="10px" depth="10px" style="background: lightblue"/>
</mroot>
<mspace width="20px" height="10px" depth="10px" style="background: gray"/>
</math>
</div>
<div>
<math style="font-family: RadicalFont2">
<mspace width="20px" height="10px" depth="10px" style="background: gray"/>
<msqrt>
<mspace width="20px" height="10px" depth="10px" style="background: blue"/>
</msqrt>
<mspace width="20px" height="10px" depth="10px" style="background: gray"/>
</math>
</div>
<div>
<math style="font-family: RadicalFont2">
<mspace width="20px" height="10px" depth="10px" style="background: gray"/>
<mroot>
<mspace width="20px" height="10px" depth="10px" style="background: blue"/>
<mspace width="20px" height="10px" depth="10px" style="background: lightblue"/>
</mroot>
<mspace width="20px" height="10px" depth="10px" style="background: gray"/>
</math>
</div>
<div>
<math>
<mspace width="20px" height="10px" depth="10px" style="background: gray"/>
<msqrt>
<mspace width="20px" height="10px" depth="10px" style="background: blue"/>
</msqrt>
<mspace width="20px" height="10px" depth="10px" style="background: gray"/>
</math>
</div>
<div>
<math>
<mspace width="20px" height="10px" depth="10px" style="background: gray"/>
<mroot>
<mspace width="20px" height="10px" depth="10px" style="background: blue"/>
<mspace width="20px" height="10px" depth="10px" style="background: lightblue"/>
</mroot>
<mspace width="20px" height="10px" depth="10px" style="background: gray"/>
</math>
</div>
</div>
<script src="/mathml/support/feature-detection.js"></script>
<script>MathMLFeatureDetection.ensure_for_match_reftest("has_mspace");</script>
</body>
</html>
|