Repository navigation
Description
I'm opening this in response to a comment of @fred-wang about some tests I wrote testing how a renderer handles elements that MathML 3 require one or more children:
I don't think the tests for n=1 are correct. It seems to me that all these elements are allowed to have no children. We should only keep the elements that have explicit expected number of children in MathML Core.
This is related to w3c/mathml-core#136 , but I've opened a separate issue because this is about what the spec should require, not the recovery mechanism.
Specifically, this applies to all the elements listed as "1*" (inferred mrow) in the MathML 3 spec. It would be a change to MathML 3 that may or may not have a visual effect depending on the resolution of w3c/mathml-core#136. If 0 elements are considered an error but the recovery mechanism is to add an empty mrow, there is effectly no difference. Similarly, if 0 children are allowed and rendering is implicitly or explictly defined to be equivalent to having an empty mrow, then there is no difference. I did a few spot checks of the current core spec and the descriptions for laying out the elements that I looked at either fall back to mrow's layout or just say "children" and appear to work if there are no children.
Hence, it appears that the only case of a visual difference is if we require 1 or more children and the error recovery mechanism is to layout the element as an mrow. In that case, examples like
<msqrt></msqrt> would not layout as a square root. In the other cases, it would look like a (narrow) square root.
Since I'm in favor of seeing the square root, think we have the following options:
- Resolve Interoperable handling of invalid markup mathml-core#136 according to this comment [add empty mrows/wrap extra childen in an mrow]. As the comment says, this means adding some text to the core spec.
- Change the full spec to allow 0 or more children where it currently says 1 or more
- Don't change core or full. I don't see anything in full that says what should happen if there aren't the correct number of children, so this difference is potentially not important.
Activity
fred-wang commentedon Nov 14, 2019
msqrt does not have any restriction on child count.
NSoiffer commentedon Nov 14, 2019
It does in MathML 3, hence this needs to be addressed, even if it means we consciously do nothing.
davidcarlisle commentedon Nov 14, 2019
@NSoiffer the mml3 schema has the content as
ImpliedMrowwhich is defined byImpliedMrow = MathExpression*so allows zero elements.
davidcarlisle commentedon Nov 14, 2019
https://www.w3.org/TR/MathML3/chapter3.html#presm.inferredmrow
says that 1* allows any number of children including 0 the "1" here was intended to denote the conceptual single mrow child,
NSoiffer commentedon Nov 14, 2019
Good catch. So there is no conflict. I'll close this.