w3c / mathml-core

MathML Core draft
https://w3c.github.io/mathml-core
38 stars 14 forks source link

mpadded and percentages #183

Open fred-wang opened 1 year ago

fred-wang commented 1 year ago

I'm extracting this from #75

In MathML 3, percentages are relative to the size of the mpadded element. For example with

<mpadded width="50%">
  <mspace width="100px"/>
</mpadded>

the mpadded would have width=50px. As stated on #75, this behavior is different from CSS and makes implementation more complicate. So percentage values are just ignored in Chrome 109 implementation.

Currently, https://w3c.github.io/mathml-core/#adjust-space-around-content-mpadded does not seem to say how percentage values are handled.

brucemiller commented 1 year ago

The sub-issue I raised in #75 was about the +/- form of dimensions rather than percentages; However, a working % as you describe would provide a much more robust solution to the problem I mentioned.

fred-wang commented 1 year ago

The text is actually:

If the width (respectively height, depth, lspace, voffset) attribute is absent, invalid or a <length-percentage> then the requested width (respectively height, depth, lspace, voffset) is the inner inline size (respectively inner line-ascent, inner line-descent, 0, 0).

which seems a mistake, otherwise all <length-percentage> values are rejected... I'm going to relax this, to only reject percentage, so it's minimum that browsers implement.

bkardell commented 1 year ago

This should be linked to #84, probably which changed the text @fred-wang quoted. The WG discussed this and thought this change in #84 was perhaps too subtle and easy to miss the word "not" on width.