Skip to content
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

Extend mpadded attribute syntax to be closer to MathML3 #103

Open
fred-wang opened this issue Jun 14, 2019 · 8 comments
Open

Extend mpadded attribute syntax to be closer to MathML3 #103

fred-wang opened this issue Jun 14, 2019 · 8 comments
Assignees
Labels
MathML Core Issues affecting the MathML Core specification MathML 4 Issues affecting the MathML 4 specification need specification update Issues requiring specification changes need tests Issues related to writing WPT tests

Comments

@fred-wang
Copy link

In #81, we agreed that mpadded attributes in MathML Core should only use pseudo-unit with the same vertical/horizontal direction.

Can we simplify it any further? Remove/Deprecate it?

Some thoughts:

@fred-wang fred-wang added MathML 4 Issues affecting the MathML 4 specification MathML Core Issues affecting the MathML Core specification need implementation update need polyfill Issues requiring implementation changes need resolution Issues needing resolution at MathML Refresh CG meeting need specification update Issues requiring specification changes need tests Issues related to writing WPT tests labels Jun 14, 2019
@fred-wang
Copy link
Author

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
Copy link
Author

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
Copy link
Author

fred-wang commented 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)

@NSoiffer
Copy link
Contributor

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
Copy link
Author

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.

fred-wang added a commit to w3c/mathml-core that referenced this issue May 22, 2020
… not used elsewhere and can hopefully be simplified.

w3c/mathml#103
fred-wang added a commit to w3c/mathml-core that referenced this issue Jun 1, 2020
w3c/mathml#103

DO NOT MERGE until there is a consensus on the future of mpadded.
@fred-wang fred-wang changed the title Simplification/Removal/Deprecation of the mpadded element Extend mpadded attribute syntax to be closer to MathML3 Jun 1, 2020
@fred-wang fred-wang removed the need resolution Issues needing resolution at MathML Refresh CG meeting label Aug 12, 2020
@davidcarlisle
Copy link
Collaborator

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.

See also the discussion in PR #297

@davidcarlisle
Copy link
Collaborator

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 davidcarlisle removed the need polyfill Issues requiring implementation changes label Aug 8, 2024
@davidcarlisle
Copy link
Collaborator

WG meeting 2024-11-14 agreed to change full to match core, noting that css length allows calc syntax.

@davidcarlisle davidcarlisle self-assigned this Nov 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
MathML Core Issues affecting the MathML Core specification MathML 4 Issues affecting the MathML 4 specification need specification update Issues requiring specification changes need tests Issues related to writing WPT tests
Projects
None yet
Development

No branches or pull requests

3 participants