mirror of
https://github.com/servo/servo.git
synced 2025-08-15 10:25:32 +01:00
Update web-platform-tests to revision e8bfc205e36ad699601212cd50083870bad9a75d
This commit is contained in:
parent
65dd6d4340
commit
ccdb0a3458
1428 changed files with 118036 additions and 9786 deletions
|
@ -0,0 +1,90 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Subscripts and Superscripts metrics</title>
|
||||
<link rel="help" href="http://www.mathml-association.org/MathMLinHTML5/S3.html#SS4">
|
||||
<meta name="assert" content="Verify metrics of scripted elements with tall scripts.">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<style>
|
||||
math, mspace {
|
||||
font-size: 10px;
|
||||
}
|
||||
</style>
|
||||
<script>
|
||||
/* This test does not use any specific fonts and so the exact rules are not
|
||||
specified precisely. We assume reasonable values for script shifts and
|
||||
spacing. */
|
||||
|
||||
function getBox(aId) {
|
||||
var box = document.getElementById(aId).getBoundingClientRect();
|
||||
box.middle = (box.bottom + box.top) / 2;
|
||||
return box;
|
||||
}
|
||||
|
||||
setup({ explicit_done: true });
|
||||
window.addEventListener("load", runTests);
|
||||
|
||||
var sizeArray = [50, 75, 100];
|
||||
|
||||
function runTests() {
|
||||
test(function() {
|
||||
var e = 1;
|
||||
assert_approx_equals(getBox("msubbase").middle, getBox("baseline").bottom, e, "msub base is placed on the baseline");
|
||||
assert_approx_equals(getBox("msupbase").middle, getBox("baseline").bottom, e, "msup base is placed on the baseline");
|
||||
assert_approx_equals(getBox("msubsupbase").middle, getBox("baseline").bottom, e, "msubsup base is placed on the baseline");
|
||||
assert_approx_equals(getBox("multibase").middle, getBox("baseline").bottom, e, "mmultiscripts baseis placed on the baseline");
|
||||
}, "Alignment on the baseline with different and large script heights");
|
||||
|
||||
test(function() {
|
||||
assert_greater_than(getBox("msubsub").top, getBox("msubbase").top, "msub: subscript is below the top of the base");
|
||||
assert_less_than(getBox("msupsup").bottom, getBox("msupbase").bottom, "msup: supscript is above the bottom of the base");
|
||||
assert_greater_than(getBox("msubsupsub").top, getBox("msubsupbase").top, "msubsup: subscript is below the top of the base");
|
||||
assert_less_than(getBox("msubsupsup").bottom, getBox("msubsupbase").bottom, "msubsup: supscript is above the bottom of the base");
|
||||
assert_greater_than(getBox("multipostsub").top, getBox("multibase").top, "mmultiscripts: postsubscript is below the top of the base");
|
||||
assert_less_than(getBox("multipostsup").bottom, getBox("multibase").bottom, "mmultiscripts: postsupscript is above the bottom of the base");
|
||||
assert_greater_than(getBox("multipresub").top, getBox("multibase").top, "mmultiscripts: presubscript is below the top of the base");
|
||||
assert_less_than(getBox("multipresup").bottom, getBox("multibase").bottom, "mmultiscripts: presupscript is above the bottom of the base");
|
||||
}, "Tall subscripts/superscripts are not placed too high/low");
|
||||
|
||||
test(function() {
|
||||
assert_greater_than(getBox("msubsupsub").top, getBox("msubsupsup").bottom, "msubsup: subscript is below the superscript");
|
||||
assert_greater_than(getBox("multipresub").top, getBox("multipresup").bottom, "mmultiscripts: presubscript is below the presuperscript");
|
||||
assert_greater_than(getBox("multipostsub").top, getBox("multipostsup").bottom, "mmultiscripts: postsubscript is below the postsuperscript");
|
||||
}, "No collisions for tall subscripts and superscripts");
|
||||
|
||||
done();
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<p>
|
||||
<math>
|
||||
<mspace id="baseline" width="30px" height="2px" depth="0px" mathbackground="blue"/>
|
||||
<msub id="msub">
|
||||
<mspace id="msubbase" width="30px" height="15px" depth="15px" mathbackground="black"/>
|
||||
<mspace id="msubsub" width="10px" height="50px" depth="50px" mathbackground="black"/>
|
||||
</msub>
|
||||
<msup id="msup">
|
||||
<mspace id="msupbase" width="30px" height="15px" depth="15px" mathbackground="black"/>
|
||||
<mspace id="msupsup" width="10px" height="75px" depth="75px" mathbackground="black"/>
|
||||
</msup>
|
||||
<msubsup id="msubsup">
|
||||
<mspace id="msubsupbase" width="30px" height="15px" depth="15px" mathbackground="black"/>
|
||||
<mspace id="msubsupsub" width="10px" height="50px" depth="50px" mathbackground="black"/>
|
||||
<mspace id="msubsupsup" width="10px" height="75px" depth="75px" mathbackground="black"/>
|
||||
</msubsup>
|
||||
<mmultiscripts id="multi">
|
||||
<mspace id="multibase" width="30px" height="15px" depth="15px" mathbackground="black"/>
|
||||
<mspace id="multipostsub" width="10px" height="50px" depth="50px" mathbackground="black"/>
|
||||
<mspace id="multipostsup" width="10px" height="75px" depth="75px" mathbackground="black"/>
|
||||
<mprescripts/>
|
||||
<mspace id="multipresub" width="10px" height="50px" depth="50px" mathbackground="black"/>
|
||||
<mspace id="multipresup" width="10px" height="75px" depth="75px" mathbackground="black"/>
|
||||
</mmultiscripts>
|
||||
</math>
|
||||
</p>
|
||||
<hr/>
|
||||
</body>
|
||||
</html>
|
Loading…
Add table
Add a link
Reference in a new issue