Personal tools

MathML:mstyle

From MozillaWiki

Jump to: navigation, search

The mstyle element is used to make style changes that affect the rendering of its contents. However, CSS may be more appropriate for that purpose e.g. mstyle attributes apply only to the descendants while it would be more convenient to specify a style of mathematics in an external style sheet. Some mstyle attributes may not really be useful in practice (for example, the MathML 3 spec mentions indentation attributes) and we could also ask the MathML WG to remove some of them. Finally, some mstyle attributes are implemented on the layout side (using GetAttribute and data propagation). The method seems less efficient than the standard CSS inheritance and has been the cause of many bugs. This document enumerates the mstyle attributes (based on the MathML RelaxNG schema) and suggests a way to rely on the standard CSS mechanism to address these problems.

The mstyle inheritance mechanism is not exactly the same as CSS. The MathML REC distinguishes three cases:

- "Some attributes, such as displaystyle or scriptlevel (explained below), are inherited from the surrounding context when they are not explicitly set. [...] ". This is the standard CSS inheritance. Most of these attributes are already mapped to style in nsMathMLElement or mathml.css, sometimes with the help of new -moz-* CSS properties.

- "Other attributes, such as linethickness on mfrac, have default values that are not normally inherited [...]". Most of these attributes are handled on the layout/ side using GetAttribute. This method could be replaced by the use of -moz-mstyle-* properties. Calls to GetAttribute will be replaced by calls to the corresponding GetStyle* functions.

- "Another group of attributes, such as stretchy and form, are computed from operator dictionary information, position in the enclosing mrow, and other similar data. [...]". This can be handle the same way as the second case, except that we have to take into account other data for the final computation.

Note: attributes from the first category and general attributes (like id) are indicated in bold. They seem the most important attributes but the MathML testsuite also uses linethickness, maxsize, minsize, accent, accentunder, longdivstyle, decimalpoint and some indentation attributes.

Attribute Description Status Suggestion
id Establishes a unique identifier associated with the element to support

linking, cross-references and parallel markup.

Implemented /
class Associates the element with a set of style classes for use with XSLT and

CSS21.

Implemented /
style Associates style information with the element for use with XSLT and CSS21. Implemented /
href Can be used to establish the element as a hyperlink to the specfied URI. Implemented /
xref References another element within the document. Not implemented /
other Attribute used for non-standard extension. Deprecated. /
mathcolor Specifies the foreground color to use when drawing the components of this

element.

Implemented in nsMathMLElement via the CSS property "color" /
mathbackground Specifies the background color to be used to fill in the bounding box of the

element and its children. Contrary to MathML 2, this does not specify a default background color but the background of the element itself.

Implemented in nsMathMLElement via the CSS property "background" /
scriptlevel Changes the scriptlevel in effect for the children. Implemented via the CSS property "-moz-script-level" /
displaystyle Changes the displaystyle in effect for the children. Implemented via a mPresentationData on the MathML frames. Use a new CSS property "-moz-display-style" and remove the data

in mPresentationData

scriptsizemultiplier Specifies the multiplier to be used to adjust font size due to changes in

scriptlevel.

Implemented via the CSS property "-moz-script-size-multiplier" /
scriptminsize Specifies the minimum font size allowed due to changes in scriptlevel. Implemented via the CSS property "-moz-script-min-size" /
infixlinebreakstyle Specifies the default linebreakstyle to use for infix operators Not Implemented. Implement it via a new CSS property "-moz-line-break-style"
decimalpoint Specifies the character used to determine the alignment point within mstack

and mtable columns when the "decimalpoint" value is used to specify the alignment.

Not implemented. Implement it via a new CSS property "-moz-decimal-point"
accent Specifies whether overscript is drawn as an "accent" or as a limit. Implemented in nsMathMLmunderoverFrame via GetAttribute. Replace GetAttribute by a new CSS property "-moz-mstyle-accent"
accentunder Specifies whether underscript is drawn as an "accent" or as a limit. Implemented in nsMathMLmunderoverFrame via GetAttribute Replace GetAttribute by a new CSS property "-moz-mstyle-accentunder"
align Specifies whether the scripts are aligned left, center, or right under/over

the base. Apply to munder, mover, and munderover descendants.

Implemented in nsMathMLmunderoverFrame via GetAttribute Replace GetAttribute by a new CSS property "-moz-mstyle-align"
alignmentscope This attribute is described with the alignment elements, maligngroup and

malignmark

Not Implemented Implement it via a new CSS property "-moz-mstyle-alignmentscope"
bevelled Specifies whether the fraction should be displayed in a beveled style, rather

than "build up" vertically.

Implemented in nsMathMLmfracFrame via GetAttribute Replace GetAttribute by a new CSS property "-moz-mstyle-bevelled"
charalign Specifies the horizontal alignment of digits within a column. Not Implemented Implement it via a new CSS property "-moz-mstyle-charalign"
charspacing Specifies the amount of space to put between each column. Not Implemented Implement it via a new CSS property "-moz-mstyle-charspacing"
close Specifies the closing delimiter. Implemented nsMathMLmfencedFrame in via GetAttribute Replace GetAttribute by a new CSS property "-moz-mstyle-close"
columnalign Specifies the horizontal alignment of the cells with respect to other cells

within the same column. Apply to mtable descendants.

Implemented but see bug 768819. Also, relies on a private _moz-*

attribute that should be removed (see bug 731667).

Implement it via a new CSS property "-moz-mstyle-column-align"
columnlines Specifies whether and what kind of lines should be added between each column Implemented but see bug 768819. Also, relies on a private _moz-*

attribute that should be removed (see bug 731667).

Implement it via a new CSS property "-moz-mstyle-column-lines"
columnspacing Specifies how much space to add between columns Not implemented (see bug 330964). Implement it via a new CSS property "-moz-mstyle-column-spacing"
columnspan Causes the cell to be treated as if it occupied the number of columns

specified

Implemented but see bug 768819. Implement it via a new CSS property "-moz-mstyle-column-span".
columnwidth Specifies how wide a column should be: "auto" means that the column should be

as wide as needed

Not implemented. Implement it via a new CSS property "-moz-mstyle-column-width".
crossout specifies how the column content below each carry is "crossed out"; Not Implemented Implement it via a new CSS property "-moz-mstyle-crossout".
denomalign Specifies the alignment of the denominator under the fraction. Implemented in nsMathMLmfracFrame via GetAttribute Replace GetAttribute by a new CSS property "-moz-mstyle-mfrac".
depth Specifies the desired depth of the space. Apply to mspace descendants. Implemented in nsMathMLmspaceFrame via GetAttribute Replace GetAttribute by a new CSS property "-moz-mstyle-depth".
dir Specifies the overall directionality ltr (Left To Right) or rtl

(Right To Left) to use to layout the children of the row ;

Implemented via a mPresentationData on the MathML frames. Use the CSS property "direction" and remove the data in mPresentationData.

See bug 764996

edge Specifies whether the alignment point will be found on the left or right edge

of some element or character.

Not Implemented Implement it via a new CSS property "-moz-mstyle-edge"
equalcolumns Specifies whether to force all columns to have the same total width. Not Implemented Implement it via a new CSS property "-moz-mstyle-equalcolumns"
equalrows Specifies whether to force all rows to have the same total height. Not Implemented Implement it via a new CSS property "-moz-mstyle-equalrows"
fence Specifies whether the operator represents a ‘fence’, such as a parenthesis. Implemented in nsMathMLmoFrame via GetAttribute Replace GetAttribute by a new CSS property "-moz-mstyle-fence"
form Specifies the role of the operator in the enclosing expression. Implemented in nsMathMLmoFrame via GetAttribute Replace GetAttribute by a new CSS property "-moz-mstyle-movablelimits"
frame Specifies whether and what kind of lines should be drawn around the table. Implemented in mathml.css but see bug 768819 Implement it via a new CSS property "-moz-mstyle-frame"
framespacing Specifies the additional spacing added between the table and frame, if frame

is not "none"

Not implemented. Implement it via a new CSS property "-moz-mstyle-column-width".
groupalign Apply to mtable descendants.

This attribute is described with the alignment elements, maligngroup and malignmark

Not Implemented Implement it via a new CSS property "-moz-mstyle-groupalign"
height Specifies the desired height of the space. Apply to mspace descendants. Implemented in nsMathMLmspaceFrame via GetAttribute Replace GetAttribute by a new CSS property "-moz-mstyle-height".
indentalign Specifies the positioning of lines when linebreaking takes place within an

mrow

Not Implemented Ask the MathML WG to remove this attribute on mstyle?

"Note that except for cases where heavily marked-up manual linebreaking is desired, many of these attributes are most useful when bound on an mstyle or math element."

indentalignfirst Specifies the indentation style to use for the first line of a formula Not Implemented Ask the MathML WG to remove this attribute on mstyle?
indentalignlast Specifies the indentation style to use for the last line when a linebreak

occurs within a given mrow;

Not Implemented Ask the MathML WG to remove this attribute on mstyle?
indentshift Specifies an additional indentation offset relative to the position

determined by indentalign.

Not Implemented Ask the MathML WG to remove this attribute on mstyle?
indentshiftfirst Specifies the offset to use for the first line of a formula; Not Implemented Ask the MathML WG to remove this attribute on mstyle?
indentshiftlast Specifies the offset to use for the last line when a linebreak occurs within

a given mrow;

Not Implemented Ask the MathML WG to remove this attribute on mstyle?
indenttarget Specifies the id of another element whose horizontal position determines the

position of indented lines when indentalign="id".

Not Implemented Ask the MathML WG to remove this attribute on mstyle?
largeop Specifies whether the operator is considered a ‘large’ operator Implemented in nsMathMLmoFrame via GetAttribute Replace GetAttribute by a new CSS property "-moz-mstyle-largeop"
leftoverhang Specifies an extra amount that the line should overhang on the left of the

leftmost column spanned by the line.

Not implemented Implement it via a new CSS property "-moz-mstyle-rightoverhang".
length Specifies the the number of columns that should be spanned by the line. Not Implemented Implement it via a new CSS property "-moz-mstyle-length" to

specify a default value.

linebreak Specifies the desirability of a linebreak at a <mo> or <mspace> Not Implemented Ask the MathML WG to remove this attribute?
linebreakmultchar Specifies the character used to make an &InvisibleTimes; operator visible at

a linebreak.

Not Implemented Implement it via a new CSS property "-moz-mstyle-line-break-multchar" to

specify a default value.

linebreakstyle Specifies whether a linebreak occurs ‘before’ or ‘after’ the operator when a

linebreaks occur on this operator; or whether the operator is duplicated

Not Implemented Implement it via a new CSS property "-moz-mstyle-line-break-style" to

specify a default value.

lineleading Specifies the amount of vertical space to use after a linebreak. Not Implemented Implement it via a new CSS property "-moz-mstyle-line-leading" to

specify a default value.

linethickness Specifies the thickness of the horizontal "fraction bar", or "rule" Implemented in nsMathMLmfracFrame via GetAttribute

Replace GetAttribute by a new CSS property "-moz-mstyle-line-thickness" to specify a default value.

location Specifies the location of the carry or borrow relative to the character below

it in the associated column

Not implemented Implement it via a new CSS property "-moz-mstyle-location".
longdivstyle Controls the style of the long division layout. Not implemented Implement it via a new CSS property "-moz-mstyle-longdivstyle".
lquote Specifies the opening quote to enclose the content. Implemented in nsMathMLmoFrame via GetAttribute but see bug 656391

and bug 560100

Implement it via a new CSS property "-moz-mstyle-lquote".
lspace Specifies the leading space appearing before the operator.

Apply to mo descendants.

Implemented in nsMathMLmoFrame via GetAttribute Replace GetAttribute by a new CSS property "-moz-mstyle-lspace"
mathsize Specifies the size to display the token content. Implemented in nsMathMLElement via the CSS property "font-size". /
mathvariant Specifies the logical class of the token Partially Implemented in mathml.css (see bug 114365). Also, relies on the

private _moz-math-font-style attribute that should be removed (bug 69409).

Determine the best way to implement this attribute and the mstyle

inheritance.

maxsize Specifies the maximum size of the operator when stretchy; Implemented in nsMathMLmoFrame via GetAttribute Replace GetAttribute by a new CSS property "-moz-mstyle-maxsize"
minlabelspacing Specifies the minimum space allowed between a label and the adjacent cell in

the row.

Not Implemented Implement it via a new CSS property "-moz-mstyle-minlabelspacing"
minsize Specifies the minimum size of the operator when stretchy; Implemented in nsMathMLmoFrame via GetAttribute Replace GetAttribute by a new CSS property "-moz-mstyle-minsize"
movablelimits Specifies whether under- and overscripts attached to this operator ‘move’ to

the more compact sub- and superscript positions when displaystyle is false

Implemented in nsMathMLmoFrame via GetAttribute Replace GetAttribute by a new CSS property "-moz-mstyle-movablelimits"
mslinethickness Specifies how thick the line should be drawn. Not Implemented Implement it via a new CSS property "-moz-mstyle-mslinethickness"
notation Specifies a space separated list of notations to be used to enclose the

children.

Implemented in nsMathMLmencloseFrame via GetAttribute Replace GetAttribute by a new CSS property "-moz-mstyle-notation"
numalign Specifies the alignment of the numerator over the fraction. Implemented in nsMathMLmfracFrame via GetAttribute Replace GetAttribute by a new CSS property "-moz-mstyle-bevelled"
open Specifies the opening delimiter. Implemented nsMathMLmfencedFrame in via GetAttribute Replace GetAttribute by a new CSS property "-moz-mstyle-open"
position specifies the horizontal position of the rows within this group relative the

position determined by the containing msgroup

Not Implemented Implement it via a new CSS property "-moz-mstyle-position".
rightoverhang Specifies an extra amount that the line should overhang on the right of the

rightmost column spanned by the line.

Not implemented Implement it via a new CSS property "-moz-mstyle-rightoverhang".
rowalign Specifies the vertical alignment of the cells with respect to other cells

within the same row. Apply to mtable descendants.

Implemented but see bug 768819. Also, relies on a private _moz-*

attribute that should be removed (see bug 731667).

Implement it via a new CSS property "-moz-mstyle-row-align"
rowlines Specifies whether and what kind of lines should be added between each row Implemented but see bug 768819. Also, relies on a private _moz-*

attribute that should be removed (see bug 731667).

Implement it via a new CSS property "-moz-mstyle-row-lines"
rowspacing Specifies how much space to add between rows. Not implemented (see bug 330964). Implement it via a new CSS property "-moz-mstyle-row-spacing"
rowspan Causes the cell to be treated as if it occupied the number of rows specified. Implemented but see bug 768819. Implement it via a new CSS property "-moz-mstyle-column-span".
rquote Specifies the closing quote to enclose the content. Implemented in nsMathMLmoFrame via GetAttribute but see bug 656391

and bug 560100

Implement it via a new CSS property "-moz-mstyle-rquote".
rspace Specifies the trailing space appearing after the operator. Implemented in nsMathMLmoFrame via GetAttribute Replace GetAttribute by a new CSS property "-moz-mstyle-rspace"
selection Specifies which child should be used for viewing. Its value should be between

1 and the number of children of the element.

Implemented in nsMathMLmactionFrame via GetAttribute but see bug 734729 Replace GetAttribute by a new CSS property "-moz-mstyle-selection"
separator Specifies whether the operator represents a ‘separator’, or punctuation. Implemented in nsMathMLmoFrame via GetAttribute Replace GetAttribute by a new CSS property "-moz-mstyle-separator"
separators Specifies a sequence of zero or more separator characters, optionally

separated by whitespace.

Implemented nsMathMLmfencedFrame in via GetAttribute Replace GetAttribute by a new CSS property "-moz-mstyle-separators"
shift Specifies an incremental shift of position for successive children (rows or

groups) within this group.

Not Implemented Implement it via a new CSS property "-moz-mstyle-shift"
side Specifies on what side of the table labels from enclosed mlabeledtr (if any)

should be placed.

Not Implemented. Implement it via a new CSS property "-moz-mstyle-side"
stackalign Specifies which column is used to horizontally align the rows. Not Implemented Implement it via a new CSS property "-moz-mstyle-stackalign"
stretchy Specifies whether the operator should stretch to the size of adjacent material Implemented in nsMathMLmoFrame via GetAttribute Replace GetAttribute by a new CSS property "-moz-mstyle-symmetric"
subscriptshift Specifies the minimum amount to shift the baseline of subscript down; Implemented in nsMathMLmsubsupFrame (and similar frames) via GetAttribute Replace GetAttribute by a new CSS property "-moz-mstyle-subscriptshift"
superscriptshift Specifies the minimum amount to shift the baseline of superscript up; Implemented in nsMathMLmsubsupFrame (and similar frames) via GetAttribute Replace GetAttribute by a new CSS property "-moz-mstyle-superscriptshift"
symmetric Specifies whether the operator should be kept symmetric around the math axis

when stretchy.

Implemented in nsMathMLmoFrame via GetAttribute Replace GetAttribute by a new CSS property "-moz-mstyle-symmetric"
valign Specifies the baseline alignment point of the image with respect to the

current baseline.

Not implemented Ask the MathML WG to remove this element on mstyle? Other mglyph attributes

like width or height do not apply on mglyph descendants.

width Specifies the desired width of the space. Apply to mspace descendants. Implemented in nsMathMLmspaceFrame via GetAttribute Replace GetAttribute by a new CSS property "-moz-mstyle-width"
fontfamily Should be the name of a font that may be available to a MathML renderer, or a

CSS font specification. Does not apply to mglyph descendants.

Deprecated.

Implemented in nsMathMLElement via the CSS property "font-family".

Add a warning (bug 553917) and remove the support in future.
fontweight Specified the font weight for the token. Deprecated in favor of mathvariant.

Implemented in mathml.css via the CSS property "font-weight". This property is also set by the private _moz-math-font-style attribute that should be removed (bug 69409).

Add a warning and remove the support in future.
fontstyle Specified the size for the token. Deprecated in favor of mathvariant.

Implemented in mathml.css. This property is also set by the private _moz-math-font-style attribute that should be removed (bug 69409).

Add a warning and remove the support in future.
fontsize Specified the size for the token. Deprecated in favor of mathsize.

Implemented in nsMathMLElement via the CSS property "font-size".

Add a warning (bug 553917) and remove the support in future.
color Specified the color for the token. Deprecated in favor of mathcolor.

Implemented in nsMathMLElement via the CSS property "color".

Add a warning (bug 553917) and remove the support in future.
background Specified the background color to be used to fill in the bounding box of the

element and its children.

Deprecated in favor of mathbackground.

Implemented in nsMathMLElement via the CSS property "background".

Add a warning (bug 553917) and remove the support in future.
veryverythinmathspace Binding of namedspaces to new values. Deprecated. Support removed in bug 673759. /
verythinmathspace Binding of namedspaces to new values. Deprecated. Support removed in bug 673759. /
thinmathspace Binding of namedspaces to new values. Deprecated. Support removed in bug 673759. /
mediummathspace Binding of namedspaces to new values. Deprecated. Support removed in bug 673759. /
thickmathspace Binding of namedspaces to new values. Deprecated. Support removed in bug 673759. /
verythickmathspace Binding of namedspaces to new values. Deprecated. Support removed in bug 673759. /
veryverythickmathspace Binding of namedspaces to new values. Deprecated. Support removed in bug 673759. /