1 /* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this
3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #include "LocalAccessible-inl.h"
8 #include "nsAccUtils.h"
12 using namespace mozilla::a11y
;
13 using namespace mozilla::a11y::filters
;
15 uint32_t filters::GetSelected(LocalAccessible
* aAccessible
) {
16 if (aAccessible
->State() & states::SELECTED
) return eMatch
| eSkipSubtree
;
21 uint32_t filters::GetSelectable(LocalAccessible
* aAccessible
) {
22 if (aAccessible
->InteractiveState() & states::SELECTABLE
) {
23 return eMatch
| eSkipSubtree
;
29 uint32_t filters::GetRow(LocalAccessible
* aAccessible
) {
30 if (aAccessible
->IsTableRow()) return eMatch
| eSkipSubtree
;
32 // Look for rows inside rowgroup or wrapping text containers.
33 a11y::role role
= aAccessible
->Role();
34 const nsRoleMapEntry
* roleMapEntry
= aAccessible
->ARIARoleMap();
35 if (role
== roles::GROUPING
||
36 (aAccessible
->IsGenericHyperText() && !roleMapEntry
)) {
43 uint32_t filters::GetCell(LocalAccessible
* aAccessible
) {
44 return aAccessible
->IsTableCell() ? eMatch
: eSkipSubtree
;