Bumping manifests a=b2g-bump
[gecko.git] / layout / mathml / mathml.css
blob20f7e879b74e0783ab4eeee8e1f811a90a2384ea
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 /* <math> - outermost math element */
14 /* Put Cambria before Cambria Math as Cambria Math has neither bold nor */
15 /* italic. */
16 /**************************************************************************/
18 math {
19 direction: ltr;
20 unicode-bidi: embed;
21 display: inline;
22 font-size: inherit;
23 font-style: normal;
24 font-family: MathJax_Main, STIXGeneral, Cambria, Cambria Math, XITS, Latin Modern Math, DejaVu Serif, DejaVu Sans, Times, Lucida Sans Unicode, OpenSymbol, Standard Symbols L, serif;
25 text-rendering: optimizeLegibility;
26 -moz-float-edge: margin-box;
27 -moz-math-display: inline;
29 math[mode="display"], math[display="block"] {
30 display: block;
31 text-align: -moz-center;
32 -moz-math-display: block;
34 math[display="inline"] {
35 display: inline;
36 -moz-math-display: inline;
38 math[displaystyle="false"] {
39 -moz-math-display: inline;
41 math[displaystyle="true"] {
42 -moz-math-display: block;
45 /**************************************************************************/
46 /* Token elements */
47 /**************************************************************************/
49 ms {
50 display: inline;
52 ms:before, ms:after {
53 content: "\0022"
55 ms[lquote]:before {
56 content: attr(lquote)
58 ms[rquote]:after {
59 content: attr(rquote)
62 /**************************************************************************/
63 /* Links */
64 /**************************************************************************/
65 :-moz-any-link {
66 text-decoration: none !important;
69 /**************************************************************************/
70 /* attributes common to all tags */
71 /**************************************************************************/
73 /* These attributes are mapped to style in nsMathMLElement.cpp:
75 - background -> background (deprecated)
76 - color -> color (deprecated)
77 - fontfamily -> font-family (deprecated)
78 - fontsize -> font-size (deprecated)
79 - fontstyle -> font-style (deprecated)
80 - fontweight -> font-weight (deprecated)
81 - mathvariant -> -moz-math-variant
82 - scriptsizemultiplier -> -moz-script-size-multiplier
83 - scriptminsize -> -moz-script-min-size
84 - scriptlevel -> -moz-script-level
85 - mathsize -> font-size
86 - mathcolor -> color
87 - mathbackground -> background
92 /**************************************************************************/
93 /* merror */
94 /**************************************************************************/
96 merror {
97 display: block;
98 font-family: sans-serif;
99 font-weight: bold;
100 white-space: pre;
101 margin: 1em;
102 padding: 1em;
103 border-width: thin;
104 border-style: inset;
105 border-color: red;
106 font-size: 14pt;
107 background-color: lightyellow;
110 /**************************************************************************/
111 /* mtable and its related tags */
112 /**************************************************************************/
114 mtable {
115 display: inline-table;
116 border-collapse: separate;
117 border-spacing: 0;
118 text-indent: 0;
120 mtable[frame="none"] {
121 border: none;
123 mtable[frame="solid"] {
124 border: solid thin;
126 mtable[frame="dashed"] {
127 border: dashed thin;
130 mtr, mlabeledtr {
131 display: table-row;
132 vertical-align: baseline;
135 mtd {
136 display: table-cell;
137 vertical-align: inherit;
138 text-align: -moz-center;
139 white-space: nowrap;
142 /* Don't support m(labeled)tr without mtable, nor mtd without m(labeled)tr */
143 :not(mtable) > mtr,
144 :not(mtable) > mlabeledtr,
145 :not(mtr):not(mlabeledtr) > mtd {
146 display: none !important;
149 /* Hide the label because mlabeledtr is not supported yet (bug 356870). This
150 rule can be overriden by users. */
151 mlabeledtr > mtd:first-child {
152 display: none;
155 /**********************************************************************/
156 /* rules to achieve the default spacing between cells. When rowspacing,
157 columnspacing and framespacing aren't set on mtable. The back-end code
158 will set the internal attributes depending on the cell's position.
159 When they are set, the spacing behaviour is handled outside of CSS */
160 mtd {
161 padding-right: 0.4em; /* half of columnspacing[colindex] */
162 padding-left: 0.4em; /* half of columnspacing[colindex-1] */
163 padding-bottom: 0.5ex; /* half of rowspacing[rowindex] */
164 padding-top: 0.5ex; /* half of rowspacing[rowindex-1] */
166 /* turn off the spacing at the periphery of boundary cells */
167 mtr:first-child > mtd {
168 padding-top: 0ex;
170 mtr:last-child > mtd {
171 padding-bottom: 0ex;
173 mtd:first-child {
174 -moz-padding-start: 0em;
176 mtd:last-child {
177 -moz-padding-end: 0em;
179 /* re-instate the spacing if the table has a surrounding frame */
180 mtable[frame="solid"] > mtr:first-child > mtd,
181 mtable[frame="dashed"] > mtr:first-child > mtd {
182 padding-top: 0.5ex; /* framespacing.top */
184 mtable[frame="solid"] > mtr:last-child > mtd,
185 mtable[frame="dashed"] > mtr:last-child > mtd {
186 padding-bottom: 0.5ex; /* framespacing.bottom */
188 mtable[frame="solid"] > mtr > mtd:first-child,
189 mtable[frame="dashed"] > mtr > mtd:first-child {
190 -moz-padding-start: 0.4em; /* framespacing.left (or right in rtl)*/
192 mtable[frame="solid"] > mtr > mtd:last-child,
193 mtable[frame="dashed"] > mtr > mtd:last-child {
194 -moz-padding-end: 0.4em; /* framespacing.right (or left in rtl)*/
197 mtable[rowspacing] > mtr > mtd,
198 mtable[columnspacing] > mtr > mtd,
199 mtable[framespacing] > mtr > mtd {
200 /* Spacing handled outside of CSS */
201 padding: 0px;
204 /**************************************************************************/
205 /* This rule is used to give a style context suitable for nsMathMLChars.
206 We don't actually style -moz-math-anonymous by default. */
208 ::-moz-math-anonymous {
212 /**********************************************************************/
213 /* This is used when wrapping non-MathML inline elements inside math. */
214 *|*::-moz-mathml-anonymous-block {
215 display: inline-block !important;
216 position: static !important;
217 text-indent: 0;
220 /**************************************************************************/
221 /* Controlling Displaystyle and Scriptlevel */
222 /**************************************************************************/
225 http://www.w3.org/Math/draft-spec/chapter3.html#presm.scriptlevel
227 The determination of -moz-math-display for <math> involves the displaystyle
228 and display attributes. See the <math> section above.
232 Map mstyle@displaystyle to -moz-math-display.
234 mstyle[displaystyle="false"] {
235 -moz-math-display: inline;
237 mstyle[displaystyle="true"] {
238 -moz-math-display: block;
241 /* munder, mover and munderover change the scriptlevels of their children
242 using -moz-math-increment-script-level because regular CSS rules are
243 insufficient to control when the scriptlevel should be incremented. All other
244 cases can be described using regular CSS, so we do it this way because it's
245 more efficient and less code. */
246 :-moz-math-increment-script-level { -moz-script-level: +1; }
249 The mfrac element sets displaystyle to "false", or if it was already false
250 increments scriptlevel by 1, within numerator and denominator.
252 mfrac > * {
253 -moz-script-level: auto;
254 -moz-math-display: inline;
258 The mroot element increments scriptlevel by 2, and sets displaystyle to
259 "false", within index, but leaves both attributes unchanged within base.
260 The msqrt element leaves both attributes unchanged within its argument.
262 mroot > :not(:first-child) {
263 -moz-script-level: +2;
264 -moz-math-display: inline;
268 The msub element [...] increments scriptlevel by 1, and sets displaystyle to
269 "false", within subscript, but leaves both attributes unchanged within base.
271 The msup element [...] increments scriptlevel by 1, and sets displaystyle to
272 "false", within superscript, but leaves both attributes unchanged within
273 base.
275 The msubsup element [...] increments scriptlevel by 1, and sets displaystyle
276 to "false", within subscript and superscript, but leaves both attributes
277 unchanged within base.
279 The mmultiscripts element increments scriptlevel by 1, and sets displaystyle
280 to "false", within each of its arguments except base, but leaves both
281 attributes unchanged within base.
283 msub > :not(:first-child),
284 msup > :not(:first-child),
285 msubsup > :not(:first-child),
286 mmultiscripts > :not(:first-child) {
287 -moz-script-level: +1;
288 -moz-math-display: inline;
292 The munder element [...] always sets displaystyle to "false" within the
293 underscript, but increments scriptlevel by 1 only when accentunder is
294 "false". Within base, it always leaves both attributes unchanged.
296 The mover element [...] always sets displaystyle to "false" within
297 overscript, but increments scriptlevel by 1 only when accent is "false".
298 Within base, it always leaves both attributes unchanged.
300 The munderover [..] always sets displaystyle to "false" within underscript
301 and overscript, but increments scriptlevel by 1 only when accentunder or
302 accent, respectively, are "false". Within base, it always leaves both
303 attributes unchanged.
305 munder > :not(:first-child),
306 mover > :not(:first-child),
307 munderover > :not(:first-child) {
308 -moz-math-display: inline;
312 The displaystyle attribute is allowed on the mtable element to set the
313 inherited value of the attribute. If the attribute is not present, the
314 mtable element sets displaystyle to "false" within the table elements.
316 mtable { -moz-math-display: inline; }
317 mtable[displaystyle="true"] { -moz-math-display: block; }
320 The mscarries element sets displaystyle to "false", and increments
321 scriptlevel by 1, so the children are typically displayed in a smaller font.
322 XXXfredw: This element is not implemented yet. See bug 534967.
323 mscarries {
324 -moz-script-level: +1;
325 -moz-math-display: inline;