Bug 1890523 - Remove extra space above/below stretchy operators. r=emilio

Gecko always adds .2em space above and below stretchy operators but this
is not part of MathML Core and is causing several WPT failures. The
MATH table does not have any parameter for that so it's likely some
tweak that was added in the early days of MathML that may no longer be
necessary. This patch tentatively removes this feature by placing it
under a disabled-by-default flag.

Differential Revision: https://phabricator.services.mozilla.com/D207014
This commit is contained in:
Frédéric Wang 2024-04-11 08:38:19 +00:00
parent 7a3d998312
commit a0998a4069
6 changed files with 16 additions and 50 deletions

View File

@ -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

View File

@ -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."
#---------------------------------------------------------------------------

View File

@ -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

View File

@ -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

View File

@ -1,5 +0,0 @@
[mo-stretch-properties-001.html]
expected:
if (os == "android") and fission: [OK, TIMEOUT]
[Stretchy vertical line]
expected: FAIL

View File

@ -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