accessible/base/Filters.cpp
author B2G Bumper Bot <release+b2gbumper@mozilla.com>
Mon, 19 Oct 2015 01:05:33 -0700
changeset 303448 2cda93c9cb39755deb2d582d50f529f852fa9a78
parent 291881 08caf7dd050274fcd091f5d9bef5ab2e2c031c68
child 332299 d0c6dd45e0cfcb641746485511767fea770e8459
permissions -rw-r--r--
Bumping gaia.json for 5 gaia revision(s) a=gaia-bump ======== https://hg.mozilla.org/integration/gaia-central/rev/8be78fcf836b Author: Timothy Guan-tin Chien <timdream@gmail.com> Desc: Merge pull request #32536 from timdream/input-mgmt-chrome-event2 Bug 1207485 - Remove mozChromeEvent/mozContentEvent w/ new InputMethod API methods, r=albertopq ======== https://hg.mozilla.org/integration/gaia-central/rev/2d8ecd5869db Author: Timothy Guan-tin Chien <timdream@gmail.com> Desc: Bug 1207485 - Part II, Use addinputrequest/removeinputrequest events to handle addInput()/removeInput() ======== https://hg.mozilla.org/integration/gaia-central/rev/f372403a5fd3 Author: Timothy Guan-tin Chien <timdream@gmail.com> Desc: Bug 1207485 - Remove mozChromeEvent/mozContentEvent w/ new InputMethod API methods ======== https://hg.mozilla.org/integration/gaia-central/rev/508a6cea1619 Author: Staś Małolepszy <stas@mozilla.com> Desc: Merge pull request #32526 from stasm/1215454-l20n-3.3.3 Bug 1215454 - Update l20n.js to 3.3.3. r=gandalf ======== https://hg.mozilla.org/integration/gaia-central/rev/c02403f4901d Author: Staś Małolepszy <stas@mozilla.com> Desc: Bug 1215454 - Update l20n.js to 3.3.3. r=gandalf

/* 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/. */

#include "Filters.h"

#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)
{
  a11y::role role = aAccessible->Role();
  if (role == roles::ROW)
    return eMatch | eSkipSubtree;

  // Look for rows inside rowgroup.
  if (role == roles::GROUPING)
    return eSkip;

  return eSkipSubtree;
}

uint32_t
filters::GetCell(Accessible* aAccessible)
{
  return aAccessible->IsTableCell() ? eMatch : eSkipSubtree;
}

uint32_t
filters::GetEmbeddedObject(Accessible* aAccessible)
{
  return nsAccUtils::IsEmbeddedObject(aAccessible) ?
    eMatch | eSkipSubtree : eSkipSubtree;
}