Page MenuHomePhabricator

User Feedback to MathML implementation in Math extension
Closed, ResolvedPublic

Description

Thanks for participating in the first round of user Feedback for native MathML Rendering running on WMF labs Wikipedia instance.

The native MathML rendering on Wikipedia is designed to support the macros defined here. For the chem-macros, there will be a dedicated feedback round.

A testing page which enforces native MathML rendering can be seen here:
https://en.wikipedia.beta.wmflabs.org/wiki/Help:MathTestNative

A testing page for comparison with SVG MathML Rendering (or the setting used for rendering):
https://en.wikipedia.beta.wmflabs.org/wiki/Help:MathTest

If you like to test custom formulas, you can add them here, by editing this page:
https://en.wikipedia.beta.wmflabs.org/w/index.php?title=Help:MathTestCustom

The settings for the used MathML renderer (by default it is SVG) can be changed in the user settings:
"preferences"->"appearance"->"Math"

or with the new skin, which is sometimes used as default on wmf-instances:
"settings"->"user preferences"->"appearance"-> "Math"

You can paste your user feedback in the comments, here is a template for user feedback:

**Which formulas are rendered correctly by visual check? ** :  Can also contain generalisations like //all, most, few, none//
**Which formulas are not correctly rendered by visual check? **:  If there is a good atomic example for the issue case, we would be glad to know of 
**Other Remarks**:  such as  comments on structure of MathML of native Formula, or other anything 
**Browser perfomance of native MathML pages**: Time to load the wikipage with native formulas, Caching issues, etc 
**Browser(s) used**:  name of used browser and browser version

Related Objects

StatusSubtypeAssignedTask
StalledStegmujo
OpenNone
OpenNone
ResolvedPhysikerwelt
DuplicateNone
ResolvedStegmujo
ResolvedStegmujo
ResolvedStegmujo
ResolvedStegmujo
ResolvedStegmujo
ResolvedStegmujo
ResolvedStegmujo
ResolvedStegmujo
ResolvedStegmujo
OpenStegmujo
OpenStegmujo
ResolvedStegmujo
ResolvedBUG REPORTStegmujo
ResolvedBUG REPORTStegmujo
OpenBUG REPORTNone
ResolvedBUG REPORTPhysikerwelt
ResolvedBUG REPORTPhysikerwelt
ResolvedBUG REPORTPhysikerwelt
ResolvedBUG REPORTPhysikerwelt
ResolvedBUG REPORTPhysikerwelt
ResolvedPhysikerwelt
ResolvedPhysikerwelt

Event Timeline

This comment was removed by Stegmujo.
Stegmujo updated the task description. (Show Details)

Hi,

I examined the MathML markup in MathTestNative. Well done! It's great to see such a long test page - but it is also a reason that my feedback is partial, as I ran out of free time before I could inspect all examples.

Here are some suggestions for improvements:

  • For \operatorname{} it looks like each individual letter in the argument becomes a separate <mi> element. It should be possible to group those into a single <mi> for the entire argument.
  • There is a similar need of grouping in numeric scripts, e.g. the "Overbraces" example has ...^{5050} where each digit is in a separate <mn>. An alternative <mn>5050</mn> would be better for a11y. You may similarly want to group 0.5 into a single <mn>0.5</mn>.
  • For function names, such as \min, \max, \liminf, \limsup, \dim... , they are usually better represented as an <mi> element, possibly with an invisible function application (U+2061) <mo> between the function name and the argument. If you keep them as <mo> you might want to add a form="prefix" attribute (which is sometimes there, but not always - e.g. \liminf does not have it).
  • You can consider using that invisible apply character (U+2061) after other function names with known arguments (such as \sin, \cos...). Some accessibility tools take advantage of it, I am told, but it may also be used to provide correct spacing from the MathML operator dictionary. In Chrome <mi>sin</mi><mi>a</mi> will show up with no added spacing as sina, which is not ideal.
  • There is a curious use of <mstyle> around spacing elements, as in <mstyle scriptlevel="0"><mspace width="-0.167em"></mspace></mstyle>. I am not sure that wrapper element is needed? The mspace ought to be successful standalone.
  • The {smallmatrix} example has its fences wrapped in too many mrows I think, so it renders without stretching them in both Firefox and Chrome. Ideally you should be able to emit the <mo>(</mo> followed directly by an <mtable>, and trailed by <mo>)</mo>, and only wrap those 3 into a parent <mrow>.

I am not the most proficient MathML Core practitioner, so this may be a partial list (and you may want to double check with the spec text).

Firefox reports several parse errors in the mathml in

https://en.wikipedia.beta.wmflabs.org/wiki/Help:MathTestNative

Error in parsing the value '' for 'columnspacing' attribute of <mtable/>.  Attribute ignored.Invalid markup: Incorrect number of children for <munder/> tag. Help:MathTestNative
Invalid markup: Incorrect number of children for <msup/> tag. Help:MathTestNative
Invalid markup: Incorrect number of children for <munder/> tag. Help:MathTestNative
Invalid markup: Incorrect number of children for <msup/> tag. Help:MathTestNative
Invalid markup: Incorrect number of children for <munder/> tag. node.js:370:30
Invalid markup: Incorrect number of children for <msup/> tag. node.js:370:30
Invalid markup: Incorrect number of children for <munder/> tag. node.js:370:30
Invalid markup: Incorrect number of children for <msup/> tag. node.js:370:30
Invalid markup: Incorrect number of children for <munder/> tag. utils.js:166:21

A typical cause of the incorrect child count is empty tex groups.

For example the slightly nonsensical example

\underset{\mathrm{def}}{}

on the page is producing an <munder> with just one child. The mathml could be simplified simply removing the munder (corresponding to correcting the tex to \mathrm{def} without the spurious \underset) or if you want to model the tex exactly you need an empty <mrow/> (or <mi/> to match the empty tex argument so that <munder> has two children.

Math Alphabets rendered incorrectly. in

https://en.wikipedia.beta.wmflabs.org/wiki/Help:MathTestNative

The math alphabets such as \mathcal{ABCDEF} are rendered using <mi data-mjx-variant="-tex-calligraphic" mathvariant="script">A</mi> mathvariant is not in mathml-core so the end result depends on CSS and local font install. On Chrome I get Cambria Math ascii in italic style A and in firefox I get STix Two Math Ascii A in italic style, so not calligraphic/script in either case. It would be better to use the Unicode math alphabet codepoints, so in this case 𝒜ℬ𝒞𝒟ℰℱ (perhaps supplying stix two math as a fallback web font if no suitable font is locally available, but that applies to all math symbols)

Physikerwelt claimed this task.

While there are some alignment problems in chrome remain, and one very special (buggy) behavior in the chem part was not reproduced. I close this issue as the first round of user feedback is completed. Bug reports are always appreciated, but the specific activity of collecting and fixing feedback to the initial wikitexvc implementation is completed.
Please do NOT reopen, but create a new task.