Closed Bug 1904220 Opened 4 months ago Closed 2 months ago

Hypen-minus renders smaller than math minus in MathML

Categories

(Core :: MathML, defect)

Firefox 127
defect

Tracking

()

RESOLVED FIXED
132 Branch
Tracking Status
firefox-esr115 --- unaffected
firefox-esr128 --- wontfix
firefox129 --- wontfix
firefox130 --- wontfix
firefox131 --- wontfix
firefox132 --- fixed

People

(Reporter: paulmasson, Assigned: fredw)

References

(Regression)

Details

(Keywords: regression)

Attachments

(1 file)

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:127.0) Gecko/20100101 Firefox/127.0

Steps to reproduce:

Create an HTML document containing either of the following math tags:

<math><mo>-</mo><mo>−</mo></math>

<math><mo>-</mo><mo>−</mo></math>

Actual results:

The first character, the hypen-minus, renders much smaller than the official math minus, appearing to be less than half the length of the latter.

Expected results:

The hypen-minus used to render the same size as math minus in MathML. Since this character is easy to type with a standard keyboard, the former behavior should be restored. The current behavior does not match MathJax, where both characters render the same size.

The Bugbug bot thinks this bug should belong to the 'Core::MathML' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.

Component: Untriaged → MathML
Product: Firefox → Core

It should be done in https://searchfox.org/mozilla-central/rev/02a4a649ed75ebaf3fbdf301c3d3137baf6842a1/layout/mathml/nsMathMLmoFrame.cpp#120

It's working if I set mathml.centered_operators.disabled to false, so probably a regression of bug 1890531.

Keywords: regression
Regressed by: 1890531

I think nsMathMLmoFrame::UseMathMLChar() should still return true for the hyphen.

After bug 1890531, mathml.centered_operator is disabled and
U+002D HYPHEN-MINUS in <mo> no longer renders as U+2212 MINUS SIGN.
This patches restore this behavior as the change was unintentional, even
though this is not specified in MathML Core.

Attachment #9418925 - Attachment description: WIP: Bug 1904220 - Fix MathML regression with HYPHEN-MINUS not rendered as MINUS SIGN → WIP: Bug 1904220 - Fix MathML regression with HYPHEN-MINUS not rendered as MINUS SIGN. r=emilio

(In reply to Paul Masson from comment #0)

The hypen-minus used to render the same size as math minus in MathML. Since this character is easy to type with a standard keyboard, the former behavior should be restored. The current behavior does not match MathJax, where both characters render the same size.

In general our reference for browsers is MathML Core, not MathJax. For this particular bug, this is a legacy behavior from Firefox and WebKit but it is not standardized in MathML Core, not covered by WPT tests and not implemented in Chromium.

Anyway, since it was unintentional change I uploaded D219085 to restore previous behavior.

Assignee: nobody → fwang
Attachment #9418925 - Attachment description: WIP: Bug 1904220 - Fix MathML regression with HYPHEN-MINUS not rendered as MINUS SIGN. r=emilio → Bug 1904220 - Fix MathML regression with HYPHEN-MINUS not rendered as MINUS SIGN. r=emilio
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true

Set release status flags based on info from the regressing bug 1890531

Pushed by fwang@igalia.com: https://hg.mozilla.org/integration/autoland/rev/a6394916d0fd Fix MathML regression with HYPHEN-MINUS not rendered as MINUS SIGN. r=emilio

Set release status flags based on info from the regressing bug 1890531

Pushed by fwang@igalia.com: https://hg.mozilla.org/integration/autoland/rev/fab98364af1c Fix MathML regression with HYPHEN-MINUS not rendered as MINUS SIGN. r=emilio

Backed out for causing build bustages on mathml/nsMathMLmoFrame.cpp.

[task 2024-09-05T08:56:48.293Z] 08:56:48     INFO -  gmake[4]: Entering directory '/builds/worker/workspace/obj-build/layout/mathml'
[task 2024-09-05T08:56:48.296Z] 08:56:48     INFO -  /builds/worker/fetches/sccache/sccache /builds/worker/fetches/clang/bin/clang-cl -fms-compatibility-version=19.39 -std:c++17 -m32 -Xclang -ivfsoverlay -Xclang /builds/worker/fetches/vs/overlay.yaml -FoUnified_cpp_layout_mathml0.obj -c  -I/builds/worker/workspace/obj-build/dist/stl_wrappers -guard:cf -DNDEBUG=1 -DTRIMMED=1 -DUNICODE -D_UNICODE -D_CRT_RAND_S -DCERT_CHAIN_PARA_HAS_EXTRA_FIELDS -D_SECURE_ATL -DCHROMIUM_BUILD -DU_STATIC_IMPLEMENTATION -DWIN32 -D_WIN32 -D_WINDOWS -DWIN32_LEAN_AND_MEAN -DWINAPI_NO_BUNDLED_LIBRARIES -DMOZ_HAS_MOZGLUE -DMOZILLA_INTERNAL_API -DIMPL_LIBXUL -DMOZ_SUPPORT_LEAKCHECKING -DSTATIC_EXPORTABLE_JS_API -I/builds/worker/checkouts/gecko/layout/mathml -I/builds/worker/workspace/obj-build/layout/mathml -I/builds/worker/workspace/obj-build/ipc/ipdl/_ipdlheaders -I/builds/worker/checkouts/gecko/ipc/chromium/src -I/builds/worker/checkouts/gecko/layout/base -I/builds/worker/checkouts/gecko/layout/generic -I/builds/worker/checkouts/gecko/layout/painting -I/builds/worker/checkouts/gecko/layout/style -I/builds/worker/checkouts/gecko/layout/tables -I/builds/worker/checkouts/gecko/layout/xul -I/builds/worker/checkouts/gecko/dom/base -I/builds/worker/checkouts/gecko/dom/mathml -I/builds/worker/workspace/obj-build/dist/include -I/builds/worker/workspace/obj-build/dist/include/nspr -I/builds/worker/workspace/obj-build/dist/include/nss -MD -DMOZILLA_CLIENT -FI /builds/worker/workspace/obj-build/mozilla-config.h -Zc:sizedDealloc- -Gy -Zc:inline -Gw -D_SILENCE_TR1_NAMESPACE_DEPRECATION_WARNING -TP -GR- -D_HAS_EXCEPTIONS=0 -fcrash-diagnostics-dir=/builds/worker/artifacts -arch:SSE2 -Z7 -Xclang -load -Xclang /builds/worker/workspace/obj-build/build/clang-plugin/libclang-plugin.so -Xclang -add-plugin -Xclang moz-check -O2 -Oy- -Werror -W3 -Wbitfield-enum-conversion -Wempty-body -Wformat-type-confusion -Wignored-qualifiers -Wpointer-arith -Wshadow-field-in-constructor-modified -Wsign-compare -Wtautological-constant-in-range-compare -Wtype-limits -Wno-error=tautological-type-limit-compare -Wunreachable-code -Wunreachable-code-return -Wunused-but-set-parameter -Wno-invalid-offsetof -Wclass-varargs -Wempty-init-stmt -Wfloat-overflow-conversion -Wfloat-zero-conversion -Wloop-analysis -Wno-range-loop-analysis -Wenum-compare-conditional -Wenum-float-conversion -Wvolatile -Wno-deprecated-anon-enum-enum-conversion -Wno-deprecated-enum-enum-conversion -Wno-deprecated-this-capture -Wcomma -Wimplicit-fallthrough -Wstring-conversion -Wno-inline-new-delete -Wno-error=deprecated-declarations -Wno-error=array-bounds -Wno-error=free-nonheap-object -Wno-error=atomic-alignment -Wno-error=deprecated-builtins -Wno-unknown-pragmas -Wno-ignored-pragmas -Wno-deprecated-declarations -Wno-microsoft-enum-value -Wno-microsoft-include -Wno-invalid-noreturn -Wno-inconsistent-missing-override -Wno-implicit-exception-spec-mismatch -Wno-microsoft-exception-spec -Wno-unused-local-typedef -Wno-ignored-attributes -Wno-used-but-marked-unused -Wno-psabi -Wthread-safety -Wno-error=builtin-macro-redefined -Wno-vla-cxx-extension -Wno-unknown-warning-option -fno-strict-aliasing -Xclang -ffp-contract=off  -Xclang -MP -Xclang -dependency-file -Xclang .deps/Unified_cpp_layout_mathml0.obj.pp -Xclang -MT -Xclang Unified_cpp_layout_mathml0.obj   Unified_cpp_layout_mathml0.cpp
[task 2024-09-05T08:56:48.297Z] 08:56:48     INFO -  In file included from Unified_cpp_layout_mathml0.cpp:74:
[task 2024-09-05T08:56:48.297Z] 08:56:48    ERROR -  /builds/worker/checkouts/gecko/layout/mathml/nsMathMLmoFrame.cpp(62,10): error: comparison of integers of different signs: '(unnamed enum at /builds/worker/checkouts/gecko/layout/mathml/nsMathMLOperators.h:21:1)' and 'nsOperatorFlags' (aka 'unsigned int') [-Werror,-Wsign-compare]
[task 2024-09-05T08:56:48.298Z] 08:56:48     INFO -     62 |          NS_MATHML_OPERATOR_FORCES_MATHML_CHAR(mFlags);
[task 2024-09-05T08:56:48.298Z] 08:56:48     INFO -        |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[task 2024-09-05T08:56:48.298Z] 08:56:48     INFO -  /builds/worker/checkouts/gecko/layout/mathml/nsMathMLOperators.h(101,41): note: expanded from macro 'NS_MATHML_OPERATOR_FORCES_MATHML_CHAR'
[task 2024-09-05T08:56:48.299Z] 08:56:48     INFO -    101 |   (NS_MATHML_OPERATOR_FORCE_MATHML_CHAR ==            \
[task 2024-09-05T08:56:48.299Z] 08:56:48     INFO -        |    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^
[task 2024-09-05T08:56:48.299Z] 08:56:48     INFO -    102 |    ((_flags) & NS_MATHML_OPERATOR_FORCE_MATHML_CHAR))
[task 2024-09-05T08:56:48.300Z] 08:56:48     INFO -        |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[task 2024-09-05T08:56:48.300Z] 08:56:48     INFO -  1 error generated.
[task 2024-09-05T08:56:48.300Z] 08:56:48    ERROR -  gmake[4]: *** [/builds/worker/checkouts/gecko/config/rules.mk:676: Unified_cpp_layout_mathml0.obj] Error 1
[task 2024-09-05T08:56:48.301Z] 08:56:48     INFO -  gmake[4]: Leaving directory '/builds/worker/workspace/obj-build/layout/mathml'
[task 2024-09-05T08:56:48.301Z] 08:56:48     INFO -  gmake[4]: Target 'target-objects' not remade because of errors.
[task 2024-09-05T08:56:48.301Z] 08:56:48    ERROR -  gmake[3]: *** [/builds/worker/checkouts/gecko/config/recurse.mk:72: layout/mathml/target-objects] Error 2
[task 2024-09-05T08:56:48.326Z] 08:56:48     INFO -  gmake[4]: Entering directory '/builds/worker/workspace/obj-build/netwerk/protocol/http'
[task 2024-09-05T08:56:48.326Z] 08:56:48     INFO -  mkdir -p '.deps/'
[task 2024-09-05T08:56:48.326Z] 08:56:48     INFO -  gmake[4]: Leaving directory '/builds/worker/workspace/obj-build/netwerk/protocol/http'
[task 2024-09-05T08:56:48.354Z] 08:56:48     INFO -  gmake[4]: Entering directory '/builds/worker/workspace/obj-build/netwerk/protocol/http'
[task 2024-09-05T08:56:48.354Z] 08:56:48     INFO -  netwerk/protocol/http/nsHttpChannelAuthProvider.obj
Pushed by fwang@igalia.com: https://hg.mozilla.org/integration/autoland/rev/68cc51e9fccd Fix MathML regression with HYPHEN-MINUS not rendered as MINUS SIGN. r=emilio

Backed out for causing build bustages on nsMathMLmoFrame.cpp

[task 2024-09-05T13:21:39.533Z] 13:21:39     INFO -  gmake[4]: Entering directory '/builds/worker/workspace/obj-build/layout/mathml'
[task 2024-09-05T13:21:39.537Z] 13:21:39     INFO -  /builds/worker/fetches/sccache/sccache /builds/worker/fetches/clang/bin/clang-cl -fms-compatibility-version=19.39 -std:c++17 -Xclang -ivfsoverlay -Xclang /builds/worker/fetches/vs/overlay.yaml -FoUnified_cpp_layout_mathml0.obj -c  -I/builds/worker/workspace/obj-build/dist/stl_wrappers -guard:cf -D_FORTIFY_SOURCE=0 -Xclang -fno-common -DNDEBUG=1 -DTRIMMED=1 -DUNICODE -D_UNICODE -D_CRT_RAND_S -DCERT_CHAIN_PARA_HAS_EXTRA_FIELDS -D_SECURE_ATL -DCHROMIUM_BUILD -DU_STATIC_IMPLEMENTATION -DWIN32 -D_WIN32 -D_WINDOWS -DWIN32_LEAN_AND_MEAN -DWINAPI_NO_BUNDLED_LIBRARIES -DMOZ_HAS_MOZGLUE -DMOZILLA_INTERNAL_API -DIMPL_LIBXUL -DMOZ_SUPPORT_LEAKCHECKING -DSTATIC_EXPORTABLE_JS_API -I/builds/worker/checkouts/gecko/layout/mathml -I/builds/worker/workspace/obj-build/layout/mathml -I/builds/worker/workspace/obj-build/ipc/ipdl/_ipdlheaders -I/builds/worker/checkouts/gecko/ipc/chromium/src -I/builds/worker/checkouts/gecko/layout/base -I/builds/worker/checkouts/gecko/layout/generic -I/builds/worker/checkouts/gecko/layout/painting -I/builds/worker/checkouts/gecko/layout/style -I/builds/worker/checkouts/gecko/layout/tables -I/builds/worker/checkouts/gecko/layout/xul -I/builds/worker/checkouts/gecko/dom/base -I/builds/worker/checkouts/gecko/dom/mathml -I/builds/worker/workspace/obj-build/dist/include -I/builds/worker/workspace/obj-build/dist/include/nspr -I/builds/worker/workspace/obj-build/dist/include/nss -MD -DMOZILLA_CLIENT -FI /builds/worker/workspace/obj-build/mozilla-config.h -fsanitize-blacklist=/builds/worker/checkouts/gecko/build/sanitizers/asan_blacklist_win.txt -fsanitize=address -Zc:sizedDealloc- -Gy -Zc:inline -D_SILENCE_TR1_NAMESPACE_DEPRECATION_WARNING -TP -GR- -D_HAS_EXCEPTIONS=0 -fcrash-diagnostics-dir=/builds/worker/artifacts -fcrash-diagnostics-dir=/builds/worker/artifacts -fcrash-diagnostics-dir=/builds/worker/artifacts -Z7 -Xclang -load -Xclang /builds/worker/workspace/obj-build/build/clang-plugin/libclang-plugin.so -Xclang -add-plugin -Xclang moz-check -O2 -gline-tables-only -Oy- -Werror -W3 -Wbitfield-enum-conversion -Wempty-body -Wformat-type-confusion -Wignored-qualifiers -Wpointer-arith -Wshadow-field-in-constructor-modified -Wsign-compare -Wtautological-constant-in-range-compare -Wtype-limits -Wno-error=tautological-type-limit-compare -Wunreachable-code -Wunreachable-code-return -Wunused-but-set-parameter -Wno-invalid-offsetof -Wclass-varargs -Wempty-init-stmt -Wfloat-overflow-conversion -Wfloat-zero-conversion -Wloop-analysis -Wno-range-loop-analysis -Wenum-compare-conditional -Wenum-float-conversion -Wvolatile -Wno-deprecated-anon-enum-enum-conversion -Wno-deprecated-enum-enum-conversion -Wno-deprecated-this-capture -Wcomma -Wimplicit-fallthrough -Wstring-conversion -Wno-inline-new-delete -Wno-error=deprecated-declarations -Wno-error=array-bounds -Wno-error=free-nonheap-object -Wno-error=atomic-alignment -Wno-error=deprecated-builtins -Wno-unknown-pragmas -Wno-ignored-pragmas -Wno-deprecated-declarations -Wno-microsoft-enum-value -Wno-microsoft-include -Wno-invalid-noreturn -Wno-inconsistent-missing-override -Wno-implicit-exception-spec-mismatch -Wno-microsoft-exception-spec -Wno-unused-local-typedef -Wno-ignored-attributes -Wno-used-but-marked-unused -Wno-psabi -Wthread-safety -Wno-error=builtin-macro-redefined -Wno-vla-cxx-extension -Wno-unknown-warning-option -fno-strict-aliasing -Xclang -ffp-contract=off  -Xclang -MP -Xclang -dependency-file -Xclang .deps/Unified_cpp_layout_mathml0.obj.pp -Xclang -MT -Xclang Unified_cpp_layout_mathml0.obj   Unified_cpp_layout_mathml0.cpp
[task 2024-09-05T13:21:39.537Z] 13:21:39     INFO -  In file included from Unified_cpp_layout_mathml0.cpp:74:
[task 2024-09-05T13:21:39.537Z] 13:21:39    ERROR -  /builds/worker/checkouts/gecko/layout/mathml/nsMathMLmoFrame.cpp(62,10): error: comparison of integers of different signs: '(unnamed enum at /builds/worker/checkouts/gecko/layout/mathml/nsMathMLOperators.h:21:1)' and 'nsOperatorFlags' (aka 'unsigned int') [-Werror,-Wsign-compare]
[task 2024-09-05T13:21:39.538Z] 13:21:39     INFO -     62 |          NS_MATHML_OPERATOR_FORCES_MATHML_CHAR(mFlags);
[task 2024-09-05T13:21:39.538Z] 13:21:39     INFO -        |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[task 2024-09-05T13:21:39.538Z] 13:21:39     INFO -  /builds/worker/checkouts/gecko/layout/mathml/nsMathMLOperators.h(101,41): note: expanded from macro 'NS_MATHML_OPERATOR_FORCES_MATHML_CHAR'
[task 2024-09-05T13:21:39.539Z] 13:21:39     INFO -    101 |   (NS_MATHML_OPERATOR_FORCE_MATHML_CHAR ==            \
[task 2024-09-05T13:21:39.539Z] 13:21:39     INFO -        |    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^
[task 2024-09-05T13:21:39.539Z] 13:21:39     INFO -    102 |    ((_flags) & NS_MATHML_OPERATOR_FORCE_MATHML_CHAR))
[task 2024-09-05T13:21:39.539Z] 13:21:39     INFO -        |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[task 2024-09-05T13:21:39.540Z] 13:21:39     INFO -  1 error generated.
[task 2024-09-05T13:21:39.540Z] 13:21:39    ERROR -  gmake[4]: *** [/builds/worker/checkouts/gecko/config/rules.mk:676: Unified_cpp_layout_mathml0.obj] Error 1
[task 2024-09-05T13:21:39.540Z] 13:21:39     INFO -  gmake[4]: Leaving directory '/builds/worker/workspace/obj-build/layout/mathml'
[task 2024-09-05T13:21:39.541Z] 13:21:39     INFO -  gmake[4]: Target 'target-objects' not remade because of errors.
[task 2024-09-05T13:21:39.541Z] 13:21:39    ERROR -  gmake[3]: *** [/builds/worker/checkouts/gecko/config/recurse.mk:72: layout/mathml/target-objects] Error 2
[task 2024-09-05T13:21:39.562Z] 13:21:39     INFO -  gmake[4]: Entering directory '/builds/worker/workspace/obj-build/netwerk/mime'
[task 2024-09-05T13:21:39.562Z] 13:21:39     INFO -  mkdir -p '.deps/'
[task 2024-09-05T13:21:39.562Z] 13:21:39     INFO -  gmake[4]: Leaving directory '/builds/worker/workspace/obj-build/netwerk/mime'
[task 2024-09-05T13:21:39.593Z] 13:21:39     INFO -  gmake[4]: Entering directory '/builds/worker/workspace/obj-build/netwerk/mime'
[task 2024-09-05T13:21:39.593Z] 13:21:39     INFO -  netwerk/mime/nsMIMEHeaderParamImpl.obj
Flags: needinfo?(fwang)

mmh, wrong patch landed, sorry...

Flags: needinfo?(fwang)
Pushed by fwang@igalia.com: https://hg.mozilla.org/integration/autoland/rev/5fc8a26375a9 Fix MathML regression with HYPHEN-MINUS not rendered as MINUS SIGN. r=emilio
Status: ASSIGNED → RESOLVED
Closed: 2 months ago
Resolution: --- → FIXED
Target Milestone: --- → 132 Branch

The patch landed in nightly and beta is affected.
:fredw, is this bug important enough to require an uplift?

  • If yes, please nominate the patch for beta approval.
  • If no, please set status-firefox131 to wontfix.

For more information, please visit BugBot documentation.

Flags: needinfo?(fwang)

Probably not important enough to require an uplift.

Flags: needinfo?(fwang)

If I may ask, what precisely is an uplift? And if this can be fixed sooner rather than later, why not do so?

I've noticed that the vertical bar operator "|" is no longer automatically stretchy when included inside <row></row>. Is this change in behavior due to this regression or should I file another bug report?

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: