blob: 186881cd5b0ba58c384fe1d5f770f0cfc46c1a63 [file] [log] [blame]
@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;
}