1@namespace "http://www.w3.org/1998/Math/MathML"; 2 3math { 4 -webkit-line-box-contain: glyphs replaced; 5 text-indent: 0; 6} 7mtext { 8 line-height: 1.0; 9} 10 11/* 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. */ 12math, mfenced > * { 13 font-family: MathJax_Main, STIXGeneral, "DejaVu Serif", Cambria, "Cambria Math", Times, serif; 14} 15mo, mfenced { 16 font-family: MathJax_Main, STIXGeneral, STIXSizeOneSym, "DejaVu Sans", "DejaVu Serif", Cambria, "Cambria Math", 17 "Lucida Sans Unicode", "Arial Unicode MS", "Lucida Grande", OpenSymbol, "Standard Symbols L", sans-serif; 18} 19 20math { 21 display: -webkit-inline-flex !important; 22 padding-left: 1px; 23 padding-right: 1px; 24} 25 26math[display="block"] { 27 display: -webkit-flex !important; 28 -webkit-justify-content: center; 29 page-break-inside: avoid; 30 /* -webkit-margin-before: 1em; -- FIXME: Ask www-math for a default MathML stylesheet, including this (or margin-top). */ 31 -webkit-margin-after: 1em; 32} 33 34mo, mrow, mfenced, mfrac, msub, msup, msubsup, munder, mover, munderover, msqrt, mroot { 35 display: -webkit-inline-flex !important; 36} 37 38msup { 39 -webkit-align-items: flex-start; 40} 41 42msub { 43 -webkit-align-items: flex-end; 44} 45 46math, mrow, mfenced, msqrt, mroot { 47 -webkit-align-items: baseline; 48} 49msqrt > * { /* This rule is needed because of <msqrt>'s anonymous <mrow>. */ 50 -webkit-align-self: baseline; 51} 52 53mo, mfrac, munder, mover, munderover { 54 -webkit-flex-direction: column; 55} 56 57munder, mover, munderover { 58 -webkit-align-items: center; 59} 60 61mfrac > * { 62 -webkit-align-self: center; 63} 64mfrac[numalign="left"] > :first-child { 65 -webkit-align-self: flex-start; 66} 67mfrac[numalign="right"] > :first-child { 68 -webkit-align-self: flex-end; 69} 70mfrac[denomalign="left"] > :last-child { 71 -webkit-align-self: flex-start; 72} 73mfrac[denomalign="right"] > :last-child { 74 -webkit-align-self: flex-end; 75} 76mfrac > :first-child { 77 -webkit-margin-after: 0.2em; 78} 79mfrac > :last-child { 80 -webkit-margin-before: 0.2em; 81} 82mfrac { 83 -webkit-margin-start: 1px; 84 -webkit-margin-end: 1px; 85} 86 87msubsup > :last-child, mover > :last-child, munderover > :last-child { 88 -webkit-order: -1; 89} 90 91msub > * + *, msup > * + *, msubsup > * + *, munder > * + *, mover > * + *, munderover > * + * { 92 font-size: 0.75em; /* FIXME: MathML standard is 0.71em */ 93} 94 95mi { 96 font-style: italic; 97 -webkit-padding-end: 0.1em; 98} 99msub > mi:first-child, msubsup > mi:first-child { 100 -webkit-padding-end: 0; 101} 102msubsup > mi:first-child + * + * { 103 -webkit-margin-start: 0.14em; /* This is larger than 0.1em because the child's font-size is smaller than the <msubsup>'s. */ 104} 105 106/* FIXME: For a RenderMathMLOperator's margin-start and margin-end, or for a MathML "embellished operator", check the operator's lspace and rspace attributes, 107 and the MathML operator dictionary. */ 108math > mo, mrow > mo, msqrt > mo, mtd > mo { 109 -webkit-margin-start: 0.2em; 110 -webkit-margin-end: 0.2em; 111} 112math > mo:first-child, mrow > mo:first-child, msqrt > mo:first-child, mtd > mo:first-child, 113math > mo:last-child, mrow > mo:last-child, msqrt > mo:last-child, mtd > mo:last-child { 114 -webkit-margin-start: 0.1em; 115 -webkit-margin-end: 0.1em; 116} 117 118mroot { 119 position: relative; 120} 121mroot > * + * { 122 font-size: 0.75em; 123 position: absolute; 124 left: 0; 125 top: 0; 126 padding-right: 0.4em; 127 padding-left: 0.2em; 128 padding-bottom: 0.35em; 129} 130 131math[mathvariant="normal"], mstyle[mathvariant="normal"], mo[mathvariant="normal"], mn[mathvariant="normal"], mi[mathvariant="normal"], mtext[mathvariant="normal"], mspace[mathvariant="normal"], ms[mathvariant="normal"] { 132 font-style: normal; 133 font-weight: normal; 134} 135 136math[mathvariant="bold"], mstyle[mathvariant="bold"], mo[mathvariant="bold"], mn[mathvariant="bold"], mi[mathvariant="bold"], mtext[mathvariant="bold"], mspace[mathvariant="bold"], ms[mathvariant="bold"] { 137 font-style: normal; 138 font-weight: bold; 139} 140 141math[mathvariant="italic"], mstyle[mathvariant="italic"], mo[mathvariant="italic"], mn[mathvariant="italic"], mi[mathvariant="italic"], mtext[mathvariant="italic"], mspace[mathvariant="italic"], ms[mathvariant="italic"] { 142 font-style: italic; 143 font-weight: normal; 144} 145 146math[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"] { 147 font-weight: bold; 148 font-style: italic; 149} 150 151math[mathsize="small"], mstyle[mathsize="small"], mo[mathsize="small"], mn[mathsize="small"], mi[mathsize="small"], mtext[mathsize="small"], mspace[mathsize="small"], ms[mathsize="small"] { 152 font-size: 0.75em; 153} 154 155math[mathsize="normal"], mstyle[mathsize="normal"], mo[mathsize="normal"], mn[mathsize="normal"], mi[mathsize="normal"], mtext[mathsize="normal"], mspace[mathsize="normal"], ms[mathsize="normal"] { 156 font-size: 1em; 157} 158 159math[mathsize="big"], mstyle[mathsize="big"], mo[mathsize="big"], mn[mathsize="big"], mi[mathsize="big"], mtext[mathsize="big"], mspace[mathsize="big"], ms[mathsize="big"] { 160 font-size: 1.5em; 161} 162 163annotation, annotation-xml { 164 display: none; 165} 166 167mphantom { 168 visibility: hidden; 169} 170 171merror { 172 outline: solid thin red; 173 font-weight: bold; 174 font-family: sans-serif; 175 background-color: lightYellow; 176} 177 178mtable { 179 display: inline-table; 180 text-align: center; 181} 182 183mtr { 184 display: table-row; 185} 186 187mtd { 188 display: table-cell; 189 padding: 0.5ex; 190} 191 192mtable[columnalign="left"], mtr[columnalign="left"], mtd[columnalign="left"] { 193 text-align: left; 194} 195 196mtable[columnalign="right"], mtr[columnalign="right"], mtd[columnalign="right"] { 197 text-align: right; 198} 199 200mtable[rowalign="top"] mtd, mtable mtr[rowalign="top"] mtd, mtable mtr mtd[rowalign="top"] { 201 vertical-align: top; 202} 203 204mtable[rowalign="bottom"] mtd, mtable mtr[rowalign="bottom"] mtd, mtable mtr mtd[rowalign="bottom"] { 205 vertical-align: bottom; 206} 207 208mtable[rowalign="center"] mtd, mtable mtr[rowalign="center"] mtd, mtable mtr mtd[rowalign="center"] { 209 vertical-align: middle; 210} 211 212mtable[frame="solid"] { 213 border: solid thin; 214} 215 216mtable[frame="dashed"] { 217 border: dashed thin; 218} 219 220mtable[rowlines="solid"], mtable[rowlines="dashed"], mtable[columnlines="solid"], mtable[columnlines="dashed"] { 221 border-collapse: collapse; 222} 223 224mtable[rowlines="solid"] > mtr + mtr { 225 border-top: solid thin; 226} 227 228mtable[rowlines="dashed"] > mtr + mtr { 229 border-top: dashed thin; 230} 231 232mtable[columnlines="solid"] > mtr > mtd + mtd { 233 border-left: solid thin; 234} 235 236mtable[columnlines="dashed"] > mtr > mtd + mtd { 237 border-left: dashed thin; 238} 239 240mspace[linebreak="newline"] { 241 display: block; 242} 243