Skip to content

Commit

Permalink
Rename math-style values from display/inline to normal/compact.
Browse files Browse the repository at this point in the history
This also changes the default to "normal" but does not affect MathML
since the value on the <math> root is set by the UA sheet.

https://github.com/mathml-refresh/mathml/issues/170
  • Loading branch information
fred-wang committed Jun 16, 2020
1 parent dcc8051 commit 8132e86
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 36 deletions.
56 changes: 28 additions & 28 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ <h4>The Top-Level <code>&lt;math&gt;</code> Element</h4>
default values for the <a><code>display</code></a>
(<code>math</code> or <code>inline-math</code>)
and <a><code>math-style</code></a>
(<code>block</code> or <code>inline</code>) properties.
(<code>normal</code> or <code>compact</code>) properties.
If the <code>display</code>
attribute is absent or has an invalid value, the User Agent
stylesheet treats it the same as <code>inline</code>.
Expand Down Expand Up @@ -580,8 +580,8 @@ <h4>The <code>displaystyle</code> and <code>scriptlevel</code> attributes</h4>
<a data-cite="HTML#presentational-hints">presentational hint</a> setting the element's
<a><code>math-style</code></a>
property to the corresponding value.
More precisely, <code>true</code> is mapped to <code>display</code> and
<code>false</code> to <code>inline</code>.
More precisely, <code>true</code> is mapped to <code>normal</code> and
<code>false</code> to <code>compact</code>.
This attribute indicates whether formulas should try to minimize
the logical height (value is <code>false</code>) or not
(value is <code>true</code>) e.g. by changing the size of content or
Expand Down Expand Up @@ -1960,7 +1960,7 @@ <h4>Layout of operators</h4>
<li>
If the operator has the <a>largeop</a> property and
if <a><code>math-style</code></a> on
the <code>&lt;mo&gt;</code> element is <code>display</code>,
the <code>&lt;mo&gt;</code> element is <code>normal</code>,
then:
<ol>
<li>
Expand Down Expand Up @@ -2526,16 +2526,16 @@ <h5>Fraction with nonzero line thickness</h5>
<li>
<a>FractionNumeratorShiftUp</a> (respectively
<a>FractionNumeratorDisplayStyleShiftUp</a>) if
the <a>math-style</a> is <code>inline</code>
(respectively <code>display</code>).
the <a>math-style</a> is <code>compact</code>
(respectively <code>normal</code>).
</li>
<li>
The <a>AxisHeight</a> + half the
<a>fraction line thickness</a> +
<a>FractionNumeratorGapMin</a>
(respectively <a>FractionNumDisplayStyleGapMin</a>)
if the <a>math-style</a> is <code>inline</code>
(respectively <code>display</code>) +
if the <a>math-style</a> is <code>compact</code>
(respectively <code>normal</code>) +
the <a>ink line-descent</a> of the <a>numerator</a>'s <a>margin box</a>.
</li>
</ul>
Expand All @@ -2544,15 +2544,15 @@ <h5>Fraction with nonzero line thickness</h5>
<li>
<a>FractionDenominatorShiftDown</a> (respectively
<a>FractionDenominatorDisplayStyleShiftDown</a>) if
the <a>math-style</a> is <code>inline</code>
(respectively <code>display</code>).
the <a>math-style</a> is <code>compact</code>
(respectively <code>normal</code>).
</li>
<li>
Half the <a>fraction line thickness</a> +
<a>FractionDenominatorGapMin</a>
(respectively <a>FractionDenomDisplayStyleGapMin</a>)
if the <a>math-style</a> is <code>inline</code>
(respectively <code>display</code>) +
if the <a>math-style</a> is <code>compact</code>
(respectively <code>normal</code>) +
the <a>ink line-ascent</a> of the <a>denominator</a>'s <a>margin box</a>
the <a>AxisHeight</a>.
</li>
Expand Down Expand Up @@ -2643,24 +2643,24 @@ <h5>Fraction with zero line thickness</h5>
any stretch size constraint.
</p>
<p>
If the <a>math-style</a> is <code>inline</code> then
If the <a>math-style</a> is <code>compact</code> then
<code>TopShift</code> and
<code>BottomShift</code> are respectively
set to <a>StackTopShiftUp</a> and <a>StackBottomShiftDown</a>.
Otherwise <a>math-style</a> is <code>display</code>) and
Otherwise <a>math-style</a> is <code>normal</code> and
they are respectively set to <a>StackTopDisplayStyleShiftUp</a>
and <a>StackBottomDisplayStyleShiftDown</a>).
and <a>StackBottomDisplayStyleShiftDown</a>.
</p>
<p>
The <code>Gap</code> is defined to be
(<code>BottomShift</code>
the <a>ink line-ascent</a> of the <a>denominator</a>'s <a>margin box</a>) +
(<code>TopShift</code>
the <a>ink line-descent</a> of the <a>numerator</a>'s <a>margin box</a>).
If <a>math-style</a> is <code>inline</code>
If <a>math-style</a> is <code>compact</code>
then <code>GapMin</code>
is <a>StackGapMin</a>
otherwise <a>math-style</a> is <code>display</code>
otherwise <a>math-style</a> is <code>normal</code>
and it is <a>StackDisplayStyleGapMin</a>.
If Δ = <code>GapMin</code><code>Gap</code> is positive then
<code>TopShift</code> and <code>BottomShift</code>
Expand Down Expand Up @@ -2802,9 +2802,9 @@ <h5>Radical symbol</h5>
<p>
The <dfn>radical gap</dfn> is given by
<a>RadicalVerticalGap</a>
if the <a>math-style</a> is <code>inline</code> and
if the <a>math-style</a> is <code>compact</code> and
<a>RadicalDisplayStyleVerticalGap</a>
if the <a>math-style</a> is <code>display</code>.
if the <a>math-style</a> is <code>normal</code>.
</p>
<p>
The radical target size for the stretchy radical glyph is
Expand Down Expand Up @@ -3638,7 +3638,7 @@ <h5>Children of <code>&lt;munder&gt;</code>,
If the
<code>&lt;munder&gt;</code>, <code>&lt;mover&gt;</code> or
<code>&lt;munderover&gt;</code> element have a computed
<a>math-style</a> property equal to <code>inline</code>
<a>math-style</a> property equal to <code>compact</code>
and their base is an <a>embellished operator</a> with the
<a><code>movablelimits</code></a> property, then
their layout algorithms are respectively
Expand Down Expand Up @@ -4786,8 +4786,8 @@ <h3>The <code>math-style</code> property</h3>
<dfn><code>math-style</code></dfn>
</td>
</tr>
<tr><th>Value:</th><td><code>display | inline</code></td></tr>
<tr><th>Initial:</th><td><code>inline</code></td></tr>
<tr><th>Value:</th><td><code>normal | compact</code></td></tr>
<tr><th>Initial:</th><td><code>normal</code></td></tr>
<tr><th>Applies to:</th><td>All elements</td></tr>
<tr><th>Inherited:</th><td>yes</td></tr>
<tr><th>Percentages:</th><td>n/a</td></tr>
Expand All @@ -4798,7 +4798,7 @@ <h3>The <code>math-style</code> property</h3>
</tbody>
</table>
<p>
When <code>math-style</code> is <code>inline</code>,
When <code>math-style</code> is <code>compact</code>,
the math layout on descendants try to minimize the
<a data-cite="CSS-WRITING-MODES-3#extent">logical height</a> by
applying the following rules:
Expand All @@ -4824,8 +4824,8 @@ <h3>The <code>math-style</code> property</h3>
<p>The following example shows a
mathematical formula renderered with
its <a><code>&lt;math&gt;</code></a> root styled with
<code>math-style: inline</code> (left) and
<code>math-style: display</code> (right).
<code>math-style: normal</code> (left) and
<code>math-style: compact</code> (right).
In the former case, the font-size is automatically scaled down
within the fractions and the summation limits are rendered as
subscript and superscript of the ∑. In the latter case, the ∑ is
Expand Down Expand Up @@ -4885,7 +4885,7 @@ <h3>The <code>math-superscript-shift-style</code> property</h3>
</p>
<div class="example" id="math-superscript-shift-style-example">
<p>In the following example, the two "x squared" are rendered with
inline <a>math-style</a> and the same <code>font-size</code>.
compact <a>math-style</a> and the same <code>font-size</code>.
However, the one within the square root is rendered with
inline <code>math-superscript-shift-style</code> while
the other one is rendered with
Expand Down Expand Up @@ -4920,7 +4920,7 @@ <h3>New value <code>scriptlevel()</code> function for font-size</h3>
<li>If the specified value of <a>font-size</a> is
<code>scriptlevel(auto)</code> and
the inherited value of <a>math-style</a>
is <code>inline</code> then the <a>internal scriptlevel</a> of
is <code>compact</code> then the <a>internal scriptlevel</a> of
the element is the one of its parent plus one.
</li>
<li>If the specified value of <a>font-size</a> is of
Expand Down Expand Up @@ -4970,7 +4970,7 @@ <h3>New value <code>scriptlevel()</code> function for font-size</h3>
</ol>
<div class="example" id="font-size-scriptlevel-example">
<p>The following example shows a mathematical formula
with display <a>math-style</a>
with normal <a>math-style</a>
rendered with the Latin Modern Math font.
When entering subexpressions like scripts or fractions,
the font-size is automatically scaled down according to the
Expand Down
6 changes: 3 additions & 3 deletions user-agent-stylesheet/math.css
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ math {
font-size: inherit;
font-style: normal;
font-family: math;
math-style: inline;
math-style: compact;
math-superscript-shift-style: display;
}
math[display="block" i] {
display: math;
math-style: display;
math-style: normal;
}
math[display="inline" i] {
display: inline-math;
math-style: inline;
math-style: compact;
}
4 changes: 2 additions & 2 deletions user-agent-stylesheet/mfrac.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ mfrac {
}
mfrac > * {
font-size: scriptlevel(auto);
math-style: inline;
math-style: compact;
}
mfrac > :nth-child(2) {
math-superscript-shift-style: inline;
math-superscript-shift-style: compact;
}
2 changes: 1 addition & 1 deletion user-agent-stylesheet/mtable.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
mtable {
display: inline-table;
math-style: inline;
math-style: compact;
}
2 changes: 1 addition & 1 deletion user-agent-stylesheet/radicals.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
mroot > :not(:first-child) {
font-size: scriptlevel(add(2));
math-style: inline;
math-style: compact;
}
mroot, msqrt {
math-superscript-shift-style: inline;
Expand Down
2 changes: 1 addition & 1 deletion user-agent-stylesheet/scripts.css
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ munder > :not(:first-child),
mover > :not(:first-child),
munderover > :not(:first-child) {
font-size: scriptlevel(add(1));
math-style: inline;
math-style: compact;
}
munder[accentunder="true" i] > :nth-child(2),
mover[accent="true" i] > :nth-child(2),
Expand Down

0 comments on commit 8132e86

Please sign in to comment.