Re: [csswg-drafts] [css-fonts] Add new CSS properties math-script-level and math-style (#3746)

The CSS Working Group just discussed `math-script-level and math-style`.

<details><summary>The full IRC log of that discussion</summary>
&lt;TabAtkins> Topic: math-script-level and math-style<br>
&lt;astearns> github: https://github.com/w3c/csswg-drafts/issues/3746<br>
&lt;TabAtkins> bkardell_: In doing Chromium impl of mathml, and trying to explain the mathml magic in a way that's part of the platform, there are some funky areas<br>
&lt;TabAtkins> bkardell_: So we want to get that funky added to CSS.<br>
&lt;AmeliaBR> Explainer link: https://mathml-refresh.github.io/mathml-css-proposals/math-script-level-and-math-style-explainer.html<br>
&lt;TabAtkins> bkardell_: One is math-style. As part of layout, takes into consideration whether your math equation is happening inline in text or as a block; aligns baselines differently and tries to minimize vertical size in inline, etc.<br>
&lt;TabAtkins> bkardell_: If we have that, this is one more thing that becomes a UA stylesheet rule.<br>
&lt;TabAtkins> bkardell_: math-script-level is in my mind a lot like counters. It lets you scale up or down font-size<br>
&lt;TabAtkins> emilio: So when you nest an element that's a subscript or superscript, or part of a fraction, the font-size shrinks.<br>
&lt;TabAtkins> emilio: But in CSS it affects the computed font-size, which is annoying.<br>
&lt;TabAtkins> fantasai: This effects the font-size. Why is it called script-level, and why is separate from font-size?<br>
&lt;TabAtkins> bkardell_: This is how I think it's similar to counters, it carries info about nesting.<br>
&lt;TabAtkins> AmeliaBR: So elika's question is why not do this with relative font sizes. I think reason is to give browsers some more flexibility...<br>
&lt;TabAtkins> fantasai: We can have math-larger and math-smaller...<br>
&lt;TabAtkins> fremy: If you have a fraction, 1/2. You can nest, 1/(1/2). But third level of nesting, switch to a side-by-side fraction.<br>
&lt;TabAtkins> bkardell_: Even within that context, you can have sub/superscripts too.<br>
&lt;TabAtkins> AmeliaBR: There definitely needs to be a new property. Math fonts have a property saying how much you scale down as you go down a script level.<br>
&lt;TabAtkins> AmeliaBR: Do you need to be able to absolutely set "3 sizes down from normal", or is it always single steps?<br>
&lt;TabAtkins> bkardell_: These map stragiht from MathML attributes. I know the name isn't great, but<br>
&lt;myles_> q+<br>
&lt;TabAtkins> emilio: Figuring out which nodes need to incrmeent or decrement the script level is pretty tricky<br>
&lt;AmeliaBR> `font-size-math-adjust`???<br>
&lt;TabAtkins> emilio: It would be good to see if we can decouple the script-level from font-size, because it becomes much easier, add an "auto" value and figure it out doing layout or something<br>
&lt;TabAtkins> AmeliaBR: Does nesting level have effects other than font-size?<br>
&lt;TabAtkins> myles_: bkardell said yes<br>
&lt;una> what about `font-size-math-adjust: &lt;nesting-level>`<br>
&lt;TabAtkins> fantasai: So then you'd want to *select* based on that level. So then that info must be in the DOM.<br>
&lt;TabAtkins> fantasai: We've had similar cases in the past of things thought to be in CSS that we pushed back and said "no, this needs to be in the DOM".<br>
&lt;TabAtkins> fantasai: Like directionality.<br>
&lt;myles_> s/bkardell said yes/fremy said yes/<br>
&lt;astearns> ack myles_<br>
&lt;astearns> q+ myles_<br>
&lt;fremy> (yep, for the record I agree with fantasai)<br>
&lt;TabAtkins> dbaron: I think one of the reasons for this is that mathml has attributes that specify both the ratio of font-size for each change in script level, and the min font-size at which you stop changing it.<br>
&lt;TabAtkins> dbaron: script-size-multiplier and script-min-size<br>
&lt;TabAtkins> fantasai: Does this mean we're adding font-min-size back?<br>
&lt;TabAtkins> myles_: There have been a half-dozen or so of these proposals. How do these affect existing elements outside of MathML?<br>
&lt;TabAtkins> bkardell_: Some people do indeed think that &lt;math> isn't great, and math layout should be a normal part of CSS.<br>
&lt;una> `font-size-math-adjust: &lt;max-nesting-level> / &lt;min-font-size>`<br>
&lt;TabAtkins> florian: I think we want the building blocks of math in normal CSS. And I've heard the argument that MathML is bad for math; mathjax people will do that.<br>
&lt;TabAtkins> florian: So mathjax renders math into HTML or SVG, but they're missing some tools that make it subpar.<br>
&lt;TabAtkins> myles_: So what's the criteria here: hsould math layout be dumped in whole-hog?<br>
&lt;chris> https://www.w3.org/TR/MathML3/chapter3.html#presm.mstyle.attrs<br>
&lt;TabAtkins> bkardell_: We're trying to find the mathml core and eliminate as much as possible.<br>
&lt;TabAtkins> bkardell_: So far we've been doing good at that.<br>
&lt;TabAtkins> bkardell_: Reusing CSS stuff well.<br>
&lt;chris> also https://www.w3.org/TR/MathML3/chapter3.html#presm.scriptlevel<br>
&lt;TabAtkins> astearns: I hear this as a request from another group, like the timed text people, to get something that they can't currently do in CSS.<br>
&lt;tantek> q?<br>
&lt;fantasai> TabAtkins: Is the goal that you can implement math layout with &lt;div>s, or are we still using mathml but ...<br>
&lt;TabAtkins> dbaron: There are two different groups in w3c working on diff solutions here<br>
&lt;TabAtkins> s/are we still using mathml but .../are we saying that mathml is a special layout form, like SVG, that can have its own specialized CSS without influencing arbitrary text layout/<br>
&lt;TabAtkins> myles_: So if this is a generic layout mechanism, you need to be able to put flexbox inside of it<br>
&lt;TabAtkins> florian: I don't think we want to be able to take naive markup and get good math out of it.<br>
&lt;fantasai> TabAtkins: Are we intending that you can make a fraction, and the nuerator is a flexbox?<br>
&lt;iank_> q+<br>
&lt;astearns> ack myles_<br>
&lt;fantasai> TabAtkins: If so, you can nest flexbox into it. If not, then you can't.<br>
&lt;fantasai> TabAtkins: But need to know which way we're going so we can figure out how to interact with it<br>
&lt;fantasai> chrisl: ...<br>
&lt;fantasai> TabAtkins: We'd make a Math layout spec<br>
&lt;TabAtkins> iank_: So basically mathml is already in this state where you can nest CSS layout inside of it<br>
&lt;TabAtkins> iank_: And it uses CSS layouts to ahcieve some of its layouts<br>
&lt;TabAtkins> iank_: so &lt;mtable> uses css tables<br>
&lt;TabAtkins> iank_: The text inside of mathml is just text layout, it can do floats/etc<br>
&lt;tantek> q?<br>
&lt;TabAtkins> iank_: This was the feedback we gave to the group: you need to define how this interacts with all of CSS.<br>
&lt;astearns> ack iank_<br>
&lt;tantek> q+<br>
&lt;TabAtkins> myles_: ARe you saying that philophically that's how this shoudl be designed, or that it's just a quirk of impl.<br>
&lt;TabAtkins> Rossen: So support rich layout that allows math, and interacts nicely with the rest of css.<br>
&lt;fremy> q+<br>
&lt;astearns> ack tantek<br>
&lt;TabAtkins> astearns: A detail is that some requirements, we may not get to. LIke western typography, some details we never get to.<br>
&lt;TabAtkins> myles_: So the intention is that we end up with display:math at some point?<br>
&lt;TabAtkins> AmeliaBR: display:fraction, perhaps, like display:ruby : some specialized focused layouts as necessary<br>
&lt;dauwhe> this is a w3c strategy funnel issue https://github.com/w3c/strategy/issues/43<br>
&lt;myles> q+<br>
&lt;tantek> q-<br>
&lt;astearns> ack fremy<br>
&lt;TabAtkins> fremy: So math-level.<br>
&lt;TabAtkins> fremy: If you want a layout that's different depending on the math level, that's fine. We could do that.<br>
&lt;dauwhe> https://www.w3.org/community/knowledge-domain/<br>
&lt;TabAtkins> fremy: But the way I see this is that math-level is changing other properties, in some weird interaction.<br>
&lt;astearns> q+<br>
&lt;TabAtkins> fremy: So my mental model matches fantasai, this is at the DOM level.<br>
&lt;TabAtkins> fremy: And if we go the "you should do math using divs", that doesn't work.<br>
&lt;TabAtkins> fremy: My impression from when I worked on this, is that this is complex to put in a CSS property.<br>
&lt;florian> q+<br>
&lt;TabAtkins> fremy: But if our goal is to allow everything in CSS, I don't see how it's a markup thing.<br>
&lt;TabAtkins> fremy: So question is we need mathml markup, or is there a simplified markup that would provide the grouping/level/etc that we could provide the levels on top of.<br>
&lt;astearns> ack myles<br>
&lt;TabAtkins> myles: So let's say we do wanna go on this path where we induct math layout into CSS.<br>
&lt;TabAtkins> myles: When we write CSS specs we have to describe layout exactly.<br>
&lt;TabAtkins> myles: Do you envision that this group would make those decisions, or that MathML would do it and deliver them to us and we'd put them into our docs?<br>
&lt;TabAtkins> bkardell_: Right now they're trying to get that defined.<br>
&lt;TabAtkins> bkardell_: Huge criticism right now is that it's super underdefined.<br>
&lt;TabAtkins> iank_: As part of our launch process we require interop-capable specification.<br>
&lt;tantek> FYI: https://caniuse.com/mathml<br>
&lt;TabAtkins> iank_: And the two impls currently aren't remotely interoperable, especially layout.<br>
&lt;TabAtkins> iank_: I spent two or three hours one day and created a list of issues where Firefox and WebKit differ.<br>
&lt;florian> q?<br>
&lt;TabAtkins> fantasai: If mathml is going to define a layout model closer to css, they should def interact with us more than what's happening currently.<br>
&lt;TabAtkins> fantasai: So we can make sure it's compatible with css layout and all the interactions with othe rproeprties.<br>
&lt;tantek> Is there an opportunity for CSS/MathML joint meeting at TPAC?<br>
&lt;TabAtkins> fantasai: Just because of where the expertise lies.<br>
&lt;AmeliaBR> q+<br>
&lt;Rossen_> q?<br>
&lt;TabAtkins> astearns: I would really like to see more stuff in the explainer. Righ tnow it looks like a reiteration fo the proposal. It has some markup examples without intended renderings, etc.<br>
&lt;Rossen_> ack astearns<br>
&lt;TabAtkins> fantasai: SAme, I don't really understand what it's trying to do currently. So I can't even comment on whether they're doing it right or not.<br>
&lt;TabAtkins> fantasai: So somebody came up with a solution to a problem, but I don't udnerstand the problem, or why this is the best solution to that problem.<br>
&lt;TabAtkins> fantasai: Would love to advise them, but can't right now.<br>
&lt;astearns> ack florian<br>
&lt;TabAtkins> florian: Back to fremy's point, for those trying to solve math with css, i don't think the goal is markup that resembles mathml and uses display:fraction, display:sqrt, etc. I think it was to start from a mathml-ish markup that is processed into a pile of divs, then rendering fractions with a vertical flexbox, etc. Only a few lacking aspects would need to be added.<br>
&lt;TabAtkins> fremy: I don't disagree, that's also an option. But if that's the goal then you don't need the math-script-level property.<br>
&lt;TabAtkins> myles: Agree. We already have SVG then.<br>
&lt;astearns> ack AmeliaBR<br>
&lt;TabAtkins> TabAtkins: SVG doesn't quite solve it - we still need a few small things, like baseline control, stretchy characters. Talked about this at last TPAC. But it's pretty minimal.<br>
&lt;TabAtkins> AmeliaBR: So wrapping up, we have some requests from Brian's team at Igalia about how we want communication to happen, better explainers. larger comprehensive use-cases, rather than one proposal at a time.<br>
&lt;TabAtkins> AmeliaBR: Would be useful if this group gave feedback about how we'd like to be communicated with.<br>
&lt;TabAtkins> AmeliaBR: And then there's further concern about where things should live, CSS vs DOM, etc.<br>
&lt;astearns> ack dbaron<br>
&lt;AmeliaBR> s/requests from/requests for/<br>
&lt;TabAtkins> dbaron: elika was asking about the problem to be solved. There is a political disagreement about the problem.<br>
&lt;TabAtkins> dbaron: In that, there is the question of whether mathml is the way forward.<br>
&lt;TabAtkins> dbaron: A few years ago when it was in Firefox only and we thought we might remove it, everyone thought MathML wasn't the right way to do it; do it in CSS instead, etc.<br>
&lt;TabAtkins> dbaron: And add to CSS to improve mathjax output.<br>
&lt;TabAtkins> dbaron: Now we're somewhat surprisingly getting to a world where mathml is supported across browser engines.<br>
&lt;TabAtkins> dbaron: So question is whether mathml is, like html, something that needs CSS to reflect on things in it.<br>
&lt;TabAtkins> dbaron: ARe we concerned with MathML backcompat such that CSS needs to care about its legacy mechanisms.<br>
&lt;TabAtkins> dbaron: Or do we have substantial flexibility to change things as necessary.<br>
&lt;TabAtkins> dbaron: So three possibilities:<br>
&lt;TabAtkins> dbaron: 1. MathML is in browser engines, CSS has to be compatible with that.<br>
&lt;TabAtkins> dbaron: 2. MathML is in browser engines, but we might make substantial changes in the process and can adjust it to CSS better.<br>
&lt;TabAtkins> dbaron: 3. MathML isn't the right path forward, and math should be taking this up the path.<br>
&lt;TabAtkins> dbaron: Path to making this decision right now is very uncoordinated and not based on principles, but rather on lots of small decisions where people might not be aware of the larger path they're supporting.<br>
&lt;TabAtkins> dbaron: Possible we should be discussing this more epxlicitly.<br>
&lt;TabAtkins> dbaron: I think before we decide waht we're trying to solve, we might want to have that discussion.<br>
&lt;TabAtkins> bkardell_: Before I went to Igalia, I spent a lot of time thinking about this.<br>
&lt;TabAtkins> bkardell_: My own thought were between 2 and 3.<br>
&lt;TabAtkins> bkardell_: HTML isn't very perfect semantically either, it's focused on text.<br>
&lt;TabAtkins> bkardell_: So it has no starting point. It's not like SVG, where we all agree what SVG is.<br>
&lt;TabAtkins> bkardell_: Thirty years the community has been working on something, lots of back and forth.<br>
&lt;TabAtkins> bkardell_: When we got to HTML5 and mathml was codified into the parser, now it's in a special weird place.<br>
&lt;TabAtkins> bkardell_: If there's something I'd personally advocate, it's that we need to find a starting point or we can't have this convo.<br>
&lt;TabAtkins> bkardell_: So back with corp hat on, the core-math group is trying to find the minimal bits that hold things together.<br>
&lt;TabAtkins> bkardell_: I don't want to personally be like "mathml is the best thing ever", I dunno. I want to be malleable here.<br>
&lt;TabAtkins> &lt;br dur=20min><br>
&lt;TabAtkins> myles_: Minutes of the Math session during last year's tpac: https://lists.w3.org/Archives/Public/www-style/2018Nov/0008.html<br>
</details>


-- 
GitHub Notification of comment by css-meeting-bot
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/3746#issuecomment-498815063 using your GitHub account

Received on Tuesday, 4 June 2019 19:44:40 UTC