D Document Object Model for MathML

Overview: Mathematical Markup Language (MathML) Version 2.0
Previous: C Content Element Definitions
Next: E MathML Document Object Model Bindings (Non-normative)
 
D Document Object Model for MathML
D.1 IDL Interfaces
   D.1.1 Miscellaneous Object Definitions
      D.1.1.1 MathMLDOMImplementation
      D.1.1.2 MathMLDocument
      D.1.1.3 MathMLNodeList
   D.1.2 Generic MathML Elements
      D.1.2.1 MathMLElement
      D.1.2.2 MathMLContainer
      D.1.2.3 MathMLMathElement
      D.1.2.4 MathMLSemanticsElement
      D.1.2.5 MathMLAnnotationElement
      D.1.2.6 MathMLXMLAnnotationElement
   D.1.3 Presentation Elements
      D.1.3.1 MathMLPresentationElement
      D.1.3.1 Leaf Presentation Element Interfaces
         D.1.3.1.1 MathMLGlyphElement
         D.1.3.1.2 MathMLSpaceElement
      D.1.3.2 Presentation Token Element Interfaces
         D.1.3.2.1 MathMLPresentationToken
         D.1.3.2.2 MathMLOperatorElement
         D.1.3.2.3 MathMLStringLitElement
      D.1.3.3 Presentation Container Interfaces
         D.1.3.3.1 MathMLPresentationContainer
         D.1.3.3.2 MathMLStyleElement
         D.1.3.3.3 MathMLPaddedElement
         D.1.3.3.4 MathMLFencedElement
         D.1.3.3.5 MathMLEncloseElement
         D.1.3.3.6 MathMLActionElement
      D.1.3.4 Presentation Schemata Interfaces
         D.1.3.4.1 MathMLFractionElement
         D.1.3.4.2 MathMLRadicalElement
         D.1.3.4.3 MathMLScriptElement
         D.1.3.4.4 MathMLUnderOverElement
         D.1.3.4.5 MathMLMultiScriptsElement
         D.1.3.4.6 MathMLTableElement
         D.1.3.4.7 MathMLTableRowElement
         D.1.3.4.8 MathMLLabeledRowElement
         D.1.3.4.9 MathMLTableCellElement
         D.1.3.4.10 MathMLAlignGroupElement
         D.1.3.4.11 MathMLAlignMarkElement
   D.1.4 Content Elements
      D.1.4.1 MathMLContentElement
      D.1.4.1 Content Token Interfaces
         D.1.4.1.1 MathMLContentToken
         D.1.4.1.2 MathMLCnElement
         D.1.4.1.3 MathMLCiElement
         D.1.4.1.4 MathMLCsymbolElement
      D.1.4.2 Content Container Interfaces
         D.1.4.2.1 MathMLContentContainer
         D.1.4.2.2 MathMLApplyElement
         D.1.4.2.3 MathMLFnElement
         D.1.4.2.4 MathMLLambdaElement
         D.1.4.2.5 MathMLSetElement
         D.1.4.2.6 MathMLListElement
         D.1.4.2.7 MathMLBvarElement
      D.1.4.3 Content Leaf Element Interfaces
         D.1.4.3.1 MathMLPredefinedSymbol
      D.1.4.4 Other Content Element Interfaces
         D.1.4.4.1 MathMLIntervalElement
         D.1.4.4.2 MathMLConditionElement
         D.1.4.4.3 MathMLDeclareElement
         D.1.4.4.4 MathMLVectorElement
         D.1.4.4.5 MathMLMatrixElement
         D.1.4.4.6 MathMLMatrixrowElement
         D.1.4.4.7 MathMLPiecewiseElement
         D.1.4.4.8 MathMLCaseElement
D.2 MathML DOM Tables
   D.2.1 Chart of MathML DOM Inheritance
   D.2.2 Table of Elements and MathML DOM Representations

The following sections describe the interfaces that have been defined in the Document Object Model for MathML. Please refer to Chapter 8 [Document Object Model for MathML] for more information.

Bindings for IDL, Java and ECMAScript are located in Appendix E [MathML Document Object Model Bindings].

D.1 IDL Interfaces

D.1.1 Miscellaneous Object Definitions

Interface MathMLDOMImplementation

Extends: DOMImplementation

This interface extends the DOMImplementation interface by adding a method to create a MathMLDocument.

IDL Definition

interface MathMLDOMImplementation: DOMImplementation {
  MathMLDocument createMathMLDocument();
};

Methods

createMathMLDocument

Creates a MathMLDocument with a minimal tree containing only a MathMLMathElement corresponding to a MathML math element. The MathMLMathElement is empty, having no child elements or non-default attributes; it is the root element of the document, and is the element accessed via the documentElement attribute of the MathMLDocument. Note that a MathMLDocument object should only be created for a stand-alone MathML document.

Return value

MathMLDocument

The MathMLDocument created.

This method raises no exceptions.

Interface MathMLDocument

Extends: Document

This interface extends the Document interface to add access to document properties relating to navigation. The documentElement attribute for a MathMLDocument should be the MathMLMathElement representing the top-level math element which is the root of the document.

IDL Definition

interface MathMLDocument: Document {
  readonly attribute DOMString referrer;
  readonly attribute DOMString domain;
  readonly attribute DOMString URI;
};

Attributes

referrer of type DOMString, readonly

The URI of the page that linked to this document, if available. This is null if the user navigated directly to the page. If this is not a stand-alone MathML document (e.g. is embedded in an XHTML document), this may be retrieved from the parent Document if available.

domain of type DOMString, readonly

The domain name of the server that served the document, or null if the server cannot be identified by a domain name, or if it is not available. If this is not a stand-alone MathML document (e.g. is embedded in an XHTML document), this may be retrieved from the parent Document if available.

URI of type DOMString, readonly

The complete URI of this document. This is null if this is not a stand-alone MathML document.

Interface MathMLNodeList

Extends: NodeList

This interface is provided as a specialization of the NodeList interface. The child Nodes of this NodeList must be MathMLElements or Text nodes.

Note that MathMLNodeLists are frequently used in the DOM as values of readonly attributes, encapsulating, for instance, various collections of child elements. When used in this way, these objects are always understood to be live, in the sense that changes to the document are immediately reflected in them.

IDL Definition

interface MathMLNodeList: NodeList {
};

D.1.2 Generic MathML Elements

Interface MathMLElement

Extends: Element

All MathML element interfaces derive from this object, which derives from the basic DOM interface Element.

IDL Definition

interface MathMLElement: Element {
  attribute DOMString className;
  attribute DOMString mathElementStyle;
  attribute DOMString id;
  attribute DOMString xref;
  attribute DOMString href;
  readonly attribute MathMLMathElement ownerMathElement;
};

Attributes

className of type DOMString

The class attribute of the element. See the discussion elsewhere in this document of the class attribute; see also the HTML definition of this attribute.

mathElementStyle of type DOMString

A string identifying the element's style attribute.

id of type DOMString

The element's identifier. See the discussion elsewhere in this document of the id attribute; see also the HTML definition.

xref of type DOMString

The xref attribute of the element. See the discussion elsewhere in this document of the xref attribute.

href of type DOMString

The xlink:href attribute of the element. See the discussion elsewhere in this document of the xlink:href attribute; see also the definition of this attribute in the XLink specification.

ownerMathElement of type MathMLMathElement, readonly

The MathMLMathElement corresponding to the nearest math element ancestor of this element. Should be null if this element is a top-level math element.

Interface MathMLContainer

This is an abstract interface containing functionality required by MathML elements that may contain arbitarily many child elements. No elements are directly supported by this interface; all instances are instances of either MathMLPresentationContainer, MathMLContentContainer, or MathMLMathElement.

IDL Definition

interface MathMLContainer {
  readonly attribute unsigned long nArguments;
  readonly attribute MathMLNodeList arguments;
  readonly attribute MathMLNodeList declarations;
  MathMLElement getArgument(in unsigned long index);
  MathMLElement setArgument(in MathMLElement newArgument, in unsigned long index);
  MathMLElement insertArgument(in MathMLElement newArgument, in unsigned long index);
  void deleteArgument(in unsigned long index);
  MathMLElement removeArgument(in unsigned long index);
  MathMLDeclareElement getDeclaration(in unsigned long index);
  MathMLDeclareElement setDeclaration(in MathMLDeclareElement newDeclaration, in unsigned long index);
  MathMLDeclareElement insertDeclaration(in MathMLDeclareElement newDeclaration, in unsigned long index);
  MathMLDeclareElement removeDeclaration(in unsigned long index);
  void deleteDeclaration(in unsigned long index);
};

Attributes

nArguments of type unsigned long, readonly

The number of child elements of this element which represent arguments of the element, as opposed to qualifiers or declare elements. Thus for a MathMLContentContainer it does not contain elements representing bound variables, conditions, separators, degrees, or upper or lower limits (bvar, condition, sep, degree, lowlimit, or uplimit).

arguments of type MathMLNodeList, readonly

This attribute accesses the child MathMLElements of this element which are arguments of it, as a MathMLNodeList. Note that this list does not contain any MathMLElements representing qualifier elements or declare elements.

declarations of type MathMLNodeList, readonly

Provides access to the declare elements which are children of this element, in a MathMLNodeList. All Nodes in this list must be MathMLDeclareElements.

Methods

getArgument

This method returns the indexth child argument element of this element. This frequently differs from the value of Node::childNodes().item(index), as qualifier elements and declare elements are not counted.

Parameters

unsigned longindex

The one-based index of the argument to be retrieved.

Return value

MathMLElement

A MathMLElement representing the index-th argument of this element.

Exceptions

DOMException

INDEX_SIZE_ERR: Raised if index is greater than the number of child elements.

setArgument

This method sets newArgument as the index-th argument of this element. If there is currently an index-th argument, it is replaced by newArgument. This frequently differs from setting the node at Node::childNodes().item(index), as qualifier elements and declare elements are not counted.

Parameters

MathMLElementnewArgument

A MathMLElement representing the element that is to be set as the index-th argument of this element.

unsigned longindex

The index of the argument that is to be set to newArgument. The first argument is numbered 1. If index is one more than the current number of arguments, a new argument is appended.

Return value

MathMLElement

The MathMLElement child of this element that represents the new argument in the DOM.

Exceptions

DOMException

HIERARCHY_REQUEST_ERR: Raised if this element does not permit a child element of the type of newArgument, if this is a MathMLContentContainer and newArgument is a qualifier element, or if newElement is a MathMLDeclareElement.

INDEX_SIZE_ERR: Raised if index is greater than one more than the number of child elements.

insertArgument

This method inserts newArgument before the current index-th argument of this element. If index is 0, or if index is one more than the current number of arguments, newArgument is appended as the last argument. This frequently differs from setting the node at Node::childNodes().item(index), as qualifier elements and declare elements are not counted.

Parameters

MathMLElementnewArgument

A MathMLElement representing the element that is to be inserted as a child argument of this element.

unsigned longindex

The one-based index of the position before which newArgument is to be inserted. The first argument is numbered 1.

Return value

MathMLElement

The MathMLElement child of this element that represents the new argument in the DOM.

Exceptions

DOMException

HIERARCHY_REQUEST_ERR: Raised if this element does not permit a child argument of the type of newArgument, or, for MathMLContentContainers, if newArgument represents a qualifier element.

INDEX_SIZE_ERR: Raised if index is greater than one more than the number of child arguments.

deleteArgument

This method deletes the index-th child element that is an argument of this element. Note that child elements which are qualifier elements or declare elements are not counted in determining the index-th argument.

Parameters

unsigned longindex

The one-based index of the argument to be deleted.

Return value

void

None.

Exceptions

DOMException

INDEX_SIZE_ERR: Raised if index is greater than the number of child elements.

removeArgument

This method deletes the index-th child element that is an argument of this element, and returns it to the caller. Note that child elements that are qualifier elements or declare elements are not counted in determining the index-th argument.

Parameters

unsigned longindex

The one-based index of the argument to be removed.

Return value

MathMLElement

A MathMLElement representing the argument being removed.

Exceptions

DOMException

INDEX_SIZE_ERR: Raised if index is greater than the number of child elements.

getDeclaration

This method retrieves the index-th child declare element of this element.

Parameters

unsigned longindex

A one-based index into the list of child declare elements of this element giving the position of the declare element to be retrieved.

Return value

MathMLDeclareElement

The MathMLDeclareElement representing the index-th child declare.

Exceptions

DOMException

INDEX_SIZE_ERR: Raised if index is greater than the number of child declare elements.

setDeclaration

This method inserts newDeclaration as the index-th child declaration of this element. If there is already an index-th declare child element, it is replaced by newDeclaration.

Parameters

MathMLDeclareElementnewDeclaration

A MathMLDeclareElement to be inserted as the index-th child declare element.

unsigned longindex

A one-based index into the list of child declare elements of this element giving the position into which newDeclaration is to be inserted. If index is one more than the number of declare children of this element, newDeclaration is appended as the last declare child.

Return value

MathMLDeclareElement

The MathMLDeclareElement being inserted.

Exceptions

DOMException

INDEX_SIZE_ERR: Raised if index is greater than one more than the number of child declare elements.

HIERARCHY_REQUEST_ERR: Raised if this element does not permit child declare elements.

insertDeclaration

This method inserts newDeclaration before the current index-th child declare element of this element. If index is 0, newDeclaration is appended as the last child declare element.

Parameters

MathMLDeclareElementnewDeclaration

A MathMLDeclareElement to be inserted as the index-th child declare element.

unsigned longindex

A one-based index into the list of child declare elements of this element giving the position before which newDeclaration is to be inserted. If index is 0 or if it is one more than the number of child declare children, newDeclaration is appended as the last child declare element.

Return value

MathMLDeclareElement

The MathMLDeclareElement child of this element representing newDeclaration in the DOM.

Exceptions

DOMException

INDEX_SIZE_ERR: Raised if index is greater than one more than the number of child declare elements.

HIERARCHY_REQUEST_ERR: Raised if this element does not permit child declare elements.

removeDeclaration

This method removes the MathMLDeclareElement representing the index-th declare child element of this element, and returns it to the caller. Note that index is the position in the list of declare element children, as opposed to the position in the list of all child Nodes.

Parameters

unsigned longindex

The one-based index of the declare element to be removed.

Return value

MathMLDeclareElement

The MathMLDeclareElement being removed as a child Node of this element.

Exceptions

DOMException

INDEX_SIZE_ERR: Raised if index is greater than the number of child declare elements.

deleteDeclaration

This method deletes the MathMLDeclareElement representing the index-th declare child element of this element. Note that index is the position in the list of declare element children, as opposed to the position in the list of all child Nodes.

Parameters

unsigned longindex

The one-based index of the declare element to be removed.

Return value

void

None.

Exceptions

DOMException

INDEX_SIZE_ERR: Raised if index is greater than the number of child declare elements.

Interface MathMLMathElement

Extends: MathMLElement, MathMLContainer

This interface represents the top-level MathML math element.

It may become useful for interfacing between the Document Object Model objects encoding an enclosing document and the MathML DOM elements that are its children. It could also be used for some purposes as a MathML DOM surrogate for a Document object. For instance, MathML-specific factory methods could be placed here, as could methods for creating MathML-specific Iterators or TreeWalkers. However, this functionality is as yet undefined.

IDL Definition

interface MathMLMathElement: MathMLElement, MathMLContainer {
  attribute DOMString macros;
  attribute DOMString display;
};

Attributes

macros of type DOMString

Represents the macros attribute of the math element. See Section 7.1.2 [The Top-Level math Element].

display of type DOMString

Represents the display attribute of the math element. This value is either block or inline. See Section 7.1.2 [The Top-Level math Element].

Interface MathMLSemanticsElement

Extends: MathMLElement

This interface represents the semantics element in MathML.

IDL Definition

interface MathMLSemanticsElement: MathMLElement {
  attribute MathMLElement body;
  readonly attribute unsigned long nAnnotations;
  MathMLElement getAnnotation(in unsigned long index);
  MathMLElement insertAnnotation(in MathMLElement newAnnotation, in unsigned long index);
  MathMLElement setAnnotation(in MathMLElement newAnnotation, in unsigned long index);
  void deleteAnnotation(in unsigned long index);
  MathMLElement removeAnnotation(in unsigned long index);
};

Attributes

body of type MathMLElement

This attribute represents the first child of the semantics element, i.e. the child giving the `primary' content represented by the element.

nAnnotations of type unsigned long, readonly

Represents the number of annotation or annotation-xml children of the semantics element, i.e. the number of alternate content forms for this element.

Methods

getAnnotation

This method gives access to the index-th `alternate' content associated with a semantics element.

Parameters

unsigned longindex

The one-based index of the annotation being retrieved.

Return value

MathMLElement

The MathMLAnnotationElement or MathMLXMLAnnotationElement representing the index-th annotation or annotation-xml child of the semantics element. Note that all child elements of a semantics element other than the first are required to be of one of these types.

This method raises no exceptions.

insertAnnotation

This method inserts newAnnotation before the current index-th `alternate' content associated with a semantics element. If index is 0, newAnnotation is appended as the last annotation or annotation-xml child of this element.

Parameters

MathMLElementnewAnnotation

A MathMLAnnotationElement or MathMLXMLAnnotationElement representing the new annotation or annotation-xml to be inserted.

unsigned longindex

The position in the list of annotation or annotation-xml children before which newAnnotation is to be inserted. The first annotation is numbered 1.

Return value

MathMLElement

The MathMLAnnotationElement or MathMLXMLAnnotationElement child of this element that represents the new annotation in the DOM.

Exceptions

DOMException

HIERARCHY_REQUEST_ERR: Raised if newAnnotation is not a MathMLAnnotationElement or MathMLXMLAnnotationElement.

INDEX_SIZE_ERR: Raised if index is greater than the current number of annotation or annotation-xml children of this semantics element.

setAnnotation

This method allows setting or replacement of the index-th `alternate' content associated with a semantics element. If there is already an annotation or annotation-xml element with this index, it is replaced by newAnnotation.

Parameters

MathMLElementnewAnnotation

A MathMLAnnotationElement or MathMLXMLAnnotationElement representing the new value of the index-th annotation or annotation-xml child of this semantics element.

unsigned longindex

The position in the list of annotation or annotation-xml children of this semantics element that is to be occupied by newAnnotation. The first annotation element is numbered 1.

Return value

MathMLElement

The MathMLAnnotationElement or MathMLXMLAnnotationElement child of this element that represents the new annotation in the DOM.

Exceptions

DOMException

HIERARCHY_REQUEST_ERR: Raised if newAnnotation is not a MathMLAnnotationElement or MathMLXMLAnnotationElement.

INDEX_SIZE_ERR: Raised if index is greater than one more than the current number of annotation or annotation-xml children of this semantics element.

deleteAnnotation

A convenience method to delete the index-th `alternate' content associated with this semantics element.

Parameters

unsigned longindex

The one-based index of the annotation being deleted.

Return value

void

None.

This method raises no exceptions.

removeAnnotation

A convenience method to delete the index-th `alternate' content associated with this semantics element, and to return it to the caller.

Parameters

unsigned longindex

The one-based index of the annotation being deleted.

Return value

MathMLElement

The MathMLAnnotationElement or MathMLXMLAnnotationElement being deleted.

This method raises no exceptions.

Interface MathMLAnnotationElement

Extends: MathMLElement

This interface represents the annotation element of MathML.

IDL Definition

interface MathMLAnnotationElement: MathMLElement {
  attribute DOMString body;
  attribute DOMString encoding;
};

Attributes

body of type DOMString

Provides access to the content of an annotation element.

encoding of type DOMString

Provides access to the encoding attribute of an annotation element.

Interface MathMLXMLAnnotationElement

Extends: MathMLElement

This interface represents the annotation-xml element of MathML.

IDL Definition

interface MathMLXMLAnnotationElement: MathMLElement {
  attribute DOMString encoding;
};

Attributes

encoding of type DOMString

Provides access to the encoding attribute of an xml-annotation element.

D.1.3 Presentation Elements

Interface MathMLPresentationElement

Extends: MathMLElement

This interface is provided to serve as a base interface for various MathML Presentation interfaces. It contains no new attributes or methods at this time; however, it is felt that the distinction between Presentation and Content MathML entities should be indicated in the MathMLElement hierarchy. In particular, future versions of the MathML DOM may add functionality on this interface; it may also serve as an aid to implementors.

IDL Definition

interface MathMLPresentationElement: MathMLElement {
};

D.1.3.1 Leaf Presentation Element Interfaces

Interface MathMLGlyphElement

Extends: MathMLPresentationElement

This interface supports the mglyph element Section 3.2.9 [Adding new character glyphs to MathML (mglyph)].

IDL Definition

interface MathMLGlyphElement: MathMLPresentationElement {
  attribute DOMString alt;
  attribute DOMString fontfamily;
  attribute unsigned long index;
};

Attributes

alt of type DOMString

A string giving an alternate name for the character. Represents the mglyph's alt attribute.

fontfamily of type DOMString

A string representing the font family.

index of type unsigned long

An unsigned integer giving the glyph's position within the font.

Interface MathMLSpaceElement

Extends: MathMLPresentationElement

This interface extends the MathMLPresentationElement interface for the MathML space element mspace. Note that this is not derived from MathMLPresentationToken, despite the fact that mspace is classified as a token element, since it does not carry the attributes declared for MathMLPresentationToken.

IDL Definition

interface MathMLSpaceElement: MathMLPresentationElement {
  attribute DOMString width;
  attribute DOMString height;
  attribute DOMString depth;
};

Attributes

width of type DOMString

A string of the form `number h-unit'; represents the width attribute for the mspace element, if specified.

height of type DOMString

A string of the form `number v-unit'; represents the height attribute for the mspace element, if specified.

depth of type DOMString

A string of the form `number v-unit'; represents the depth attribute for the mspace element, if specified.

D.1.3.2 Presentation Token Element Interfaces

Interfaces representing the MathML Presentation token elements that may have content are described here.

Interface MathMLPresentationToken

Extends: MathMLPresentationElement

This interface extends the MathMLElement interface to include access for attributes specific to text presentation. It serves as the base class for all MathML presentation token elements. Access to the body of the element is via the nodeValue attribute inherited from Node. Elements that expose only the core presentation token attributes are directly supported by this object. These elements are:

mi
identifier element
mn
number element
mtext
text element

IDL Definition

interface MathMLPresentationToken: MathMLPresentationElement {
  attribute DOMString mathvariant;
  attribute DOMString mathsize;
  attribute DOMString mathfamily;
  attribute DOMString mathcolor;
  attribute DOMString mathbackground;
  readonly attribute MathMLNodeList contents;
};

Attributes

mathvariant of type DOMString

The mathvariant attribute for the element, if specified. One of the values normal, bold, italic, bold-italic, double-struck, bold-fraktur, script, bold-script, fraktur, sans-serif, bold-sans-serif, sans-serif-italic, sans-serif-bold-italic, or monospace.

mathsize of type DOMString

The mathsize attribute for the element, if specified. Either small, normal or big, or of the form number v-unit.

mathfamily of type DOMString

The mathfamily attribute for the element, if specified. This should be a string of the form css-fontfamily.

mathcolor of type DOMString

The mathcolor attribute for the element, if specified. The DOMString returned should be in the form of a CSS color spec.

mathbackground of type DOMString

The mathbackground attribute for the element, if specified. The DOMString returned should be in the form of a CSS color spec.

contents of type MathMLNodeList, readonly

Returns the child Nodes of the element. These should consist only of Text nodes and possibly MathMLGlyphElements. Should behave the same as the base class's Node::childNodes attribute; however, it is provided here for clarity.

Interface MathMLOperatorElement

Extends: MathMLPresentationToken

This interface extends the MathMLPresentationToken interface for the MathML operator element mo.

IDL Definition

interface MathMLOperatorElement: MathMLPresentationToken {
  attribute DOMString form;
  attribute DOMString fence;
  attribute DOMString separator;
  attribute DOMString lspace;
  attribute DOMString rspace;
  attribute DOMString stretchy;
  attribute DOMString symmetric;
  attribute DOMString maxsize;
  attribute DOMString minsize;
  attribute DOMString largeop;
  attribute DOMString moveablelimits;
  attribute DOMString accent;
};

Attributes

form of type DOMString

The form attribute (prefix, infix or postfix) for the mo element, if specified.

fence of type DOMString

The fence attribute (true or false) for the mo element, if specified.

separator of type DOMString

The separator attribute (true or false) for the mo element, if specified.

lspace of type DOMString

The lspace attribute (spacing to left) of the mo element, if specified.

rspace of type DOMString

The rspace attribute (spacing to right) of the mo element, if specified.

stretchy of type DOMString

The stretchy attribute (true or false) for the mo element, if specified.

symmetric of type DOMString

The symmetric attribute (true or false) for the mo element, if specified.

maxsize of type DOMString

The maxsize attribute for the mo element, if specified.

minsize of type DOMString

The minsize attribute for the mo element, if specified.

largeop of type DOMString

The largeop attribute for the mo element, if specified.

moveablelimits of type DOMString

The moveablelimits (true or false) attribute for the mo element, if specified.

accent of type DOMString

The accent attribute (true or false) for the mo element, if specified.

Interface MathMLStringLitElement

Extends: MathMLPresentationToken

This interface extends the MathMLPresentationToken interface for the MathML string literal element ms.

IDL Definition

interface MathMLStringLitElement: MathMLPresentationToken {
  attribute DOMString lquote;
  attribute DOMString rquote;
};

Attributes

lquote of type DOMString

A string giving the opening delimiter for the string literal; represents the lquote attribute for the ms element, if specified.

rquote of type DOMString

A string giving the closing delimiter for the string literal; represents the rquote attribute for the ms element, if specified.

D.1.3.3 Presentation Container Interfaces

Interfaces designed to represent MathML Presentation elements that can contain arbitrary numbers of child MathMLElements are included under the heading of Presentation Container Elements.

Interface MathMLPresentationContainer

Extends: MathMLPresentationElement, MathMLContainer

This interface represents MathML Presentation elements that may contain arbitarily many child elements. Elements directly supported by this interface include mrow, mphantom and merror. All attributes and methods are derived from the base MathMLPresentationElement and MathMLContainer interfaces.

IDL Definition

interface MathMLPresentationContainer: MathMLPresentationElement, MathMLContainer {
};

Interface MathMLStyleElement

Extends: MathMLPresentationContainer

This interface extends the MathMLElement interface for the MathML style element mstyle. While the mstyle element may contain any attributes allowable on any MathML presentation element, only attributes specific to the mstyle element are included in the interface below. Other attributes should be accessed using the methods on the base Element class, particularly the Element::getAttribute and Element::setAttribute methods, or even the Node::attributes attribute to access all of them at once. Not only does this obviate a lengthy list below, but it seems likely that most implementations will find this a considerably more useful interface to a MathMLStyleElement.

IDL Definition

interface MathMLStyleElement: MathMLPresentationContainer {
  attribute DOMString scriptlevel;
  attribute DOMString displaystyle;
  attribute DOMString scriptsizemultiplier;
  attribute DOMString scriptminsize;
  attribute DOMString color;
  attribute DOMString background;
};

Attributes

scriptlevel of type DOMString

A string of the form `+/- unsigned integer'; represents the scriptlevel attribute for the mstyle element, if specified. See also the discussion of this attribute.

displaystyle of type DOMString

Either true or false; a string representing the displaystyle attribute for the mstyle element, if specified. See also the discussion of this attribute.

scriptsizemultiplier of type DOMString

A string of the form `number'; represents the scriptsizemultiplier attribute for the mstyle element, if specified. See also the discussion of this attribute.

scriptminsize of type DOMString

A string of the form `number v-unit'; represents the scriptminsize attribute for the mstyle element, if specified. See also the discussion of this attribute.

color of type DOMString

A string representation of a color; represents the color attribute for the mstyle element, if specified. See also the discussion of this attribute.

background of type DOMString

A string representation of a color or the string transparent; represents the background attribute for the mstyle element, if specified. See also the discussion of this attribute.

Interface MathMLPaddedElement

Extends: MathMLPresentationContainer

This interface extends the MathMLElement interface for the MathML spacing adjustment element mpadded.

IDL Definition

interface MathMLPaddedElement: MathMLPresentationContainer {
  attribute DOMString width;
  attribute DOMString lspace;
  attribute DOMString height;
  attribute DOMString depth;
};

Attributes

width of type DOMString

A string representing the total width of the mpadded element, if specified. See also the discussion of this attribute.

lspace of type DOMString

A string representing the lspace attribute - the additional space to the left - of the mpadded element, if specified. See also the discussion of this attribute.

height of type DOMString

A string representing the height above the baseline of the mpadded element, if specified. See also the discussion of this attribute.

depth of type DOMString

A string representing the depth beneath the baseline of the mpadded element, if specified. See also the discussion of this attribute.

Interface MathMLFencedElement

Extends: MathMLPresentationContainer

This interface extends the MathMLPresentationContainer interface for the MathML fenced content element mfenced.

IDL Definition

interface MathMLFencedElement: MathMLPresentationContainer {
  attribute DOMString open;
  attribute DOMString close;
  attribute DOMString separators;
};

Attributes

open of type DOMString

A string representing the opening-fence for the mfenced element, if specified; this is the element's open attribute.

close of type DOMString

A string representing the opening-fence for the mfenced element, if specified; this is the element's close attribute.

separators of type DOMString

A string representing any separating characters inside the mfenced element, if specified; this is the element's separators attribute.

Interface MathMLEncloseElement

Extends: MathMLPresentationContainer

This interface supports the menclose element Section 3.3.9 [Enclose Expression Inside Notation (menclose)].

IDL Definition

interface MathMLEncloseElement: MathMLPresentationContainer {
  attribute DOMString notation;
};

Attributes

notation of type DOMString

A string giving a name for the notation enclosing the element's contents. Represents the notation attribute of the menclose. Allowed values are longdiv, actuarial, radical.

Interface MathMLActionElement

Extends: MathMLPresentationContainer

This interface extends the MathMLPresentationContainer interface for the MathML enlivening expression element maction.

IDL Definition

interface MathMLActionElement: MathMLPresentationContainer {
  attribute DOMString actiontype;
  attribute DOMString selection;
};

Attributes

actiontype of type DOMString

A string specifying the action. Possible values include toggle, statusline, tooltip, highlight, and menu.

selection of type DOMString

A string specifying an integer that selects the current subject of the action.

D.1.3.4 Presentation Schemata Interfaces

Interface MathMLFractionElement

Extends: MathMLPresentationElement

This interface extends the MathMLPresentationElement interface for the MathML fraction element mfrac.

IDL Definition

interface MathMLFractionElement: MathMLPresentationElement {
  attribute DOMString linethickness;
  attribute MathMLElement numerator;
  attribute MathMLElement denominator;
};

Attributes

linethickness of type DOMString

A string representing the linethickness attribute of the mfrac, if specified.

numerator of type MathMLElement

The first child MathMLElement of the MathMLFractionElement; represents the numerator of the represented fraction.

denominator of type MathMLElement

The second child MathMLElement of the MathMLFractionElement; represents the denominator of the represented fraction.

Interface MathMLRadicalElement

Extends: MathMLPresentationElement

This interface extends the MathMLPresentationElement interface for the MathML radical and square root elements mroot and msqrt.

IDL Definition

interface MathMLRadicalElement: MathMLPresentationElement {
  attribute MathMLElement radicand;
  attribute MathMLElement index;
};

Attributes

radicand of type MathMLElement

The first child MathMLElement of the MathMLRadicalElement; represents the base of the represented radical.

index of type MathMLElement

The second child MathMLElement of the MathMLRadicalElement; represents the index of the represented radical. This must be null for msqrt elements.

Interface MathMLScriptElement

Extends: MathMLPresentationElement

This interface extends the MathMLPresentationElement interface for the MathML subscript, superscript and subscript-superscript pair elements msub, msup, and msubsup.

IDL Definition

interface MathMLScriptElement: MathMLPresentationElement {
  attribute DOMString subscriptshift;
  attribute DOMString superscriptshift;
  attribute MathMLElement base;
  attribute MathMLElement subscript;
  attribute MathMLElement superscript;
};

Attributes

subscriptshift of type DOMString

A string representing the minimum amount to shift the baseline of the subscript down, if specified; this is the element's subscriptshift attribute. This must return null for an msup.

superscriptshift of type DOMString

A string representing the minimum amount to shift the baseline of the superscript up, if specified; this is the element's superscriptshift attribute. This must return null for a msub.

base of type MathMLElement

A MathMLElement representing the base of the script. This is the first child of the element.

subscript of type MathMLElement

A MathMLElement representing the subscript of the script. This is the second child of a msub or msubsup; retrieval must return null for an msup.

Exceptions on Setting

DOMException

HIERARCHY_REQUEST_ERR: Raised when the element is a msup.

superscript of type MathMLElement

A MathMLElement representing the superscript of the script. This is the second child of a msup or the third child of a msubsup; retrieval must return null for an msub.

Exceptions on Setting

DOMException

HIERARCHY_REQUEST_ERR: Raised when the element is a msub.

Interface MathMLUnderOverElement

Extends: MathMLPresentationElement

This interface extends the MathMLPresentationElement interface for the MathML underscript, overscript and overscript-underscript pair elements munder, mover and munderover.

IDL Definition

interface MathMLUnderOverElement: MathMLPresentationElement {
  attribute DOMString accentunder;
  attribute DOMString accent;
  attribute MathMLElement base;
  attribute MathMLElement underscript;
  attribute MathMLElement overscript;
};

Attributes

accentunder of type DOMString

Either true or false if present; a string controlling whether underscript is drawn as an `accent' or as a `limit', if specified; this is the element's accentunder attribute. This must return null for an mover.

accent of type DOMString

Either true or false if present; a string controlling whether overscript is drawn as an `accent' or as a `limit', if specified; this is the element's accent attribute. This must return null for an munder.

base of type MathMLElement

A MathMLElement representing the base of the script. This is the first child of the element.

underscript of type MathMLElement

A MathMLElement representing the underscript of the script. This is the second child of a munder or munderover; retrieval must return null for an mover.

Exceptions on Setting

DOMException

HIERARCHY_REQUEST_ERR: Raised when the element is a mover.

overscript of type MathMLElement

A MathMLElement representing the overscript of the script. This is the second child of a mover or the third child of a munderover; retrieval must return null for an munder.

Exceptions on Setting

DOMException

HIERARCHY_REQUEST_ERR: Raised when the element is a munder.

Interface MathMLMultiScriptsElement

Extends: MathMLPresentationElement

This interface extends the MathMLPresentationElement interface for the MathML multiscripts (including prescripts or tensors) element mmultiscripts.

IDL Definition

interface MathMLMultiScriptsElement: MathMLPresentationElement {
  attribute DOMString subscriptshift;
  attribute DOMString superscriptshift;
  attribute MathMLElement base;
  readonly attribute MathMLNodeList prescripts;
  readonly attribute MathMLNodeList scripts;
  readonly attribute unsigned long numprescriptcolumns;
  readonly attribute unsigned long numscriptcolumns;
  MathMLElement getPreSubScript(in unsigned long colIndex);
  MathMLElement getSubScript(in unsigned long colIndex);
  MathMLElement getPreSuperScript(in unsigned long colIndex);
  MathMLElement getSuperScript(in unsigned long colIndex);
  MathMLElement insertPreSubScriptBefore(in unsigned long colIndex, in MathMLElement newScript);
  MathMLElement setPreSubScriptAt(in unsigned long colIndex, in MathMLElement newScript);
  MathMLElement insertSubScriptBefore(in unsigned long colIndex, in MathMLElement newScript);
  MathMLElement setSubScriptAt(in unsigned long colIndex, in MathMLElement newScript);
  MathMLElement insertPreSuperScriptBefore(in unsigned long colIndex, in MathMLElement newScript);
  MathMLElement setPreSuperScriptAt(in unsigned long colIndex, in MathMLElement newScript);
  MathMLElement insertSuperScriptBefore(in unsigned long colIndex, in MathMLElement newScript);
  MathMLElement setSuperScriptAt(in unsigned long colIndex, in MathMLElement newScript);
};

Attributes

subscriptshift of type DOMString

A string representing the minimum amount to shift the baseline of the subscripts down, if specified; this is the element's subscriptshift attribute.

superscriptshift of type DOMString

A string representing the minimum amount to shift the baseline of the superscripts up, if specified; this is the element's superscriptshift attribute.

base of type MathMLElement

A MathMLElement representing the base of the script. This is the first child of the element.

prescripts of type MathMLNodeList, readonly

A NodeList representing the prescripts of the script, which appear in the order described by the expression (prescript presuperscript)*. This is the same as traversing the contents of the NodeList returned by Node::childNodes() from the Node following the <mprescripts/> (if present) to the end of the list.

scripts of type MathMLNodeList, readonly

A MathMLNodeList representing the scripts of the script, which appear in the order described by the expression (script superscript)*. This is the same as traversing the contents of the NodeList returned by Node::childNodes() from the first Node up to and including the Node preceding the <mprescripts/> (if present).

numprescriptcolumns of type unsigned long, readonly

The number of script/subscript columns preceding (to the left of) the base. Should always be half of getprescripts().length()

numscriptcolumns of type unsigned long, readonly

The number of script/subscript columns following (to the right of) the base. Should always be half of getscripts().length()

Methods

getPreSubScript

A convenience method to retrieve pre-subscript children of the element, referenced by column index .

Parameters

unsigned longcolIndex

Column index of prescript (where 1 represents the leftmost prescript column).

Return value

MathMLElement

Returns the MathMLElement representing the colIndex-th presubscript (to the left of the base, counting from 1 at the far left). Note that this may be the MathMLElement corresponding to the special element <none/> in the case of a `missing' presubscript (see the discussion of mmultiscripts), or it may be null if colIndex is out of range for the element.

This method raises no exceptions.

getSubScript

A convenience method to retrieve subscript children of the element, referenced by column index.

Parameters

unsigned longcolIndex

Column index of script (where 1 represents the leftmost script column, the first to the right of the base).

Return value

MathMLElement

Returns the MathMLElement representing the colIndex-th subscript to the right of the base. Note that this may be the MathMLElement corresponding to the special element <none/> in the case of a `missing' subscript (see the discussion of mmultiscripts), or it may be null if colIndex is out of range for the element.

This method raises no exceptions.

getPreSuperScript

A convenience method to retrieve pre-superscript children of the element, referenced by column index .

Parameters

unsigned longcolIndex

Column index of pre-superscript (where 1 represents the leftmost prescript column).

Return value

MathMLElement

Returns the MathMLElement representing the colIndex-th presuperscript (to the left of the base, counting from 1 at the far left). Note that this may be the MathMLElement corresponding to the special element <none/> in the case of a `missing' presuperscript (see the discussion of mmultiscripts), or it may be null if colIndex is out of range for the element.

This method raises no exceptions.

getSuperScript

A convenience method to retrieve superscript children of the element, referenced by column index .

Parameters

unsigned longcolIndex

Column index of script (where 1 represents the leftmost script column, the first to the right of the base)

Return value

MathMLElement

Returns the MathMLElement representing the colIndex-th superscript to the right of the base. Note that this may be the MathMLElement corresponding to the special element <none/> in the case of a `missing' superscript (see the discussion of mmultiscripts), or it may be null if colIndex is out of range for the element.

This method raises no exceptions.

insertPreSubScriptBefore

A convenience method to insert a pre-subscript before the position referenced by column index. If colIndex is 0, the new pre-subscript is appended as the last pre-subscript of the mmultiscripts element; if colIndex is 1, a new pre-subscript is prepended at the far left. Note that inserting a new pre-subscript will cause the insertion of an empty pre-superscript in the same column.

Parameters

unsigned longcolIndex

Column index of pre-subscript (where 1 represents the leftmost prescript column).

MathMLElementnewScript

A MathMLElement representing the element to be inserted as a pre-subscript.

Return value

MathMLElement

The MathMLElement child of this MathMLMultiScriptsElement representing the new script in the DOM.

Exceptions

DOMException

HIERARCHY_REQUEST_ERR: Raised if newScript represents an element that cannot be a pre-subscript.

INDEX_SIZE_ERR: Raised if colIndex is greater than the number of pre-scripts of the element.

setPreSubScriptAt

A convenience method to set the pre-subscript child at the position referenced by colIndex. If there is currently a pre-subscript at this position, it is replaced by newScript.

Parameters

unsigned longcolIndex

Column index of pre-subscript (where 1 represents the leftmost prescript column).

MathMLElementnewScript

MathMLElement representing the element that is to be set as the colIndex-th pre-subscript child of this element.

Return value

MathMLElement

The MathMLElement child of this MathMLMultiScriptsElement representing the new pre-subscript in the DOM.

Exceptions

DOMException

HIERARCHY_REQUEST_ERR: Raised if newScript represents an element that cannot be a pre-subscript.

INDEX_SIZE_ERR: Raised if colIndex is greater than one more than the number of pre-scripts of the element.

insertSubScriptBefore

A convenience method to insert a subscript before the position referenced by column index. If colIndex is 0, the new subscript is appended as the last subscript of the mmultiscripts element; if colIndex is 1, a new subscript is prepended at the far left. Note that inserting a new subscript will cause the insertion of an empty superscript in the same column.

Parameters

unsigned longcolIndex

Column index of subscript, where 1 represents the leftmost script column (the first to the right of the base).

MathMLElementnewScript

A MathMLElement representing the element to be inserted as a subscript.

Return value

MathMLElement

The MathMLElement child of this MathMLMultiScriptsElement that represents the new subscript in the DOM.

Exceptions

DOMException

HIERARCHY_REQUEST_ERR: Raised if newScript represents an element that cannot be a subscript.

INDEX_SIZE_ERR: Raised if colIndex is greater than the number of scripts of the element.

setSubScriptAt

A convenience method to set the subscript child at the position referenced by colIndex. If there is currently a subscript at this position, it is replaced by newScript.

Parameters

unsigned longcolIndex

Column index of subscript, where 1 represents the leftmost script column (the first to the right of the base).

MathMLElementnewScript

MathMLElement representing the element that is to be set as the colIndex-th subscript child of this element.

Return value

MathMLElement

The MathMLElement chlid of this element representing the new subscript in the DOM.

Exceptions

DOMException

HIERARCHY_REQUEST_ERR: Raised if newScript represents an element that cannot be a subscript.

INDEX_SIZE_ERR: Raised if colIndex is greater than one more than the number of scripts of the element.

insertPreSuperScriptBefore

A convenience method to insert a pre-superscript before the position referenced by column index. If colIndex is 0, the new pre-superscript is appended as the last pre-superscript of the mmultiscripts element; if colIndex is 1, a new pre-superscript is prepended at the far left. Note that inserting a new pre-superscript will cause the insertion of an empty pre-subscript in the same column.

Parameters

unsigned longcolIndex

Column index of pre-superscript (where 1 represents the leftmost prescript column).

MathMLElementnewScript

A MathMLElement representing the element to be inserted as a pre-superscript.

Return value

MathMLElement

The MathMLElement child of this element that represents the new pre-superscript in the DOM.

Exceptions

DOMException

HIERARCHY_REQUEST_ERR: Raised if newScript represents an element that cannot be a pre-superscript.

INDEX_SIZE_ERR: Raised if colIndex is greater than the number of pre-scripts of the element.

setPreSuperScriptAt

A convenience method to set the pre-superscript child at the position referenced by colIndex. If there is currently a pre-superscript at this position, it is replaced by newScript.

Parameters

unsigned longcolIndex

Column index of pre-superscript (where 1 represents the leftmost prescript column).

MathMLElementnewScript

MathMLElement representing the element that is to be set as the colIndex-th pre-superscript child of this element.

Return value

MathMLElement

The MathMLElement child of this element that represents the new pre-superscript in the DOM.

Exceptions

DOMException

HIERARCHY_REQUEST_ERR: Raised if newScript represents an element that cannot be a pre-superscript.

INDEX_SIZE_ERR: Raised if colIndex is greater than one more than the number of pre-scripts of the element.

insertSuperScriptBefore

A convenience method to insert a superscript before the position referenced by column index. If colIndex is 0, the new superscript is appended as the last superscript of the mmultiscripts element; if colIndex is 1, a new superscript is prepended at the far left. Note that inserting a new superscript will cause the insertion of an empty subscript in the same column.

Parameters

unsigned longcolIndex

Column index of superscript, where 1 represents the leftmost script column (the first to the right of the base).

MathMLElementnewScript

A MathMLElement representing the element to be inserted as a superscript.

Return value

MathMLElement

The MathMLElement child of this element that represents the new superscript in the DOM.

Exceptions

DOMException

HIERARCHY_REQUEST_ERR: Raised if newScript represents an element that cannot be a superscript.

INDEX_SIZE_ERR: Raised if colIndex is greater than the number of scripts of the element.

setSuperScriptAt

A convenience method to set the superscript child at the position referenced by colIndex. If there is currently a superscript at this position, it is replaced by newScript.

Parameters

unsigned longcolIndex

Column index of superscript, where 1 represents the leftmost script column (the first to the right of the base).

MathMLElementnewScript

MathMLElement representing the element that is to be set as the colIndex-th superscript child of this element.

Return value

MathMLElement

The MathMLElement child of this element that represents the new superscript in the DOM.

Exceptions

DOMException

HIERARCHY_REQUEST_ERR: Raised if newScript represents an element that cannot be a superscript.

INDEX_SIZE_ERR: Raised if colIndex is greater than one more than the number of scripts of the element.

Interface MathMLTableElement

Extends: MathMLPresentationElement

This interface extends the MathMLPresentationElement interface for the MathML table or matrix element mtable.

IDL Definition

interface MathMLTableElement: MathMLPresentationElement {
  attribute DOMString align;
  attribute DOMString rowalign;
  attribute DOMString columnalign;
  attribute DOMString groupalign;
  attribute DOMString alignmentscope;
  attribute DOMString columnwidth;
  attribute DOMString width;
  attribute DOMString rowspacing;
  attribute DOMString columnspacing;
  attribute DOMString rowlines;
  attribute DOMString columnlines;
  attribute DOMString frame;
  attribute DOMString framespacing;
  attribute DOMString equalrows;
  attribute DOMString equalcolumns;
  attribute DOMString displaystyle;
  attribute DOMString side;
  attribute DOMString minlabelspacing;
  readonly attribute MathMLNodeList rows;
  MathMLTableRowElement insertEmptyRow(in long index);
  MathMLLabeledRowElement insertEmptyLabeledRow(in long index);
  MathMLTableRowElement getRow(in unsigned long index);
  MathMLTableRowElement insertRow(in long index, in MathMLTableRowElement newRow);
  MathMLTableRowElement setRow(in long index, in MathMLTableRowElement newRow);
  void deleteRow(in unsigned long index);
  MathMLTableRowElement removeRow(in long index);
};

Attributes

align of type DOMString

A string representing the vertical alignment of the table with the adjacent text. Allowed values are (top | bottom | center | baseline | axis)[rownumber], where rownumber is between 1 and n (for a table with n rows) or -1 and -n.

rowalign of type DOMString

A string representing the alignment of entries in each row, consisting of a space-separated sequence of alignment specifiers, each of which can have the following values: top, bottom, center, baseline, or axis.

columnalign of type DOMString

A string representing the alignment of entries in each column, consisting of a space-separated sequence of alignment specifiers, each of which can have the following values: left, center, or right.

groupalign of type DOMString

A string specifying how the alignment groups within the cells of each row are to be aligned with the corresponding items above or below them in the same column. The string consists of a sequence of braced group alignment lists. Each group alignment list is a space-separated sequence, each of which can have the following values: left, right, center, or decimalpoint.

alignmentscope of type DOMString

A string consisting of the values true or false indicating, for each column, whether it can be used as an alignment scope.

columnwidth of type DOMString

A string consisting of a space-separated sequence of specifiers, each of which can have one of the following forms: auto, number h-unit, namedspace, or fit. (A value of the form namedspace is one of veryverythinmathspace, verythinmathspace, thinmathspace, mediummathspace, thickmathspace, verythickmathspace, or veryverythickmathspace.) This represents the element's columnwidth attribute.

width of type DOMString

A string that is either of the form number h-unit or is the string auto. This represents the element's width attribute.

rowspacing of type DOMString

A string consisting of a space-separated sequence of specifiers of the form number v-unit representing the space to be added between rows.

columnspacing of type DOMString

A string consisting of a space-separated sequence of specifiers of the form number h-unit representing the space to be added between columns.

rowlines of type DOMString

A string specifying whether and what kind of lines should be added between each row. The string consists of a space-separated sequence of specifiers, each of which can have the following values: none, solid, or dashed.

columnlines of type DOMString

A string specifying whether and what kind of lines should be added between each column. The string consists of a space-separated sequence of specifiers, each of which can have the following values: none, solid, or dashed.

frame of type DOMString

A string specifying a frame around the table. Allowed values are (none | solid | dashed).

framespacing of type DOMString

A string of the form number h-unit number v-unit specifying the spacing between table and its frame.

equalrows of type DOMString

A string with the values true or false.

equalcolumns of type DOMString

A string with the values true or false.

displaystyle of type DOMString

A string with the values true or false.

side of type DOMString

A string with the values left, right, leftoverlap, or rightoverlap.

minlabelspacing of type DOMString

A string of the form number h-unit, specifying the minimum space between a label and the adjacent entry in the labeled row.

rows of type MathMLNodeList, readonly

A MathMLNodeList consisting of MathMLTableRowElements and MathMLLabeledRowElements representing the rows of the table. This is a live object.

Methods

insertEmptyRow

A convenience method to insert a new (empty) row (mtr) in the table before the current index-th row. If index is less than 0, the new row is inserted before the -index-th row counting up from the current last row; if index is equal to the current number of rows, the new row is appended as the last row.

Parameters

longindex

Position before which to insert the new row, where 0 represents the first row. Negative numbers are used to count backwards from the last row.

Return value

MathMLTableRowElement

Returns the MathMLTableRowElement child of this MathMLTableElement that represents the new mtr element being inserted.

Exceptions

DOMException

INDEX_SIZE_ERR: Raised if index is greater than the current number of rows of this mtable element or less than minus this number.

insertEmptyLabeledRow

A convenience method to insert a new (empty) labeled row (mlabeledtr) in the table before the current index-th row. If index is less than 0, the new row is inserted before the -index-th row counting up from the current last row; if index is equal to the current number of rows, the new row is appended as the last row.

Parameters

longindex

Position before which to insert the new row, where 0 represents the first row. Negative numbers are used to count backwards from the last row.

Return value

MathMLLabeledRowElement

Returns the MathMLLabeledRowElement child of this MathMLTableElement representing the mtr element being inserted.

Exceptions

DOMException

INDEX_SIZE_ERR: Raised if index is greater than the current number of rows of this mtable element or less than minus this number.

getRow

A convenience method to retrieve the index-th row from the table. If index is less than 0, the -index-th row from the bottom of the table is retrieved. (So, for instance, if index is -2, the next-to-last row is retrieved.) If index is not a valid value (i.e. is greater than or equal to the number of rows, or is less than minus the number of rows), a null MathMLTableRowElement is returned.

Parameters

unsigned longindex

Index of the row to be returned, where 0 represents the first row. Negative numbers are used to count backwards from the last row.

Return value

MathMLTableRowElement

Returns the MathMLTableRowElement representing the index-th row of the table.

This method raises no exceptions.

insertRow

A convenience method to insert the new row or labeled row (mtr or mlabeledtr) represented by newRow in the table before the current index-th row. If index is equal to the current number of rows, newRow is appended as the last row in the table. If index is less than 0, the new row is inserted before the -index-th row from the bottom of the table. (So, for instance, if index is -2, the new row is inserted before the next-to-last current row.)

Parameters

longindex

Index before which to insert newRow, where 0 represents the first row. Negative numbers are used to count backwards from the current last row.

MathMLTableRowElementnewRow

A MathMLTableRowElement or MathMLLabeledRowElement representing the row to be inserted.

Return value

MathMLTableRowElement

The MathMLTableRowElement or MathMLLabeledRowElement child of this MathMLTableElement representing the mtr element being inserted.

Exceptions

DOMException

HIERARCHY_REQUEST_ERR: Raised if newRow is not a MathMLTableRowElement or MathMLLabeledRowElement.

INDEX_SIZE_ERR: Raised if index is greater than the current number of rows or less than minus the current number of rows of this mtable element.

setRow

A method to set the value of the row in the table at the specified index to the mtr or mlabeledtr represented by newRow. If index is less than 0, the -index-th row counting up from the last is replaced by newRow; if index is one more than the current number of rows, the new row is appended as the last row in the table.

Parameters

longindex

Index of the row to be set to newRow, where 0 represents the first row. Negative numbers are used to count backwards from the last row.

MathMLTableRowElementnewRow

A MathMLTableRowElement representing the row that is to be the new index-th row.

Return value

MathMLTableRowElement

Returns the MathMLTableRowElement or MathMLLabeledRowElement child of this element that represents the new row in the DOM.

Exceptions

DOMException

HIERARCHY_REQUEST_ERR: Raised if newRow is not a MathMLTableRowElement or MathMLLabeledRowElement.

INDEX_SIZE_ERR: Raised if index is greater than the current number of rows of this mtable element or less than minus this number.

deleteRow

A convenience method to delete the row of the table at the specified index. If index is less than 0, the -index-th row from the bottom of the table is deleted. (So, for instance, if index is -2, the next-to-last row is deleted.)

Parameters

unsigned longindex

Index of row to be deleted, where 0 represents the first row.

Return value

void

None.

Exceptions

DOMException

INDEX_SIZE_ERR: Raised if index is greater than or equal to the current number of rows of this mtable element or less than minus this number.

removeRow

A convenience method to delete the row of the table at the specified index and return it to the caller. If index is less than 0, the -index-th row from the bottom of the table is deleted. (So, for instance, if index is -2, the next-to-last row is deleted.)

Parameters

longindex

Index of row to be removed, where 0 represents the first row.

Return value

MathMLTableRowElement

A MathMLTableRowElement representing the row being deleted.

Exceptions

DOMException

INDEX_SIZE_ERR: Raised if index is greater than or equal to the number of rows of this mtable element or less than minus this number.

Interface MathMLTableRowElement

Extends: MathMLPresentationElement

This interface extends the MathMLPresentationElement interface for the MathML table or matrix row element mtr.

IDL Definition

interface MathMLTableRowElement: MathMLPresentationElement {
  attribute DOMString rowalign;
  attribute DOMString columnalign;
  attribute DOMString groupalign;
  readonly attribute MathMLNodeList cells;
  MathMLTableCellElement insertEmptyCell(in unsigned long index);
  MathMLTableCellElement insertCell(in MathMLTableCellElement newCell, in unsigned long index);
  MathMLTableCellElement setCell(in MathMLTableCellElement newCell, in unsigned long index);
  void deleteCell(in unsigned long index);
};

Attributes

rowalign of type DOMString

A string representing an override of the row alignment specified in the containing mtable. Allowed values are top, bottom, center, baseline, and axis.

columnalign of type DOMString

A string representing an override of the column alignment specified in the containing mtable. Allowed values are left, center, and right.

groupalign of type DOMString

[To be changed?]

cells of type MathMLNodeList, readonly

A MathMLNodeList consisting of the cells of the row. Note that this does not include the label if this is a MathMLLabeledRowElement!

Methods

insertEmptyCell

A convenience method to insert a new (empty) cell in the row.

Parameters

unsigned longindex

Index of the cell before which the new cell is to be inserted, where the first cell is numbered 0. If index is equal to the current number of cells, the new cell is appended as the last cell of the row. Note that the index will differ from the index of the corresponding Node in the collection returned by Node::childNodes if this is a MathMLLabeledRowElement!

Return value

MathMLTableCellElement

Returns the MathMLTableCellElement representing the mtd element being inserted.

Exceptions

DOMException

INDEX_SIZE_ERR: Raised if index is greater than the current number of cells of this mtr element.

insertCell

A convenience method to insert a new cell in the row.

Parameters

MathMLTableCellElementnewCell

A MathMLTableCellElement representing the new cell (mtd element) to be inserted.

unsigned longindex

Index of the cell before which the new cell is to be inserted, where the first cell is numbered 0. If index equals the current number of cells, the new cell is appended as the last cell of the row. Note that the index will differ from the index of the corresponding Node in Node::childNodes if this is a MathMLLabeledRowElement!

Return value

MathMLTableCellElement

The MathMLTableCellElement representing the mtd element being inserted.

Exceptions

DOMException

INDEX_SIZE_ERR: Raised if index is greater than the current number of cells of this mtr element.

setCell

A convenience method to set the value of a cell in the row to newCell. If index is equal to the current number of cells, newCell is appended as the last cell in the row.

Parameters

MathMLTableCellElementnewCell

A MathMLTableCellElement representing the cell (mtd element) that is to be inserted.

unsigned longindex

Index of the cell that is to be replaced by the new cell, where the first cell is numbered 0. Note that the index will differ