1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim:expandtab:shiftwidth=2:tabstop=2:
4 /* This Source Code Form is subject to the terms of the Mozilla Public
5 * License, v. 2.0. If a copy of the MPL was not distributed with this
6 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
8 MARKUPMAP(math
, New_HyperText
, roles::MATHML_MATH
)
10 MARKUPMAP(mi_
, New_HyperText
, roles::MATHML_IDENTIFIER
)
12 MARKUPMAP(mn_
, New_HyperText
, roles::MATHML_NUMBER
)
14 MARKUPMAP(mo_
, New_HyperText
, roles::MATHML_OPERATOR
,
15 AttrFromDOM(accent_
, accent_
), AttrFromDOM(fence_
, fence_
),
16 AttrFromDOM(separator_
, separator_
), AttrFromDOM(largeop_
, largeop_
))
18 MARKUPMAP(mtext_
, New_HyperText
, roles::MATHML_TEXT
)
20 MARKUPMAP(ms_
, New_HyperText
, roles::MATHML_STRING_LITERAL
)
22 MARKUPMAP(mglyph_
, New_HyperText
, roles::MATHML_GLYPH
)
24 MARKUPMAP(mrow_
, New_HyperText
, roles::MATHML_ROW
)
26 MARKUPMAP(mfrac_
, New_HyperText
, roles::MATHML_FRACTION
,
27 AttrFromDOM(bevelled_
, bevelled_
),
28 AttrFromDOM(linethickness_
, linethickness_
))
30 MARKUPMAP(msqrt_
, New_HyperText
, roles::MATHML_SQUARE_ROOT
)
32 MARKUPMAP(mroot_
, New_HyperText
, roles::MATHML_ROOT
)
34 MARKUPMAP(mfenced_
, New_HyperText
, roles::MATHML_ROW
)
36 MARKUPMAP(menclose_
, New_HyperText
, roles::MATHML_ENCLOSED
,
37 AttrFromDOM(notation_
, notation_
))
39 MARKUPMAP(mstyle_
, New_HyperText
, roles::MATHML_STYLE
)
41 MARKUPMAP(msub_
, New_HyperText
, roles::MATHML_SUB
)
43 MARKUPMAP(msup_
, New_HyperText
, roles::MATHML_SUP
)
45 MARKUPMAP(msubsup_
, New_HyperText
, roles::MATHML_SUB_SUP
)
47 MARKUPMAP(munder_
, New_HyperText
, roles::MATHML_UNDER
,
48 AttrFromDOM(accentunder_
, accentunder_
), AttrFromDOM(align
, align
))
50 MARKUPMAP(mover_
, New_HyperText
, roles::MATHML_OVER
,
51 AttrFromDOM(accent_
, accent_
), AttrFromDOM(align
, align
))
53 MARKUPMAP(munderover_
, New_HyperText
, roles::MATHML_UNDER_OVER
,
54 AttrFromDOM(accent_
, accent_
),
55 AttrFromDOM(accentunder_
, accentunder_
), AttrFromDOM(align
, align
))
57 MARKUPMAP(mmultiscripts_
, New_HyperText
, roles::MATHML_MULTISCRIPTS
)
61 [](Element
* aElement
, LocalAccessible
* aContext
) -> LocalAccessible
* {
62 // If we're not a table according to layout, use a generic accessible.
63 if (!aElement
->GetPrimaryFrame() ||
64 aElement
->GetPrimaryFrame()->AccessibleType() != eHTMLTableType
) {
65 return new ARIAGridAccessible(aElement
, aContext
->Document());
68 return new HTMLTableAccessible(aElement
, aContext
->Document());
70 roles::MATHML_TABLE
, AttrFromDOM(align
, align
),
71 AttrFromDOM(columnlines_
, columnlines_
), AttrFromDOM(rowlines_
, rowlines_
))
75 [](Element
* aElement
, LocalAccessible
* aContext
) -> LocalAccessible
* {
76 return new HTMLTableRowAccessible(aElement
, aContext
->Document());
78 roles::MATHML_LABELED_ROW
)
82 [](Element
* aElement
, LocalAccessible
* aContext
) -> LocalAccessible
* {
83 if (aContext
->IsHTMLTable() && aElement
->GetPrimaryFrame() &&
84 aElement
->GetPrimaryFrame()->AccessibleType() == eHTMLTableRowType
) {
85 return new HTMLTableRowAccessible(aElement
, aContext
->Document());
88 // If the mtr element in a MathML table has a display style other than
89 // 'table', create a generic table row accessible, since there's no
90 // underlying table layout.
91 if (aContext
->IsTable()) {
92 return new ARIARowAccessible(aElement
, aContext
->Document());
97 roles::MATHML_TABLE_ROW
)
101 [](Element
* aElement
, LocalAccessible
* aContext
) -> LocalAccessible
* {
102 if (aContext
->IsHTMLTableRow() && aElement
->GetPrimaryFrame() &&
103 aElement
->GetPrimaryFrame()->AccessibleType() == eHTMLTableCellType
) {
104 return new HTMLTableCellAccessible(aElement
, aContext
->Document());
107 // If the mtd element in a MathML table has a display style other than
108 // 'table', create a generic table cell accessible, since there's no
109 // underlying table layout.
110 if (aContext
->IsTableRow()) {
111 return new ARIAGridCellAccessible(aElement
, aContext
->Document());
118 MARKUPMAP(maction_
, New_HyperText
, roles::MATHML_ACTION
,
119 AttrFromDOM(actiontype_
, actiontype_
),
120 AttrFromDOM(selection_
, selection_
))
122 MARKUPMAP(merror_
, New_HyperText
, roles::MATHML_ERROR
)
124 MARKUPMAP(mstack_
, New_HyperText
, roles::MATHML_STACK
,
125 AttrFromDOM(align
, align
), AttrFromDOM(position
, position
))
127 MARKUPMAP(mlongdiv_
, New_HyperText
, roles::MATHML_LONG_DIVISION
,
128 AttrFromDOM(longdivstyle_
, longdivstyle_
))
130 MARKUPMAP(msgroup_
, New_HyperText
, roles::MATHML_STACK_GROUP
,
131 AttrFromDOM(position
, position
), AttrFromDOM(shift_
, shift_
))
133 MARKUPMAP(msrow_
, New_HyperText
, roles::MATHML_STACK_ROW
,
134 AttrFromDOM(position
, position
))
136 MARKUPMAP(mscarries_
, New_HyperText
, roles::MATHML_STACK_CARRIES
,
137 AttrFromDOM(location_
, location_
), AttrFromDOM(position
, position
))
139 MARKUPMAP(mscarry_
, New_HyperText
, roles::MATHML_STACK_CARRY
,
140 AttrFromDOM(crossout_
, crossout_
))
142 MARKUPMAP(msline_
, New_HyperText
, roles::MATHML_STACK_LINE
,
143 AttrFromDOM(position
, position
))