diff --git a/accessible/base/MarkupMap.h b/accessible/base/MarkupMap.h index 286c8bc1b42..c2a1d8560d6 100644 --- a/accessible/base/MarkupMap.h +++ b/accessible/base/MarkupMap.h @@ -103,6 +103,186 @@ MARKUPMAP(li, New_HTMLListitem, 0) +MARKUPMAP(math, + New_HyperText, + roles::MATHML_MATH) + +MARKUPMAP(mi_, + New_HyperText, + roles::MATHML_IDENTIFIER) + +MARKUPMAP(mn_, + New_HyperText, + roles::MATHML_NUMBER) + +MARKUPMAP(mo_, + New_HyperText, + roles::MATHML_OPERATOR, + AttrFromDOM(accent_, accent_), + AttrFromDOM(fence_, fence_), + AttrFromDOM(separator_, separator_), + AttrFromDOM(largeop_, largeop_)) + +MARKUPMAP(mtext_, + New_HyperText, + roles::MATHML_TEXT) + +MARKUPMAP(ms_, + New_HyperText, + roles::MATHML_STRING_LITERAL) + +MARKUPMAP(mglyph_, + New_HyperText, + roles::MATHML_GLYPH) + +MARKUPMAP(mrow_, + New_HyperText, + roles::MATHML_ROW) + +MARKUPMAP(mfrac_, + New_HyperText, + roles::MATHML_FRACTION, + AttrFromDOM(bevelled_, bevelled_), + AttrFromDOM(linethickness_, linethickness_)) + +MARKUPMAP(msqrt_, + New_HyperText, + roles::MATHML_SQUARE_ROOT) + +MARKUPMAP(mroot_, + New_HyperText, + roles::MATHML_ROOT) + +MARKUPMAP(mfenced_, + New_HyperText, + roles::MATHML_FENCED, + AttrFromDOM(close, close), + AttrFromDOM(open, open), + AttrFromDOM(separators_, separators_)) + +MARKUPMAP(menclose_, + New_HyperText, + roles::MATHML_ENCLOSED, + AttrFromDOM(notation_, notation_)) + +MARKUPMAP(mstyle_, + New_HyperText, + roles::MATHML_STYLE) + +MARKUPMAP(msub_, + New_HyperText, + roles::MATHML_SUB) + +MARKUPMAP(msup_, + New_HyperText, + roles::MATHML_SUP) + +MARKUPMAP(msubsup_, + New_HyperText, + roles::MATHML_SUB_SUP) + +MARKUPMAP(munder_, + New_HyperText, + roles::MATHML_UNDER, + AttrFromDOM(accentunder_, accentunder_), + AttrFromDOM(align, align)) + +MARKUPMAP(mover_, + New_HyperText, + roles::MATHML_OVER, + AttrFromDOM(accent_, accent_), + AttrFromDOM(align, align)) + +MARKUPMAP(munderover_, + New_HyperText, + roles::MATHML_UNDER_OVER, + AttrFromDOM(accent_, accent_), + AttrFromDOM(accentunder_, accentunder_), + AttrFromDOM(align, align)) + +MARKUPMAP(mmultiscripts_, + New_HyperText, + roles::MATHML_MULTISCRIPTS) + +MARKUPMAP(mtable_, + New_HyperText, + roles::MATHML_TABLE, + AttrFromDOM(align, align), + AttrFromDOM(columnlines_, columnlines_), + AttrFromDOM(rowlines_, rowlines_)) + +MARKUPMAP(mlabeledtr_, + New_HyperText, + roles::MATHML_LABELED_ROW) + +MARKUPMAP(mtr_, + New_HyperText, + roles::MATHML_TABLE_ROW) + +MARKUPMAP(mtd_, + New_HyperText, + roles::MATHML_CELL) + +MARKUPMAP(maction_, + New_HyperText, + roles::MATHML_ACTION, + AttrFromDOM(actiontype_, actiontype_), + AttrFromDOM(selection_, selection_)) + +MARKUPMAP(merror_, + New_HyperText, + roles::MATHML_ERROR) + +MARKUPMAP(semantics_, + New_HyperText, + roles::MATHML_SEMANTICS) + +MARKUPMAP(annotation_, + New_HyperText, + roles::MATHML_ANNOTATION) + +MARKUPMAP(annotation_xml_, + New_HyperText, + roles::MATHML_XML_ANNOTATION) + +MARKUPMAP(mstack_, + New_HyperText, + roles::MATHML_STACK, + AttrFromDOM(align, align), + AttrFromDOM(position, position)) + +MARKUPMAP(mlongdiv_, + New_HyperText, + roles::MATHML_LONG_DIVISION, + AttrFromDOM(longdivstyle_, longdivstyle_)) + +MARKUPMAP(msgroup_, + New_HyperText, + roles::MATHML_STACK_GROUP, + AttrFromDOM(position, position), + AttrFromDOM(shift_, shift_)) + +MARKUPMAP(msrow_, + New_HyperText, + roles::MATHML_STACK_ROW, + AttrFromDOM(position, position)) + +MARKUPMAP(mscarries_, + New_HyperText, + roles::MATHML_STACK_CARRIES, + AttrFromDOM(location_, location_), + AttrFromDOM(position, position)) + +MARKUPMAP(mscarry_, + New_HyperText, + roles::MATHML_STACK_CARRY, + AttrFromDOM(crossout_, crossout_)) + +MARKUPMAP(msline_, + New_HyperText, + roles::MATHML_STACK_LINE, + AttrFromDOM(position, position)) + MARKUPMAP(nav, New_HyperText, roles::SECTION) diff --git a/accessible/base/Role.h b/accessible/base/Role.h index 1566eb9f9c5..928668a6ad3 100644 --- a/accessible/base/Role.h +++ b/accessible/base/Role.h @@ -716,17 +716,17 @@ enum Role { * An image map -- has child links representing the areas */ IMAGE_MAP = 116, - + /** * An option in a listbox */ OPTION = 117, - + /** * A rich option in a listbox, it can have other widgets as children */ RICH_OPTION = 118, - + /** * A list of options */ @@ -736,7 +736,7 @@ enum Role { * Represents a mathematical equation in the accessible name */ FLAT_EQUATION = 120, - + /** * Represents a cell within a grid. It is used for role="gridcell". Unlike * CELL, it allows the calculation of the accessible name from subtree. @@ -790,7 +790,193 @@ enum Role { */ SWITCH = 130, - LAST_ROLE = SWITCH + /** + * A block of MathML code (math). + */ + MATHML_MATH = 131, + + /** + * A MathML identifier (mi in MathML). + */ + MATHML_IDENTIFIER = 132, + + /** + * A MathML number (mn in MathML). + */ + MATHML_NUMBER = 133, + + /** + * A MathML operator (mo in MathML). + */ + MATHML_OPERATOR = 134, + + /** + * A MathML text (mtext in MathML). + */ + MATHML_TEXT = 135, + + /** + * A MathML string literal (ms in MathML). + */ + MATHML_STRING_LITERAL = 136, + + /** + * A MathML glyph (mglyph in MathML). + */ + MATHML_GLYPH = 137, + + /** + * A MathML row (mrow in MathML). + */ + MATHML_ROW = 138, + + /** + * A MathML fraction (mfrac in MathML). + */ + MATHML_FRACTION = 139, + + /** + * A MathML square root (msqrt in MathML). + */ + MATHML_SQUARE_ROOT = 140, + + /** + * A MathML root (mroot in MathML). + */ + MATHML_ROOT = 141, + + /** + * A MathML fenced element (mfenced in MathML). + */ + MATHML_FENCED = 142, + + /** + * A MathML enclosed element (menclose in MathML). + */ + MATHML_ENCLOSED = 143, + + /** + * A MathML styling element (mstyle in MathML). + */ + MATHML_STYLE = 144, + + /** + * A MathML subscript (msub in MathML). + */ + MATHML_SUB = 145, + + /** + * A MathML superscript (msup in MathML). + */ + MATHML_SUP = 146, + + /** + * A MathML subscript and superscript (msubsup in MathML). + */ + MATHML_SUB_SUP = 147, + + /** + * A MathML underscript (munder in MathML). + */ + MATHML_UNDER = 148, + + /** + * A MathML overscript (mover in MathML). + */ + MATHML_OVER = 149, + + /** + * A MathML underscript and overscript (munderover in MathML). + */ + MATHML_UNDER_OVER = 150, + + /** + * A MathML multiple subscript and superscript element (mmultiscripts in + * MathML). + */ + MATHML_MULTISCRIPTS = 151, + + /** + * A MathML table (mtable in MathML). + */ + MATHML_TABLE = 152, + + /** + * A MathML labelled table row (mlabeledtr in MathML). + */ + MATHML_LABELED_ROW = 153, + + /** + * A MathML table row (mtr in MathML). + */ + MATHML_TABLE_ROW = 154, + + /** + * A MathML table entry or cell (mtd in MathML). + */ + MATHML_CELL = 155, + + /** + * A MathML interactive element (maction in MathML). + */ + MATHML_ACTION = 156, + + /** + * A MathML error message (merror in MathML). + */ + MATHML_ERROR = 157, + + /** + * A MathML semantics annotation element (semantics in MathML). + */ + MATHML_SEMANTICS = 158, + + /** + * A MathML annotation (annotation in MathML). + */ + MATHML_ANNOTATION = 159, + + /** + * A MathML XML annotation (annotation-xml in MathML). + */ + MATHML_XML_ANNOTATION = 160, + + /** + * A MathML stacked (rows of numbers) element (mstack in MathML). + */ + MATHML_STACK = 161, + + /** + * A MathML long division element (mlongdiv in MathML). + */ + MATHML_LONG_DIVISION = 162, + + /** + * A MathML stack group (msgroup in MathML). + */ + MATHML_STACK_GROUP = 163, + + /** + * A MathML stack row (msrow in MathML). + */ + MATHML_STACK_ROW = 164, + + /** + * MathML carries, borrows, or crossouts for a row (mscarries in MathML). + */ + MATHML_STACK_CARRIES = 165, + + /** + * A MathML carry, borrow, or crossout for a column (mscarry in MathML). + */ + MATHML_STACK_CARRY = 166, + + /** + * A MathML line in a stack (msline in MathML). + */ + MATHML_STACK_LINE = 167, + + LAST_ROLE = MATHML_STACK_LINE }; } // namespace role diff --git a/accessible/base/RoleMap.h b/accessible/base/RoleMap.h index b3195cfd5b6..b023922442b 100644 --- a/accessible/base/RoleMap.h +++ b/accessible/base/RoleMap.h @@ -1063,3 +1063,299 @@ ROLE(SWITCH, ROLE_SYSTEM_CHECKBUTTON, IA2_ROLE_TOGGLE_BUTTON, eNameFromSubtreeRule) + +ROLE(MATHML_MATH, + "math", + ATK_ROLE_UNKNOWN, + NSAccessibilityUnknownRole, + ROLE_SYSTEM_EQUATION, + ROLE_SYSTEM_EQUATION, + eNoNameRule) + +ROLE(MATHML_IDENTIFIER, + "mathml identifier", + ATK_ROLE_UNKNOWN, + NSAccessibilityUnknownRole, + 0, + IA2_ROLE_UNKNOWN, + eNameFromSubtreeRule) + +ROLE(MATHML_NUMBER, + "mathml number", + ATK_ROLE_UNKNOWN, + NSAccessibilityUnknownRole, + 0, + IA2_ROLE_UNKNOWN, + eNameFromSubtreeRule) + +ROLE(MATHML_OPERATOR, + "mathml operator", + ATK_ROLE_UNKNOWN, + NSAccessibilityUnknownRole, + 0, + IA2_ROLE_UNKNOWN, + eNameFromSubtreeRule) + +ROLE(MATHML_TEXT, + "mathml text", + ATK_ROLE_UNKNOWN, + NSAccessibilityUnknownRole, + 0, + IA2_ROLE_UNKNOWN, + eNameFromSubtreeRule) + +ROLE(MATHML_STRING_LITERAL, + "mathml string literal", + ATK_ROLE_UNKNOWN, + NSAccessibilityUnknownRole, + 0, + IA2_ROLE_UNKNOWN, + eNameFromSubtreeRule) + +ROLE(MATHML_GLYPH, + "mathml glyph", + ATK_ROLE_UNKNOWN, + NSAccessibilityUnknownRole, + 0, + IA2_ROLE_UNKNOWN, + eNameFromSubtreeRule) + +ROLE(MATHML_ROW, + "mathml row", + ATK_ROLE_UNKNOWN, + NSAccessibilityUnknownRole, + 0, + IA2_ROLE_UNKNOWN, + eNoNameRule) + +ROLE(MATHML_FRACTION, + "mathml fraction", + ATK_ROLE_UNKNOWN, + NSAccessibilityUnknownRole, + 0, + IA2_ROLE_UNKNOWN, + eNoNameRule) + +ROLE(MATHML_SQUARE_ROOT, + "mathml square root", + ATK_ROLE_UNKNOWN, + NSAccessibilityUnknownRole, + 0, + IA2_ROLE_UNKNOWN, + eNoNameRule) + +ROLE(MATHML_ROOT, + "mathml root", + ATK_ROLE_UNKNOWN, + NSAccessibilityUnknownRole, + 0, + IA2_ROLE_UNKNOWN, + eNoNameRule) + +ROLE(MATHML_FENCED, + "mathml fenced", + ATK_ROLE_UNKNOWN, + NSAccessibilityUnknownRole, + 0, + IA2_ROLE_UNKNOWN, + eNoNameRule) + +ROLE(MATHML_ENCLOSED, + "mathml enclosed", + ATK_ROLE_UNKNOWN, + NSAccessibilityUnknownRole, + 0, + IA2_ROLE_UNKNOWN, + eNoNameRule) + +ROLE(MATHML_STYLE, + "mathml style", + ATK_ROLE_UNKNOWN, + NSAccessibilityUnknownRole, + 0, + IA2_ROLE_UNKNOWN, + eNoNameRule) + +ROLE(MATHML_SUB, + "mathml sub", + ATK_ROLE_UNKNOWN, + NSAccessibilityUnknownRole, + 0, + IA2_ROLE_UNKNOWN, + eNoNameRule) + +ROLE(MATHML_SUP, + "mathml sup", + ATK_ROLE_UNKNOWN, + NSAccessibilityUnknownRole, + 0, + IA2_ROLE_UNKNOWN, + eNoNameRule) + +ROLE(MATHML_SUB_SUP, + "mathml sub sup", + ATK_ROLE_UNKNOWN, + NSAccessibilityUnknownRole, + 0, + IA2_ROLE_UNKNOWN, + eNoNameRule) + +ROLE(MATHML_UNDER, + "mathml under", + ATK_ROLE_UNKNOWN, + NSAccessibilityUnknownRole, + 0, + IA2_ROLE_UNKNOWN, + eNoNameRule) + +ROLE(MATHML_OVER, + "mathml over", + ATK_ROLE_UNKNOWN, + NSAccessibilityUnknownRole, + 0, + IA2_ROLE_UNKNOWN, + eNoNameRule) + +ROLE(MATHML_UNDER_OVER, + "mathml under over", + ATK_ROLE_UNKNOWN, + NSAccessibilityUnknownRole, + 0, + IA2_ROLE_UNKNOWN, + eNoNameRule) + +ROLE(MATHML_MULTISCRIPTS, + "mathml multiscripts", + ATK_ROLE_UNKNOWN, + NSAccessibilityUnknownRole, + 0, + IA2_ROLE_UNKNOWN, + eNoNameRule) + +ROLE(MATHML_TABLE, + "mathml table", + ATK_ROLE_UNKNOWN, + NSAccessibilityUnknownRole, + 0, + IA2_ROLE_UNKNOWN, + eNoNameRule) + +ROLE(MATHML_LABELED_ROW, + "mathml labeled row", + ATK_ROLE_UNKNOWN, + NSAccessibilityUnknownRole, + 0, + IA2_ROLE_UNKNOWN, + eNoNameRule) + +ROLE(MATHML_TABLE_ROW, + "mathml table row", + ATK_ROLE_UNKNOWN, + NSAccessibilityUnknownRole, + 0, + IA2_ROLE_UNKNOWN, + eNoNameRule) + +ROLE(MATHML_CELL, + "mathml cell", + ATK_ROLE_UNKNOWN, + NSAccessibilityUnknownRole, + 0, + IA2_ROLE_UNKNOWN, + eNoNameRule) + +ROLE(MATHML_ACTION, + "mathml action", + ATK_ROLE_UNKNOWN, + NSAccessibilityUnknownRole, + 0, + IA2_ROLE_UNKNOWN, + eNoNameRule) + +ROLE(MATHML_ERROR, + "mathml error", + ATK_ROLE_UNKNOWN, + NSAccessibilityUnknownRole, + 0, + IA2_ROLE_UNKNOWN, + eNoNameRule) + +ROLE(MATHML_SEMANTICS, + "mathml semantics", + ATK_ROLE_UNKNOWN, + NSAccessibilityUnknownRole, + 0, + IA2_ROLE_UNKNOWN, + eNoNameRule) + +ROLE(MATHML_ANNOTATION, + "mathml annotation", + ATK_ROLE_UNKNOWN, + NSAccessibilityUnknownRole, + 0, + IA2_ROLE_UNKNOWN, + eNoNameRule) + +ROLE(MATHML_XML_ANNOTATION, + "mathml xml annotation", + ATK_ROLE_UNKNOWN, + NSAccessibilityUnknownRole, + 0, + IA2_ROLE_UNKNOWN, + eNoNameRule) + +ROLE(MATHML_STACK, + "mathml stack", + ATK_ROLE_UNKNOWN, + NSAccessibilityUnknownRole, + 0, + IA2_ROLE_UNKNOWN, + eNoNameRule) + +ROLE(MATHML_LONG_DIVISION, + "mathml long division", + ATK_ROLE_UNKNOWN, + NSAccessibilityUnknownRole, + 0, + IA2_ROLE_UNKNOWN, + eNoNameRule) + +ROLE(MATHML_STACK_GROUP, + "mathml stack group", + ATK_ROLE_UNKNOWN, + NSAccessibilityUnknownRole, + 0, + IA2_ROLE_UNKNOWN, + eNoNameRule) + +ROLE(MATHML_STACK_ROW, + "mathml stack row", + ATK_ROLE_UNKNOWN, + NSAccessibilityUnknownRole, + 0, + IA2_ROLE_UNKNOWN, + eNoNameRule) + +ROLE(MATHML_STACK_CARRIES, + "mathml stack carries", + ATK_ROLE_UNKNOWN, + NSAccessibilityUnknownRole, + 0, + IA2_ROLE_UNKNOWN, + eNoNameRule) + +ROLE(MATHML_STACK_CARRY, + "mathml stack carry", + ATK_ROLE_UNKNOWN, + NSAccessibilityUnknownRole, + 0, + IA2_ROLE_UNKNOWN, + eNoNameRule) + +ROLE(MATHML_STACK_LINE, + "mathml stack line", + ATK_ROLE_UNKNOWN, + NSAccessibilityUnknownRole, + 0, + IA2_ROLE_UNKNOWN, + eNoNameRule) diff --git a/accessible/base/nsAccUtils.cpp b/accessible/base/nsAccUtils.cpp index c4b4aa26fb7..aae2bc449f2 100644 --- a/accessible/base/nsAccUtils.cpp +++ b/accessible/base/nsAccUtils.cpp @@ -400,7 +400,7 @@ nsAccUtils::TextLength(Accessible* aAccessible) bool nsAccUtils::MustPrune(Accessible* aAccessible) -{ +{ roles::Role role = aAccessible->Role(); // Don't prune the tree for certain roles if the tree is more complex than diff --git a/accessible/base/nsAccessibilityService.cpp b/accessible/base/nsAccessibilityService.cpp index 07ab4d621d6..08ae2fb60c0 100644 --- a/accessible/base/nsAccessibilityService.cpp +++ b/accessible/base/nsAccessibilityService.cpp @@ -1170,11 +1170,21 @@ nsAccessibilityService::GetOrCreateAccessible(nsINode* aNode, } else if (content->IsSVGElement(nsGkAtoms::svg)) { newAcc = new EnumRoleAccessible(content, document); } + } else if (content->IsMathMLElement()) { - if (content->IsMathMLElement(nsGkAtoms::math)) - newAcc = new EnumRoleAccessible(content, document); - else + const MarkupMapInfo* markupMap = + mMarkupMaps.Get(content->NodeInfo()->NameAtom()); + if (markupMap && markupMap->new_func) + newAcc = markupMap->new_func(content, aContext); + + // Fall back to text when encountering Content MathML. + if (!newAcc && !content->IsAnyOfMathMLElements(nsGkAtoms::mpadded_, + nsGkAtoms::mphantom_, + nsGkAtoms::maligngroup_, + nsGkAtoms::malignmark_, + nsGkAtoms::mspace_)) { newAcc = new HyperTextAccessible(content, document); + } } } diff --git a/accessible/base/nsAccessibilityService.h b/accessible/base/nsAccessibilityService.h index 7761058e9a3..d3bcc5bbc53 100644 --- a/accessible/base/nsAccessibilityService.h +++ b/accessible/base/nsAccessibilityService.h @@ -57,7 +57,7 @@ struct MarkupMapInfo { nsIAtom** tag; New_Accessible* new_func; a11y::role role; - MarkupAttrInfo attrs[2]; + MarkupAttrInfo attrs[4]; }; } // namespace a11y diff --git a/accessible/generic/Accessible.h b/accessible/generic/Accessible.h index d613d3f76ec..f9d909de42e 100644 --- a/accessible/generic/Accessible.h +++ b/accessible/generic/Accessible.h @@ -39,6 +39,7 @@ class HTMLLIAccessible; class HyperTextAccessible; class ImageAccessible; class KeyBinding; +class MathMLAccessible; class ProxyAccessible; class Relation; class RootAccessible; diff --git a/accessible/interfaces/nsIAccessibleRole.idl b/accessible/interfaces/nsIAccessibleRole.idl index aeb1d6672c5..6862b1407ef 100644 --- a/accessible/interfaces/nsIAccessibleRole.idl +++ b/accessible/interfaces/nsIAccessibleRole.idl @@ -8,7 +8,7 @@ /** * Defines cross platform (Gecko) roles. */ -[scriptable, uuid(76ce835f-ef86-47c0-ac7b-e871417f1b6e)] +[scriptable, uuid(55581ec3-ba6e-4805-8108-260ed34cdcbb)] interface nsIAccessibleRole : nsISupports { /** @@ -783,4 +783,190 @@ interface nsIAccessibleRole : nsISupports * A switch control widget. */ const unsigned long ROLE_SWITCH = 130; + + /** + * A block of MathML code (math). + */ + const unsigned long ROLE_MATHML_MATH = 131; + + /** + * A MathML identifier (mi in MathML). + */ + const unsigned long ROLE_MATHML_IDENTIFIER = 132; + + /** + * A MathML number (mn in MathML). + */ + const unsigned long ROLE_MATHML_NUMBER = 133; + + /** + * A MathML operator (mo in MathML). + */ + const unsigned long ROLE_MATHML_OPERATOR = 134; + + /** + * A MathML text (mtext in MathML). + */ + const unsigned long ROLE_MATHML_TEXT = 135; + + /** + * A MathML string literal (ms in MathML). + */ + const unsigned long ROLE_MATHML_STRING_LITERAL = 136; + + /** + * A MathML glyph (mglyph in MathML). + */ + const unsigned long ROLE_MATHML_GLYPH = 137; + + /** + * A MathML row (mrow in MathML). + */ + const unsigned long ROLE_MATHML_ROW = 138; + + /** + * A MathML fraction (mfrac in MathML). + */ + const unsigned long ROLE_MATHML_FRACTION = 139; + + /** + * A MathML square root (msqrt in MathML). + */ + const unsigned long ROLE_MATHML_SQUARE_ROOT = 140; + + /** + * A MathML root (mroot in MathML). + */ + const unsigned long ROLE_MATHML_ROOT = 141; + + /** + * A MathML fenced element (mfenced in MathML). + */ + const unsigned long ROLE_MATHML_FENCED = 142; + + /** + * A MathML enclosed element (menclose in MathML). + */ + const unsigned long ROLE_MATHML_ENCLOSED = 143; + + /** + * A MathML styling element (mstyle in MathML). + */ + const unsigned long ROLE_MATHML_STYLE = 144; + + /** + * A MathML subscript (msub in MathML). + */ + const unsigned long ROLE_MATHML_SUB = 145; + + /** + * A MathML superscript (msup in MathML). + */ + const unsigned long ROLE_MATHML_SUP = 146; + + /** + * A MathML subscript and superscript (msubsup in MathML). + */ + const unsigned long ROLE_MATHML_SUB_SUP = 147; + + /** + * A MathML underscript (munder in MathML). + */ + const unsigned long ROLE_MATHML_UNDER = 148; + + /** + * A MathML overscript (mover in MathML). + */ + const unsigned long ROLE_MATHML_OVER = 149; + + /** + * A MathML underscript and overscript (munderover in MathML). + */ + const unsigned long ROLE_MATHML_UNDER_OVER = 150; + + /** + * A MathML multiple subscript and superscript element (mmultiscripts in + * MathML). + */ + const unsigned long ROLE_MATHML_MULTISCRIPTS = 151; + + /** + * A MathML table (mtable in MathML). + */ + const unsigned long ROLE_MATHML_TABLE = 152; + + /** + * A MathML labelled table row (mlabeledtr in MathML). + */ + const unsigned long ROLE_MATHML_LABELED_ROW = 153; + + /** + * A MathML table row (mtr in MathML). + */ + const unsigned long ROLE_MATHML_TABLE_ROW = 154; + + /** + * A MathML table entry or cell (mtd in MathML). + */ + const unsigned long ROLE_MATHML_CELL = 155; + + /** + * A MathML interactive element (maction in MathML). + */ + const unsigned long ROLE_MATHML_ACTION = 156; + + /** + * A MathML error message (merror in MathML). + */ + const unsigned long ROLE_MATHML_ERROR = 157; + + /** + * A MathML semantics annotation element (semantics in MathML). + */ + const unsigned long ROLE_MATHML_SEMANTICS = 158; + + /** + * A MathML annotation (annotation in MathML). + */ + const unsigned long ROLE_MATHML_ANNOTATION = 159; + + /** + * A MathML XML annotation (annotation-xml in MathML). + */ + const unsigned long ROLE_MATHML_XML_ANNOTATION = 160; + + /** + * A MathML stacked (rows of numbers) element (mstack in MathML). + */ + const unsigned long ROLE_MATHML_STACK = 161; + + /** + * A MathML long division element (mlongdiv in MathML). + */ + const unsigned long ROLE_MATHML_LONG_DIVISION = 162; + + /** + * A MathML stack group (msgroup in MathML). + */ + const unsigned long ROLE_MATHML_STACK_GROUP = 163; + + /** + * A MathML stack row (msrow in MathML). + */ + const unsigned long ROLE_MATHML_STACK_ROW = 164; + + /** + * MathML carries, borrows, or crossouts for a row (mscarries in MathML). + */ + const unsigned long ROLE_MATHML_STACK_CARRIES = 165; + + /** + * A MathML carry, borrow, or crossout for a column (mscarry in MathML). + */ + const unsigned long ROLE_MATHML_STACK_CARRY = 166; + + /** + * A MathML line in a stack (msline in MathML). + */ + const unsigned long ROLE_MATHML_STACK_LINE = 167; }; diff --git a/accessible/tests/mochitest/elm/a11y.ini b/accessible/tests/mochitest/elm/a11y.ini index c0b94f4c3d2..ecbf075e526 100644 --- a/accessible/tests/mochitest/elm/a11y.ini +++ b/accessible/tests/mochitest/elm/a11y.ini @@ -4,6 +4,7 @@ skip-if = buildapp == 'mulet' [test_figure.html] [test_listbox.xul] +[test_MathMLSpec.html] [test_nsApplicationAcc.html] [test_plugin.html] skip-if = buildapp == 'mulet' diff --git a/accessible/tests/mochitest/elm/test_HTMLSpec.html b/accessible/tests/mochitest/elm/test_HTMLSpec.html index 867b334ab9f..e381feedf05 100644 --- a/accessible/tests/mochitest/elm/test_HTMLSpec.html +++ b/accessible/tests/mochitest/elm/test_HTMLSpec.html @@ -941,7 +941,7 @@ // HTML:math obj = { - role: ROLE_EQUATION + role: ROLE_MATHML_MATH }; testElm("math", obj); diff --git a/accessible/tests/mochitest/elm/test_MathMLSpec.html b/accessible/tests/mochitest/elm/test_MathMLSpec.html new file mode 100644 index 00000000000..e7799d91aa6 --- /dev/null +++ b/accessible/tests/mochitest/elm/test_MathMLSpec.html @@ -0,0 +1,625 @@ + + + + HTML a11y spec tests + + + + + + + + + + + + + + + + + + Mozilla Bug 658272 +
+

+ +
+  
+ + + + + + a + 2 + + + + + 2 + + + = + + c + 2 + + + + Arbitrary text + + InterpretedStringLiteral + + + + + x + 2 + + + x + 5 + + + + + x + y + + + + [ + + X + , + Y + + closing-fence + + + + a + + + b + + + + x + + + + y + + + + + + b + 1 + 2 + + + + x + + + y + + + z + + + + + + x + ^ + + + + 0 + + + + R + i + + + j + k + + l + + + + + + + (2.1) + + + + E + = + + m + + + c + 2 + + + + + + + + ( + + + 1 + 0 + 0 + + + 0 + 1 + 0 + + + 0 + 0 + 1 + + + ) + + + + + 6 + 8 + + + + 3 + + 2 + + + 4 + + 2 + + + + 3 + 4 + + + + + + Division by zero: + + 1 + 0 + + + + + + + + + x + 2 + + + + y + + + + + + + + x + 2 + + y + + + + + x^{2} + y + + + + + + + + 1 + + + 1 + + + 523 + + - + + 15 + + + 508 + + + + 5 + 1 + 5 + + + + + 123 + ×321 + + + + 123 + 246 + 369 + + + + + + + diff --git a/accessible/tests/mochitest/role.js b/accessible/tests/mochitest/role.js index 08cb39e6346..99524c17471 100644 --- a/accessible/tests/mochitest/role.js +++ b/accessible/tests/mochitest/role.js @@ -41,6 +41,43 @@ const ROLE_LINK = nsIAccessibleRole.ROLE_LINK; const ROLE_LIST = nsIAccessibleRole.ROLE_LIST; const ROLE_LISTBOX = nsIAccessibleRole.ROLE_LISTBOX; const ROLE_LISTITEM = nsIAccessibleRole.ROLE_LISTITEM; +const ROLE_MATHML_MATH = nsIAccessibleRole.ROLE_MATHML_MATH; +const ROLE_MATHML_IDENTIFIER = nsIAccessibleRole.ROLE_MATHML_IDENTIFIER; +const ROLE_MATHML_NUMBER = nsIAccessibleRole.ROLE_MATHML_NUMBER; +const ROLE_MATHML_OPERATOR = nsIAccessibleRole.ROLE_MATHML_OPERATOR; +const ROLE_MATHML_TEXT = nsIAccessibleRole.ROLE_MATHML_TEXT; +const ROLE_MATHML_STRING_LITERAL = nsIAccessibleRole.ROLE_MATHML_STRING_LITERAL; +const ROLE_MATHML_GLYPH = nsIAccessibleRole.ROLE_MATHML_GLYPH; +const ROLE_MATHML_ROW = nsIAccessibleRole.ROLE_MATHML_ROW; +const ROLE_MATHML_FRACTION = nsIAccessibleRole.ROLE_MATHML_FRACTION; +const ROLE_MATHML_SQUARE_ROOT = nsIAccessibleRole.ROLE_MATHML_SQUARE_ROOT; +const ROLE_MATHML_ROOT = nsIAccessibleRole.ROLE_MATHML_ROOT; +const ROLE_MATHML_FENCED = nsIAccessibleRole.ROLE_MATHML_FENCED; +const ROLE_MATHML_ENCLOSED = nsIAccessibleRole.ROLE_MATHML_ENCLOSED; +const ROLE_MATHML_STYLE = nsIAccessibleRole.ROLE_MATHML_STYLE; +const ROLE_MATHML_SUB = nsIAccessibleRole.ROLE_MATHML_SUB; +const ROLE_MATHML_SUP = nsIAccessibleRole.ROLE_MATHML_SUP; +const ROLE_MATHML_SUB_SUP = nsIAccessibleRole.ROLE_MATHML_SUB_SUP; +const ROLE_MATHML_UNDER = nsIAccessibleRole.ROLE_MATHML_UNDER; +const ROLE_MATHML_OVER = nsIAccessibleRole.ROLE_MATHML_OVER; +const ROLE_MATHML_UNDER_OVER = nsIAccessibleRole.ROLE_MATHML_UNDER_OVER; +const ROLE_MATHML_MULTISCRIPTS = nsIAccessibleRole.ROLE_MATHML_MULTISCRIPTS; +const ROLE_MATHML_TABLE = nsIAccessibleRole.ROLE_MATHML_TABLE; +const ROLE_MATHML_LABELED_ROW = nsIAccessibleRole.ROLE_MATHML_LABELED_ROW; +const ROLE_MATHML_TABLE_ROW = nsIAccessibleRole.ROLE_MATHML_TABLE_ROW; +const ROLE_MATHML_CELL = nsIAccessibleRole.ROLE_MATHML_CELL; +const ROLE_MATHML_ACTION = nsIAccessibleRole.ROLE_MATHML_ACTION; +const ROLE_MATHML_ERROR = nsIAccessibleRole.ROLE_MATHML_ERROR; +const ROLE_MATHML_SEMANTICS = nsIAccessibleRole.ROLE_MATHML_SEMANTICS; +const ROLE_MATHML_ANNOTATION = nsIAccessibleRole.ROLE_MATHML_ANNOTATION; +const ROLE_MATHML_XML_ANNOTATION = nsIAccessibleRole.ROLE_MATHML_XML_ANNOTATION; +const ROLE_MATHML_STACK = nsIAccessibleRole.ROLE_MATHML_STACK; +const ROLE_MATHML_LONG_DIVISION = nsIAccessibleRole.ROLE_MATHML_LONG_DIVISION; +const ROLE_MATHML_STACK_GROUP = nsIAccessibleRole.ROLE_MATHML_STACK_GROUP; +const ROLE_MATHML_STACK_ROW = nsIAccessibleRole.ROLE_MATHML_STACK_ROW; +const ROLE_MATHML_STACK_CARRIES = nsIAccessibleRole.ROLE_MATHML_STACK_CARRIES; +const ROLE_MATHML_STACK_CARRY = nsIAccessibleRole.ROLE_MATHML_STACK_CARRY; +const ROLE_MATHML_STACK_LINE = nsIAccessibleRole.ROLE_MATHML_STACK_LINE; const ROLE_MENUBAR = nsIAccessibleRole.ROLE_MENUBAR; const ROLE_MENUITEM = nsIAccessibleRole.ROLE_MENUITEM; const ROLE_MENUPOPUP = nsIAccessibleRole.ROLE_MENUPOPUP;