You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Extend mpadded attribute syntax to be closer to MathML3 #103
These are the possible non-length values implemented by @distler in itex2MML and copied into TeXZilla:
lspace="-100%width" (\mathllap)
lspace="-50%width" (\mathclap)
height="+[LENGTH][UNIT]" (\mathraisebox)
depth="+[LENGTH][UNIT]" (\mathraisebox)
depth="depth" (\mathraisebox)
depth="depth" can basically be replaced with not using (or ignoring) the attribute. I'm not exactly sure about how the other commands work.
As far as I can see, the only difference in attrs is in the pseudo units being slightly restricted: the vertical attrs can only refer to height/depth (not width) and the horizontal ones only to width (not height/depth). Is there something else a polyfill needs to handle?
I'm still concerned by the current text for mpadded as I doubt it will reflect what is "acceptable" for native implementations. So at this point, I'm not sure we can rely on it to know what a polyfill should handle.
As far as I can see, the only difference in attrs is in the pseudo units being slightly restricted: the vertical attrs can only refer to height/depth (not width) and the horizontal ones only to width (not height/depth). Is there something else a polyfill needs to handle?
@NSoiffer I think the biggest breaking change is (as currently written in the core spec) in core width="+3em" has no magic meaning: it's same as width="3em" and forces the length to 3em not increase it by that amount.
Note that the css length syntax allows width="calc(100% + 3em)" to get the increment meaning. This already works on mpadded in whatever version of chrome canary I have installed, although apparently not in firefox.
I am tempted to suggest that MathML4 accepts this breaking change and follows core here: using the same interpretation for any values that are syntactically valid css length values.
MathML4 full spec can still add named lengths and psuedo-units thinmathspace and width etc but they are less of a problem as they are syntactically invalid in core so you don't have the same value having different interpretations in full and core.
Sigh no My above comment is wrong as core is specified as accepting % but treating them as 0, but perhaps the suggestion for full should still stand, as really we need width="+3em" to mean the same thing in Core and Full.
@NSoiffer I think the original idea of this issue was to make mpadded syntax from MathML Core a bit closer to what we have in MathML3 instead of the current CSS-based version. I don't think this happened at the end. So I would keep it open if that's something people are still interesting in.
Regarding current WPT tests, I believe most of them are for the MathML Core syntax, written when we implemented it in Chromium. For the MathML3 syntax, I suspect WebKit/Firefox still have their own internal tests. I guess the answer is "Yes we have enough WPT tests" if we are talking about current MathML Core spec but "No" if we are talking about a potential alignment with MathML 3.
I believe that at least for the current Core spec, mpadded is as it is. The question is about the wpt-tests because that the label on it ("need tests"). Since you feel they are sufficient, I will close this.
Activity
fred-wang commentedon Jun 14, 2019
These are the possible non-length values implemented by @distler in itex2MML and copied into TeXZilla:
lspace="-100%width" (\mathllap)
lspace="-50%width" (\mathclap)
height="+[LENGTH][UNIT]" (\mathraisebox)
depth="+[LENGTH][UNIT]" (\mathraisebox)
depth="depth" (\mathraisebox)
depth="depth" can basically be replaced with not using (or ignoring) the attribute. I'm not exactly sure about how the other commands work.
fred-wang commentedon Jun 14, 2019
From https://mathml-refresh.github.io/mathml/chapter3.html#presm.mpadded
For any unsigned number X, if Y = X / 100 then
X%pseudo-unit is equivalent to Ypseudo-unit
+X%pseudo-unit is equivalent to +Ypseudo-unit
-X%pseudo-unit => -Ypseudo-unit
So it seems that this syntax is not useful.
fred-wang commentedon Jun 14, 2019
I've rewritten the description of mpadded in MathML core, so that it no longer refers to MatHML3
https://mathml-refresh.github.io/mathml-core/#adjust-space-around-content-mpadded
Unless I'm mistaken, the current syntax and semantic should more or less match what is in the full spec:
https://mathml-refresh.github.io/mathml/#presm_mpaddedatt
(with namedspace removed and numbers defined from CSS)
Remove test for RTL ms and add test for legacy lquote/rquote
NSoiffer commentedon May 19, 2020
As far as I can see, the only difference in attrs is in the pseudo units being slightly restricted: the vertical attrs can only refer to height/depth (not width) and the horizontal ones only to width (not height/depth). Is there something else a polyfill needs to handle?
fred-wang commentedon May 19, 2020
I'm still concerned by the current text for mpadded as I doubt it will reflect what is "acceptable" for native implementations. So at this point, I'm not sure we can rely on it to know what a polyfill should handle.
Move the weird mpadded attribute syntax into its own section, as it's…
3 remaining items
davidcarlisle commentedon Mar 21, 2022
@NSoiffer I think the biggest breaking change is (as currently written in the core spec) in core
width="+3em"has no magic meaning: it's same aswidth="3em"and forces the length to 3em not increase it by that amount.Note that the css length syntax allows
width="calc(100% + 3em)"to get the increment meaning. This already works on mpadded in whatever version of chrome canary I have installed, although apparently not in firefox.I am tempted to suggest that MathML4 accepts this breaking change and follows core here: using the same interpretation for any values that are syntactically valid css length values.
MathML4 full spec can still add named lengths and psuedo-units
thinmathspaceandwidthetc but they are less of a problem as they are syntactically invalid in core so you don't have the same value having different interpretations in full and core.See also the discussion in PR #297
davidcarlisle commentedon Mar 21, 2022
Sigh no My above comment is wrong as core is specified as accepting % but treating them as 0, but perhaps the suggestion for full should still stand, as really we need
width="+3em"to mean the same thing in Core and Full.davidcarlisle commentedon Nov 14, 2024
WG meeting 2024-11-14 agreed to change full to match core, noting that css length allows
calcsyntax.NSoiffer commentedon Dec 19, 2024
@fred-wang: I see some wpt mpadded tests. Do you feel these are complete enough that this issue can be closed?
NSoiffer commentedon May 12, 2026
@fred-wang: ping... are the WPT tests enough to close this issue?
NSoiffer commentedon Oct 22, 2026
@fred-wang: ping... are the WPT tests enough to close this issue?
fred-wang commentedon Oct 29, 2026
@NSoiffer I think the original idea of this issue was to make mpadded syntax from MathML Core a bit closer to what we have in MathML3 instead of the current CSS-based version. I don't think this happened at the end. So I would keep it open if that's something people are still interesting in.
Regarding current WPT tests, I believe most of them are for the MathML Core syntax, written when we implemented it in Chromium. For the MathML3 syntax, I suspect WebKit/Firefox still have their own internal tests. I guess the answer is "Yes we have enough WPT tests" if we are talking about current MathML Core spec but "No" if we are talking about a potential alignment with MathML 3.
NSoiffer commentedon Oct 29, 2026
I believe that at least for the current Core spec,
mpaddedis as it is. The question is about the wpt-tests because that the label on it ("need tests"). Since you feel they are sufficient, I will close this.