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

mrow-like elements and space-like / embellished operator / core operator #183

Closed
fred-wang opened this issue Jan 21, 2020 · 8 comments
Closed
Labels
MathML Core Issues affecting the MathML Core specification MathML 4 Issues affecting the MathML 4 specification

Comments

@fred-wang
Copy link

fred-wang commented Jan 21, 2020

The following elements are laid out as an mrow in MathML Core:

Unknown MathML Elements (e.g. mfenced)

maction
mphantom
mrow
mstyle
semantics
merror

math

mprescripts
none

After #139 #160 and #180, most of these elements use the same definition for space-like and embellished operators. @rwlbuis pointed out that it is not the case of merror, but that sounds a clear mistake to me.

The math element does not have any parent so the fact of being being embellished operator or space-like is not really important in general. The only difference is the case of a math with a single operator and other space-like elements, where the mrow-layout will or will not add space around the operator depending on whether math is treated as an embellished operator. If that's really important, we can add a special case in the https://mathml-refresh.github.io/mathml-core/#layout-of-mrow

The two last ones are generally empty, without padding/border/margin and in any case only used as "markers" inside mmultiscripts. So in general being embellished operator or space-like or laid out as mrow is not important at all ; this change should not be a big deal.

So my proposal is to define "mrow-like" elements to be one of the elements above i.e. the ones using the mrow layout (with perhaps additional CSS rules). Then change the definitions of space-like and embellished operators:

From the spec point of view, introducing a new concept simplifies definitions, improve readability and facilitate maintenance. Maybe the most obvious way to show the latter point is that the definition of Dictionary-based attributes is already out-of-sync: https://mathml-refresh.github.io/mathml-core/#dictionary-based-attributes (I'll open a separate issue for it)

Similarly from the implementer point of view, it's also easier to handle similar elements consistently rather than adding particular cases.

Note that I already followed that approach by introducing https://mathml-refresh.github.io/mathml-core/#dfn-scripted-mathml-elements


So to summarize, the proposal is:

  • Introduce mrow-like element concept corresponding to all the elements currently laid out as mrow.
  • Just use this in the definitions of space-like / embellished operator / core operator.
  • This is changing (fixing) the case of merror.
  • It does not matter for mprescripts and none.
  • We can add an exception for the math root if we really want to preserve the layout of a math with a single mo and space-like children.
@NSoiffer
Copy link
Contributor

The following elements are laid out as an mrow in MathML Core:
Unknown MathML Elements (e.g. mfenced)

The spec seems to be silent on unknown elements other than a list of unknown MathML elements. Does HTML dictate what should happen for other elements? E.g.,span or my-element or my-custom-element (if there is a difference in how a custom element is handled from an unknown one)? If HTML doesn't say what should happen, then the core spec should.

@fred-wang
Copy link
Author

I think the spec does say it e.g. "Unknown MathML elements with display: math behave the same as the mrow element" https://mathml-refresh.github.io/mathml-core/#new-display-math-value and in several other places.

@NSoiffer
Copy link
Contributor

NSoiffer commented Feb 3, 2020

In a call, @davidcarlisle pointed out that the behavior for non-MathML elements not in mtext are specified by the HTML parser to break out of MathML. However, @fred-wang also pointed out that one can manipulate the DOM via Javascript and put them in MathML, so we do need to say what should happen.

@fred-wang
Copy link
Author

@NSoiffer I'm not sure I follow the connection with this issue?

@fred-wang
Copy link
Author

consensus from feb 3: approved with special case for the math root

@fred-wang
Copy link
Author

w3c/mathml-core@b29bdb2

fred-wang added a commit to w3c/mathml-core that referenced this issue Feb 4, 2020
…llished operator / core operator, since it's not included in mrow-like.

w3c/mathml#183
fred-wang added a commit to web-platform-tests/wpt that referenced this issue Feb 4, 2020
fred-wang added a commit to web-platform-tests/wpt that referenced this issue Feb 4, 2020
moz-v2v-gh pushed a commit to mozilla/gecko-dev that referenced this issue Feb 11, 2020
Automatic update from web-platform-tests
Update space-like tests. (#21568)

w3c/mathml#183
--

wpt-commits: 56c5d893f8a3fc6cf2a889d1c42616098ac7959b
wpt-pr: 21568
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified-and-comments-removed that referenced this issue Feb 12, 2020
Automatic update from web-platform-tests
Update space-like tests. (#21568)

w3c/mathml#183
--

wpt-commits: 56c5d893f8a3fc6cf2a889d1c42616098ac7959b
wpt-pr: 21568

UltraBlame original commit: 83194ea778725b67db177ae0c1333449101e6e00
gecko-dev-updater pushed a commit to marco-c/gecko-dev-comments-removed that referenced this issue Feb 12, 2020
Automatic update from web-platform-tests
Update space-like tests. (#21568)

w3c/mathml#183
--

wpt-commits: 56c5d893f8a3fc6cf2a889d1c42616098ac7959b
wpt-pr: 21568

UltraBlame original commit: 83194ea778725b67db177ae0c1333449101e6e00
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified that referenced this issue Feb 12, 2020
Automatic update from web-platform-tests
Update space-like tests. (#21568)

w3c/mathml#183
--

wpt-commits: 56c5d893f8a3fc6cf2a889d1c42616098ac7959b
wpt-pr: 21568

UltraBlame original commit: 83194ea778725b67db177ae0c1333449101e6e00
xeonchen pushed a commit to xeonchen/gecko that referenced this issue Feb 12, 2020
Automatic update from web-platform-tests
Update space-like tests. (#21568)

w3c/mathml#183
--

wpt-commits: 56c5d893f8a3fc6cf2a889d1c42616098ac7959b
wpt-pr: 21568
@NSoiffer
Copy link
Contributor

@fred-wang: can this be closed? If not, what's left to do?

fred-wang added a commit to web-platform-tests/wpt that referenced this issue Mar 21, 2020
This commit updates tests after [1] [2]:

* merror, mprescripts, none, unknown are now treated as other mrow-like
  elements.
* maction and semantics are moved into a separate file and new tests
  added now that they are mrow-like elements with some hidden children.

[1] w3c/mathml#182
[2] w3c/mathml#183
@fred-wang
Copy link
Author

@fred-wang: can this be closed? If not, what's left to do?

tests for space-like definition have been updated but we need to do that for embellished op too. Doing it in web-platform-tests/wpt#22381

@fred-wang fred-wang added MathML 4 Issues affecting the MathML 4 specification MathML Core Issues affecting the MathML Core specification need tests Issues related to writing WPT tests labels Mar 21, 2020
fred-wang added a commit to web-platform-tests/wpt that referenced this issue Mar 22, 2020
This commit updates tests after [1] [2]:

* merror, mprescripts, none, unknown are now treated as other mrow-like
  elements.
* maction and semantics are moved into a separate file and new tests
  added now that they are mrow-like elements with some hidden children.

[1] w3c/mathml#182
[2] w3c/mathml#183
@fred-wang fred-wang removed the need tests Issues related to writing WPT tests label Mar 22, 2020
xeonchen pushed a commit to xeonchen/gecko that referenced this issue Mar 26, 2020
…ators., a=testonly

Automatic update from web-platform-tests
Update MathML tests for embellished operators. (#22381)

This commit updates tests after [1] [2]:

* merror, mprescripts, none, unknown are now treated as other mrow-like
  elements.
* maction and semantics are moved into a separate file and new tests
  added now that they are mrow-like elements with some hidden children.

[1] w3c/mathml#182
[2] w3c/mathml#183
--

wpt-commits: c38ae4ac2e0af285deb06f33c75e1699d0718942
wpt-pr: 22381
moz-v2v-gh pushed a commit to mozilla/gecko-dev that referenced this issue Mar 26, 2020
…ators., a=testonly

Automatic update from web-platform-tests
Update MathML tests for embellished operators. (#22381)

This commit updates tests after [1] [2]:

* merror, mprescripts, none, unknown are now treated as other mrow-like
  elements.
* maction and semantics are moved into a separate file and new tests
  added now that they are mrow-like elements with some hidden children.

[1] w3c/mathml#182
[2] w3c/mathml#183
--

wpt-commits: c38ae4ac2e0af285deb06f33c75e1699d0718942
wpt-pr: 22381
gecko-dev-updater pushed a commit to marco-c/gecko-dev-comments-removed that referenced this issue Mar 31, 2020
…ators., a=testonly

Automatic update from web-platform-tests
Update MathML tests for embellished operators. (#22381)

This commit updates tests after [1] [2]:

* merror, mprescripts, none, unknown are now treated as other mrow-like
  elements.
* maction and semantics are moved into a separate file and new tests
  added now that they are mrow-like elements with some hidden children.

[1] w3c/mathml#182
[2] w3c/mathml#183
--

wpt-commits: c38ae4ac2e0af285deb06f33c75e1699d0718942
wpt-pr: 22381

UltraBlame original commit: 8e8fe19364e1c1ddc7d7ce589aa2fd8d8e23572c
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified-and-comments-removed that referenced this issue Mar 31, 2020
…ators., a=testonly

Automatic update from web-platform-tests
Update MathML tests for embellished operators. (#22381)

This commit updates tests after [1] [2]:

* merror, mprescripts, none, unknown are now treated as other mrow-like
  elements.
* maction and semantics are moved into a separate file and new tests
  added now that they are mrow-like elements with some hidden children.

[1] w3c/mathml#182
[2] w3c/mathml#183
--

wpt-commits: c38ae4ac2e0af285deb06f33c75e1699d0718942
wpt-pr: 22381

UltraBlame original commit: 8e8fe19364e1c1ddc7d7ce589aa2fd8d8e23572c
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified that referenced this issue Mar 31, 2020
…ators., a=testonly

Automatic update from web-platform-tests
Update MathML tests for embellished operators. (#22381)

This commit updates tests after [1] [2]:

* merror, mprescripts, none, unknown are now treated as other mrow-like
  elements.
* maction and semantics are moved into a separate file and new tests
  added now that they are mrow-like elements with some hidden children.

[1] w3c/mathml#182
[2] w3c/mathml#183
--

wpt-commits: c38ae4ac2e0af285deb06f33c75e1699d0718942
wpt-pr: 22381

UltraBlame original commit: 8e8fe19364e1c1ddc7d7ce589aa2fd8d8e23572c
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
Projects
None yet
Development

No branches or pull requests

2 participants