Bad clipping/width of large operators when italic correction is applied
Categories
(Core :: MathML, defect)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox149 | --- | fixed |
People
(Reporter: fwang, Assigned: fwang)
References
(Blocks 2 open bugs)
Details
(Keywords: dev-doc-complete)
Attachments
(5 files, 1 obsolete file)
See the attached testcase, with large clockwise integrals drawn with Latin Modern Math and XITS Math.
In LTR mode, the width is too small (see the blue background).
In RTL mode this is even worse: the left part of the integrals are never shown.
Both are due to the following code that subtracts italic correct from the operator width:
This is legacy stuff that mimics the behavior of old fonts like STIX-Word, that provides a shorter width for slanted integrals, in order to allow proper position of subscripts.
Per MathML Core, we should actually not modified the operator width but instead take the italic correction of the base during the layout of nsMathMLmmultiscriptsFrame: https://www.w3.org/TR/mathml-core/#base-with-subscript
Note that this is a bit tricky because the base may be more complex (e.g. <mrow><mrow><mrow><mo largeop="true">∲</mo></mrow></mrow></mrow>) and we need to transmit the italic correction from the core operator to the nsMathMLmmultiscriptsFrame, which is probably why we haven't done that so far.
I see:
https://www.w3.org/TR/mathml-core/#layout-of-mtext
If the text content is made of a single glyph and this glyph has an entry in the MathItalicsCorrectionInfo table then the specified value is used as the italic correction.
https://www.w3.org/TR/mathml-core/#layout-of-mrow
The italic correction of the math content is set to the italic correction of the last in-flow child, which is the final value of previous-italic-correction.
https://www.w3.org/TR/mathml-core/#layout-of-operators
If the algorithm to shape a stretchy glyph has been used for one of the step above, then the italic correction of the math content is set to the value returned by that algorithm.
https://wpt.fyi/results/mathml/presentation-markup/scripts/subsup-parameters-2.html seems to be a basic test for italic correction, but we probably need more complex ones involving mtext (or mo behaving like mtext) or mrow constructions.
| Assignee | ||
Comment 1•7 months ago
|
||
| Assignee | ||
Comment 2•7 months ago
|
||
| Assignee | ||
Updated•7 months ago
|
| Assignee | ||
Comment 3•7 months ago
|
||
| Assignee | ||
Comment 4•7 months ago
|
||
I attached one screenshot showing the bug in Firefox release 146. And another one showing the script placement issue if we disable the italic correction hack at https://searchfox.org/firefox-main/rev/33bba5cfe4a89dda0ee07fa9fbac578353713fd3/layout/mathml/nsMathMLChar.cpp#1021
| Assignee | ||
Comment 5•7 months ago
|
||
| Assignee | ||
Comment 6•7 months ago
|
||
Updated•7 months ago
|
| Assignee | ||
Comment 7•7 months ago
|
||
Comment 10•6 months ago
|
||
| bugherder | ||
| Assignee | ||
Comment 12•6 months ago
|
||
Updated•6 months ago
|
Comment 13•5 months ago
|
||
FF149 MDN work for this can be tracked in https://github.com/mdn/content/issues/43207
Fred, what were you thinking was needed for this? It sounds like a bug fix, so perhaps:
-
A release note like this? (if not, please suggest alternative):
Fixed a rendering bug where large operators were incorrectly clipped or had improper widths when italic correction was applied.
-
Does this need data compatibility information to be recorded? If so, is https://developer.mozilla.org/en-US/docs/Web/MathML/Reference/Element/mo#largeop the correct operator.attribute to target?
| Assignee | ||
Comment 14•5 months ago
|
||
@Hamish: Largeop has been supported forever in Firefox, I think this is more a bug fix so a note like you did in (1) sounds correct.
(I don't know how important it is to be in the release notes, but I'll trust your judgement on that)
Comment 15•5 months ago
|
||
Hi Fred, Thanks! I choose not to include anything for this - it doesn't change the way that developers should use the interface. I suspect most that care will aleady be tracking this issue, and the remainder hopefully upgrade to new Firefox and never notice there was ever a problem.
Description
•