1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
|
@namespace "http://www.w3.org/1998/Math/MathML";
math {
-webkit-line-box-contain: glyphs replaced;
text-indent: 0;
direction: ltr;
}
mtext {
line-height: 1.0;
}
/* Keep font-family and other defaults here consistent with http://mxr.mozilla.org/mozilla-central/source/layout/mathml/mathml.css and feedback from www-math. */
math {
#if defined(WTF_PLATFORM_IOS) && WTF_PLATFORM_IOS
/* We explicitly include the font Symbol as it's the iOS equivalent of font STIXGeneral. */
font-family: STIXGeneral, Symbol, "Times New Roman", sans-serif;
#else
font-family: "Latin Modern Math", MathJax_Main, STIXGeneral, STIXSizeOneSym, "DejaVu Sans", "DejaVu Serif", Cambria, "Cambria Math", "Lucida Sans Unicode", "Arial Unicode MS", "Lucida Grande", OpenSymbol, "Standard Symbols L", Times, serif;
#endif
}
math {
display: -webkit-inline-flex !important;
padding-left: 1px;
padding-right: 1px;
}
math[display="block"] {
display: flex !important;
justify-content: center;
page-break-inside: avoid;
/* -webkit-margin-before: 1em; -- FIXME: Ask www-math for a default MathML stylesheet, including this (or margin-top). */
-webkit-margin-after: 1em;
}
ms, mi, mo, mrow, mfenced, mfrac, msub, msup, msubsup, mmultiscripts, mprescripts, none, munder, mover, munderover, msqrt, mroot, merror, mphantom, mstyle, menclose {
display: -webkit-inline-flex !important;
}
math, mrow, mfenced, merror, mphantom, mstyle, menclose {
align-items: baseline;
}
mo, mfrac, munder, mover, munderover {
flex-direction: column;
}
munder, mover, munderover {
align-items: center;
}
mfrac > * {
align-self: center;
}
mfrac[numalign="left"] > :first-child {
align-self: flex-start;
}
mfrac[numalign="right"] > :first-child {
align-self: flex-end;
}
mfrac[denomalign="left"] > :last-child {
align-self: flex-start;
}
mfrac[denomalign="right"] > :last-child {
align-self: flex-end;
}
mfrac > :first-child {
-webkit-margin-after: 0.2em;
}
mfrac > :last-child {
-webkit-margin-before: 0.2em;
}
mfrac {
-webkit-margin-start: 1px;
-webkit-margin-end: 1px;
}
mover > :last-child, munderover > :last-child {
order: -1;
}
msub > * + *, msup > * + *, msubsup > * + *, mmultiscripts > * + *, munder > * + *, mover > * + *, munderover > * + * {
font-size: 0.75em; /* FIXME: MathML standard is 0.71em */
}
mroot > *:last-child {
font-size: 0.5625em; /* This 0.75^2 since the scriptlevel is incremented by 2 in the index. */
}
mi {
-webkit-padding-end: 0.1em;
}
msub > mi:first-child, msubsup > mi:first-child {
-webkit-padding-end: 0;
}
msubsup > mi:first-child + * + * {
-webkit-margin-start: 0.14em; /* This is larger than 0.1em because the child's font-size is smaller than the <msubsup>'s. */
}
math[mathvariant="normal"], mstyle[mathvariant="normal"], mo[mathvariant="normal"], mn[mathvariant="normal"], mi[mathvariant="normal"], mtext[mathvariant="normal"], mspace[mathvariant="normal"], ms[mathvariant="normal"] {
font-style: normal;
font-weight: normal;
}
math[mathvariant="bold"], mstyle[mathvariant="bold"], mo[mathvariant="bold"], mn[mathvariant="bold"], mi[mathvariant="bold"], mtext[mathvariant="bold"], mspace[mathvariant="bold"], ms[mathvariant="bold"] {
font-style: normal;
font-weight: bold;
}
math[mathvariant="italic"], mstyle[mathvariant="italic"], mo[mathvariant="italic"], mn[mathvariant="italic"], mi[mathvariant="italic"], mtext[mathvariant="italic"], mspace[mathvariant="italic"], ms[mathvariant="italic"] {
font-style: italic;
font-weight: normal;
}
math[mathvariant="bold-italic"], mstyle[mathvariant="bold-italic"], mo[mathvariant="bold-italic"], mn[mathvariant="bold-italic"], mi[mathvariant="bold-italic"], mtext[mathvariant="bold-italic"], mspace[mathvariant="bold-italic"], ms[mathvariant="bold-italic"] {
font-weight: bold;
font-style: italic;
}
math[mathsize="small"], mstyle[mathsize="small"], mo[mathsize="small"], mn[mathsize="small"], mi[mathsize="small"], mtext[mathsize="small"], mspace[mathsize="small"], ms[mathsize="small"] {
font-size: 0.75em;
}
math[mathsize="normal"], mstyle[mathsize="normal"], mo[mathsize="normal"], mn[mathsize="normal"], mi[mathsize="normal"], mtext[mathsize="normal"], mspace[mathsize="normal"], ms[mathsize="normal"] {
font-size: 1em;
}
math[mathsize="big"], mstyle[mathsize="big"], mo[mathsize="big"], mn[mathsize="big"], mi[mathsize="big"], mtext[mathsize="big"], mspace[mathsize="big"], ms[mathsize="big"] {
font-size: 1.5em;
}
mphantom {
visibility: hidden;
}
/* This is a special style for erroneous markup:
- <merror> element.
- extra children in script elements.
- <mprescripts/> and <none/> elements in msub/msup/msubsup.
*/
merror, msub > * + * + *, msup > * + * + *, msubsup > * + * + * + *, msub > mprescripts, msup > mprescripts, msubsup > mprescripts, msub > none, msup > none, msubsup > none, mmultiscripts > mprescripts ~ mprescripts, mmultiscripts > mprescripts ~ mprescripts ~ * {
outline: solid thin red;
font-weight: bold;
font-family: sans-serif;
background-color: lightYellow;
}
mtable {
display: inline-table;
text-align: center;
}
mtr {
display: table-row;
}
mtd {
display: table-cell;
padding: 0.5ex;
}
mtable[columnalign="left"], mtr[columnalign="left"], mtd[columnalign="left"] {
text-align: left;
}
mtable[columnalign="right"], mtr[columnalign="right"], mtd[columnalign="right"] {
text-align: right;
}
mtable[rowalign="top"] mtd, mtable mtr[rowalign="top"] mtd, mtable mtr mtd[rowalign="top"] {
vertical-align: top;
}
mtable[rowalign="bottom"] mtd, mtable mtr[rowalign="bottom"] mtd, mtable mtr mtd[rowalign="bottom"] {
vertical-align: bottom;
}
mtable[rowalign="center"] mtd, mtable mtr[rowalign="center"] mtd, mtable mtr mtd[rowalign="center"] {
vertical-align: middle;
}
mtable[frame="solid"] {
border: solid thin;
}
mtable[frame="dashed"] {
border: dashed thin;
}
mtable[rowlines="solid"], mtable[rowlines="dashed"], mtable[columnlines="solid"], mtable[columnlines="dashed"] {
border-collapse: collapse;
}
mtable[rowlines="solid"] > mtr + mtr {
border-top: solid thin;
}
mtable[rowlines="dashed"] > mtr + mtr {
border-top: dashed thin;
}
mtable[columnlines="solid"] > mtr > mtd + mtd {
border-left: solid thin;
}
mtable[columnlines="dashed"] > mtr > mtd + mtd {
border-left: dashed thin;
}
|