Bug 739883 - decomtaminate impl of GetSummary() on accessible tables, r=tbsaunde, f=surkov

This commit is contained in:
Max Li 2012-04-15 22:41:58 -04:00
Родитель a95dfe282e
Коммит eb14d6807c
7 изменённых файлов: 23 добавлений и 33 удалений

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

@ -84,18 +84,6 @@ ARIAGridAccessible::Shutdown()
////////////////////////////////////////////////////////////////////////////////
// nsIAccessibleTable
NS_IMETHODIMP
ARIAGridAccessible::GetSummary(nsAString& aSummary)
{
aSummary.Truncate();
if (IsDefunct())
return NS_ERROR_FAILURE;
// XXX: should be pointed by aria-describedby on grid?
return NS_ERROR_NOT_IMPLEMENTED;
}
NS_IMETHODIMP
ARIAGridAccessible::GetColumnCount(PRInt32* aColumnCount)
{

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

@ -554,13 +554,13 @@ nsHTMLTableAccessible::Caption()
return child && child->Role() == roles::CAPTION ? child : nsnull;
}
NS_IMETHODIMP
nsHTMLTableAccessible::GetSummary(nsAString &aSummary)
void
nsHTMLTableAccessible::Summary(nsString& aSummary)
{
nsCOMPtr<nsIDOMHTMLTableElement> table(do_QueryInterface(mContent));
NS_ENSURE_TRUE(table, NS_ERROR_FAILURE);
return table->GetSummary(aSummary);
if (table)
table->GetSummary(aSummary);
}
NS_IMETHODIMP

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

@ -129,6 +129,7 @@ public:
// TableAccessible
virtual nsAccessible* Caption();
virtual void Summary(nsString& aSummary);
virtual bool IsProbablyLayoutTable();
// nsAccessNode

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

@ -21,6 +21,19 @@ xpcAccessibleTable::GetCaption(nsIAccessible** aCaption)
return NS_OK;
}
nsresult
xpcAccessibleTable::GetSummary(nsAString& aSummary)
{
if (!mTable)
return NS_ERROR_FAILURE;
nsAutoString summary;
mTable->Summary(summary);
aSummary.Assign(summary);
return NS_OK;
}
nsresult
xpcAccessibleTable::IsProbablyForLayout(bool* aResult)
{

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

@ -7,6 +7,7 @@
#ifndef MOZILLA_A11Y_XPCOM_XPACCESSIBLETABLE_H_
#define MOZILLA_A11Y_XPCOM_XPACCESSIBLETABLE_H_
#include "nsAString.h"
#include "nscore.h"
class nsIAccessible;
@ -22,6 +23,7 @@ public:
xpcAccessibleTable(mozilla::a11y::TableAccessible* aTable) : mTable(aTable) { }
nsresult GetCaption(nsIAccessible** aCaption);
nsresult GetSummary(nsAString& aSummary);
nsresult IsProbablyForLayout(bool* aIsForLayout);
protected:
@ -31,7 +33,8 @@ protected:
#define NS_DECL_OR_FORWARD_NSIACCESSIBLETABLE_WITH_XPCACCESSIBLETABLE \
NS_IMETHOD GetCaption(nsIAccessible** aCaption) \
{ return xpcAccessibleTable::GetCaption(aCaption); } \
NS_SCRIPTABLE NS_IMETHOD GetSummary(nsAString & aSummary); \
NS_SCRIPTABLE NS_IMETHOD GetSummary(nsAString & aSummary) \
{ return xpcAccessibleTable::GetSummary(aSummary); } \
NS_SCRIPTABLE NS_IMETHOD GetColumnCount(PRInt32 *aColumnCount); \
NS_SCRIPTABLE NS_IMETHOD GetRowCount(PRInt32 *aRowCount); \
NS_SCRIPTABLE NS_IMETHOD GetCellAt(PRInt32 rowIndex, PRInt32 columnIndex, nsIAccessible * *_retval NS_OUTPARAM); \

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

@ -241,14 +241,6 @@ nsXULListboxAccessible::NativeRole()
////////////////////////////////////////////////////////////////////////////////
// nsXULListboxAccessible. nsIAccessibleTable
NS_IMETHODIMP
nsXULListboxAccessible::GetSummary(nsAString &aSummary)
{
aSummary.Truncate();
return NS_OK;
}
NS_IMETHODIMP
nsXULListboxAccessible::GetColumnCount(PRInt32 *aColumnsCout)
{

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

@ -72,13 +72,6 @@ NS_IMPL_ISUPPORTS_INHERITED1(nsXULTreeGridAccessible,
////////////////////////////////////////////////////////////////////////////////
// nsXULTreeGridAccessible: nsIAccessibleTable implementation
NS_IMETHODIMP
nsXULTreeGridAccessible::GetSummary(nsAString &aSummary)
{
aSummary.Truncate();
return IsDefunct() ? NS_ERROR_FAILURE : NS_OK;
}
NS_IMETHODIMP
nsXULTreeGridAccessible::GetColumnCount(PRInt32 *aColumnCount)
{