mirror of
https://github.com/servo/servo.git
synced 2025-08-07 14:35:33 +01:00
Update web-platform-tests to revision bc60e6f82132cfc9a5b688c566c7772024b3c15c
This commit is contained in:
parent
449881f566
commit
29156ca9e2
223 changed files with 7517 additions and 2093 deletions
|
@ -0,0 +1,155 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Embellished operators</title>
|
||||
<link rel="stylesheet" type="text/css" href="/fonts/ahem.css" />
|
||||
<link rel="help" href="https://mathml-refresh.github.io/mathml-core/#embellished-operators">
|
||||
<link rel="help" href="https://mathml-refresh.github.io/mathml-core/#definition-of-space-like-elements">
|
||||
<link rel="help" href="https://mathml-refresh.github.io/mathml-core/#layout-of-mrow">
|
||||
<meta name="assert" content="Verify definition of embellished operators">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/mathml/support/feature-detection.js"></script>
|
||||
<style>
|
||||
/* Default spacing of operator 'X' is 0.2777777777777778em so quite different
|
||||
from the measured/specified 0em and 1em. */
|
||||
math, math * {
|
||||
font: 25px/1 Ahem;
|
||||
}
|
||||
mn {
|
||||
color: black;
|
||||
}
|
||||
.testedElement mo {
|
||||
color: yellow !important;
|
||||
}
|
||||
.testedElement, .testedElement * {
|
||||
color: blue !important;
|
||||
background: blue !important;
|
||||
}
|
||||
</style>
|
||||
<script>
|
||||
function spaceBeforeElement(id) {
|
||||
var element = document.getElementById(id);
|
||||
var mnBefore = element.previousElementSibling;
|
||||
return element.getBoundingClientRect().left - mnBefore.getBoundingClientRect().right;
|
||||
}
|
||||
|
||||
function spaceBeforeCoreOperator(id) {
|
||||
var element = document.getElementById(id);
|
||||
var coreMo = element.getElementsByTagName("mo")[0];
|
||||
return coreMo.getBoundingClientRect().left - element.getBoundingClientRect().left;
|
||||
}
|
||||
|
||||
setup({ explicit_done: true });
|
||||
window.addEventListener("load", runTests);
|
||||
|
||||
function runTests() {
|
||||
var epsilon = 1;
|
||||
var emToPx = 25;
|
||||
|
||||
["mrow", "mstyle", "mphantom", "mpadded"].forEach(tag => {
|
||||
test(function() {
|
||||
assert_true(MathMLFeatureDetection.has_operator_spacing());
|
||||
assert_approx_equals(spaceBeforeElement(`${tag}-op`), 2 * emToPx, epsilon);
|
||||
assert_approx_equals(spaceBeforeCoreOperator(`${tag}-op`), 0, epsilon);
|
||||
}, `${tag} (embellished operator)`);
|
||||
|
||||
test(function() {
|
||||
assert_true(MathMLFeatureDetection.has_operator_spacing());
|
||||
assert_approx_equals(spaceBeforeElement(`${tag}-nonop`), 0, epsilon);
|
||||
assert_approx_equals(spaceBeforeCoreOperator(`${tag}-nonop`), 2 * emToPx, epsilon);
|
||||
}, `${tag} (not embellished operator)`);
|
||||
});
|
||||
|
||||
done();
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="log"></div>
|
||||
<p>
|
||||
<math>
|
||||
<mn>X</mn>
|
||||
<mrow id="mrow-op" class="testedElement">
|
||||
<mo lspace="2em" rspace="0em">X</mo>
|
||||
<mtext class="space-like">X</mtext>
|
||||
</mrow>
|
||||
<mn>X</mn>
|
||||
</math>
|
||||
</p>
|
||||
<p>
|
||||
<math>
|
||||
<mn>X</mn>
|
||||
<mrow id="mrow-nonop" class="testedElement">
|
||||
<mo lspace="2em" rspace="0em">X</mo>
|
||||
<mn>X</mn> <!-- "mn" is not space-like -->
|
||||
</mrow>
|
||||
<mn>X</mn>
|
||||
</math>
|
||||
</p>
|
||||
<!-- mstyle is an embellished operator if its children consist
|
||||
of one embellished operator and zero or more space-like elements. -->
|
||||
<p>
|
||||
<math>
|
||||
<mn>X</mn>
|
||||
<mstyle id="mstyle-op" class="testedElement">
|
||||
<mo lspace="2em" rspace="0em">X</mo>
|
||||
</mstyle>
|
||||
<mn>X</mn>
|
||||
</math>
|
||||
</p>
|
||||
<p>
|
||||
<math>
|
||||
<mn>X</mn>
|
||||
<mstyle id="mstyle-nonop" class="testedElement">
|
||||
<mo lspace="2em" rspace="0em">X</mo>
|
||||
<mn>X</mn> <!-- "mn" is not space-like -->
|
||||
</mstyle>
|
||||
<mn>X</mn>
|
||||
</math>
|
||||
</p>
|
||||
<!-- mphantom is an embellished operator if its children consist
|
||||
of one embellished operator and zero or more space-like elements. -->
|
||||
<p>
|
||||
<math>
|
||||
<mn>X</mn>
|
||||
<mphantom id="mphantom-op" class="testedElement">
|
||||
<mo lspace="2em" rspace="0em">X</mo>
|
||||
</mphantom>
|
||||
<mn>X</mn>
|
||||
</math>
|
||||
</p>
|
||||
<p>
|
||||
<math>
|
||||
<mn>X</mn>
|
||||
<mphantom id="mphantom-nonop" class="testedElement">
|
||||
<mo lspace="2em" rspace="0em">X</mo>
|
||||
<mn>X</mn> <!-- "mn" is not space-like -->
|
||||
</mphantom>
|
||||
<mn>X</mn>
|
||||
</math>
|
||||
</p>
|
||||
<!-- mpadded is an embellished operator if its children consist
|
||||
of one embellished operator and zero or more space-like elements. -->
|
||||
<p>
|
||||
<math>
|
||||
<mn>X</mn>
|
||||
<mpadded id="mpadded-op" class="testedElement">
|
||||
<mo lspace="2em" rspace="0em">X</mo>
|
||||
</mpadded>
|
||||
<mn>X</mn>
|
||||
</math>
|
||||
</p>
|
||||
<p>
|
||||
<math>
|
||||
<mn>X</mn>
|
||||
<mpadded id="mpadded-nonop" class="testedElement">
|
||||
<mo lspace="2em" rspace="0em">X</mo>
|
||||
<mn>X</mn> <!-- "mn" is not space-like -->
|
||||
</mpadded>
|
||||
<mn>X</mn>
|
||||
</math>
|
||||
</p>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,286 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Embellished operators</title>
|
||||
<link rel="stylesheet" type="text/css" href="/fonts/ahem.css" />
|
||||
<link rel="help" href="https://mathml-refresh.github.io/mathml-core/#embellished-operators">
|
||||
<link rel="help" href="https://mathml-refresh.github.io/mathml-core/#definition-of-space-like-elements">
|
||||
<link rel="help" href="https://mathml-refresh.github.io/mathml-core/#layout-of-mrow">
|
||||
<meta name="assert" content="Verify definition of embellished operators">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/mathml/support/feature-detection.js"></script>
|
||||
<style>
|
||||
/* Default spacing of operator 'X' is 0.2777777777777778em so quite different
|
||||
from the measured/specified 0em and 1em. */
|
||||
math, math * {
|
||||
font: 25px/1 Ahem;
|
||||
}
|
||||
mn {
|
||||
color: black;
|
||||
}
|
||||
mtext.space-like {
|
||||
color: lightblue !important;
|
||||
}
|
||||
.testedElement mo {
|
||||
color: yellow !important;
|
||||
}
|
||||
.testedElement, .testedElement * {
|
||||
color: blue !important;
|
||||
background: blue !important;
|
||||
}
|
||||
</style>
|
||||
<script>
|
||||
function spaceBeforeElement(element) {
|
||||
var mnBefore = element.previousElementSibling;
|
||||
return element.getBoundingClientRect().left - mnBefore.getBoundingClientRect().right;
|
||||
}
|
||||
|
||||
setup({ explicit_done: true });
|
||||
window.addEventListener("load", runTests);
|
||||
|
||||
function runTests() {
|
||||
var epsilon = 1;
|
||||
var emToPx = 25;
|
||||
|
||||
["msub", "msup", "msubsup", "munder", "mover", "munderover",
|
||||
"mmultiscripts", "mfrac", "maction", "semantics"].forEach(tag => {
|
||||
test(function() {
|
||||
assert_true(MathMLFeatureDetection.has_operator_spacing());
|
||||
var element = document.getElementsByTagName(tag)[0];
|
||||
assert_approx_equals(spaceBeforeElement(element), 2 * emToPx, epsilon);
|
||||
}, `${tag} (embellished operator)`);
|
||||
|
||||
test(function() {
|
||||
assert_true(MathMLFeatureDetection.has_operator_spacing());
|
||||
var element = document.getElementsByTagName(tag)[1];
|
||||
assert_approx_equals(spaceBeforeElement(element), 0, epsilon);
|
||||
}, `${tag} (not embellished operator)`);
|
||||
});
|
||||
done();
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="log"></div>
|
||||
<!-- <msub>, <msup>, <msubsup>, <munder>, <mover>, <munderover>,
|
||||
<mmultiscripts>, <mfrac>, <semantics> or <maction> are embellished
|
||||
operators if their first child exists and is an embellished operator -->
|
||||
<p>
|
||||
<math>
|
||||
<mn>X</mn>
|
||||
<msub class="testedElement">
|
||||
<mo lspace="2em" rspace="0em">X</mo>
|
||||
<mn>X</mn>
|
||||
</msub>
|
||||
<mn>X</mn>
|
||||
</math>
|
||||
</p>
|
||||
<p>
|
||||
<math>
|
||||
<mn>X</mn>
|
||||
<msup class="testedElement">
|
||||
<mo lspace="2em" rspace="0em">X</mo>
|
||||
<mn>X</mn>
|
||||
</msup>
|
||||
<mn>X</mn>
|
||||
</math>
|
||||
</p>
|
||||
<p>
|
||||
<math>
|
||||
<mn>X</mn>
|
||||
<msubsup class="testedElement">
|
||||
<mo lspace="2em" rspace="0em">X</mo>
|
||||
<mn>X</mn>
|
||||
<mn>X</mn>
|
||||
</msubsup>
|
||||
<mn>X</mn>
|
||||
</math>
|
||||
</p>
|
||||
<p>
|
||||
<math>
|
||||
<mn>X</mn>
|
||||
<munder class="testedElement">
|
||||
<mo lspace="2em" rspace="0em">X</mo>
|
||||
<mn>X</mn>
|
||||
</munder>
|
||||
<mn>X</mn>
|
||||
</math>
|
||||
</p>
|
||||
<p>
|
||||
<math>
|
||||
<mn>X</mn>
|
||||
<mover class="testedElement">
|
||||
<mo lspace="2em" rspace="0em">X</mo>
|
||||
<mn>X</mn>
|
||||
</mover>
|
||||
<mn>X</mn>
|
||||
</math>
|
||||
</p>
|
||||
<p>
|
||||
<math>
|
||||
<mn>X</mn>
|
||||
<munderover class="testedElement">
|
||||
<mo lspace="2em" rspace="0em">X</mo>
|
||||
<mn>X</mn>
|
||||
</munderover>
|
||||
<mn>X</mn>
|
||||
</math>
|
||||
</p>
|
||||
<p>
|
||||
<math>
|
||||
<mn>X</mn>
|
||||
<mmultiscripts class="testedElement">
|
||||
<mo lspace="2em" rspace="0em">X</mo>
|
||||
<mn>X</mn>
|
||||
<mn>X</mn>
|
||||
<mn>X</mn>
|
||||
<mn>X</mn>
|
||||
</mmultiscripts>
|
||||
<mn>X</mn>
|
||||
</math>
|
||||
</p>
|
||||
<p>
|
||||
<math>
|
||||
<mn>X</mn>
|
||||
<mfrac class="testedElement">
|
||||
<mo lspace="2em" rspace="0em">X</mo>
|
||||
<mn>X</mn>
|
||||
</mfrac>
|
||||
<mn>X</mn>
|
||||
</math>
|
||||
</p>
|
||||
<p>
|
||||
<math>
|
||||
<mn>X</mn>
|
||||
<maction class="testedElement" actiontype="statusline">
|
||||
<mo lspace="2em" rspace="0em">X</mo>
|
||||
<mn>STATUS MESSAGE</mn>
|
||||
</maction>
|
||||
<mn>X</mn>
|
||||
</math>
|
||||
</p>
|
||||
<p>
|
||||
<math>
|
||||
<mn>X</mn>
|
||||
<semantics class="testedElement">
|
||||
<mo lspace="2em" rspace="0em">X</mo>
|
||||
<annotation>TEXT ANNOTATION</annotation>
|
||||
<mn>X</mn>
|
||||
</semantics>
|
||||
<mn>X</mn>
|
||||
</math>
|
||||
</p>
|
||||
<!-- <msub>, <msup>, <msubsup>, <munder>, <mover>, <munderover>,
|
||||
<mmultiscripts>, <mfrac>, <semantics> or <maction> are not embellished
|
||||
operators if their first child is not an embellished operator -->
|
||||
<p>
|
||||
<math>
|
||||
<mn>X</mn>
|
||||
<msub class="testedElement">
|
||||
<mn>X</mn>
|
||||
<mo lspace="2em" rspace="0em">X</mo>
|
||||
</msub>
|
||||
<mn>X</mn>
|
||||
</math>
|
||||
</p>
|
||||
<p>
|
||||
<math>
|
||||
<mn>X</mn>
|
||||
<msup class="testedElement">
|
||||
<mn>X</mn>
|
||||
<mo lspace="2em" rspace="0em">X</mo>
|
||||
</msup>
|
||||
<mn>X</mn>
|
||||
</math>
|
||||
</p>
|
||||
<p>
|
||||
<math>
|
||||
<mn>X</mn>
|
||||
<msubsup class="testedElement">
|
||||
<mn>X</mn>
|
||||
<mo lspace="2em" rspace="0em">X</mo>
|
||||
<mn>X</mn>
|
||||
</msubsup>
|
||||
<mn>X</mn>
|
||||
</math>
|
||||
</p>
|
||||
<p>
|
||||
<math>
|
||||
<mn>X</mn>
|
||||
<munder class="testedElement">
|
||||
<mn>X</mn>
|
||||
<mo lspace="2em" rspace="0em">X</mo>
|
||||
</munder>
|
||||
<mn>X</mn>
|
||||
</math>
|
||||
</p>
|
||||
<p>
|
||||
<math>
|
||||
<mn>X</mn>
|
||||
<mover class="testedElement">
|
||||
<mn>X</mn>
|
||||
<mo lspace="2em" rspace="0em">X</mo>
|
||||
</mover>
|
||||
<mn>X</mn>
|
||||
</math>
|
||||
</p>
|
||||
<p>
|
||||
<math>
|
||||
<mn>X</mn>
|
||||
<munderover class="testedElement">
|
||||
<mn>X</mn>
|
||||
<mo lspace="2em" rspace="0em">X</mo>
|
||||
</munderover>
|
||||
<mn>X</mn>
|
||||
</math>
|
||||
</p>
|
||||
<p>
|
||||
<math>
|
||||
<mn>X</mn>
|
||||
<mmultiscripts class="testedElement">
|
||||
<mn>X</mn>
|
||||
<mo lspace="2em" rspace="0em">X</mo>
|
||||
<mn>X</mn>
|
||||
<mn>X</mn>
|
||||
<mn>X</mn>
|
||||
</mmultiscripts>
|
||||
<mn>X</mn>
|
||||
</math>
|
||||
</p>
|
||||
<p>
|
||||
<math>
|
||||
<mn>X</mn>
|
||||
<mfrac class="testedElement">
|
||||
<mn>X</mn>
|
||||
<mo lspace="2em" rspace="0em">X</mo>
|
||||
</mfrac>
|
||||
<mn>X</mn>
|
||||
</math>
|
||||
</p>
|
||||
<p>
|
||||
<math>
|
||||
<mn>X</mn>
|
||||
<maction class="testedElement" actiontype="statusline">
|
||||
<mn>X</mn>
|
||||
<mo lspace="2em" rspace="0em">STATUS MESSAGE</mo>
|
||||
</maction>
|
||||
<mn>X</mn>
|
||||
</math>
|
||||
</p>
|
||||
<p>
|
||||
<math>
|
||||
<mn>X</mn>
|
||||
<semantics class="testedElement">
|
||||
<mrow>
|
||||
<mn>X</mn>
|
||||
<mo lspace="2em" rspace="0em">X</mo>
|
||||
</mrow>
|
||||
<annotation>TEXT ANNOTATION</annotation>
|
||||
</semantics>
|
||||
<mn>X</mn>
|
||||
</math>
|
||||
</p>
|
||||
</body>
|
||||
</html>
|
Loading…
Add table
Add a link
Reference in a new issue