2012-08-28 17:13:59 +04:00
|
|
|
/* 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/. */
|
|
|
|
|
2012-08-31 14:36:41 +04:00
|
|
|
#include "Filters.h"
|
2012-08-28 17:13:59 +04:00
|
|
|
|
|
|
|
#include "Accessible-inl.h"
|
|
|
|
#include "nsAccUtils.h"
|
|
|
|
#include "Role.h"
|
|
|
|
#include "States.h"
|
|
|
|
|
|
|
|
using namespace mozilla::a11y;
|
|
|
|
using namespace mozilla::a11y::filters;
|
|
|
|
|
|
|
|
uint32_t filters::GetSelected(Accessible* aAccessible) {
|
|
|
|
if (aAccessible->State() & states::SELECTED) return eMatch | eSkipSubtree;
|
|
|
|
|
|
|
|
return eSkip;
|
|
|
|
}
|
|
|
|
|
|
|
|
uint32_t filters::GetSelectable(Accessible* aAccessible) {
|
|
|
|
if (aAccessible->InteractiveState() & states::SELECTABLE)
|
|
|
|
return eMatch | eSkipSubtree;
|
|
|
|
|
|
|
|
return eSkip;
|
|
|
|
}
|
|
|
|
|
|
|
|
uint32_t filters::GetRow(Accessible* aAccessible) {
|
2018-03-13 10:56:03 +03:00
|
|
|
if (aAccessible->IsTableRow()) return eMatch | eSkipSubtree;
|
2012-08-28 17:13:59 +04:00
|
|
|
|
|
|
|
// Look for rows inside rowgroup.
|
2018-03-13 10:56:03 +03:00
|
|
|
a11y::role role = aAccessible->Role();
|
2012-11-17 11:59:55 +04:00
|
|
|
if (role == roles::GROUPING) return eSkip;
|
2012-08-28 17:13:59 +04:00
|
|
|
|
|
|
|
return eSkipSubtree;
|
|
|
|
}
|
|
|
|
|
|
|
|
uint32_t filters::GetCell(Accessible* aAccessible) {
|
2015-08-13 15:43:26 +03:00
|
|
|
return aAccessible->IsTableCell() ? eMatch : eSkipSubtree;
|
2012-08-28 17:13:59 +04:00
|
|
|
}
|