W3C home > Mailing lists > Public > www-math@w3.org > February 2019

Re: [MathML4] Simplification of the mstyle element

From: Frédéric Wang <fwang@igalia.com>
Date: Fri, 22 Feb 2019 15:03:52 +0100
To: www-math@w3.org
Message-ID: <61a6f39b-9080-f061-b44f-f77e424ab005@igalia.com>
Discussion has been moved to
https://github.com/mathml-refresh/mathml/issues/1

On 27/07/2016 10:10, Frédéric WANG wrote:
>
> Hi,
>
> Continuing with suggestions for future Math WG work, let's come back
> again to the idea of simplifying the mstyle element. It duplicates the
> CSS inheritance mechanism in a CSS-incompatible way and has many
> exceptions that make it hard to understand: there are three different
> types of inheritance described in the specification, mathbackground
> applies more naturally to the element that bears the attribute than to
> each token descendants, mpadded/mspace share attributes names that
> have different syntax etc For example, in previous discussions the
> case of displaystyle seemed really clear in the mind of spec authors
> but less in the one of the various implementers.
>
> In practice, many of the mstyle attributes are not useful and never
> used. It is a burden for implementers since they essentially have to
> reimplement a specific "attribute" inheritance mechanism to support
> the general case even if the most prominent attributes have obvious
> mapping to CSS. It is also a performance issue to perform the
> rendering and keep it up-to-date since the rendering on any node may
> depend on its mstyle ancestors.
>
> Support for mstyle has been simplified in Gecko several years ago.
> When this was reported to this mailing list, there have not been
> strong complaints against the idea (only a few extra attributes were
> reported to be used in the MathML3 test suite). There has not been any
> bug reports regarding removal of attributes, confirming they were not
> used (this contrasts with the case of displaystyle for which aligning
> on the specification caused some trouble). Support for some important
> mstyle attributes have been implemented in WebKit but there are no
> plans to handle the general cases.
>
> Given this, the proposal is as follows: restrict mstyle to attributes
> used in practice listed below. Also the inheritance can in most cases
> be more easily described with CSS rules or attribute mapping.
>
> 1) dir: mapped to the CSS direction property.
>
> 2) mathsize: mapped to font-size. Note that MathML has the keywords
> "small", "normal", "big" that adds some parsing code before the
> mapping. It's not clear whether these keywords are very important
> (small is 100%, small/big are unspecified...) so they could be
> deprecated too to simplify the mapping code.
>
> 3) mathbackground: mapped to CSS background property.
>
> 4) color: mapped to CSS color property.
>
> 5) displaystyle: this one will be preserved but inheritance can be
> more clearly described to people familiar with CSS as equivalent to
> having a CSS property with values false/true, which is inherited, has
> computed value "as specified" and with the following rules in the user
> agent stylesheet.
>
> math {
>   displaystyle: false;
> }
> math[display="block"] {
>   displaystyle: true;
> }
> math[display="false"] {
>   displaystyle: false;
> }
> math[displaystyle="false"] {
>   displaystyle: false;
> }
> math[displaystyle="true"] {
>   displaystyle: true;
> }
> mtable {
>   displaystyle: false;
> }
> mtable[displaystyle="true"] {
>   displaystyle: true;
> }
> mstyle[displaystyle="false"] {
>   displaystyle: false;
> }
> mstyle[displaystyle="true"] {
>   displaystyle: true;
> }
> mfrac > * {
>   displaystyle: false;
> }
> mroot > :not(:first-child) {
>   displaystyle: false;
> }
> msub > :not(:first-child),
> msup > :not(:first-child),
> msubsup > :not(:first-child),
> mmultiscripts > :not(:first-child) {
>   displaystyle: false;
> }
> munder > :not(:first-child),
> mover > :not(:first-child),
> munderover > :not(:first-child) {
>   displaystyle: false;
> }
>
> 6) mathvariant: this one will be preserved but inheritance can be more
> clearly described to people familiar with CSS as mapped to a CSS
> property with all the mathvariant values + an "auto" value (to handle
> automatic italic), initial value "auto", which is inherited and has
> computed value "as specified".
>
> 7) scriptsizemultiplier: can be described as a CSS property with
> <number> values, initial value 0.71, computed value "as specified" and
> which is inherited. It's not clear whether the attribute is really
> useful as in practice it is left to its default value. Also this is in
> conflicts with ScriptPercentScaleDown and ScriptScriptPercentScaleDown
> properties of the MATH table.
>
> 8) scriptminsize: can be described as a CSS property with <length>
> values, initial value 8pt, computed value "as specified" and which is
> inherited. Again, it's not really clear whether the attribute is
> useful as in practice it is left to its default value.
>
> 9) scriptlevel: This one must be preserved but it is not clear whether
> it can be described as a pure CSS property without adding too much
> complexities. There is a proposal on
> http://www.mathml-association.org/MathMLinHTML5/S2.html#SS3 but the
> increment in munderover/munder/mover should really depend on the
> accent/accentunder property which itself depends on specified
> attributes or implicit/explicit operator properties in the
> overscript/underscript subtrees.
>
> A rule to determine the computed value for font-size must also be
> provided, for example:
>
> FontSize_Child =
>   max of ScriptMinSize_Parent and
>          [FontSize_Parent times
>           ScriptSizeMultiplier_Parent^(FontSize_Child - FontSize_Parent)]
>
> with possible additional edge cases to handle.
>
> Unless something has been forgotten above, all the other mstyle
> attributes could be safely deprecated and removed.
>
> -- 
> Frédéric Wang


-- 
Frédéric Wang
Received on Friday, 22 February 2019 14:04:26 UTC

This archive was generated by hypermail 2.3.1 : Friday, 22 February 2019 14:04:27 UTC