Bug 160075

Summary: Support for multiple alignment values for tabular columnalign and rowalign attributes
Product: WebKit Reporter: Frédéric Wang (:fredw) <fred.wang>
Component: MathMLAssignee: Nobody <webkit-unassigned>
Status: NEW ---    
Severity: Normal CC: alex, distler, rego
Priority: P2    
Version: WebKit Nightly Build   
Hardware: All   
OS: All   
URL: https://www.w3.org/TR/MathML/chapter3.html#presm.tabmat
Attachments:
Description Flags
Testcase columnalign none

Description Frédéric Wang (:fredw) 2016-07-21 23:52:44 PDT
Created attachment 284310 [details]
Testcase columnalign

Our columnalign and rowalign support currently relies on the following CSS rules:

/* Use inline-block for children so that the text-align property is taken into account */
mtd > * {
    display: inline-block;
}

mtable[columnalign="left"], mtr[columnalign="left"], mtd[columnalign="left"] {
    text-align: left;
}

mtable[columnalign="right"], mtr[columnalign="right"], mtd[columnalign="right"] {
    text-align: right;
}

mtable[rowalign="top"] mtd, mtable mtr[rowalign="top"] mtd, mtable mtr mtd[rowalign="top"] {
    vertical-align: top;
}

mtable[rowalign="bottom"] mtd, mtable mtr[rowalign="bottom"] mtd, mtable mtr mtd[rowalign="bottom"] {
    vertical-align: bottom;
}

mtable[rowalign="center"] mtd, mtable mtr[rowalign="center"] mtd, mtable mtr mtd[rowalign="center"] {
    vertical-align: middle;
}

These only handle the basic cases. MathML tables are closer to LaTeX than to HTML and allows multiple alignment rules to be specified in a single attribute.

I'm attaching a testcase from Mozilla's testsuite demonstrating the issue. More can be found at https://dxr.mozilla.org/mozilla-central/source/layout/reftests/mathml/

I think the case of columnalign is particularly important for aligned equations. I noticed it on Wikipedia and Jacques Distler reported the issue too for itex2MML/Instiki.