w3c / mathml

MathML4 editors draft
https://w3c.github.io/mathml/
Other
60 stars 18 forks source link

CSS interoperability with vertical-align #13

Open dani31415 opened 5 years ago

dani31415 commented 5 years ago

The CSS vertical-align property should work as per specification with MathML (CSS spec). The resolution of this issue is perhaps just related to create some tests and does not affect the MathML specification.

Some examples are

<img height="40" src="https://www.w3.org/html/logo/img/mark-word-icon.png">
<math><mi style="vertical-align:top">24</mi></math>

with result

Top alignment

and

<math>
    <mn>4</mn>
    <mo>-</mo>  
    <mfenced>
        <mrow style="vertical-align:middle">
            <mfrac>
                <mfrac>
                    <mi>x</mi>
                    <mn>2</mn>
                </mfrac>
                <mn>2</mn>
            </mfrac>
        </mrow>
    </mfenced>
</math>

with result

Fractions and vertical alignment

fred-wang commented 5 years ago

I think this makes sense for the long term, IMHO it's way too early to consider this for the Core spec. Igalia is still working with Google to clarify the box and layout models, so I'd prefer to keep things simple and just ignore the vertical-align value for box layout for now.

fred-wang commented 5 years ago

I think vertical-align is not what we want. It is is supposed to apply to inline boxes.

The dominant-baseline property looks closer to what we want: https://www.w3.org/TR/css-inline-3/#propdef-dominant-baseline

NSoiffer commented 5 years ago

I wasn't aware that there was a "dominant-baseline" property. Interestingly they mention a value of mathematical. They don't use the word "axis" in their description of it, but it seems like we can influence the language they used (it is marked with an issue that the section is being rewritten) and perhaps this is a way to get the notion of math axis into CSS...

fred-wang commented 5 years ago

This is mentioned in the current core spec: https://mathml-refresh.github.io/mathml-core/#box-model

NSoiffer commented 4 years ago

What's left to do? Can this be closed or does some other issue need to be resolved before this can be closed?

NSoiffer commented 4 years ago

Need to write a test that shows setting vertical-align does nothing.

rwlbuis commented 4 years ago

I will try to add that test.