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

Remove/Deprecate subscriptshift/superscriptshift attributes of msubsup/msup/msub #27

Open
fred-wang opened this issue Feb 22, 2019 · 12 comments
Labels
compatibility Issues affecting backward compatibility MathML 4 Issues affecting the MathML 4 specification need polyfill Issues requiring implementation changes need tests Issues related to writing WPT tests

Comments

@fred-wang
Copy link

These are currently defined in MathML 4 and ignored in MathML Core.

Script shifts are currently described via complex TeX / OpenType rules in MathML Core, allowing font designers to provide proper position of scripts.

subscriptshift/superscriptshift allow page authors to override the min script shifts. However, I'm not sure that's really use in practice. I wonder if we should deprecate/remove them to simplify the layout.

@fred-wang fred-wang added MathML Core Issues affecting the MathML Core specification MathML 4 Issues affecting the MathML 4 specification and removed MathML Core Issues affecting the MathML Core specification labels Feb 22, 2019
@dani31415
Copy link

What about using non math fonts? The default choice should be good enough.

@fred-wang
Copy link
Author

What about using non math fonts? The default choice should be good enough.

I believe the TeX appendix G has some suggestions for the min shifts and this is what is used in Gecko & WebKit.

@NSoiffer
Copy link
Contributor

NSoiffer commented Mar 5, 2019

I think the spec should say what values to use when using math fonts. Let's make sure there is no confusion by being specific about which should be used.

Similarly, when using fonts without math tables, we need to specific about how to calculate default values for them. I hope it won't be a problem to do so via character-specific bounding boxes (e.g, defining the axis and rule thickness based on the bounding box for "-"). Using generic font-wide info such as x-height will lead to poor layout.

@fred-wang
Copy link
Author

What about using non math fonts? The default choice should be good enough.

I believe the TeX appendix G has some suggestions for the min shifts and this is what is used in Gecko & WebKit.

Similarly, when using fonts without math tables, we need to specific about how to calculate default values for them. I hope it won't be a problem to do so via character-specific bounding boxes (e.g, defining the axis and rule thickness based on the bounding box for "-"). Using generic font-wide info such as x-height will lead to poor layout.

Let's not go off-topic, I opened w3c/mathml-core#116 for that.

@fred-wang
Copy link
Author

The MathML Core spec already indicates how to use MATH parameters to layout scripted expressions:
https://mathml-refresh.github.io/mathml-core/#scriptsandlimits
We can add fallback values w3c/mathml-core#116

This issue is about whether we actually need subscriptshift/superscriptshift? Gecko interprets them as "minimal shifts" but some people might want that it overrides the whole MATH / TeX rules.

My preference would be that it does not keep in MathML core, that we remove support from Gecko. (AFAIK there is no plan to implement it in WebKit or Chromium) and that people who really want to tweak the shifts (which is probably a bad thing) could use CSS (once we clarify the things about margin/padding/border/width/height) or mspace or mpadded...

@fred-wang
Copy link
Author

cc @rwlbuis, @emilio :

This went off topic, but as I understand current status is:

My preference would be:
(1) Remove this attribute from core to remove the extra layout/parsing code.
(2) Or if there is really a strong use case for this, interpret them as minimal shifts with default 0 values, so that it's easy to plug them into the default algorithm.

@fred-wang fred-wang added the compatibility Issues affecting backward compatibility label Mar 20, 2019
@physikerwelt
Copy link
Member

I would go for (1)

@NSoiffer
Copy link
Contributor

The shifts are not in use for the converters we have data for. However, I'm not sure that is meaningful as the source is mostly TeX and the games people play in TeX to shift a script probably aren't easily translated to these values. I do see mphantom and mpadded have some use in the stats and that for arXiv, there are some (very small) number of scripts that have a class of ltx_phantom. These could be cases where shifting the script more directly represents what they want to do.

@fred-wang fred-wang added the need resolution Issues needing resolution at MathML Refresh CG meeting label May 16, 2019
@NSoiffer
Copy link
Contributor

FYI... On p179 of the TeXBook, Knuth has an example of resetting the script default shift values for typesetting Chemistry. That's the only case I could see, but he lists this as an alternative to \vphantom so other cases are possibly listed in the TeXBook.

The shift attrs are a higher-level method of doing this. Maybe we add something as mentioned in #92 to handle the Chemistry case and then the use case goes away... if one of the possibilities is easy to implement in a browser.

fred-wang added a commit to web-platform-tests/wpt that referenced this issue Oct 1, 2019
fred-wang added a commit to web-platform-tests/wpt that referenced this issue Oct 1, 2019
moz-v2v-gh pushed a commit to mozilla/gecko-dev that referenced this issue Oct 14, 2019
…ght remove from Core / unship…, a=testonly

Automatic update from web-platform-tests
Add tests for MathML features that we might remove from Core / unship from browsers (#19450)

w3c/mathml#27
w3c/mathml#29
w3c/mathml#2

--

wpt-commits: d9e0e15247ca5269b4e2c9060f38416c2068997b
wpt-pr: 19450
@rwlbuis rwlbuis added need tests Issues related to writing WPT tests need specification update Issues requiring specification changes labels Oct 14, 2019
xeonchen pushed a commit to xeonchen/gecko that referenced this issue Oct 14, 2019
…ght remove from Core / unship…, a=testonly

Automatic update from web-platform-tests
Add tests for MathML features that we might remove from Core / unship from browsers (#19450)

w3c/mathml#27
w3c/mathml#29
w3c/mathml#2

--

wpt-commits: d9e0e15247ca5269b4e2c9060f38416c2068997b
wpt-pr: 19450
gecko-dev-updater pushed a commit to marco-c/gecko-dev-comments-removed that referenced this issue Oct 16, 2019
…ght remove from Core / unship…, a=testonly

Automatic update from web-platform-tests
Add tests for MathML features that we might remove from Core / unship from browsers (#19450)

w3c/mathml#27
w3c/mathml#29
w3c/mathml#2

--

wpt-commits: d9e0e15247ca5269b4e2c9060f38416c2068997b
wpt-pr: 19450

UltraBlame original commit: f3f6dad0dad824e643e833dfd3bcc0ebdec1f28e
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified-and-comments-removed that referenced this issue Oct 16, 2019
…ght remove from Core / unship…, a=testonly

Automatic update from web-platform-tests
Add tests for MathML features that we might remove from Core / unship from browsers (#19450)

w3c/mathml#27
w3c/mathml#29
w3c/mathml#2

--

wpt-commits: d9e0e15247ca5269b4e2c9060f38416c2068997b
wpt-pr: 19450

UltraBlame original commit: f3f6dad0dad824e643e833dfd3bcc0ebdec1f28e
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified that referenced this issue Oct 16, 2019
…ght remove from Core / unship…, a=testonly

Automatic update from web-platform-tests
Add tests for MathML features that we might remove from Core / unship from browsers (#19450)

w3c/mathml#27
w3c/mathml#29
w3c/mathml#2

--

wpt-commits: d9e0e15247ca5269b4e2c9060f38416c2068997b
wpt-pr: 19450

UltraBlame original commit: f3f6dad0dad824e643e833dfd3bcc0ebdec1f28e
@fred-wang fred-wang removed the need resolution Issues needing resolution at MathML Refresh CG meeting label Aug 12, 2020
@NSoiffer
Copy link
Contributor

At the meeting today, the consensus was to remove these from core. A problem does exist for supporting chemical notations as they want sub/superscripts always aligned. @davidcarlisle felt various workarounds could be used ranging from converters adding struts via mphantom to publishers creating their own version of a font where they have tweaked the open math params so they work well with chemical formulas.

@davidcarlisle davidcarlisle removed the need specification update Issues requiring specification changes label Aug 8, 2024
@davidcarlisle
Copy link
Collaborator

call resolved not to deprecate these

@dginev
Copy link
Contributor

dginev commented Sep 19, 2024

A problem does exist for supporting chemical notations as they want sub/superscripts always aligned.

I do not currently have enough practical experience with CSS Box Alignment, but I was wondering during the call today whether that could be a long-term device to accomplish the script alignments for chemistry.

If other participants here have thoughts on that idea (especially when it comes to MathML Core), it would be interesting to hear.

To clarify David's comment above, the call resolved to keep the attributes in MathML Full, as there is no clear alternative mechanism available today.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compatibility Issues affecting backward compatibility MathML 4 Issues affecting the MathML 4 specification need polyfill Issues requiring implementation changes need tests Issues related to writing WPT tests
Projects
None yet
Development

No branches or pull requests

7 participants