Sync web-platform-tests PR 29878 into mozilla-central (this bug is closed when the sync is complete).
[mathml] Refine definition of embellished operators
In , basic logic was added to prepare support for embellished
operators . For example in a LaTeX expression like $u +_V v$,
which may be represented in MathML as
the spacing around the operators should be put around the whole
embellished operator "+ subscript V". Similar behavior is expected
for other operator properties.
In , only \<mo> elements were considered embellished operators.
This CL extends it to the full definition from MathML Core but
considering only \<mtext> and \<mspace> as space-like for now .
Together, these two CLs add special handling of properties lspace,
rspace and movablelimits with embellished operators. Supporting
other operator properties (e.g. stretchy) and refining the
definition of space-like will happen in follow-up CLs.
MathML Core's definition is based on MathML 3 and is still
relatively complex. Determining whether an element is an
embellished operator and retrieving the property of the core
operator has bad worst-case complexity but it should be fine in
practice . An alternative would be to cache these properties
somewhere in our trees for fast access but it does not seem
worth adding that extra complexity for existing use cases.
Finally, now that mrow-like elements can be embellished operators,
this CL refines the row layout algorithm so that spacing is added
around operator children only if the element being laid out is the
\<math> root or is not itself an embellished operator . This
basically addresses the use case of expressions like
where the operator spacing should be added during the layout of the
\<math> element, not during the one of the \<mrow> element.
Bug: 6606, 1124298