diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 09:22:09 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 09:22:09 +0000 |
commit | 43a97878ce14b72f0981164f87f2e35e14151312 (patch) | |
tree | 620249daf56c0258faa40cbdcf9cfba06de2a846 /testing/web-platform/tests/mathml/relations/css-styling/displaystyle-3.html | |
parent | Initial commit. (diff) | |
download | firefox-43a97878ce14b72f0981164f87f2e35e14151312.tar.xz firefox-43a97878ce14b72f0981164f87f2e35e14151312.zip |
Adding upstream version 110.0.1.upstream/110.0.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'testing/web-platform/tests/mathml/relations/css-styling/displaystyle-3.html')
-rw-r--r-- | testing/web-platform/tests/mathml/relations/css-styling/displaystyle-3.html | 84 |
1 files changed, 84 insertions, 0 deletions
diff --git a/testing/web-platform/tests/mathml/relations/css-styling/displaystyle-3.html b/testing/web-platform/tests/mathml/relations/css-styling/displaystyle-3.html new file mode 100644 index 0000000000..a5bcab2aaa --- /dev/null +++ b/testing/web-platform/tests/mathml/relations/css-styling/displaystyle-3.html @@ -0,0 +1,84 @@ +<!DOCTYPE html> +<html> +<head> +<meta charset="utf-8"> +<title>displaystyle</title> +<link rel="help" href="https://w3c.github.io/mathml-core/#css-styling"> +<link rel="help" href="https://w3c.github.io/mathml-core/#the-displaystyle-and-scriptlevel-attributes"> +<link rel="help" href="https://w3c.github.io/mathml-core/#the-math-style-property"> +<meta name="assert" content="Verify the displaystyle of the underover element is considered (not the one of its base) to determine whether to move limits."> +<link rel="stylesheet" href="/fonts/ahem.css"> +<style> + math, math * { + font-family: Ahem; + font-size: 20px; + } +</style> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/mathml/support/feature-detection.js"></script> +<script src="/mathml/support/fonts.js"></script> +<script> + setup({ explicit_done: true }); + window.addEventListener("load", () => { loadAllFonts().then(runTests); }); + function runTests() { + ["munder", "mover", "munderover"].forEach((tag) => { + Array.from(document.getElementsByTagName(tag)).forEach(e => { + var displaystyle = e.getAttribute('displaystyle') === "true"; + test(function() { + assert_true(MathMLFeatureDetection.has_movablelimits()); + var elementRight = e.getBoundingClientRect().right; + var baseRight = e.firstElementChild.getBoundingClientRect().right; + if (displaystyle) + assert_approx_equals(elementRight, baseRight, 1); + else + assert_greater_than(elementRight, baseRight + 10); + }, `movablelimits for ${tag} element (displaystyle=${displaystyle})`); + }); + }); + done(); + } +</script> +</head> +<body> + <div id="log"></div> + <math> + <munder displaystyle="false"> + <mo displaystyle="true" movablelimits="true">XX</mo> + <mtext>X</mtext> + </munder> + </math> + <math> + <mover displaystyle="false"> + <mo displaystyle="true" movablelimits="true">XX</mo> + <mtext>X</mtext> + </mover> + </math> + <math> + <munderover displaystyle="false"> + <mo displaystyle="true" movablelimits="true">XX</mo> + <mtext>X</mtext> + <mtext>X</mtext> + </munderover> + </math> + <math> + <munder displaystyle="true"> + <mo displaystyle="false" movablelimits="true">XX</mo> + <mtext>X</mtext> + </munder> + </math> + <math> + <mover displaystyle="true"> + <mo displaystyle="false" movablelimits="true">XX</mo> + <mtext>X</mtext> + </mover> + </math> + <math> + <munderover displaystyle="true"> + <mo displaystyle="false" movablelimits="true">XX</mo> + <mtext>X</mtext> + <mtext>X</mtext> + </munderover> + </math> +</body> +</html> |