home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 35 Internet / 35-Internet.zip / phoenx05.zip / phoenix / res / mathml.css < prev    next >
Cascading Style Sheet File  |  2002-12-10  |  12KB  |  425 lines

  1. /*
  2.  * The contents of this file are subject to the Mozilla Public
  3.  * License Version 1.1 (the "License"); you may not use this file
  4.  * except in compliance with the License. You may obtain a copy of
  5.  * the License at http://www.mozilla.org/MPL/
  6.  *
  7.  * Software distributed under the License is distributed on an "AS
  8.  * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
  9.  * implied. See the License for the specific language governing
  10.  * rights and limitations under the License.
  11.  *
  12.  * The Original Code is Mozilla MathML Project.
  13.  *
  14.  * The Initial Developer of the Original Code is The University Of
  15.  * Queensland.  Portions created by The University Of Queensland are
  16.  * Copyright (C) 1999 The University Of Queensland.  All Rights Reserved.
  17.  *
  18.  * Contributor(s):
  19.  *   Roger B. Sidje <rbs@maths.uq.edu.au>
  20.  */
  21.  
  22.  
  23. /**************************************************************************/
  24. /* namespace for MathML elements                                          */
  25. /**************************************************************************/
  26.  
  27. @namespace url(http://www.w3.org/1998/Math/MathML);
  28.  
  29.  
  30. /**************************************************************************/
  31. /* <math> - outermost math element                                        */
  32. /**************************************************************************/
  33.  
  34. math {
  35.   display: inline;
  36.   font-size: inherit;
  37.   font-style: normal;
  38.   font-family: CMSY10, Symbol, Times, Lucida Sans Unicode, MT Extra, Math1, Math2, Math3, Math4, Math5, serif;
  39. }
  40. math[mode="inline"], math[display="inline"] {
  41.   display: inline;
  42. }
  43. math[mode="display"], math[display="block"] {
  44.   display: block;
  45.   text-align: -moz-center;
  46. }
  47. :-moz-math-inline {
  48.   display: inline;
  49. }
  50.  
  51. /**************************************************************************/
  52. /* style switching during frame construction 
  53.    these rules need to be here so that the other rules listed with
  54.    fontstyle, mathsize, etc, can override them
  55. /**************************************************************************/
  56.  
  57. /* change of style depending on the context of <mi> */
  58. [-moz-math-font-style="italic"] {
  59.   font-style: italic; /* if the textual content consists of a single character */
  60. }
  61. [-moz-math-font-style="normal"] {
  62.   font-style: normal; /* if the textual content consists of multiple characters */
  63. }
  64. /* change of size induced by changing the scriptlevel */
  65. [-moz-math-font-size="+1"] {
  66.   font-size: 71%;
  67. }
  68. [-moz-math-font-size="+2"] {
  69.   font-size: 50%;
  70. }
  71. [-moz-math-font-size="+3"] {
  72.   font-size: 36%;
  73. }
  74. [-moz-math-font-size="+4"] {
  75.   font-size: 25%;
  76. }
  77. [-moz-math-font-size="+5"] {
  78.   font-size: 18%;
  79. }
  80. [-moz-math-font-size="scriptminsize"] {
  81.   font-size: 8pt;
  82. }
  83. [-moz-math-font-size="-1"] {
  84.   font-size: 141%;
  85. }
  86. [-moz-math-font-size="-2"] {
  87.   font-size: 200%;
  88. }
  89. [-moz-math-font-size="-3"] {
  90.   font-size: 283%;
  91. }
  92. [-moz-math-font-size="-4"] {
  93.   font-size: 400%;
  94. }
  95. [-moz-math-font-size="-5"] {
  96.   font-size: 566%;
  97. }
  98.  
  99. /**************************************************************************/
  100. /* attributes common to all tags                                          */
  101. /**************************************************************************/
  102.  
  103. /* deprecated attributes from MathML 1.0 */
  104.  
  105. /* fontstyle */
  106. [fontstyle="normal"] {
  107.   font-style: normal;
  108. }
  109. [fontstyle="italic"] {
  110.   font-style: italic;
  111. }
  112. /* fontweight */
  113. [fontweight="normal"] {
  114.   font-weight: normal;
  115. }
  116. [fontweight="bold"] {
  117.   font-weight: bold;
  118. }
  119. /* fontsize */
  120. [fontsize="xx-small"] {
  121.   font-size: xx-small;
  122. }
  123. [fontsize="x-small"] {
  124.   font-size: x-small;
  125. }
  126. [fontsize="small"] {
  127.   font-size: small;
  128. }
  129. [fontsize="smaller"] {
  130.   font-size: smaller;
  131. }
  132. [fontsize="medium"] {
  133.   font-size: medium;
  134. }
  135. [fontsize="large"] {
  136.   font-size: large;
  137. }
  138. [fontsize="larger"] {
  139.   font-size: larger;
  140. }
  141. [fontsize="x-large"] {
  142.   font-size: x-large;
  143. }
  144. [fontsize="xx-large"] {
  145.   font-size: xx-large;
  146. }
  147.  
  148. /* attributes from MathML 2.0 */
  149.  
  150. /* These ones are handled in the back-end:
  151.    mathcolor (replaces 'color'):
  152.      #rgb | #rrggbb | html-color-name
  153.    mathbackground (replaces 'background'):
  154.      #rgb | #rrggbb | html-color-name
  155. */
  156. /* mathsize (replaces 'fontsize'):
  157.      small, big, number v-unit (a numeric value is handled in the back-end) */
  158. [mathsize="small"] {
  159.   font-size: small;
  160. }
  161. [mathsize="big"] {
  162.   font-size: large;
  163. }
  164. /* mathvariant (replaces 'fontstyle' & 'fontweight' & 'fontslant'; it
  165.    requires using the 'font' shorthand so as to reset everything first):
  166.      normal | bold | italic | bold-italic | double-struck | bold-fraktur | script |
  167.      bold-script | fraktur | sans-serif | bold-sans-serif | sans-serif-italic |
  168.      sans-serif-bold-italic | monospace
  169.  
  170.    Note1: These are handled with additional back-end code:
  171.           double-struck, script, fraktur, bold-fraktur, bold-script
  172.  
  173.    Note2: the 'font' shorthand must specify at least two properties, size & family
  174.    font: [ <font-style> || <font-variant> || <font-weight> ]? 
  175.          <font-size> [ / <line-height> ]?
  176.          <font-family>
  177.  
  178.    XXX bugs 46622 & 114365: need -moz-math-serif, etc, to only lookup math fonts
  179. */
  180. [mathvariant] { /* shared and same as [mathvariant="normal"] */
  181.   font: medium serif;
  182.   font-size: inherit;
  183.   font-size-adjust: inherit;
  184.   font-stretch: inherit;
  185. }
  186. [mathvariant="bold-fraktur"], 
  187. [mathvariant="bold-script"] {
  188.   font-weight: bold;
  189. }
  190. [mathvariant="bold"] {
  191.   font-weight: bold;
  192. }
  193. [mathvariant="italic"] { 
  194.   font-style: italic;
  195. }
  196. [mathvariant="bold-italic"] {
  197.   font-weight: bold;
  198.   font-style: italic;
  199. }
  200. [mathvariant="sans-serif"] {
  201.   font-family: sans-serif;
  202. }
  203. [mathvariant="bold-sans-serif"] {
  204.   font-weight: bold;
  205.   font-family: sans-serif;
  206. }
  207. [mathvariant="sans-serif-italic"] {
  208.   font-family: sans-serif;
  209.   font-style: italic;
  210. }
  211. [mathvariant="sans-serif-bold-italic"] {
  212.   font-family: sans-serif;
  213.   font-weight: bold;
  214.   font-style: italic;
  215. }
  216. [mathvariant="monospace"] {
  217.   font-family: monospace;
  218. }
  219.  
  220. /**************************************************************************/
  221. /* tags with generated content                                            */
  222. /**************************************************************************/
  223.  
  224. ms {
  225.   display: inline;
  226. }
  227. ms:before {
  228.   content: open-quote;
  229. }
  230. ms:after {
  231.   content: close-quote;
  232. }
  233.  
  234. merror {
  235.   display: block;
  236.   font-family: sans-serif;
  237.   font-weight: bold;
  238.   white-space: pre;
  239.   margin: 1em;
  240.   padding: 1em;
  241.   border-width: thin;
  242.   border-style: inset;
  243.   border-color: red;
  244.   font-size: 14pt;
  245.   background-color: lightyellow;
  246. }
  247.  
  248. /**************************************************************************/
  249. /* mtable and its related tags                                            */
  250. /**************************************************************************/
  251.  
  252. mtable {
  253.   display: table;
  254. }
  255. mtable[frame="none"] {
  256.   border: none;
  257. }
  258. mtable[frame="solid"] {
  259.   border: solid thin;
  260. }
  261. mtable[frame="dashed"] {
  262.   border: dashed thin;
  263. }
  264.  
  265. mtr {
  266.   display: table-row;
  267. }
  268.  
  269. mtd {
  270.   display: table-cell;
  271.   vertical-align: baseline;
  272.   text-align: -moz-center;
  273.   white-space: nowrap;
  274. }
  275.  
  276.  
  277. /***********************/
  278. /* -- mtd: columnalign */
  279.  
  280. mtd[columnalign="left"] {
  281.   text-align: left;
  282. }
  283. mtd[columnalign="right"] {
  284.   text-align: right;
  285. }
  286. mtd[columnalign="center"] {
  287.   text-align: -moz-center;
  288. }
  289.  
  290. /********************/
  291. /* -- mtd: rowalign */
  292.  
  293. mtd[rowalign="top"] {
  294.   vertical-align: top;
  295. }
  296. mtd[rowalign="bottom"] {
  297.   vertical-align: bottom;
  298. }
  299. mtd[rowalign="center"] {
  300.   vertical-align: middle;
  301. }
  302. mtd[rowalign="baseline"] {
  303.   vertical-align: baseline;
  304. }
  305. /* -- not yet supported --
  306. mtd[rowalign="axis"] {
  307.   vertical-align: mathline;
  308. }
  309. */
  310.  
  311. /**********************************************************************/
  312. /* rules to achieve the default spacing between cells. The back-end code
  313.    will set the internal attributes depending on the cell's position.
  314.    These rules are hard-coded, the comments indicate what would be
  315.    desirable if the style data could be changed on the fly to pick
  316.    the values that users may set with the attributes of <mtable> */
  317. mtd {
  318.   padding-right: 0.4em;  /* half of columnspacing[colindex] */
  319.   padding-left: 0.4em;   /* half of columnspacing[colindex-1] */
  320.   padding-bottom: 0.5ex; /* half of rowspacing[rowindex] */
  321.   padding-top: 0.5ex;    /* half of rowspacing[rowindex-1] */
  322. }
  323. /* turn off the spacing at the periphery of boundary cells */
  324. mtd[-moz-math-firstrow="true"] {
  325.   padding-top: 0ex;
  326. }
  327. mtd[-moz-math-lastrow="true"] {
  328.   padding-bottom: 0ex;
  329. }
  330. mtd[-moz-math-firstcolumn="true"] {
  331.   padding-left: 0em;
  332. }
  333. mtd[-moz-math-lastcolumn="true"] {
  334.   padding-right: 0em;
  335. }
  336. /* re-instate the spacing if the table has a surrounding frame */
  337. mtable[frame="solid"] > mtr > mtd[-moz-math-firstrow="true"],
  338. mtable[frame="dashed"] > mtr > mtd[-moz-math-firstrow="true"] {
  339.   padding-top: 0.5ex; /* framespacing.top */
  340. }
  341. mtable[frame="solid"] > mtr > mtd[-moz-math-lastrow="true"],
  342. mtable[frame="dashed"] > mtr > mtd[-moz-math-lastrow="true"] {
  343.   padding-bottom: 0.5ex; /* framespacing.bottom */
  344. }
  345. mtable[frame="solid"] > mtr > mtd[-moz-math-firstcolumn="true"],
  346. mtable[frame="dashed"] > mtr > mtd[-moz-math-firstcolumn="true"] {
  347.   padding-left: 0.4em; /* framespacing.left */
  348. }
  349. mtable[frame="solid"] > mtr > mtd[-moz-math-lastcolumn="true"],
  350. mtable[frame="dashed"] > mtr > mtd[-moz-math-lastcolumn="true"] {
  351.   padding-right: 0.4em; /* framespacing.right */
  352. }
  353.  
  354. /**********************************************************************/
  355. /* internal settings to support 'rowlines' and 'columnlines'. To
  356.    achieve the recommended behavior, the back-end code will avoid setting
  357.    unsuitable rules on the cells on the first row and the first column.
  358.    In general, however, authors can use the 'border' property of CSS to
  359.    achieve varying effects down to the level of the table cell. */
  360. mtd[-moz-math-rowline="none"] {
  361.   border-top: none;
  362. }
  363. mtd[-moz-math-rowline="solid"] {
  364.   border-top: solid thin;
  365. }
  366. mtd[-moz-math-rowline="dashed"] {
  367.   border-top: dashed thin;
  368. }
  369. mtd[-moz-math-columnline="none"] {
  370.   border-left: none;
  371. }
  372. mtd[-moz-math-columnline="solid"] {
  373.   border-left: solid thin;
  374. }
  375. mtd[-moz-math-columnline="dashed"] {
  376.   border-left: dashed thin;
  377. }
  378.  
  379.  
  380. /**************************************************************************/
  381. /* Style used for stretchy symbols *must* be normal to avoid misaligments */
  382. /* By leaving the font-family empty, the MathML engine will use the value
  383.    provided by the mathfont-family property in the mathfont.properties file
  384.    or the value of the user's pref("font.mathfont-family", "...").
  385.  
  386.    Authors can make elements on a document to be stretched with different
  387.    fonts, e.g.,
  388.  
  389.    To request the use of TeX fonts, you can add a <style>...</style> with:
  390.    <mo myfonts="tex">...</mo> with the associated CSS declaration
  391.    mo[myfonts="tex"]:-moz-math-font-style-stretchy {
  392.      font-family: CMSY10, CMEX10;
  393.    }
  394.  
  395.    To request the use of Mathematica fonts, you can add a <style>...</style> with:
  396.    <mo myfonts="mathematica">...</mo> with the associated CSS declaration
  397.    mo[myfonts="mathematica"]:-moz-math-font-style-stretchy {
  398.      font-family: Math1, Math2, Math4;
  399.    }
  400.  
  401.    Of course, if you just want all of the stretchy characters in your
  402.    document to be stretched with your preferred list, you can just do:
  403.    :-moz-math-font-style-stretchy {
  404.      font-family: [your-particular-list]
  405.    }
  406.  
  407.    Note that like other fonts in the document, users can override this by
  408.    clicking the pref to override document fonts.
  409. /**************************************************************************/
  410.  
  411. :-moz-math-font-style-stretchy {
  412.   font-style: normal;
  413.   font-family: serif;
  414. /*  background-color: #3C6; */
  415. }
  416. :-moz-math-font-style-anonymous {
  417. }
  418.  
  419. /**********************************************************************/
  420. /* Hide embedded semantic MathML content (as opposed to presentational
  421.    content, which we render). */
  422. annotation-xml[encoding="MathML-Content"] { 
  423.   display: none;
  424. }
  425.