-
Notifications
You must be signed in to change notification settings - Fork 20
Simplification of the mstyle element #1
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
Comments
This might be a stupid question, but why do we need
|
Yes, they can be (and are) implemented using CSS style. |
Incidentally, for attributes without CSS equivalent, there is https://github.com/mathml-refresh/mathml-css-proposals#mathml-css-proposals @physikerwelt I think in general it would be good to gather usage metrics of elements/attributes that are proposed for deprecation/removal. Maybe you can do that for wikipedia. |
html also has a dir attribute so this isn't so strange I think? Initially the model was to preserve as far as possible that as far as possible the notion that css should be used to encode potentially reader-customizable style, and that explicit attributes in the source should be used to encode author-specified meaning. So a clearer example would be <mi mathvariant="sans-serif" to chose a sans math alphabet as opposed to using CSS to chose the overall font style (which may be sans serif) Of course in the end mathvariant got defined as a shift of codepoint rather than a change of font, but it was still a motivating example here. So at the time, almost all publications were monochrome but the thought was that you may want to use colour just as fonts have been traditionally used, to have distinguished mathematical variables x mathcolor="red" and x mathcolor="blue" that are separate from a reader choice to style the whole expression in brown to match a website style... We can decide not to keep this (and we could potentially have different decision for the mathml-core and full mathml but if you are asking why mathml3 (and 2 and 1) are this way, that is basically why. |
Why not |
discussed in the telco on 2019-02-25:
|
I don't think indentalign is in MathML Core. Also we should keep in mind (2) #30 (comment) applies here. |
This is how I understand the current status: |
I think we should make MathML core as much backward compatibility as possible with existing formulas. With this idea we should implement the At the same time I would deprecate |
We have discussed a lot about scriptlevel yesterday. This is my summary regarding the attributes:
Given all of this, I would now recommend to remove
Details for the last one still have to be discussed in #31 |
@brucemiller mentioned that LaTeXML sometimes generates href on mstyle ( #55 (comment) ). First, I'd like to clarify that this proposal is not about generic MathML attributes on mstyle ( like https://mathml-refresh.github.io/mathml/chapter2.html#fund.globatt or https://mathml-refresh.github.io/mathml/chapter3.html#presm.presatt ) but only about those related to this MathML 3 "inheritance". Also, this raises yet another issue with the MathML 3 mstyle model. https://mathml-refresh.github.io/mathml/chapter3.html#presm.mstyle already has an exception for mathbackground/mathcolor saying that it applies to the mstyle itself, not to descendants. Such an exception should also apply to href. |
Resolution of 29/4/19 meeting: ( https://lists.w3.org/Archives/Public/public-mathml4/2019Apr/0022.html )
|
Resolution: Specification: Implementation: Polyfill: Tests:
|
…tyle attributes are ignored., a=testonly Automatic update from web-platform-tests Add MathML tests to check that legacy mstyle attributes are ignored. (#19110) * Add MathML tests to check that legacy mstyle attributes are ignored. See w3c/mathml#1 * Avoid false positives. -- wpt-commits: 0d0f9319b356f46f8bebd82982306b3b0053fa8c wpt-pr: 19110
…tyle attributes are ignored., a=testonly Automatic update from web-platform-tests Add MathML tests to check that legacy mstyle attributes are ignored. (#19110) * Add MathML tests to check that legacy mstyle attributes are ignored. See w3c/mathml#1 * Avoid false positives. -- wpt-commits: 0d0f9319b356f46f8bebd82982306b3b0053fa8c wpt-pr: 19110
…tyle attributes are ignored., a=testonly Automatic update from web-platform-tests Add MathML tests to check that legacy mstyle attributes are ignored. (#19110) * Add MathML tests to check that legacy mstyle attributes are ignored. See w3c/mathml#1 * Avoid false positives. -- wpt-commits: 0d0f9319b356f46f8bebd82982306b3b0053fa8c wpt-pr: 19110 UltraBlame original commit: 264ac2242a393e4691d45c7704d7c807b8516ef9
…tyle attributes are ignored., a=testonly Automatic update from web-platform-tests Add MathML tests to check that legacy mstyle attributes are ignored. (#19110) * Add MathML tests to check that legacy mstyle attributes are ignored. See w3c/mathml#1 * Avoid false positives. -- wpt-commits: 0d0f9319b356f46f8bebd82982306b3b0053fa8c wpt-pr: 19110 UltraBlame original commit: 264ac2242a393e4691d45c7704d7c807b8516ef9
…tyle attributes are ignored., a=testonly Automatic update from web-platform-tests Add MathML tests to check that legacy mstyle attributes are ignored. (#19110) * Add MathML tests to check that legacy mstyle attributes are ignored. See w3c/mathml#1 * Avoid false positives. -- wpt-commits: 0d0f9319b356f46f8bebd82982306b3b0053fa8c wpt-pr: 19110 UltraBlame original commit: 264ac2242a393e4691d45c7704d7c807b8516ef9
https://bugs.webkit.org/show_bug.cgi?id=202720 Patch by Delan Azabani <[email protected]> on 2020-04-09 Reviewed by Frédéric Wang. In MathML 2, the default mo@maxsize was infinity [1], unless some other default was given by mstyle@maxsize [2]. The sole purpose of "infinity" was to give authors a way to set mo@maxsize to infinity when some other mstyle@maxsize was set. MathML Core removes mstyle@maxsize [3][4], such that "infinity" has the same semantics as any other missing or invalid mo@maxsize, so the spec has been simplified to make infinity an anonymous value [5][6]. No functional change, because WebKit has never supported mstyle@maxsize anyway. To verify that there's no functional change: 1. Search for references to LengthType::Infinity, and observe that the mo@maxsize parser in MathMLOperatorElement::maxSize is the only place where a Length of ::type infinity is created 2. Search for references to that method, and observe that the only caller (RenderMathMLOperator::maxSize) passes intMaxForLayoutUnit (infinity) to toUserUnits as the referenceValue 3. Go to the definition of toUserUnits, and observe that the refer- enceValue is used as the ParsingFailed default 4. Step 1 shows that no other attributes would be affected by removing LengthType::Infinity, and steps 2 and 3 show that mo@maxsize treats invalid values as infinity, therefore it's safe to remove both the "infinity" parsing code and the underlying LengthType variant [1] https://www.w3.org/TR/MathML2/chapter3.html#id.3.2.5.2 [2] https://www.w3.org/TR/MathML2/chapter3.html#presm.mstyle [3] https://mathml-refresh.github.io/mathml-core/#style-change-mstyle [4] w3c/mathml#1 [5] https://mathml-refresh.github.io/mathml-core/#dictionary-based-attributes [6] w3c/mathml#107 No new tests, because no functional change. * mathml/MathMLElement.h: Remove LengthType::Infinity. * mathml/MathMLOperatorElement.cpp: (WebCore::MathMLOperatorElement::maxSize): Remove explicit branch on "infinity". Replace what remains with an equivalent cachedMathMLLength call. * rendering/mathml/RenderMathMLBlock.cpp: (WebCore::toUserUnits): Remove explicit branch on LengthType::Infinity. * rendering/mathml/RenderMathMLOperator.cpp: (WebCore::RenderMathMLOperator::maxSize): Update comment to refer to the default value in the same way as the spec. git-svn-id: http://svn.webkit.org/repository/webkit/trunk@259785 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Reopened because it still needs a polyfill. |
#204 asks some questions about inheritance and mathvariant. In a comment, @fred-wang mentioned people really should use mathvariant only on token elements. To me, that raises the question of why mathvariant is still settable on Since |
Discussed briefly at the Aug 17 and people generally felt that mathvariant doesn't make sense to remain on |
The logic in mathml core is that all the remaining mstyle attributes are now mapped to CSS and can be attached to any MathML elements. So I don't understand what's discussed here. In general it does not make any sense to talk about mstyle specifically for mathml core, since it's now strictly equivalent to an mrow. As I said on #204 , if this is an issue then it should be fixed for all elements, not mstyle specifically (i.e. use universal selectors). |
I had removed the "mathml core" label BTW, as the simplification is done for mathml core. the only reason why this is still opened is whether there is a need for a polyfill or changes in mathml full. |
The point is to remove mathvariant as a global attr because it mostly only makes sense when placed on a specific token element to effect a mapping to a different code point. Even for that use, the proper Unicode glyph should have been used. It is unclear why this value was included in the original proposal's "keep" list. |
This was discussed last year and we agreed to make all the mstyle attributes global because it's just easy to map attributes to style without doing all these tag-specific checks to know which element supports what. About completely removing mathvariant, this was also discussed last year and we agreed to keep it in the list because it's still widely used (even if using the proper unicode code point would be better, many tools don't do that). Finally we already have tests for these and implementation changes (I think at least in Chromium). |
In the last comment on this (Apr 2019) which is about a meeting resolution, only dir, mathsize, mathbackground, mathcolor were listed as being agreed to keep in core. mathvariant is not on the list. I agree mathvariant is still used, but I don't believe anyone ever sets it on mstyle as it is not a useful thing to do. I don't think we have statistics on its usage on mstyle though so we don't have any info on that front to use in this discussion. Also, it isn't clear that CSS will support the text-transform change needed as it is not in the latest working draft of CSS Text Module Level 3 so the current Chromium implementation may not be supportable on all platforms. |
This github comment is not complete, the proposal was #1 (comment) and summary says
which is what we've try to do in the spec/tests/implementation.
Two points:
We definitely need automatic mathvariant italic in any case for single-char mi. If the CSS WG rejects or wants change to mathvariant or other proposals then we can adapt accordingly, but I don't think we need to agree before we actually get their feedback. Also IIUC Brian said our text-transform proposal is uncontroversial in the CSSWG now. I think the risk is more on the scriptlevel stuff. |
https://bugs.webkit.org/show_bug.cgi?id=202720 Patch by Delan Azabani <[email protected]> on 2020-04-09 Reviewed by Frédéric Wang. In MathML 2, the default mo@maxsize was infinity [1], unless some other default was given by mstyle@maxsize [2]. The sole purpose of "infinity" was to give authors a way to set mo@maxsize to infinity when some other mstyle@maxsize was set. MathML Core removes mstyle@maxsize [3][4], such that "infinity" has the same semantics as any other missing or invalid mo@maxsize, so the spec has been simplified to make infinity an anonymous value [5][6]. No functional change, because WebKit has never supported mstyle@maxsize anyway. To verify that there's no functional change: 1. Search for references to LengthType::Infinity, and observe that the mo@maxsize parser in MathMLOperatorElement::maxSize is the only place where a Length of ::type infinity is created 2. Search for references to that method, and observe that the only caller (RenderMathMLOperator::maxSize) passes intMaxForLayoutUnit (infinity) to toUserUnits as the referenceValue 3. Go to the definition of toUserUnits, and observe that the refer- enceValue is used as the ParsingFailed default 4. Step 1 shows that no other attributes would be affected by removing LengthType::Infinity, and steps 2 and 3 show that mo@maxsize treats invalid values as infinity, therefore it's safe to remove both the "infinity" parsing code and the underlying LengthType variant [1] https://www.w3.org/TR/MathML2/chapter3.html#id.3.2.5.2 [2] https://www.w3.org/TR/MathML2/chapter3.html#presm.mstyle [3] https://mathml-refresh.github.io/mathml-core/#style-change-mstyle [4] w3c/mathml#1 [5] https://mathml-refresh.github.io/mathml-core/#dictionary-based-attributes [6] w3c/mathml#107 No new tests, because no functional change. * mathml/MathMLElement.h: Remove LengthType::Infinity. * mathml/MathMLOperatorElement.cpp: (WebCore::MathMLOperatorElement::maxSize): Remove explicit branch on "infinity". Replace what remains with an equivalent cachedMathMLLength call. * rendering/mathml/RenderMathMLBlock.cpp: (WebCore::toUserUnits): Remove explicit branch on LengthType::Infinity. * rendering/mathml/RenderMathMLOperator.cpp: (WebCore::RenderMathMLOperator::maxSize): Update comment to refer to the default value in the same way as the spec. Canonical link: https://commits.webkit.org/223145@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@259785 268f45cc-cd09-0410-ab3c-d52691b4dbfc
I think the "needs resolution" and "needs specification update" labels can be removed, leaving only the need to implement the polyfill. @fred-wang, @davidcarlisle: agree? |
This is a very old issue, just reviewing the current state, mostly mathml4 presentation follows core and makes the relevant attributes valid on all elements. Assuming #531 is merged So in answer to @NSoiffer's comment above, we could leave specification as is (and remove the label) or simply further. |
…tyle attributes are ignored., a=testonly Automatic update from web-platform-tests Add MathML tests to check that legacy mstyle attributes are ignored. (#19110) * Add MathML tests to check that legacy mstyle attributes are ignored. See w3c/mathml#1 * Avoid false positives. -- wpt-commits: 0d0f9319b356f46f8bebd82982306b3b0053fa8c wpt-pr: 19110
This proposal is to simplify mstyle so that it only supports the following attributes:
And maybe:
From the Math WG mailing list:
https://lists.w3.org/Archives/Public/www-math/2016Jul/0024.html
From the appendix of the original "MathML in HTML5" document:
"The mstyle element duplicates the CSS inheritance mechanism in a CSS-incompatible way and has many exceptions to workaround the fact that attribute names may be used for different purposes. In practice, many of its attributes are not useful and never used. It is a burden for implementers since they essentially have to reimplement a specific “attribute” inheritance mechanism to support the general case even if the most prominent attributes have obvious mapping to CSS. It is also a performance issue to perform the rendering and keep it up-to-date since the rendering on any node may depend on its mstyle ancestors. In this document, it instead suggested to keep only attributes that are compatible with CSS and five new CSS properties are introduced in section 2.3.1. These attributes actually correspond to what is used in practice. "
edit:
This is the proposal for CSS attributes that cannot be mapped to style yet: https://github.com/mathml-refresh/mathml-css-proposals#mathml-css-proposals
The text was updated successfully, but these errors were encountered: