forked from mirrors/gecko-dev
We now use CachedTableAccessible for HTML tables, so much of the code in the HTMLTable*Accessible classes was unused. However, we still depend on these classes for some data needed to build the cached table. 1. HTMLTableAccessible and HTMLTableCellAccessible no longer derive from TableAccessible and TableCellAccessible, respectively. Instead, callers which need specific access to HTML table data use the HTMLTable*Accessible class directly. 2. All table specific methods have been removed except those that provide data required to build a CachedTableAccessible. The remaining methods are those for querying the row/column span (which depends on layout) and getting the caption (which depends on DOM). 3. HTMLTable*Accessible are now used for all <table>, <td>, <th> and <tr> elements and MathML equivalents. ARIA*Accessible are never used for these elements. This improves consistency, simplifies the code and means that behavior specific to these HTML elements is handled in these classes, rather than in the ARIA classes as well. 4. The table and row roles are now specified in HTMLMarkupMap and MathMLMarkupMap, rather than overriding NativeRole. Cell roles are still handled in a NativeRole override; see the code comments for details. 5. IsProbablyLayoutTable has been moved from TableAccessible to HTMLTableAccessible, as it is only relevant for HTML tables, not for ARIA tables. 6. HTMLTableHeaderCellAccessible::NativeRole has been rewritten such that it no longer depends on querying table coordinates, as that would now require building a CachedTableAccessible, which would be very wasteful here. This replaces TableCellAccessible::HeaderCellRole, which has been removed. Differential Revision: https://phabricator.services.mozilla.com/D179799
113 lines
4 KiB
C
113 lines
4 KiB
C
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
/* vim:expandtab:shiftwidth=2:tabstop=2:
|
|
*/
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.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_ROW)
|
|
|
|
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_,
|
|
[](Element* aElement, LocalAccessible* aContext) -> LocalAccessible* {
|
|
return new HTMLTableAccessible(aElement, aContext->Document());
|
|
},
|
|
roles::MATHML_TABLE, AttrFromDOM(align, align),
|
|
AttrFromDOM(columnlines_, columnlines_), AttrFromDOM(rowlines_, rowlines_))
|
|
|
|
MARKUPMAP(
|
|
mlabeledtr_,
|
|
[](Element* aElement, LocalAccessible* aContext) -> LocalAccessible* {
|
|
return new HTMLTableRowAccessible(aElement, aContext->Document());
|
|
},
|
|
roles::MATHML_LABELED_ROW)
|
|
|
|
MARKUPMAP(
|
|
mtr_,
|
|
[](Element* aElement, LocalAccessible* aContext) -> LocalAccessible* {
|
|
return new HTMLTableRowAccessible(aElement, aContext->Document());
|
|
},
|
|
roles::MATHML_TABLE_ROW)
|
|
|
|
MARKUPMAP(
|
|
mtd_,
|
|
[](Element* aElement, LocalAccessible* aContext) -> LocalAccessible* {
|
|
return new HTMLTableCellAccessible(aElement, aContext->Document());
|
|
},
|
|
0)
|
|
|
|
MARKUPMAP(maction_, New_HyperText, roles::MATHML_ACTION,
|
|
AttrFromDOM(actiontype_, actiontype_),
|
|
AttrFromDOM(selection_, selection_))
|
|
|
|
MARKUPMAP(merror_, New_HyperText, roles::MATHML_ERROR)
|
|
|
|
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))
|