source: webkit/trunk/Source/WebCore/css/mathml.css

Last change on this file was 280581, checked in by [email protected], 4 years ago

[css-cleanup] Replace webkit- prefix properties with Standard CSS Properties in Source/
https://bugs.webkit.org/show_bug.cgi?id=228697

Patch by Sonia Singla <[email protected]> on 2021-08-02
Reviewed by Frédéric Wang.

  • Modules/mediacontrols/mediaControlsApple.css:

(video::-webkit-media-controls-closed-captions-container h3,):

  • Modules/mediacontrols/mediaControlsBase.css:

(video::-webkit-media-controls-closed-captions-container h3,):
(video::-webkit-media-controls-closed-captions-container li.selected::before,):

  • css/html.css:

(p):
(blockquote):
(figure):
(hr):
(h1):
(:is(article, aside, nav, section) h1):
(:is(article, aside, nav, section) :is(article, aside, nav, section) h1):
(:is(article, aside, nav, section) :is(article, aside, nav, section) :is(article, aside, nav, section) h1):
(:is(article, aside, nav, section) :is(article, aside, nav, section) :is(article, aside, nav, section) :is(article, aside, nav, section) h1):
(:is(article, aside, nav, section) :is(article, aside, nav, section) :is(article, aside, nav, section) :is(article, aside, nav, section) :is(article, aside, nav, section) h1):
(h2):
(h3):
(h4):
(h5):
(h6):
(ul, menu, dir):
(ol):
(dd):
(dl):
(ol ul, ul ol, ul ul, ol ol):
(legend):
(fieldset):

  • css/mathml.css:

(mi):
(msub > mi:first-child, msubsup > mi:first-child):
(msubsup > mi:first-child + * + *):

File size: 8.9 KB
Line 
1/*
2 * Copyright (C) 2020 Apple Inc. All rights reserved.
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
6 * are met:
7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
12 *
13 * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
14 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
17 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
18 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
19 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
20 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
21 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
22 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23 */
24
25#if defined(ENABLE_MATHML) && ENABLE_MATHML
26
27@namespace "http://www.w3.org/1998/Math/MathML";
28
29:any-link {
30 color: -webkit-link;
31 cursor: auto;
32}
33
34:any-link:active {
35 color: -webkit-activelink;
36}
37
38:focus {
39 outline: auto 5px -webkit-focus-ring-color
40}
41
42math {
43 display: inline;
44 math-style: compact;
45
46 /*
47 We use the exact bounding boxes of glyphs to avoid excessive gaps in mathematical formulas.
48 FIXME: Should we replace this with a more general handling of ink/logical ascent/descent?
49 See http://webkit.org/b/130326, http://webkit.org/b/156841 and
50 http://www.mathml-association.org/MathMLinHTML5/S3.html#SS1.SSS1
51 */
52 -webkit-line-box-contain: glyphs replaced;
53
54 /*
55 Inheriting the following properties can cause excessive spacing of mathematical formulas so we
56 just reset them to their default values.
57 */
58 text-indent: 0;
59 line-height: normal;
60 word-spacing: normal;
61 letter-spacing: normal;
62
63 /*
64 In some countries and languages, text is written from right-to-left while mathematical formulas
65 are written from left-to-write. Hence it is wrong to inherit the direction and we reset that
66 property to left-to-write. Per the MathML specification, authors should explicitly use the "dir"
67 attribute on the <math> element if they want to force the overall direction of the mathematical
68 formulas.
69 */
70 direction: ltr;
71
72 /*
73 Mathematical formula inside an italic paragraph should not inherit the font-style as this gives
74 poor rendering and is confusing with the mathvariant italic.
75 */
76 font-style: normal;
77
78 /* Fonts with appropriate Unicode coverage and OpenType features are required for good math
79 rendering. These requirements as well as the up-to-date list of known math fonts to fulfill
80 these requirements are listed on http://trac.webkit.org/wiki/MathML/Fonts.
81 Inheriting the font-family is likely to make MathML use text fonts that are not designed for
82 math layout and thus would cause very poor mathematical rendering. Consequently, the default
83 font-family on the <math> tag is set to a list of recommended math fonts.
84 For best rendering, authors and readers are encouraged to use text and math fonts with consistent
85 style (appearance, size...), see http://trac.webkit.org/wiki/MathML/Fonts#CustomizingMathFont
86 FIXME: Should we make math font properties configurable (http://webkit.org/b/156843)?
87 */
88 font-family:
89 /*
90 This font has Computer Modern style and is provided with most TeX & Linux distributions.
91 We put it as the default because its style is familiar to TeX, Wikipedia and math people.
92 */
93 "Latin Modern Math",
94
95 /*
96 The following fonts have Times style and are provided with most TeX & Linux distributions.
97 We put XITS & STIX as a second option because they have very good unicode coverage.
98 STIX Two is a complete redesign of STIX that fixes serious bugs in version one so we put it in first position.
99 XITS is a fork of STIX with bug fixes and more Arabic/RTL features so we put it in second position.
100 */
101 "STIX Two Math",
102 "XITS Math",
103 "STIX Math",
104 "Libertinus Math",
105 "TeX Gyre Termes Math",
106
107 /*
108 These fonts respectively have style compatible with Bookman Old and Century Schoolbook.
109 They are provided with most TeX & Linux distributions.
110 */
111 "TeX Gyre Bonum Math",
112 "TeX Gyre Schola",
113
114 /*
115 DejaVu is pre-installed on many Linux distributions and is included in LibreOffice.
116 */
117 "DejaVu Math TeX Gyre",
118
119 /*
120 The following fonts have Palatino style and are provided with most TeX & Linux distributions.
121 Asana Math has some rendering issues (e.g. missing italic correction) so we put it after.
122 */
123 "TeX Gyre Pagella Math",
124 "Asana Math",
125
126 /*
127 The following fonts are proprietary and have not much been tested so we put them at the end.
128 Cambria Math it is pre-installed on Windows 7 and higher.
129 */
130 "Cambria Math",
131 "Lucida Bright Math",
132 "Minion Math",
133
134 /*
135 The following fonts do not satisfy the requirements for good mathematical rendering.
136 These are pre-installed on Mac and iOS so we list them to provide minimal unicode-based
137 mathematical rendering. For more explanation of fallback mechanisms and missing features see
138 http://trac.webkit.org/wiki/MathML/Fonts#ObsoleteFontsandFallbackMechanisms.
139 STIX fonts have best unicode coverage so we put them first. */
140 STIXGeneral,
141 STIXSizeOneSym,
142 Symbol,
143 "Times New Roman",
144
145 /* Mathematical fonts generally use "serif" style. Hence we append the generic "serif" family
146 as a fallback in order to increase our chance to find a mathematical font. */
147 serif;
148
149 /* FIXME: Should we reset more CSS properties (http://webkit.org/b/156839)? */
150}
151
152math[display="block" i] {
153 display: block;
154 page-break-inside: avoid;
155 math-style: normal;
156}
157math[display="inline" i] {
158 math-style: compact;
159}
160
161ms, mspace, mtext, mi, mn, mo, mrow, mfenced, mfrac, msub, msup, msubsup, mmultiscripts, mprescripts, none, munder, mover, munderover, msqrt, mroot, merror, mphantom, mstyle, menclose, semantics, mpadded, maction {
162 display: block;
163}
164
165ms, mtext, mi, mn, mo, annotation, mtd {
166 white-space: nowrap !important;
167}
168
169mfrac > * {
170 math-style: compact;
171}
172
173msub > * + *, msup > * + *, msubsup > * + *, mmultiscripts > * + *, munder > * + *, mover > * + *, munderover > * + * {
174 font-size: 0.75em; /* FIXME: MathML standard is 0.71em */
175 math-style: compact;
176}
177mroot > *:last-child {
178 font-size: 0.5625em; /* This 0.75^2 since the scriptlevel is incremented by 2 in the index. */
179 math-style: compact;
180}
181mi {
182 padding-inline-end: 0.1em;
183}
184msub > mi:first-child, msubsup > mi:first-child {
185 padding-inline-end: 0;
186}
187msubsup > mi:first-child + * + * {
188 margin-inline-start: 0.14em; /* This is larger than 0.1em because the child's font-size is smaller than the <msubsup>'s. */
189}
190
191mphantom {
192 visibility: hidden;
193}
194
195/* This is a special style for erroneous markup. */
196merror {
197 outline: solid thin red;
198 font-weight: bold;
199 font-family: sans-serif;
200 background-color: lightYellow;
201}
202
203mtable {
204 display: inline-table;
205 text-align: center;
206 math-style: compact;
207}
208
209mtr {
210 display: table-row;
211}
212
213mtd {
214 display: table-cell;
215 padding: 0.5ex;
216}
217/* Use inline-block for children so that the text-align property is taken into account */
218mtd > * {
219 display: inline-block;
220}
221
222mtable[columnalign="left"], mtr[columnalign="left"], mtd[columnalign="left"] {
223 text-align: left;
224}
225
226mtable[columnalign="right"], mtr[columnalign="right"], mtd[columnalign="right"] {
227 text-align: right;
228}
229
230mtable[rowalign="top"] mtd, mtable mtr[rowalign="top"] mtd, mtable mtr mtd[rowalign="top"] {
231 vertical-align: top;
232}
233
234mtable[rowalign="bottom"] mtd, mtable mtr[rowalign="bottom"] mtd, mtable mtr mtd[rowalign="bottom"] {
235 vertical-align: bottom;
236}
237
238mtable[rowalign="center"] mtd, mtable mtr[rowalign="center"] mtd, mtable mtr mtd[rowalign="center"] {
239 vertical-align: middle;
240}
241
242mtable[frame="solid"] {
243 border: solid thin;
244}
245
246mtable[frame="dashed"] {
247 border: dashed thin;
248}
249
250mtable[rowlines="solid"], mtable[rowlines="dashed"], mtable[columnlines="solid"], mtable[columnlines="dashed"] {
251 border-collapse: collapse;
252}
253
254mtable[rowlines="solid"] > mtr + mtr {
255 border-top: solid thin;
256}
257
258mtable[rowlines="dashed"] > mtr + mtr {
259 border-top: dashed thin;
260}
261
262mtable[columnlines="solid"] > mtr > mtd + mtd {
263 border-left: solid thin;
264}
265
266mtable[columnlines="dashed"] > mtr > mtd + mtd {
267 border-left: dashed thin;
268}
269
270#endif
Note: See TracBrowser for help on using the repository browser.