diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-15 03:35:49 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-15 03:35:49 +0000 |
commit | d8bbc7858622b6d9c278469aab701ca0b609cddf (patch) | |
tree | eff41dc61d9f714852212739e6b3738b82a2af87 /testing/web-platform/tests/mathml/presentation-markup/operators | |
parent | Releasing progress-linux version 125.0.3-1~progress7.99u1. (diff) | |
download | firefox-d8bbc7858622b6d9c278469aab701ca0b609cddf.tar.xz firefox-d8bbc7858622b6d9c278469aab701ca0b609cddf.zip |
Merging upstream version 126.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'testing/web-platform/tests/mathml/presentation-markup/operators')
2 files changed, 45 insertions, 3 deletions
diff --git a/testing/web-platform/tests/mathml/presentation-markup/operators/mo-no-vertical-adjustment-for-basic-binary-operators.html b/testing/web-platform/tests/mathml/presentation-markup/operators/mo-no-vertical-adjustment-for-basic-binary-operators.html new file mode 100644 index 0000000000..a318a71ce5 --- /dev/null +++ b/testing/web-platform/tests/mathml/presentation-markup/operators/mo-no-vertical-adjustment-for-basic-binary-operators.html @@ -0,0 +1,39 @@ +<!DOCTYPE html> +<meta charset="utf-8"> +<title>No vertical adjustment for basic binary operators</title> +<link rel="stylesheet" type="text/css" href="/fonts/ahem.css" /> +<link rel="help" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1890531" /> +<meta name="assert" content="Verify vertical alignement of basic binary operators is not adjusted to align their centers with the math axis."> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/mathml/support/fonts.js"></script> +<style> + @font-face { + font-family: operators; + /* AxisHeight == 0, so the math axis matches the baseline */ + src: url("/fonts/math/operators.woff"); + } + math { + font: 25px operators; + } +</style> +<math> + <mn id="ref">↯</mn> + <mo>+</mo><mo>=</mo><mo>*</mo><mo>−</mo><mo>≤</mo><mo>≥</mo><mo>×</mo> +</math> +<script> + promise_test(async () => { + await new Promise(r => { window.addEventListener("DOMContentLoaded", r) }); + await loadAllFonts(); + function centerOf(element) { + const box = element.getBoundingClientRect(); + return (box.top + box.bottom) / 2; + } + const ref = centerOf(document.getElementById("ref")); + const epsilon = 1; + Array.from(document.getElementsByTagName("mo")).forEach(mo => { + assert_approx_equals(centerOf(mo), ref, epsilon, + `Position of "${mo.textContent}"`); + }); + }, "Vertical alignment of basic binary operators is not adjusted."); +</script> diff --git a/testing/web-platform/tests/mathml/presentation-markup/operators/stretchy-largeop-with-default-font-2.html b/testing/web-platform/tests/mathml/presentation-markup/operators/stretchy-largeop-with-default-font-2.html index 7c43c80acc..83f160a54e 100644 --- a/testing/web-platform/tests/mathml/presentation-markup/operators/stretchy-largeop-with-default-font-2.html +++ b/testing/web-platform/tests/mathml/presentation-markup/operators/stretchy-largeop-with-default-font-2.html @@ -11,8 +11,8 @@ function contentOf(aElement) { return document.getElementById(aElement).textContent; } - function heightOf(aElement) { - return document.getElementById(aElement).getBoundingClientRect().height; + function boxOf(aElement) { + return document.getElementById(aElement).getBoundingClientRect(); } promise_test(() => { return new Promise(resolve => { @@ -21,7 +21,10 @@ const numTests = 10; // zero indexed for (let i = 0; i < numTests; i++) { const operatorName = contentOf(`mo${i}`); - assert_greater_than(heightOf(`mo${i}`), heightOf(`moRef${i}`), `size of largeop '${operatorName}'`); + const box = boxOf(`mo${i}`); + const ref = boxOf(`moRef${i}`); + assert_greater_than(box.width, ref.width, `width of largeop '${operatorName}'`); + assert_greater_than(box.height, ref.height, `height of largeop '${operatorName}'`); } }); }, "Test that non-stretchy largeops are bigger in display mode."); |