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

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

Closed
fred-wang opened this issue May 7, 2019 · 8 comments
Closed

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

fred-wang opened this issue May 7, 2019 · 8 comments
Labels
MathML Core Issues affecting the MathML Core specification MathML 4 Issues affecting the MathML 4 specification need specification update Issues requiring specification changes

Comments

@fred-wang
Copy link

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)

@fred-wang fred-wang added MathML Core Issues affecting the MathML Core specification MathML 4 Issues affecting the MathML 4 specification need tests Issues related to writing WPT tests labels May 7, 2019
@fred-wang
Copy link
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.

@rwlbuis
Copy link

rwlbuis commented May 7, 2019

@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.

@fred-wang fred-wang added the need resolution Issues needing resolution at MathML Refresh CG meeting label May 16, 2019
@fred-wang
Copy link
Author

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

@NSoiffer
Copy link
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).

@fred-wang
Copy link
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.

@fred-wang fred-wang added need implementation update need specification update Issues requiring specification changes and removed need resolution Issues needing resolution at MathML Refresh CG meeting labels Jun 3, 2019
@fred-wang
Copy link
Author

Core spec updated: https://mathml-refresh.github.io/mathml-core/#mstyle

@fred-wang fred-wang removed the need specification update Issues requiring specification changes label Jun 5, 2019
@fred-wang fred-wang added need specification update Issues requiring specification changes need polyfill Issues requiring implementation changes and removed need tests Issues related to writing WPT tests labels Sep 16, 2019
@NSoiffer
Copy link
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.

@NSoiffer NSoiffer removed the need polyfill Issues requiring implementation changes label May 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
MathML Core Issues affecting the MathML Core specification MathML 4 Issues affecting the MathML 4 specification need specification update Issues requiring specification changes
Projects
None yet
Development

No branches or pull requests

3 participants