Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clarify the language around deprecated features of MathML #279

Open
captainbrosset opened this issue Jan 15, 2025 · 4 comments
Open

Clarify the language around deprecated features of MathML #279

captainbrosset opened this issue Jan 15, 2025 · 4 comments
Labels

Comments

@captainbrosset
Copy link

A few MathML features are marked as deprecated on MDN, but looking at the spec tells me a different story, and I wonder if MDN is incorrect, or if the spec language should be changed on these features.

Let's take the example of the mathbackground global attribute:

  • The MDN article says:

    Deprecated: This feature is no longer recommended. Though some browsers might still support it, it may have already been removed from the relevant web standards, may be in the process of being dropped, or may only be kept for compatibility purposes. Avoid using it, and update existing code if possible

  • The spec has a note about the attribute:

    The above attributes are implemented for compatibility with full MathML. Authors whose only target is MathML Core are encouraged to use CSS for styling.

Reading this makes me think that using the attribute is an author choice. The spec doens't specifically discourage using it, and certainly doesn't deprecate it as MDN says.

As a comparison point, here's what the UI Events spec has to say about MutationEvent:

[...] this specification describes mutation events for reference and completeness of legacy behavior, but deprecates the use of the MutationEvent interface.

This language is a lot more definitive and leaves no room for interpretation.

Should the MathML Core spec be more definitive about the elements, attributes, and attributes values it discourages? Or is MDN's language a bit too strong in this case? Or am I misreading these documents?

For context, this came up in web-platform-dx/web-features#2513, which is where the WebDX CG is trying to create a web-features entry for the remaining MathML features that are not part of the main MathML feature.

These remaining MathML features are all marked as deprecated by BCD (the data source that MDN uses for compat tables). Here is the list of these features, listed as BCD "keys":

  • mathml.elements.maction
  • mathml.elements.maction.actiontype
  • mathml.elements.maction.actiontype.toggle
  • mathml.elements.maction.selection
  • mathml.elements.mfenced
  • mathml.elements.mfrac.denomalign
  • mathml.elements.mfrac.linethickness.named_spaces
  • mathml.elements.mfrac.linethickness.nonzero_unitless_values
  • mathml.elements.mfrac.linethickness.thin_medium_thick
  • mathml.elements.mfrac.numalign
  • mathml.elements.mfrac.numalign
  • mathml.elements.mmultiscripts.subscriptshift
  • mathml.elements.mmultiscripts.superscriptshift
  • mathml.elements.mo.named_spaces
  • mathml.elements.mo.nonzero_unitless_values
  • mathml.elements.mpadded.named_spaces
  • mathml.elements.mpadded.nonzero_unitless_values
  • mathml.elements.mpadded.pseudo_units
  • mathml.elements.mpadded.scale_factor
  • mathml.elements.mspace.named_spaces
  • mathml.elements.mstyle.background
  • mathml.elements.mstyle.color
  • mathml.elements.mstyle.fontsize
  • mathml.elements.mstyle.fontstyle
  • mathml.elements.mstyle.fontweight
  • mathml.elements.msub.subscriptshift
  • mathml.elements.msubsup.subscriptshift
  • mathml.elements.msubsup.superscriptshift
  • mathml.elements.msup.superscriptshift
  • mathml.elements.mtable.width.named_spaces
  • mathml.elements.semantics.advanced_visible_child_selection
  • mathml.global_attributes.mathbackground
  • mathml.global_attributes.mathcolor
  • mathml.global_attributes.mathsize
  • mathml.global_attributes.mathsize.named_spaces
  • mathml.global_attributes.mathsize.nonzero_unitless_values
  • mathml.global_attributes.mathsize.small_normal_big
@bkardell
Copy link
Collaborator

It's a little difficult to say for sure that we can treat all of these equally.... The trouble with MathML Core is that is it trying to address several factors around the age and size of MathML and align it with the rest of the platform: How it fits with DOM and CSS and events and so on. Part of this is drawing a somewhat arbitrary box around what we can tackle in v1, trying to define a minimum viable inter-operational subset that we can hope to achieve. Some things are left to decide in a possible v2. Others are, I think, fairly straightforward - they are listed as presentational hints already... That's just how they are implemented and explained - they are not recommended for use if you are only writing for the web, but tbh I'm not sure if they should be added to a a section like https://html.spec.whatwg.org/#non-conforming-features, because MathML is used outside of the browser too and there it might actually be necessary...

@captainbrosset
Copy link
Author

they are not recommended for use if you are only writing for the web, but tbh I'm not sure if they should be added to a a section like https://html.spec.whatwg.org/#non-conforming-features, because MathML is used outside of the browser too and there it might actually be necessary...

If Core focuses on the web platform only, I tend to think it would be fair to have a note about these elements that are not recommended if you only care about web. Something like:

Elements in the following list are outside of the scope of the MathML Core specification and it is not recommended for authors who target the web platform to use them.

@NSoiffer
Copy link
Contributor

The Math WG discussed this at the meeting today. One thing that kept coming up is that there are really two related specs, but MDN doesn't seem to have a way to dealing with that: "deprecated" and "experimental" don't fully make sense in this situation. As an example, mfrac.numalign is very much in MathML full, but not in MathML core because one can (in theory) use CSS to do the alignment.

CSS support is not fully implemented in Firefox and Safari. Additionally, it is not clear how CSS will interact with the math layout rules which has its own "math inline" and "math block" rules. Because of these two things, many people felt that maybe some additional text is needed for many of the items to clarify the core/full difference and explain the limitations.

@NSoiffer
Copy link
Contributor

NSoiffer commented Jan 30, 2025

As per the the 30 Jan Math WG meeting, this is a workspace for people to add their thoughts about how each item should be classified. Two options are "deprecated" and "experimental". The meeting consensus was that there may need to be other options.

NSoiffer's general comment: the core spec mentions several features in MathML full that are "presentational hints". These include "mathcolor" and mspace's "width" attribute. These can be handled via UA style sheets. I think (as I indicate below), many of these incompatibilities can be resolved in this manner. In addition to reducing incompatibilities, doing this means people don't have to invent their own methods for implementing these features. MDN currently lists "mathcolor" as deprecated which I don't feel is appropriate.

mathml.elements.maction

NS: In core and is useful to keep even though JS can be put on any element. I think there is a strong analogy "button" which can be emulated with JS. maction represents a clear place indicate actions happen.

DG: deprecate, the web platform has enough affordances for interactivity. The element semantics do not have a clear value-add in 2025. (Possibly even <mtext><button>...</button></mtext> could be better)

mathml.elements.maction.actiontype

NS: deprecate
DG: deprecate

mathml.elements.maction.actiontype.toggle

NS: deprecate
DG: deprecate

mathml.elements.maction.selection

NS: deprecate
DG: deprecate

mathml.elements.mfenced

NS: deprecate. Although this is in full, there is a good work around (mrow) that can be used, so mfenced is not going to be part of core ever.
DG: deprecate

mathml.elements.mfrac.denomalign

NS: should be a presentational hint.
DG: deprecate in favor of CSS

mathml.elements.mfrac.linethickness.named_spaces

NS: deprecated
DG: deprecate

mathml.elements.mfrac.linethickness.nonzero_unitless_values

NS: deprecated
DG: deprecate

mathml.elements.mfrac.linethickness.thin_medium_thick

NS: deprecate
DG: deprecate

mathml.elements.mfrac.numalign

NS: should be a presentational hint.
DG: deprecate in favor of CSS

mathml.elements.mmultiscripts.subscriptshift

NS: should be a presentational hint.
DG: deprecate, see resolution in w3c/mathml#27 (comment)

mathml.elements.mmultiscripts.superscriptshift

NS: should be a presentational hint.
DG: deprecate, see resolution in w3c/mathml#27 (comment)

mathml.elements.mo.named_spaces

NS: deprecated
DG: deprecate

mathml.elements.mo.nonzero_unitless_values

NS: deprecate
DG: deprecate

mathml.elements.mpadded.named_spaces

NS: deprecated
DG: deprecate

mathml.elements.mpadded.nonzero_unitless_values

NS: deprecated
DG: deprecate

mathml.elements.mpadded.pseudo_units

NS: deprecated
DG: deprecate

mathml.elements.mpadded.scale_factor

NS: deprecated
DG: deprecate

mathml.elements.mspace.named_spaces

NS: deprecated
DG: deprecate

mathml.elements.mstyle.background

NS: deprecated
DG: deprecate

mathml.elements.mstyle.color

NS: deprecated
DG: deprecate

mathml.elements.mstyle.fontsize

NS: deprecated
DG: deprecate

mathml.elements.mstyle.fontstyle

NS: deprecated
DG: deprecate

mathml.elements.mstyle.fontweight

NS: deprecated
DG: deprecate

mathml.elements.msub.subscriptshift

NS: should be a presentational hint.
DG: deprecate, see resolution in w3c/mathml#27 (comment)

mathml.elements.msubsup.subscriptshift

NS: should be a presentational hint.
DG: deprecate, see resolution in w3c/mathml#27 (comment)

mathml.elements.msubsup.superscriptshift

NS: should be a presentational hint.
DG: deprecate, see resolution in w3c/mathml#27 (comment)

mathml.elements.msup.superscriptshift

NS: should be a presentational hint.
DG: deprecate, see resolution in w3c/mathml#27 (comment)

mathml.elements.mtable.width.named_spaces

NS: deprecated
DG: deprecate

mathml.elements.semantics.advanced_visible_child_selection

NS: deprecated
DG: deprecate

mathml.global_attributes.mathbackground

NS: should be a presentational hint.
DG: deprecate in favor of CSS

mathml.global_attributes.mathcolor

NS: should be a presentational hint. This was explicitly introduced to MathML as people felt that a red 'x' could be a different variable than a black 'x' just as a bold 'x' is different than a regular 'x'. Hence, the use of an attribute as opposed to CSS which is purely presentational and not semantic. I realize it is a bit ironic that I suggest that this be called a "presentational hint", but that's really about how it could/should be implemented.
DG: deprecate in favor of CSS

mathml.global_attributes.mathsize

NS: deprecated
DG: deprecate in favor of CSS

mathml.global_attributes.mathsize.named_spaces

NS: deprecated
DG: deprecate

mathml.global_attributes.mathsize.nonzero_unitless_values

NS: deprecated
DG: deprecate

mathml.global_attributes.mathsize.small_normal_big

NS: deprecate
DG: deprecate

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants