-
Notifications
You must be signed in to change notification settings - Fork 20
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
Comments
@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. |
Notes are not published, I don't remember what we decided at the end. |
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). |
Consensus was to allow the following mstyle attributes: displaystyle 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. |
Core spec updated: https://mathml-refresh.github.io/mathml-core/#mstyle |
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. |
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)
The text was updated successfully, but these errors were encountered: