From 861063e91b97999b24f050f7321a699c54e63e54 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Wang?= Date: Mon, 30 Sep 2024 12:26:28 +0000 Subject: [PATCH] Position mprescripts at per MathML Core. From [1]: > Place the mmultiscripts base and boxes at inline offsets inline-offset and with their alphabetic baselines aligned with the alphabetic baseline. Also tweak subsup-6.html to compute bounding box of the element at the time a test is run. Otherwise reflow due to resize of the `
` element can make the test fail. [1] https://w3c.github.io/mathml-core/#base-with-prescripts-and-postscripts Differential Revision: https://phabricator.services.mozilla.com/D222614 bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1909417 gecko-commit: fabc61dc18efed097d9d499406d12c2094b75772 gecko-reviewers: emilio --- mathml/presentation-markup/scripts/subsup-6.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mathml/presentation-markup/scripts/subsup-6.html b/mathml/presentation-markup/scripts/subsup-6.html index 9666c80f9f60bd..50a36b89dc1ee2 100644 --- a/mathml/presentation-markup/scripts/subsup-6.html +++ b/mathml/presentation-markup/scripts/subsup-6.html @@ -25,13 +25,13 @@ function runTests() { Array.from(document.getElementsByTagName("mprescripts")). forEach(prescript => { - let prescript_box = prescript.getBoundingClientRect(); let mmultiscripts = prescript.parentNode; let name = mmultiscripts.getAttribute("data-name"); test(function() { assert_true(MathMLFeatureDetection.has_mspace()); var e = 1; let base_box = mmultiscripts.firstElementChild.getBoundingClientRect(); + let prescript_box = prescript.getBoundingClientRect(); assert_approx_equals(prescript_box.left, base_box.left, e, `${name}, left`); assert_approx_equals((prescript_box.top + prescript_box.bottom) / 2, (base_box.top + base_box.bottom) / 2, e, `${name}, top`);