From 70d0ba62efe1da8f826ec36c21be4fe093642a8f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Wang?=
The
For all scripted elements, the rule of thumb is to set
Fractions
<mfrac>
displaystyle
to false
,
or if it was already false
increments
scriptlevel
by 1, within its children.
- It sets math-superscript-shift-style to
- inline
within its second child.
+ It sets math-shift to
+ compact
within its second child.
To avoid visual confusion between the fraction bar and another
adjacent items (e.g. minus sign or another fraction's bar),
a default 1-pixel space is added around the element.
@@ -2476,7 +2476,7 @@ Fractions
In practice, an <mfrac>
<mfrac>
element has two children
that are in-flow. Hence the CSS rules basically performs
scriptlevel
, displaystyle
- and math-superscript-shift-style
+ and math-shift
changes for the numerator and
denominator.
@@ -2742,8 +2742,8 @@ Radicals
<msqrt>
, <mroot>
<msqrt>
and <mroot>
- elements sets math-superscript-shift-style to
- inline
.
+ elements sets math-shift to
+ compact
.
The <mroot>
element sets
increments scriptlevel
by 2, and sets displaystyle
to "false" in all
but its first child.
@@ -3404,8 +3404,8 @@ Base with superscript
inline
, or
+ math-shift property equal to
+ compact
, or
SuperscriptShiftUp otherwise.Base with prescripts and postscripts
Displaystyle, scriptlevel and math-superscript-shift-style in scripts
+ Displaystyle, scriptlevel and math-shift in scripts
displaystyle
to false
and
@@ -4378,21 +4378,21 @@ Displaystyle, scriptlevel and math-superscript-shift-style in scripts
their second child.
<mmultiscripts>
sets
- math-superscript-shift-style
to
- inline
on its children at even position if they are
+ math-shift
to
+ compact
on its children at even position if they are
before an <mprescripts>, and on those at odd position
if they are after
an <mprescripts>.
The <msub<
and <msubsup<
- elements set math-superscript-shift-style
to
- inline
on their second child.
+ elements set math-shift
to
+ compact
on their second child.
An <mover>
and
<munderover>
elements with an accent
attribute that is an
ASCII case-insensitive
- match to "true"
also sets math-superscript-shift-style
to
- inline
within their first child.
+ match to "true"
also sets math-shift
to
+ compact
within their first child.
The @@ -4406,7 +4406,7 @@
<mprescript>
is empty.
Hence the CSS rules essentially performs automatic displaystyle
and
scriptlevel
changes for the scripts ; and
- math-superscript-shift-style
changes for
+ math-shift
changes for
subscripts and sometimes the base.
@@ -4849,18 +4849,18 @@ math-style
propertymath-superscript-shift-style
propertymath-shift
propertyName: |
- math-superscript-shift-style
+ math-shift
|
---|---|
Value: | display | inline |
Initial: | display |
Value: | normal | compact |
Initial: | normal |
Applies to: | All elements |
Inherited: | yes |
Percentages: | n/a |
- If the value of math-superscript-shift-style
is inline
, the math layout on descendants will use the
+ If the value of math-shift
is compact
, the math layout on descendants will use the
superscriptShiftUpCramped parameter to place superscript.
- If the value of math-superscript-shift-style
is display
, the math
+ If the value of math-shift
is normal
, the math
will use the superscriptShiftUp parameter instead.
@@ -4883,21 +4883,22 @@
math-superscript-shift-style
propertyIn the following example, the two "x squared" are rendered with
compact math-style and the same font-size
.
However, the one within the square root is rendered with
- inline math-superscript-shift-style
while
+ compact math-shift
while
the other one is rendered with
- display math-superscript-shift-style
, leading
+ normal math-shift
, leading
to subtle different shift of the superscript "2".
Per [[TeXBook]], a - mathematical formula uses non-cramped style by default but may - switch to cramped style within some subformulas + mathematical formula uses normal style by default but may + switch to compact style ("cramped" in TeX's terminology) + within some subformulas (e.g. radicals, fraction denominators, etc). - The math-superscript-shift-style property allows to easily + The math-shift property allows to easily implement these rules for MathML in the User Agent Stylesheet. Page authors or developers of polyfill may also benefit from @@ -5513,7 +5514,7 @@