Bug 1793629 - Implement attention indicator for the unified extensions button, r...
[gecko.git] / accessible / generic / ARIAGridAccessible-inl.h
blobed2c6e227881fc531808706ea31c33c5d70d271c
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim: set ts=2 et sw=2 tw=80: */
3 /* This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #ifndef mozilla_a11y_ARIAGridAccessible_inl_h__
8 #define mozilla_a11y_ARIAGridAccessible_inl_h__
10 #include "ARIAGridAccessible.h"
12 #include "AccIterator.h"
13 #include "nsAccUtils.h"
15 namespace mozilla {
16 namespace a11y {
18 inline int32_t ARIAGridCellAccessible::RowIndexFor(
19 LocalAccessible* aRow) const {
20 LocalAccessible* table = nsAccUtils::TableFor(aRow);
21 if (table) {
22 int32_t rowIdx = 0;
23 LocalAccessible* row = nullptr;
24 AccIterator rowIter(table, filters::GetRow);
25 while ((row = rowIter.Next()) && row != aRow) rowIdx++;
27 if (row) return rowIdx;
30 return -1;
33 } // namespace a11y
34 } // namespace mozilla
36 #endif