Skip to content

Commit 23b88c8

Browse files
committed
Point to the MathML Core spec for the actual proposals.
1 parent 691770c commit 23b88c8

4 files changed

+8
-1506
lines changed

generate-math-variant-tables.py

-105
This file was deleted.

math-script-level-and-math-style-explainer.md

+6-145
Original file line numberDiff line numberDiff line change
@@ -86,10 +86,7 @@ on this proposal see
8686

8787
* OpenType math fonts have values about how the script should scale down when
8888
going from script level 0 to script level 1 (`scriptPercentScaleDown`) or 2
89-
(`scriptScriptPercentScaleDown`). Although this propopal simply uses constant
90-
values, in theory the evolution of font-size could depend on these
91-
parameters. If they are considered in the future, having actual script level
92-
values would help implementers.
89+
(`scriptScriptPercentScaleDown`).
9390

9491
## Status in Web Engines
9592

@@ -110,150 +107,14 @@ on this proposal see
110107

111108
### CSS `math-style` property
112109

113-
<table>
114-
<tbody>
115-
<tr><th>Name:</th><td>'math-style'</td></tr>
116-
<tr><th>Value:</th><td>display | inline</td></tr>
117-
<tr><th>Initial:</th><td>inline</td></tr>
118-
<tr><th>Applies to:</th><td>All elements</td></tr>
119-
<tr><th>Inherited:</th><td>yes</td></tr>
120-
<tr><th>Percentages:</th><td>n/a</td></tr>
121-
<tr><th>Media:</th><td>visual</td></tr>
122-
<tr><th>Computed value:</th><td>specified keyword</td></tr>
123-
<tr><th>Canonical order:</th><td>n/a</td></tr>
124-
<tr><th>Animation type:</th><td>not animatable</td></tr>
125-
</tbody>
126-
</table>
127-
128-
If the value of `math-style` is 'inline', the math layout on descendants
129-
should try to minimize the
130-
[logical height](https://drafts.csswg.org/css-writing-modes-4/#extent).
131-
This includes how `font-size` is changed when `math-script-level` is 'auto'
132-
as well
133-
miscelleanous layout rules described for the `displaystyle` attribute of MathML.
134-
If the value of `math-style` is 'display', the math layout should not take
135-
such constraints into consideration.
110+
See https://mathml-refresh.github.io/mathml-core/#the-math-style-property
136111

137112
### CSS `math-script-level` property
138113

139-
<table>
140-
<tbody>
141-
<tr><th>Name:</th><td>math-script-level'</td></tr>
142-
<tr><th>Value:</th><td>auto | add(&lt;integer&gt;) | &lt;integer&gt;</td></tr>
143-
<tr><th>Initial:</th><td>0</td></tr>
144-
<tr><th>Applies to:</th><td>All elements</td></tr>
145-
<tr><th>Inherited:</th><td>yes</td></tr>
146-
<tr><th>Percentages:</th><td>n/a</td></tr>
147-
<tr><th>Media:</th><td>visual</td></tr>
148-
<tr><th>Computed value:</th><td>see individual properties</td></tr>
149-
<tr><th>Canonical order:</th><td>n/a</td></tr>
150-
<tr><th>Animation type:</th><td>not animatable</td></tr>
151-
</tbody>
152-
</table>
153-
154-
If the specified value of `math-script-level` is 'auto' and the inherited
155-
value of `math-style` is 'display' then the computed value of
156-
`math-script-level` is the inherited value.
157-
158-
If the specified value of `math-script-level` is 'auto' and the inherited
159-
value of `math-style` is 'inline' then the computed value of
160-
`math-script-level` is the inherited value plus one.
161-
162-
If the specified value of `math-script-level` is of the form
163-
'add(&lt;integer&gt;)' then
164-
the computed value of `math-script-level` is the inherited value
165-
plus the specified integer.
166-
167-
If the specified value of `math-script-level` is of the form '&lt;integer&gt;'
168-
then the computed value of `math-script-level` is set to the specified integer.
169-
170-
If `font-size` is specified or if the specified value of `math-script-level`
171-
is `initial` then `math-script-level` does not affect the computed value of
172-
`font-size`.
173-
Otherwise, the computed value of `font-size` is obtained by multiplying the
174-
inherited value of `font-size` by a nonzero scale factor calculated by the
175-
following procedure:
176-
177-
1. Let A be the inherited `math-script-level`, B the computed
178-
`math-script-level`, C be 0.71 and S be 1.0
179-
* If A = B then return S.
180-
* If B < A, swap A and B and set `InvertScaleFactor` to true.
181-
* Otherwise B > A and set `InvertScaleFactor` to false.
182-
2. Let E be B - A > 0.
183-
3. If the inherited font has an OpenType MATH table:
184-
* Read `scriptPercentScaleDown` and fallback to C if the MathVariants table is absent or provides a null value.
185-
* Read `scriptScriptPercentScaleDown` and fallback to C<sup>2</sup> if the MathVariants table is absent or provides a null value.
186-
* If A ≤ 0 and B ≥ 2 then multiply S by `scriptScriptPercentScaleDown` and
187-
decrement E by 2.
188-
* Otherwise if A = 1 then multiply S by
189-
`scriptScriptPercentScaleDown` / `scriptPercentScaleDown` and
190-
decrement E by 1.
191-
* Otherwise if B = 1 then multiply S by `scriptPercentScaleDown`
192-
and decrement E by 1.
193-
4. Multiply S by C<sup>E</sup>
194-
5. Return S if `InvertScaleFactor` is false and 1/S otherwise.
114+
See https://mathml-refresh.github.io/mathml-core/#the-math-style-property
195115

196116
### Native implementations of `display`, `displaystyle` and `scriptlevel`
197117

198-
The proposal allows to partially implement the `display`, `displaystyle` and
199-
`scriptlevel` attributes as follows:
200-
201-
* Map `scriptlevel="+U"` to 'math-script-level: add(U)' (where U is an [unsigned integer](https://www.w3.org/Math/draft-spec/chapter2.html#type.unsigned-integer)).
202-
* Map `scriptlevel="-U"` to 'math-script-level: add(-U)' (where U is an [unsigned integer](https://www.w3.org/Math/draft-spec/chapter2.html#type.unsigned-integer)).
203-
* Map `scriptlevel="U"` to 'math-script-level: U' (where U is an [unsigned integer](https://www.w3.org/Math/draft-spec/chapter2.html#type.unsigned-integer)).
204-
205-
Then add rules equivalent to the following user agent stylesheet for MathML.
206-
Note that some rendering engines do not allow universal selectors in their
207-
user agent stylesheets and so such rules must be expanded to list all possible
208-
MathML elements.
209-
210-
<pre>
211-
@namespace url(http://www.w3.org/1998/Math/MathML);
212-
213-
math {
214-
math-style: inline;
215-
math-script-level: initial;
216-
}
217-
math[display="block"] {
218-
math-style: display;
219-
}
220-
math[display="inline"] {
221-
math-style: inline;
222-
}
223-
math[displaystyle="false"] {
224-
math-style: inline;
225-
}
226-
math[displaystyle="true"] {
227-
math-style: display;
228-
}
229-
mtable {
230-
math-style: inline;
231-
}
232-
mtable[displaystyle="true"] {
233-
math-style: display;
234-
}
235-
mstyle[displaystyle="false"] {
236-
math-style: inline;
237-
}
238-
mstyle[displaystyle="true"] {
239-
math-style: display;
240-
}
241-
mfrac > * {
242-
math-script-level: auto;
243-
math-style: inline;
244-
}
245-
mroot > :not(:first-child) {
246-
math-script-level: add(2);
247-
math-style: inline;
248-
}
249-
msub > :not(:first-child),
250-
msup > :not(:first-child),
251-
msubsup > :not(:first-child),
252-
mmultiscripts > :not(:first-child),
253-
munder > :not(:first-child),
254-
mover > :not(:first-child),
255-
munderover > :not(:first-child) {
256-
math-script-level: add(1);
257-
math-style: inline;
258-
}
259-
</pre>
118+
See https://mathml-refresh.github.io/mathml-core/#attribute-display,
119+
https://mathml-refresh.github.io/mathml-core/#attribute-displaystyle
120+
and https://mathml-refresh.github.io/mathml-core/#attribute-scriptlevel

math-variant-explainer.md

+2-21
Original file line numberDiff line numberDiff line change
@@ -104,27 +104,8 @@ on this proposal see [math-variant comments](math-variant-comments.md).
104104

105105
### New CSS `text-transform` values
106106

107-
The proposal is to extend the `text-transform` properties with new values:
108-
109-
`none | [capitalize | uppercase | lowercase ] || full-width || full-size-kana | math-auto | math-bold | math-italic | math-bold-italic | math-double-struck | math-bold-fraktur | math-script | math-bold-script | math-fraktur | math-sans-serif | math-bold-sans-serif | math-sans-serif-italic | math-sans-serif-bold-italic | math-monospace | math-initial | math-tailed | math-looped | math-stretched`
110-
111-
On text nodes containing a unique character, 'math-auto' has the same
112-
effect as 'math-italic', otherwise it has no effects.
113-
114-
For all the other 'math-...' values,
115-
the transformed text is obtained by performing
116-
conversion of each character that have a mapping in the
117-
[math-variant tables](math-variant-tables.md) according
118-
to the specified `math-variant` value.
119-
120-
UAs may decide to rely on italic, bold and bold-italic font-level properties
121-
when available fonts lack the proper glyphs to perform 'math-auto',
122-
'math-italic', 'math-bold', 'math-bold-italic' character-level transforms.
107+
See https://mathml-refresh.github.io/mathml-core/#new-text-transform-values
123108

124109
### Native implementation of the `mathvariant` attribute
125110

126-
The `mathvariant` attribute can be implemented natively by relying on the
127-
`text-transform` property. For any MathML element accepting the `mathvariant`
128-
attribute that has a `mathvariant` attribute with a valid value, set the CSS
129-
property on that element to the corresponding `text-transform` value.
130-
The `normal` value is mapped to 'none'.
111+
See https://mathml-refresh.github.io/mathml-core/#attribute-mathvariant

0 commit comments

Comments
 (0)