Bug 123018

Summary: Implement MathML bidi
Product: WebKit Reporter: Frédéric Wang (:fredw) <fred.wang>
Component: MathMLAssignee: Nobody <webkit-unassigned>
Status: NEW ---    
Severity: Normal CC: bfulgham, mrobinson
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
URL: http://www.w3.org/TR/MathML3/chapter3.html#presm.bidi
Bug Depends on: 130840, 124121, 124572, 130839    
Bug Blocks:    

Description Frédéric Wang (:fredw) 2013-10-18 06:38:02 PDT
I think just mapping the attribute "dir" (on the math, mstyle, mrow and token elements with the default math@dir=ltr) to the CSS property "direction" will make most constructions work correctly. However, some MathML constructions might need more work.

In particular, stretchy operators must be mirrored. There are Open Type MATH features to do that mirroring but using a scale transform is OK in most cases (except for things like clockwise integrals where mirroring changes the semantic).

Testcase from the Mozilla bug for the "overall directionality"

More advanced testcase:

See also the MathML test suite:
Comment 1 Frédéric Wang (:fredw) 2013-10-18 06:45:19 PDT
Rationale for why I open this now: MathML bidi is needed on mtext for MathJax error messages in RTL languages. Doing the attribute-to-CSS mapping will help to render the messages correctly when WebKit's Native MathML is used.