-
Notifications
You must be signed in to change notification settings - Fork 14
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
Consider integrating scriptlevel into font-size #62
Comments
Could you be more explicit about what you are proposing. I suspect I know what you are getting at, but I could easily be thinking of something else and in either case, I don't know how you would integrate that into font-size without some sort of math-level value. |
I think the proposal was to introduce new function values for font-size. |
@rwlbuis has a first implementation of fantasai's proposal in Chromium. But this still needs to be formalized in the spec. |
I don't see the proposed changes are valid CSS in either CSS Fonts Module Level 4 or the editor's draft of that WD. Where in the CSS process is @fantasai 's suggestion? Correct me if I'm wrong, but I think the other proposed extensions to CSS can be mapped to internal CSS properties if they don't get accepted by CSS in the near future. Since this uses an existing CSS property, is that approach feasible? If not, what's the fallback? |
Some notes on the new approach based on fantasai's suggestion. First although one cannot arbitrarily set the scriptlevel via CSS, it is still possible to nest two math tag so that the inner one has nonzero scriptlevel. Option (1) of w3c/mathml#154 (comment) is essentially chosen here. Second, it is no longer possible to modify the font-size and scriptlevel at the same time on a given element. In particular:
However, in the common use case where font-size is set uniformally for the whole formula (on the math tag, or inherited from an ancestor) then there is no behavior change. It is also fine to set font-size on element without children (e.g. token elements). If you really want to change the font-size of a subformula (which I guess will make your formula look bad anyway), you can always add another mrow level to prevent the font-size and scriptlevel from being modified at the same time. Last but not least, her approach has big advantages to my opinion:
So I would lean toward that new approach, for these reasons, for consistency with the main goal of MathML Core (better integration with the rest of the Web Platform) and to increase our change to get this accepted by browser reviewers and the CSS WG. |
This is referring to what she proposed during the breaking out session of the web engines hackfest last October. I'm not sure if we had taken minutes we can share with the group. I have some from Javi Fernandez but they are not very complete (on this point there is only "script-level issues: CSS should control the font's size"). Apparently Brian has notes that I'm mentioning in w3c/mathml#171 (comment) but not sure what they contain about this particular point. In any case, I don't remember she said she would write/submit any proposal, she was just giving suggestions to improve ours... Well, I expect this work has to be made by the MathML CG :-) Also I would personally not send any proposal to the CSS WG again, until we have at least addressed all her feedback (basically w3c/mathml#154-#155 w3c/mathml#169-#174). Most of them are easy and I can take of it but her proposal to integrate scriptlevel into font-size was the biggest change which is why things have been stalled so far, until we can experiment this in Chromium.
New properties can be defined as internal properties (this is what is done in Gecko) but when Rob tried the same in Chromium we noticed some limitations (e.g. AFAIK they cannot be specified in the UA sheet). I'm not even sure we tried that technique for this complicate thing that affects font-size. That said, new properties or extensions to existing properties can be developed under a runtime flag (which is what we are doing) and the Chromium reviewer for CSS was actually not very strict on approving these experimental things. So I guess that's fine for the short-term while MathML is still under a runtime flag. For the long term, if the CSS WG does not accept our proposal and since the Chromium reviewers would prefer to avoid "hiding the MathML magic", we basically cannot implement something like scriptlevel that affects font-size. That's why I'd try to be flexible and prefer addressing the feedback over finding perfect compability with MathML3. |
math-script-level-001,003: No longer relevant since there is no computed values of math-script-level (not a property anymore). math-script-level-005: This does not correspond to anything in the spec. math-script-level-002.tentative.html: tweak the test to work with the new syntax. math-script-level-004.tentative.html: tweak the test to work with the new syntax. Remove the part about the computed values of math-script-level (not a property anymore) https://github.com/mathml-refresh/mathml/issues/174
math-script-level-001,003: No longer relevant since there is no computed values of math-script-level (not a property anymore). math-script-level-005: This does not correspond to anything in the spec. math-script-level-002.tentative.html: tweak the test to work with the new syntax. math-script-level-004.tentative.html: tweak the test to work with the new syntax. Remove the part about the computed values of math-script-level (not a property anymore) https://github.com/mathml-refresh/mathml/issues/174
math-script-level-003: remove the reference left in previous commit. math-script-level-auto-and-math-style-*: use font-size: scriptlevel(auto) and update some assert doc. https://github.com/mathml-refresh/mathml/issues/174
math-script-level-003: remove the reference left in previous commit. math-script-level-auto-and-math-style-*: use font-size: scriptlevel(auto) and update some assert doc. https://github.com/mathml-refresh/mathml/issues/174
…he new syntax., a=testonly Automatic update from web-platform-tests Update some scriptlevel tests to match the new syntax. (#23530) math-script-level-001,003: No longer relevant since there is no computed values of math-script-level (not a property anymore). math-script-level-005: This does not correspond to anything in the spec. math-script-level-002.tentative.html: tweak the test to work with the new syntax. math-script-level-004.tentative.html: tweak the test to work with the new syntax. Remove the part about the computed values of math-script-level (not a property anymore) https://github.com/mathml-refresh/mathml/issues/174 -- wpt-commits: fa5b7ba3fee5536abd64b7064320c8fd8da62dd6 wpt-pr: 23530
…he new syntax., a=testonly Automatic update from web-platform-tests Update some scriptlevel tests to match the new syntax. (#23530) math-script-level-001,003: No longer relevant since there is no computed values of math-script-level (not a property anymore). math-script-level-005: This does not correspond to anything in the spec. math-script-level-002.tentative.html: tweak the test to work with the new syntax. math-script-level-004.tentative.html: tweak the test to work with the new syntax. Remove the part about the computed values of math-script-level (not a property anymore) https://github.com/mathml-refresh/mathml/issues/174 -- wpt-commits: fa5b7ba3fee5536abd64b7064320c8fd8da62dd6 wpt-pr: 23530
…he new syntax., a=testonly Automatic update from web-platform-tests Update some scriptlevel tests to match the new syntax. (#23530) math-script-level-001,003: No longer relevant since there is no computed values of math-script-level (not a property anymore). math-script-level-005: This does not correspond to anything in the spec. math-script-level-002.tentative.html: tweak the test to work with the new syntax. math-script-level-004.tentative.html: tweak the test to work with the new syntax. Remove the part about the computed values of math-script-level (not a property anymore) https://github.com/mathml-refresh/mathml/issues/174 -- wpt-commits: fa5b7ba3fee5536abd64b7064320c8fd8da62dd6 wpt-pr: 23530
…he new syntax., a=testonly Automatic update from web-platform-tests Update some scriptlevel tests to match the new syntax. (#23530) math-script-level-001,003: No longer relevant since there is no computed values of math-script-level (not a property anymore). math-script-level-005: This does not correspond to anything in the spec. math-script-level-002.tentative.html: tweak the test to work with the new syntax. math-script-level-004.tentative.html: tweak the test to work with the new syntax. Remove the part about the computed values of math-script-level (not a property anymore) https://github.com/mathml-refresh/mathml/issues/174 -- wpt-commits: fa5b7ba3fee5536abd64b7064320c8fd8da62dd6 wpt-pr: 23530
The spec & tests now follow fantasai's suggestion ; and this has been implemented in Chromium upstream, so closing. |
…he new syntax (part 2)., a=testonly Automatic update from web-platform-tests Update some scriptlevel tests to match the new syntax (part 2). (#23538) math-script-level-003: remove the reference left in previous commit. math-script-level-auto-and-math-style-*: use font-size: scriptlevel(auto) and update some assert doc. https://github.com/mathml-refresh/mathml/issues/174 -- wpt-commits: 907d95d79df0f6d403b97ac9e494292eea7f0e9e wpt-pr: 23538
…he new syntax (part 2)., a=testonly Automatic update from web-platform-tests Update some scriptlevel tests to match the new syntax (part 2). (#23538) math-script-level-003: remove the reference left in previous commit. math-script-level-auto-and-math-style-*: use font-size: scriptlevel(auto) and update some assert doc. https://github.com/mathml-refresh/mathml/issues/174 -- wpt-commits: 907d95d79df0f6d403b97ac9e494292eea7f0e9e wpt-pr: 23538
Wow. So, uh, I think you and I did not understand each other very well here. Definitely, I would not have advocated hiding a counter in the computed value of font-size. My suggestion was more that (Also if you want to get my attention, I suggest email or IRC or even Twitter. GH notifications get buried in the vast amounts of GH notifications, I basically never see them.) |
Also if you want to change how a core property like |
Sorry for the misunderstanding. Seeing the glass half-full, I think the new proposal is much closer to what you had in mind and contains the necessary simplification that makes integration in font-size possible. Now, I agree it would be straightforward to calculate the new font-size without counter for relative changes But I'm not sure how you mean to do that for the absolute change
I'm commenting here so that the rest of the CG is aware but yes, let's follow-up later on this.
Agreed and the plan is definitely to open new issues in the CSS WG tracker and put math items on the agenda for review. Last year my colleagues suggested to write small explainers for new CSS features and submit them to the CSS WG tracker for review, which is what I optimistically did. But the feedback was unfortunately not very constructive, with people basically arguing about the usefulness of MathML rather than on the actual technical problems we were trying to address. However, after a long effort on the MathML Core spec, test and implementation side we believe we are close to be able to give another try. But there are still a few things to refine first before... |
This is done as agreed in w3c/csswg-drafts#5389 so I think we can close it. We can simplify a bit further after w3c/csswg-drafts@09efeb0 though. |
cc @fantasai
Instead of having a separate
math-level
property, we could integrate it intofont-size
as a function.The text was updated successfully, but these errors were encountered: