Bug 1869043 allow a device to be specified with MediaTrackGraph::NotifyWhenDeviceStar...
[gecko.git] / layout / mathml / mathml.css
bloba1cf371f4a426074ecc7a5b4e40106ada980c7d8
1 /* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this
3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 /**************************************************************************/
7 /* namespace for MathML elements */
8 /**************************************************************************/
10 @namespace url(http://www.w3.org/1998/Math/MathML);
12 * {
13 writing-mode: horizontal-tb !important;
14 font-size: math;
17 /**************************************************************************/
18 /* <math> - outermost math element */
19 /**************************************************************************/
21 math {
22 direction: ltr;
23 unicode-bidi: embed;
24 display: inline;
25 font-size: inherit;
26 font-style: normal;
27 font-weight: normal;
28 text-indent: 0;
29 font-family: serif;
30 line-height: normal;
31 word-spacing: normal;
32 letter-spacing: normal;
33 text-rendering: optimizeLegibility;
34 -moz-float-edge: margin-box;
35 math-style: compact;
36 math-depth: 0;
38 math[display="block" i] {
39 display: block;
40 text-align: -moz-center;
41 math-style: normal;
43 math[display="inline" i] {
44 display: inline;
45 math-style: compact;
48 /**************************************************************************/
49 /* Links */
50 /**************************************************************************/
51 :any-link {
52 text-decoration: none !important;
55 /**************************************************************************/
56 /* attributes common to all tags */
57 /**************************************************************************/
59 /* These attributes are mapped to style in MathMLElement.cpp:
61 - background -> background (deprecated)
62 - color -> color (deprecated)
63 - fontfamily -> font-family (deprecated)
64 - fontsize -> font-size (deprecated)
65 - fontstyle -> font-style (deprecated)
66 - fontweight -> font-weight (deprecated)
67 - mathvariant -> -moz-math-variant
68 - scriptlevel -> math-depth
69 - mathsize -> font-size
70 - mathcolor -> color
71 - mathbackground -> background
76 /**************************************************************************/
77 /* merror */
78 /**************************************************************************/
80 merror {
81 display: block;
82 font-family: sans-serif;
83 font-weight: bold;
84 white-space: pre;
85 margin: 1em;
86 padding: 1em;
87 border-width: thin;
88 border-style: inset;
89 border-color: red;
90 font-size: 14pt;
91 background-color: lightyellow;
94 /**************************************************************************/
95 /* mtable and its related tags */
96 /**************************************************************************/
98 mtable {
99 display: inline-table;
100 border-collapse: separate;
101 border-spacing: 0;
102 text-indent: 0;
104 mtable[frame="none"] {
105 border: none;
107 mtable[frame="solid"] {
108 border: solid thin;
110 mtable[frame="dashed"] {
111 border: dashed thin;
114 mtr, mlabeledtr {
115 display: table-row;
116 vertical-align: baseline;
119 mtd {
120 display: table-cell;
121 vertical-align: inherit;
122 text-align: -moz-center;
123 white-space: nowrap;
126 /* Don't support m(labeled)tr without mtable, nor mtd without m(labeled)tr */
127 :not(mtable) > mtr,
128 :not(mtable) > mlabeledtr,
129 :not(mtr, mlabeledtr) > mtd {
130 display: none !important;
133 /* Hide the label because mlabeledtr is not supported yet (bug 356870). This
134 rule can be overriden by users. */
135 mlabeledtr > mtd:first-child {
136 display: none;
139 /**********************************************************************/
140 /* rules to achieve the default spacing between cells. When rowspacing,
141 columnspacing and framespacing aren't set on mtable. The back-end code
142 will set the internal attributes depending on the cell's position.
143 When they are set, the spacing behaviour is handled outside of CSS */
144 mtd {
145 padding-right: 0.4em; /* half of columnspacing[colindex] */
146 padding-left: 0.4em; /* half of columnspacing[colindex-1] */
147 padding-bottom: 0.5ex; /* half of rowspacing[rowindex] */
148 padding-top: 0.5ex; /* half of rowspacing[rowindex-1] */
150 /* turn off the spacing at the periphery of boundary cells */
151 mtr:first-child > mtd {
152 padding-top: 0ex;
154 mtr:last-child > mtd {
155 padding-bottom: 0ex;
157 mtd:first-child {
158 padding-inline-start: 0em;
160 mtd:last-child {
161 padding-inline-end: 0em;
163 /* re-instate the spacing if the table has a surrounding frame */
164 mtable[frame="solid"] > mtr:first-child > mtd,
165 mtable[frame="dashed"] > mtr:first-child > mtd {
166 padding-top: 0.5ex; /* framespacing.top */
168 mtable[frame="solid"] > mtr:last-child > mtd,
169 mtable[frame="dashed"] > mtr:last-child > mtd {
170 padding-bottom: 0.5ex; /* framespacing.bottom */
172 mtable[frame="solid"] > mtr > mtd:first-child,
173 mtable[frame="dashed"] > mtr > mtd:first-child {
174 padding-inline-start: 0.4em; /* framespacing.left (or right in rtl)*/
176 mtable[frame="solid"] > mtr > mtd:last-child,
177 mtable[frame="dashed"] > mtr > mtd:last-child {
178 padding-inline-end: 0.4em; /* framespacing.right (or left in rtl)*/
181 mtable[rowspacing] > mtr > mtd,
182 mtable[columnspacing] > mtr > mtd,
183 mtable[framespacing] > mtr > mtd {
184 /* Spacing handled outside of CSS */
185 padding: 0px;
188 /**********************************************************************/
189 /* This is used when wrapping non-MathML inline elements inside math. */
190 *|*::-moz-mathml-anonymous-block {
191 display: inline-block !important;
192 position: static !important;
193 text-indent: 0;
196 /**************************************************************************/
197 /* Controlling Displaystyle and Scriptlevel */
198 /**************************************************************************/
201 http://www.w3.org/Math/draft-spec/chapter3.html#presm.scriptlevel
203 The determination of math-style for <math> involves the displaystyle
204 and display attributes. See the <math> section above.
207 /* munder, mover and munderover change the scriptlevels of their children
208 using -moz-math-increment-script-level because regular CSS rules are
209 insufficient to control when the scriptlevel should be incremented. All other
210 cases can be described using regular CSS, so we do it this way because it's
211 more efficient and less code. */
212 :-moz-math-increment-script-level { math-depth: add(1); }
215 The mfrac element sets displaystyle to "false", or if it was already false
216 increments scriptlevel by 1, within numerator and denominator.
218 mfrac > * {
219 math-depth: auto-add;
220 math-style: compact;
224 The mroot element increments scriptlevel by 2, and sets displaystyle to
225 "false", within index, but leaves both attributes unchanged within base.
226 The msqrt element leaves both attributes unchanged within its argument.
228 mroot > :not(:first-child) {
229 math-depth: add(2);
230 math-style: compact;
234 The msub element [...] increments scriptlevel by 1, and sets displaystyle to
235 "false", within subscript, but leaves both attributes unchanged within base.
237 The msup element [...] increments scriptlevel by 1, and sets displaystyle to
238 "false", within superscript, but leaves both attributes unchanged within
239 base.
241 The msubsup element [...] increments scriptlevel by 1, and sets displaystyle
242 to "false", within subscript and superscript, but leaves both attributes
243 unchanged within base.
245 The mmultiscripts element increments scriptlevel by 1, and sets displaystyle
246 to "false", within each of its arguments except base, but leaves both
247 attributes unchanged within base.
249 msub > :not(:first-child),
250 msup > :not(:first-child),
251 msubsup > :not(:first-child),
252 mmultiscripts > :not(:first-child) {
253 math-depth: add(1);
254 math-style: compact;
258 The munder element [...] always sets displaystyle to "false" within the
259 underscript, but increments scriptlevel by 1 only when accentunder is
260 "false". Within base, it always leaves both attributes unchanged.
262 The mover element [...] always sets displaystyle to "false" within
263 overscript, but increments scriptlevel by 1 only when accent is "false".
264 Within base, it always leaves both attributes unchanged.
266 The munderover [..] always sets displaystyle to "false" within underscript
267 and overscript, but increments scriptlevel by 1 only when accentunder or
268 accent, respectively, are "false". Within base, it always leaves both
269 attributes unchanged.
271 munder > :not(:first-child),
272 mover > :not(:first-child),
273 munderover > :not(:first-child) {
274 math-style: compact;
278 The displaystyle attribute is allowed on the mtable element to set the
279 inherited value of the attribute. If the attribute is not present, the
280 mtable element sets displaystyle to "false" within the table elements.
282 mtable { math-style: compact; }
285 The mscarries element sets displaystyle to "false", and increments
286 scriptlevel by 1, so the children are typically displayed in a smaller font.
287 XXXfredw: This element is not implemented yet. See bug 534967.
288 mscarries {
289 math-depth: add(1);
290 math-style: compact;
294 /* "The mphantom element renders invisibly, but with the same size and other
295 dimensions, including baseline position, that its contents would have if
296 they were rendered normally.".
297 Also, we do not expose the <mphantom> element to the accessible tree
298 (see bug 1108378). */
299 mphantom {
300 visibility: hidden;
303 /* Implement MathML Core's semantics/maction support
304 https://w3c.github.io/mathml-core/#dfn-semantics
305 https://w3c.github.io/mathml-core/#dfn-maction */
306 maction > :not(:first-child),
307 semantics > :not(:first-child) {
308 display: none;
311 /* stylelint-disable-next-line media-query-no-invalid */
312 @media (-moz-bool-pref: "mathml.legacy_mathvariant_attribute.disabled") {
313 /* Implement MathML Core's automatic italic on mi.
314 https://w3c.github.io/mathml-core/#the-mathvariant-attribute */
315 mi {
316 text-transform: math-auto;