Bug 118738 - Improve how the script size is determined
Summary: Improve how the script size is determined
Alias: None
Product: WebKit
Classification: Unclassified
Component: MathML (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Nobody
URL: http://www.w3.org/TR/2010/REC-MathML3...
Depends on: scriptlevel
Blocks: 124907
  Show dependency treegraph
Reported: 2013-07-16 10:03 PDT by Frédéric Wang (:fredw)
Modified: 2013-11-26 18:48 PST (History)
0 users

See Also:

testcase (361 bytes, text/html)
2013-07-16 10:24 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) 2013-07-16 10:03:11 PDT
Currently the script size is determined by the following CSS rule in WebCore/css/mathml.css:

msub > * + *, msup > * + *, msubsup > * + *, munder > * + *, mover > * + *, munderover > * + * {
    font-size: 0.75em; /* FIXME: MathML standard is 0.71em */

The MathML specification describes a more complicated way to compute that size using the scriptlevel, scriptminsize and  scriptsizemultiplier attributes. In Gecko these are implemented in the text rendering using private -moz-* CSS properties and then these properties are set by the MathML code. Some elements like scripts, fractions or roots increment the scriptlevel (the exact rules rely on the displaystyle value, see bug 118737).

See also bucket 3 of the MathML Acid3 tests:

and chapter 3 of the MathML spec for details:
Comment 1 Frédéric Wang (:fredw) 2013-07-16 10:24:56 PDT
Created attachment 206795 [details]

Here is a testcase. The scriptsizemultiplier is .5, mroot increments the scriptlevel of its script by 2 and there is no scriptminsize constraint (set to 0). So the size of "SCRIPT" should be 0.5 ^ 2 = 25%, which is the size of "REFERENCE".