Skip to content

Extend mpadded attribute syntax to be closer to MathML3 #103

Closed

Description

@fred-wang

In #81, we agreed that mpadded attributes in MathML Core should only use pseudo-unit with the same vertical/horizontal direction.

Can we simplify it any further? Remove/Deprecate it?

Some thoughts:

Activity

  1. added
    MathML 4
    MathML Core
    need polyfill
    need resolution
    need specification update
    need tests
    on Jun 14, 2019
  2. fred-wang commented on Jun 14, 2019

    @fred-wang
    Author

    These are the possible non-length values implemented by @distler in itex2MML and copied into TeXZilla:
    lspace="-100%width" (\mathllap)
    lspace="-50%width" (\mathclap)
    height="+[LENGTH][UNIT]" (\mathraisebox)
    depth="+[LENGTH][UNIT]" (\mathraisebox)
    depth="depth" (\mathraisebox)

    depth="depth" can basically be replaced with not using (or ignoring) the attribute. I'm not exactly sure about how the other commands work.

  3. fred-wang commented on Jun 14, 2019

    @fred-wang
    Author

    From https://mathml-refresh.github.io/mathml/chapter3.html#presm.mpadded

    For any unsigned number X, if Y = X / 100 then

    X%pseudo-unit is equivalent to Ypseudo-unit
    +X%pseudo-unit is equivalent to +Ypseudo-unit
    -X%pseudo-unit => -Ypseudo-unit

    So it seems that this syntax is not useful.

  4. fred-wang commented on Jun 14, 2019

    @fred-wang
    Author

    I've rewritten the description of mpadded in MathML core, so that it no longer refers to MatHML3
    https://mathml-refresh.github.io/mathml-core/#adjust-space-around-content-mpadded

    Unless I'm mistaken, the current syntax and semantic should more or less match what is in the full spec:
    https://mathml-refresh.github.io/mathml/#presm_mpaddedatt
    (with namedspace removed and numbers defined from CSS)

  5. NSoiffer commented on May 19, 2020

    @NSoiffer
    Contributor

    As far as I can see, the only difference in attrs is in the pseudo units being slightly restricted: the vertical attrs can only refer to height/depth (not width) and the horizontal ones only to width (not height/depth). Is there something else a polyfill needs to handle?

  6. fred-wang commented on May 19, 2020

    @fred-wang
    Author

    I'm still concerned by the current text for mpadded as I doubt it will reflect what is "acceptable" for native implementations. So at this point, I'm not sure we can rely on it to know what a polyfill should handle.

  7. 3 remaining items

  8. removed
    need resolution
    on Aug 12, 2020
  9. davidcarlisle commented on Mar 21, 2022

    @davidcarlisle
    Collaborator

    As far as I can see, the only difference in attrs is in the pseudo units being slightly restricted: the vertical attrs can only refer to height/depth (not width) and the horizontal ones only to width (not height/depth). Is there something else a polyfill needs to handle?

    @NSoiffer I think the biggest breaking change is (as currently written in the core spec) in core width="+3em" has no magic meaning: it's same as width="3em" and forces the length to 3em not increase it by that amount.

    Note that the css length syntax allows width="calc(100% + 3em)" to get the increment meaning. This already works on mpadded in whatever version of chrome canary I have installed, although apparently not in firefox.

    I am tempted to suggest that MathML4 accepts this breaking change and follows core here: using the same interpretation for any values that are syntactically valid css length values.

    MathML4 full spec can still add named lengths and psuedo-units thinmathspace and width etc but they are less of a problem as they are syntactically invalid in core so you don't have the same value having different interpretations in full and core.

    See also the discussion in PR #297

  10. davidcarlisle commented on Mar 21, 2022

    @davidcarlisle
    Collaborator

    Sigh no My above comment is wrong as core is specified as accepting % but treating them as 0, but perhaps the suggestion for full should still stand, as really we need width="+3em" to mean the same thing in Core and Full.

  11. removed
    need polyfill
    on Aug 8, 2024
  12. davidcarlisle commented on Nov 14, 2024

    @davidcarlisle
    Collaborator

    WG meeting 2024-11-14 agreed to change full to match core, noting that css length allows calc syntax.

  13. removed
    need specification update
    MathML Core
    MathML 4
    on Nov 21, 2024
  14. NSoiffer commented on Dec 19, 2024

    @NSoiffer
    Contributor

    @fred-wang: I see some wpt mpadded tests. Do you feel these are complete enough that this issue can be closed?

  15. NSoiffer commented on May 12, 2026

    @NSoiffer
    Contributor

    @fred-wang: ping... are the WPT tests enough to close this issue?

  16. NSoiffer commented on Oct 22, 2026

    @NSoiffer
    Contributor

    @fred-wang: ping... are the WPT tests enough to close this issue?

  17. fred-wang commented on Oct 29, 2026

    @fred-wang
    Author

    @NSoiffer I think the original idea of this issue was to make mpadded syntax from MathML Core a bit closer to what we have in MathML3 instead of the current CSS-based version. I don't think this happened at the end. So I would keep it open if that's something people are still interesting in.

    Regarding current WPT tests, I believe most of them are for the MathML Core syntax, written when we implemented it in Chromium. For the MathML3 syntax, I suspect WebKit/Firefox still have their own internal tests. I guess the answer is "Yes we have enough WPT tests" if we are talking about current MathML Core spec but "No" if we are talking about a potential alignment with MathML 3.

  18. NSoiffer commented on Oct 29, 2026

    @NSoiffer
    Contributor

    I believe that at least for the current Core spec, mpadded is as it is. The question is about the wpt-tests because that the label on it ("need tests"). Since you feel they are sufficient, I will close this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

need tests

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions