Skip to content

Allow mstyle attributes on more (all?) MathML elements #88

Closed

Description

@fred-wang

In #1 we decided to restrict mstyle attributes to a small set of attributes that can be mapped to CSS i.e. displaystyle, dir, mathsize, mathbackground, mathcolor, mathvariant and scriptlevel. Other MathML elements support mstyle attributes, but this is a bit messy:

(Incidentally, href is not an mstyle-specific attribute but it has to be handled on all MathML elements: https://mathml-refresh.github.io/mathml/chapter2.html#fund.globatt )

As a consequence, browser implementers have to check whether each mstyle attribute is allowed on a given element before mapping it. Also, WPT tests should really check all these cases about whether or not an attribute has an effect on a given element.

I think it would be easier to allow the presentational attributes listed above on any (presentation) MathML element. For browser implementations, mapping attributes to CSS is straightforward and that will remove special checks for element / attribute pairs. For the spec, I believe there is no longer any name conflicts between (before #1 we could have issues with e.g. mpadded@width, mtable@width, mspace@width).

Doing that will also remove the need for mstyle #1 (comment)

Activity

  1. added
    MathML Core
    MathML 4
    need tests
    on May 7, 2019
  2. fred-wang commented on May 7, 2019

    @fred-wang
    Author

    @rwlbuis: displaystyle (display), scriptlevel and maybe dir might be problematic to handle because they are currently not just mapped to CSS in the element class but instead have some special rules in the UA stylesheet. So extending to any element might mean adding universal selectors (which are prohibited in Chromium UA stylesheet). We would need to investigate what you mentioned about doing this kind of advanced CSS mapping in the C++ code instead.

  3. rwlbuis commented on May 7, 2019

    @rwlbuis

    @rwlbuis: displaystyle (display), scriptlevel and maybe dir might be problematic to handle because they are currently not just mapped to CSS in the element class but instead have some special rules in the UA stylesheet. So extending to any element might mean adding universal selectors (which are prohibited in Chromium UA stylesheet). We would need to investigate what you mentioned about doing this kind of advanced CSS mapping in the C++ code instead.

    I checked, we already map dir to the CSS property direction internally.

  4. added
    need resolution
    on May 16, 2019
  5. fred-wang commented on May 16, 2019

    @fred-wang
    Author

    Notes are not published, I don't remember what we decided at the end.

  6. NSoiffer commented on May 20, 2019

    @NSoiffer
    Contributor

    We decided to table the issue until we understand how a polyfills will be used for mstyle all the time or not (about 28 minutes into the recording).

  7. fred-wang commented on Jun 3, 2019

    @fred-wang
    Author

    Consensus was to allow the following mstyle attributes:

    displaystyle
    dir
    mathsize
    mathbackground
    mathcolor
    mathvariant
    scriptlevel

    on all MathML elements so that browser implementers just need to map them without checking the tag. This has nothing to do with how polyfill will support the removed attributes AFAIK.

  8. added
    need specification update
    and removed
    need resolution
    on Jun 3, 2019
  9. removed
    need specification update
    on Jun 5, 2019
  10. added
    need specification update
    need polyfill
    and removed
    need tests
    on Sep 16, 2019
  11. NSoiffer commented on May 20, 2020

    @NSoiffer
    Contributor

    I'm removing the 'need polyfill' label because I think the needed polyfill is referenced in #1. Allowing the above referenced values on all elements doesn't require a polyfill to be written.

    If I missed something that differs from #1 in needed a polyfill, please clarify (for me) and add the label back.

  12. removed
    need polyfill
    on May 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    MathML 4MathML Coreneed specification update

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions