Bug 1735970 part 13: Support TableAccessibleBase and TableCellAccessibleBase in XPCOM. r=morgan

This doesn't work for non-cached RemoteAccessibles, but this wasn't previously implemented anyway.
With this patch (and all earlier patches in the stack) applied, all the tests in accessible/tests/mochitest pass with the cache enabled, thus testing CachedTableAccessible.

Differential Revision: https://phabricator.services.mozilla.com/D141216
This commit is contained in:
James Teh 2022-03-23 04:00:30 +00:00
Родитель d487ef76d7
Коммит b049082275
4 изменённых файлов: 10 добавлений и 16 удалений

Просмотреть файл

@ -6,8 +6,8 @@
#include "xpcAccessibleTable.h"
#include "LocalAccessible.h"
#include "TableAccessible.h"
#include "mozilla/a11y/Accessible.h"
#include "mozilla/a11y/TableAccessibleBase.h"
#include "nsIMutableArray.h"
#include "nsComponentManagerUtils.h"

Просмотреть файл

@ -12,6 +12,7 @@
namespace mozilla {
namespace a11y {
class TableAccessibleBase;
/**
* XPCOM wrapper around TableAccessible class.
@ -65,9 +66,7 @@ class xpcAccessibleTable : public xpcAccessibleHyperText,
virtual ~xpcAccessibleTable() {}
private:
TableAccessible* Intl() {
return mIntl->IsLocal() ? mIntl->AsLocal()->AsTable() : nullptr;
}
TableAccessibleBase* Intl() { return mIntl->AsTableBase(); }
xpcAccessibleTable(const xpcAccessibleTable&) = delete;
xpcAccessibleTable& operator=(const xpcAccessibleTable&) = delete;

Просмотреть файл

@ -6,10 +6,10 @@
#include "xpcAccessibleTableCell.h"
#include "LocalAccessible.h"
#include "mozilla/a11y/Accessible.h"
#include "mozilla/a11y/TableAccessibleBase.h"
#include "mozilla/a11y/TableCellAccessibleBase.h"
#include "nsIAccessibleTable.h"
#include "TableAccessible.h"
#include "TableCellAccessible.h"
#include "nsComponentManagerUtils.h"
#include "nsIMutableArray.h"
@ -34,7 +34,7 @@ xpcAccessibleTableCell::GetTable(nsIAccessibleTable** aTable) {
if (!Intl()) return NS_ERROR_FAILURE;
TableAccessible* table = Intl()->Table();
TableAccessibleBase* table = Intl()->Table();
if (!table) return NS_ERROR_FAILURE;
nsCOMPtr<nsIAccessibleTable> xpcTable = do_QueryInterface(

Просмотреть файл

@ -13,6 +13,7 @@
namespace mozilla {
namespace a11y {
class TableCellAccessibleBase;
/**
* XPCOM wrapper around TableAccessibleCell class.
@ -39,13 +40,7 @@ class xpcAccessibleTableCell : public xpcAccessibleHyperText,
virtual ~xpcAccessibleTableCell() {}
private:
TableCellAccessible* Intl() {
if (LocalAccessible* acc = mIntl->AsLocal()) {
return acc->AsTableCell();
}
return nullptr;
}
TableCellAccessibleBase* Intl() { return mIntl->AsTableCellBase(); }
xpcAccessibleTableCell(const xpcAccessibleTableCell&) = delete;
xpcAccessibleTableCell& operator=(const xpcAccessibleTableCell&) = delete;