Bug 160075 - Support for multiple alignment values for tabular columnalign and rowalign attributes
Summary: Support for multiple alignment values for tabular columnalign and rowalign at...
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: MathML (show other bugs)
Version: WebKit Nightly Build
Hardware: All All
: P2 Normal
Assignee: Nobody
URL: https://www.w3.org/TR/MathML/chapter3...
Depends on:
Reported: 2016-07-21 23:52 PDT by Frédéric Wang (:fredw)
Modified: 2016-07-21 23:52 PDT (History)
3 users (show)

See Also:

Testcase columnalign (5.44 KB, text/html)
2016-07-21 23:52 PDT, Frédéric Wang (:fredw)
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
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.