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

Simplification of the <semantics> element #100

Open
fred-wang opened this issue Jun 10, 2019 · 7 comments
Open

Simplification of the <semantics> element #100

fred-wang opened this issue Jun 10, 2019 · 7 comments
Labels
compatibility Issues affecting backward compatibility css / html5 Issues related to CSS or HTML5 interoperability MathML 4 Issues affecting the MathML 4 specification need polyfill Issues requiring implementation changes

Comments

@fred-wang
Copy link

fred-wang commented Jun 10, 2019

The typical usage of the semantics element is as followed:

<semantics>
  [ANNOTATED PRESENTATION MATHML CHILD]
  <annotation encoding="application/x-tex">...</annotation>
  <annotation-xml encoding="MathML-Content">...</annotation-xml>
  ... MORE ANNOTATIONS ...
</semantics>

WebKit and Gecko will render the first child.

Currently, Chromium (without MathML support) will always hide that child but display all the annotations (which is ok when there is only one text annotation):
https://chromium.googlesource.com/chromium/src/+/HEAD/third_party/blink/renderer/core/css/mathml.css#40

A non-common case is when the first child is actually content MathML:
https://mathml-refresh.github.io/mathml/chapter5.html#mixing.alternate.representations
WebKit and Gecko will then actually try to render either a text annotation or a MathML/SVG/HTML annoation-xml:
https://mathml-refresh.github.io/mathml-core/#sematicsandpresentation
(Chromium will wrongly display all the children)

Another (non-valid) use case is when the semantics only has one annotation-xml child:

  <semantics>
    <annotation-xml encloding="SVG1.1">...</annotation-xml>
  </semantics>

which @distler has used to embed SVG inside MathML.
WebKit, Gecko and Chromium will properly handle that case too.

@fred-wang
Copy link
Author

I'm not sure what will be the outcome of #47, but browser developers are not really fond of content MathML. My suggestion for MathML Core is thus to assume that the first child is presentation markup and then hide the annotations. Hence the proposal will be the same as what we decided for maction (#26):

  • Treat maction as an mrow for layout purpose.
  • Make the default display values of all but the first child display: none (it can be overridden by users via standard CSS).

This is Gecko's legacy implementation which is compatible with (and motivated) the non-valid SVG case above. Users could also override the behavior if they want to render annotations instead of presentation MathML.

@fred-wang fred-wang added 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 MathML 4 Issues affecting the MathML 4 specification labels Jun 10, 2019
@NSoiffer
Copy link
Contributor

NSoiffer commented Jun 10, 2019 via email

@fred-wang
Copy link
Author

We agreed during yesterday's meeting to follow #100 (comment)
I've rewritten the section accordingly: https://mathml-refresh.github.io/mathml-core/#semantics-and-presentation

@fred-wang fred-wang removed need resolution Issues needing resolution at MathML Refresh CG meeting need specification update Issues requiring specification changes labels Jun 18, 2019
@fred-wang
Copy link
Author

https://lists.w3.org/Archives/Public/public-mathml4/2019Jun/0013.html

ADOPTED: render 1st child for Core default

ACTION ITEM: ADD issue for the Full spec as to what to do; this touches on
#101 on integration; and how the polyfill is affected

@Jamesernator
Copy link

Jamesernator commented Aug 21, 2019

but browser developers are not really fond of content MathML

They should be using it for screen readers, but otherwise I don't see what browsers should do with content MathML.

Content MathML is explicitly defined as not being tied to presentation and may not have a particular rendering (it's even the first sentence of the spec) so I don't think it makes sense for browsers attempt to render it.

For example something as simple as multiplication could be represented by a × b or a ⋅ b or even just ab depending on notational preference.

I personally think it's better to leave it to userland to generate (or hand author) a specific rendering as it's more likely the author will have a clearer preference for their specific use case on how it should be rendered.

As an example when representing the formula E = mc², using INVISIBLE TIMES (U+2062) for multiplication is more likely in that shorthand. However when showing full names then INVISIBLE TIMES wouldn't be used and instead one of the other representations would be used e.g. Energy = mass × accelaration².

fred-wang added a commit to web-platform-tests/wpt that referenced this issue Sep 17, 2019
… as mrow-like

w3c/mathml#26
w3c/mathml#100

This also checks a bit annotation/annotation-xml and display: math.
fred-wang added a commit to web-platform-tests/wpt that referenced this issue Sep 17, 2019
… as mrow-like (#19118)

w3c/mathml#26
w3c/mathml#100

This also checks a bit annotation/annotation-xml and display: math.
@fred-wang fred-wang added compatibility Issues affecting backward compatibility css / html5 Issues related to CSS or HTML5 interoperability and removed need tests Issues related to writing WPT tests labels Sep 17, 2019
moz-v2v-gh pushed a commit to mozilla/gecko-dev that referenced this issue Sep 18, 2019
…emantics elements are treated…, a=testonly

Automatic update from web-platform-tests
Add tests to check that legacy maction/semantics elements are treated as mrow-like (#19118)

w3c/mathml#26
w3c/mathml#100

This also checks a bit annotation/annotation-xml and display: math.
--

wpt-commits: 8b04cca826ffcbfe3f0f101f9824b8fb0003e21d
wpt-pr: 19118
dbaron pushed a commit to dbaron/gecko that referenced this issue Sep 19, 2019
…emantics elements are treated…, a=testonly

Automatic update from web-platform-tests
Add tests to check that legacy maction/semantics elements are treated as mrow-like (#19118)

w3c/mathml#26
w3c/mathml#100

This also checks a bit annotation/annotation-xml and display: math.
--

wpt-commits: 8b04cca826ffcbfe3f0f101f9824b8fb0003e21d
wpt-pr: 19118
gecko-dev-updater pushed a commit to marco-c/gecko-dev-comments-removed that referenced this issue Oct 4, 2019
…emantics elements are treated…, a=testonly

Automatic update from web-platform-tests
Add tests to check that legacy maction/semantics elements are treated as mrow-like (#19118)

w3c/mathml#26
w3c/mathml#100

This also checks a bit annotation/annotation-xml and display: math.
--

wpt-commits: 8b04cca826ffcbfe3f0f101f9824b8fb0003e21d
wpt-pr: 19118

UltraBlame original commit: f218a08f17b082a92dedcc4f88df9f8b619d3a1d
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified-and-comments-removed that referenced this issue Oct 4, 2019
…emantics elements are treated…, a=testonly

Automatic update from web-platform-tests
Add tests to check that legacy maction/semantics elements are treated as mrow-like (#19118)

w3c/mathml#26
w3c/mathml#100

This also checks a bit annotation/annotation-xml and display: math.
--

wpt-commits: 8b04cca826ffcbfe3f0f101f9824b8fb0003e21d
wpt-pr: 19118

UltraBlame original commit: f218a08f17b082a92dedcc4f88df9f8b619d3a1d
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified that referenced this issue Oct 4, 2019
…emantics elements are treated…, a=testonly

Automatic update from web-platform-tests
Add tests to check that legacy maction/semantics elements are treated as mrow-like (#19118)

w3c/mathml#26
w3c/mathml#100

This also checks a bit annotation/annotation-xml and display: math.
--

wpt-commits: 8b04cca826ffcbfe3f0f101f9824b8fb0003e21d
wpt-pr: 19118

UltraBlame original commit: f218a08f17b082a92dedcc4f88df9f8b619d3a1d
@NSoiffer
Copy link
Contributor

Needs a polyfill, so reopening.

@NSoiffer NSoiffer reopened this May 20, 2020
@fred-wang fred-wang removed the MathML Core Issues affecting the MathML Core specification label May 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compatibility Issues affecting backward compatibility css / html5 Issues related to CSS or HTML5 interoperability MathML 4 Issues affecting the MathML 4 specification need polyfill Issues requiring implementation changes
Projects
None yet
Development

No branches or pull requests

3 participants