Accessibility/MathML
Summary
This page describes a draft of changes to be made to add MathML accessibility to Gecko.
Interface
nsIAccessibleMathML
Inherit from nsISupports.
readonly attribute AString tokenValue; // Get token value for token MathML elements (mi, mo, mn, mtext, mspace, ms, // mglyph). Returns empty string if not a token element. readonly attribute boolean isToken; // Check if this element is a token MathML element. readonly attribute nsIPersistentProperties attributes; // Get attributes specific to the MathML element.
Two options for describing relations between MathML elements:
Option 1: Explicit readonly attributes (accessors) for going from parent elements to children and vice versa. e.g.
readonly attribute nsIAccessibleMathML radicand; readonly attribute nsIAccessibleMathML rootIndex; readonly attribute nsIAccessibleMathML under; ... readonly attribute nsIAccessibleMathML parent;
Returns nullptr if the related accessible doesn't exist.
Option 2: Relations linking accessibles based on role, so we won't have attributes/functions in the interface. An example would be for a fraction structure, as follows.
<math>
<mfrac>
<mi>a</mi>
<mn>2</mn>
</mfrac>
</math>
mfrac would have RELATION_NUMERATOR_IS -> mi and RELATION_DENOMINATOR_IS -> mn or similar. mi would have RELATION_NUMERATOR_FOR -> mfrac and mn would have RELATION_DENOMINATOR_FOR -> mfrac.
MathMLAccessible
Inherit from AccessibleWrap, and implements nsIAccessibleMathML.
- NativeAttributes - Override Accessible, and append MathML specific attributes if the element accepts them.
- GetTokenValue - Sets token value string if applicable.
- GetIsToken - Returns true if element is a token element.
Roles
One role for each of the following constructs (41 of them):
Tokens
- mi
- mn
- mo
- mtext
- mspace
- ms
- mglyph
Layout (semantic meaning)
- mrow
- mfrac
- msqrt
- mroot
- mfenced
- menclose
Layout (formatting)
- mstyle
- mpadded
- mphantom
Layout (elementary math)
- mstack
- mlongdiv
- msgroup
- msrow
- mscarries
- mscarry
- msline
Script/limits
- msub
- msup
- msubsup
- munder
- mover
- munderover
- mmultiscripts
Tables/matrices
- mtable
- mlabeledtr
- mtr
- mtd
Table formatting
- maligngroup
- malignmark
Semantics annotation
- semantics
- annotation
- annotation-xml
Other
- maction
- merror
Sample Gecko roles
- MATHML_IDENTIFIER
- MATHML_NUMBER
- MATHML_OPERATOR
- MATHML_TEXT
- MATHML_SPACE
- MATHML_STRING_LITERAL
- MATHML_GLYPH
- MATHML_ROW
- MATHML_FRACTION
- MATHML_SQUARE_ROOT
- MATHML_ROOT
- MATHML_FENCED
- MATHML_ENCLOSED
- MATHML_STYLE
- MATHML_PADDED
- MATHML_PHANTOM
- MATHML_SUB
- MATHML_SUP
- MATHML_SUB_SUP
- MATHML_UNDER
- MATHML_OVER
- MATHML_UNDER_OVER
- MATHML_MULTISCRIPTS
- MATHML_TABLE
- MATHML_LABELED_ROW
- MATHML_TABLE_ROW
- MATHML_CELL
- MATHML_ALIGNMENT_GROUP
- MATHML_ALIGNMENT_MARK
- MATHML_ACTION
- MATHML_ERROR
- MATHML_SEMANTICS
- MATHML_ANNOTATION
- MATHML_XML_ANNOTATION
- MATHML_STACK
- MATHML_LONG_DIVISION
- MATHML_STACK_GROUP
- MATHML_STACK_ROW
- MATHML_STACK_CARRIES
- MATHML_STACK_CARRY
- MATHML_STACK_LINE