diff --git a/layout/mathml/nsMathMLmoFrame.cpp b/layout/mathml/nsMathMLmoFrame.cpp index 489697f0e3199..e27709c0b0e5b 100644 --- a/layout/mathml/nsMathMLmoFrame.cpp +++ b/layout/mathml/nsMathMLmoFrame.cpp @@ -596,9 +596,15 @@ nsMathMLmoFrame::Stretch(DrawTarget* aDrawTarget, // get the leading to be left at the top and the bottom of the stretched char // this seems more reliable than using fm->GetLeading() on suspicious fonts - nscoord em; - GetEmHeight(fm, em); - nscoord leading = NSToCoordRound(0.2f * em); + const nscoord leading = [&fm] { + if (StaticPrefs:: + mathml_top_bottom_spacing_for_stretchy_operators_disabled()) { + return 0; + } + nscoord em; + GetEmHeight(fm, em); + return NSToCoordRound(0.2f * (float)em); + }(); // Operators that are stretchy, or those that are to be centered // to cater for fonts that are not math-aware, are handled by the MathMLChar diff --git a/modules/libpref/init/StaticPrefList.yaml b/modules/libpref/init/StaticPrefList.yaml index 57ac414488ec2..a4b93d3fd2c07 100644 --- a/modules/libpref/init/StaticPrefList.yaml +++ b/modules/libpref/init/StaticPrefList.yaml @@ -9548,6 +9548,13 @@ mirror: always rust: true +# Whether to disable extra top/bottom spacing for stretchy operators. +- name: mathml.top_bottom_spacing_for_stretchy_operators.disabled + type: bool + value: true + mirror: always + rust: true + #--------------------------------------------------------------------------- # Prefs starting with "media." #--------------------------------------------------------------------------- diff --git a/testing/web-platform/meta/mathml/presentation-markup/mrow/stretch-along-block-axis-001.html.ini b/testing/web-platform/meta/mathml/presentation-markup/mrow/stretch-along-block-axis-001.html.ini index 918e9dcb02ccb..a8cbc937df6b3 100644 --- a/testing/web-platform/meta/mathml/presentation-markup/mrow/stretch-along-block-axis-001.html.ini +++ b/testing/web-platform/meta/mathml/presentation-markup/mrow/stretch-along-block-axis-001.html.ini @@ -1,17 +1,6 @@ [stretch-along-block-axis-001.html] - expected: - if (os == "android") and fission: [OK, TIMEOUT] - [Taking into account stretch axis.] - expected: FAIL - - [Taking into account stretchy property.] - expected: FAIL - [Only operators with a stretchy property and block stretch axis.] expected: FAIL [Operators smaller and larger than non-stretchy siblings.] expected: FAIL - - [Embellished operators] - expected: FAIL diff --git a/testing/web-platform/meta/mathml/presentation-markup/operators/mo-minsize-maxsize-001.html.ini b/testing/web-platform/meta/mathml/presentation-markup/operators/mo-minsize-maxsize-001.html.ini index 363130b009562..843be0fe40a65 100644 --- a/testing/web-platform/meta/mathml/presentation-markup/operators/mo-minsize-maxsize-001.html.ini +++ b/testing/web-platform/meta/mathml/presentation-markup/operators/mo-minsize-maxsize-001.html.ini @@ -1,20 +1,6 @@ [mo-minsize-maxsize-001.html] - expected: - if (os == "android") and fission: [OK, TIMEOUT] [minsize < maxsize < 0 is treated as maxsize = minsize = 0] expected: FAIL - [minsize < 0 is treated as 0] - expected: FAIL - - [target size = 0 is treated as Tascent = Tdescent = minsize/2] - expected: FAIL - - [maxsize < minsize is treated as maxsize = minsize] - expected: FAIL - [minsize/maxsize percentages are relative to the target size] expected: FAIL - - [default minsize/maxsize percentages] - expected: FAIL diff --git a/testing/web-platform/meta/mathml/presentation-markup/operators/mo-stretch-properties-001.html.ini b/testing/web-platform/meta/mathml/presentation-markup/operators/mo-stretch-properties-001.html.ini deleted file mode 100644 index 294cf0bfb844e..0000000000000 --- a/testing/web-platform/meta/mathml/presentation-markup/operators/mo-stretch-properties-001.html.ini +++ /dev/null @@ -1,5 +0,0 @@ -[mo-stretch-properties-001.html] - expected: - if (os == "android") and fission: [OK, TIMEOUT] - [Stretchy vertical line] - expected: FAIL diff --git a/testing/web-platform/meta/mathml/presentation-markup/operators/mo-stretch-properties-dynamic-001.html.ini b/testing/web-platform/meta/mathml/presentation-markup/operators/mo-stretch-properties-dynamic-001.html.ini deleted file mode 100644 index 78e9ccef75a21..0000000000000 --- a/testing/web-platform/meta/mathml/presentation-markup/operators/mo-stretch-properties-dynamic-001.html.ini +++ /dev/null @@ -1,17 +0,0 @@ -[mo-stretch-properties-dynamic-001.html] - expected: - if (os == "android") and fission: [OK, TIMEOUT] - [symmetric] - expected: FAIL - - [largeop] - expected: FAIL - - [minsize] - expected: FAIL - - [maxsize] - expected: FAIL - - [stretchy] - expected: FAIL diff --git a/testing/web-platform/meta/mathml/presentation-markup/operators/stretchy-largeop-with-default-font-2.html.ini b/testing/web-platform/meta/mathml/presentation-markup/operators/stretchy-largeop-with-default-font-2.html.ini new file mode 100644 index 0000000000000..6f91fd5fa9f2a --- /dev/null +++ b/testing/web-platform/meta/mathml/presentation-markup/operators/stretchy-largeop-with-default-font-2.html.ini @@ -0,0 +1,4 @@ +[stretchy-largeop-with-default-font-2.html] + [Test that non-stretchy largeops are bigger in display mode.] + expected: + if os == "android": FAIL