mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
backout 6e03c7c669b7 due to missing local include causing windows bustage
This commit is contained in:
parent
76f85b36c5
commit
3390d61649
@ -99,9 +99,7 @@ endif
|
||||
LOCAL_INCLUDES += \
|
||||
-I$(srcdir) \
|
||||
-I$(srcdir)/../base \
|
||||
-I$(srcdir)/../generic \
|
||||
-I$(srcdir)/../html \
|
||||
-I$(srcdir)/../xpcom \
|
||||
-I$(srcdir)/../xul \
|
||||
-I$(topsrcdir)/other-licenses/atk-1.0 \
|
||||
$(NULL)
|
||||
|
@ -42,14 +42,12 @@
|
||||
#include "nsAccessibleWrap.h"
|
||||
#include "nsAccUtils.h"
|
||||
#include "nsIAccessibleTable.h"
|
||||
#include "TableAccessible.h"
|
||||
#include "nsMai.h"
|
||||
|
||||
#include "nsArrayUtils.h"
|
||||
|
||||
using namespace mozilla::a11y;
|
||||
|
||||
extern "C" {
|
||||
|
||||
static AtkObject*
|
||||
refAtCB(AtkTable *aTable, gint aRow, gint aColumn)
|
||||
{
|
||||
@ -210,17 +208,23 @@ getRowExtentAtCB(AtkTable *aTable,
|
||||
}
|
||||
|
||||
static AtkObject*
|
||||
getCaptionCB(AtkTable* aTable)
|
||||
getCaptionCB(AtkTable *aTable)
|
||||
{
|
||||
nsAccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aTable));
|
||||
if (!accWrap)
|
||||
return nsnull;
|
||||
nsAccessibleWrap *accWrap = GetAccessibleWrap(ATK_OBJECT(aTable));
|
||||
if (!accWrap)
|
||||
return nsnull;
|
||||
|
||||
TableAccessible* table = accWrap->AsTable();
|
||||
NS_ENSURE_TRUE(table, nsnull);
|
||||
nsCOMPtr<nsIAccessibleTable> accTable;
|
||||
accWrap->QueryInterface(NS_GET_IID(nsIAccessibleTable),
|
||||
getter_AddRefs(accTable));
|
||||
NS_ENSURE_TRUE(accTable, nsnull);
|
||||
|
||||
nsAccessible* caption = table->Caption();
|
||||
return caption ? nsAccessibleWrap::GetAtkObject(caption) : nsnull;
|
||||
nsCOMPtr<nsIAccessible> caption;
|
||||
nsresult rv = accTable->GetCaption(getter_AddRefs(caption));
|
||||
if (NS_FAILED(rv) || !caption)
|
||||
return nsnull;
|
||||
|
||||
return nsAccessibleWrap::GetAtkObject(caption);
|
||||
}
|
||||
|
||||
static const gchar*
|
||||
|
@ -104,9 +104,8 @@ include $(topsrcdir)/config/rules.mk
|
||||
|
||||
LOCAL_INCLUDES += \
|
||||
-I$(srcdir) \
|
||||
-I$(srcdir)/../generic \
|
||||
-I$(srcdir)/../html \
|
||||
-I$(srcdir)/../xpcom \
|
||||
-I$(srcdir)/../html \
|
||||
-I$(srcdir)/../xul \
|
||||
-I$(srcdir)/../../../layout/generic \
|
||||
-I$(srcdir)/../../../layout/style \
|
||||
|
@ -58,7 +58,7 @@ using namespace mozilla::a11y;
|
||||
|
||||
nsARIAGridAccessible::
|
||||
nsARIAGridAccessible(nsIContent* aContent, nsDocAccessible* aDoc) :
|
||||
nsAccessibleWrap(aContent, aDoc), xpcAccessibleTable(this)
|
||||
nsAccessibleWrap(aContent, aDoc)
|
||||
{
|
||||
}
|
||||
|
||||
@ -69,19 +69,22 @@ NS_IMPL_ISUPPORTS_INHERITED1(nsARIAGridAccessible,
|
||||
nsAccessible,
|
||||
nsIAccessibleTable)
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
//nsAccessNode
|
||||
|
||||
void
|
||||
nsARIAGridAccessible::Shutdown()
|
||||
{
|
||||
mTable = nsnull;
|
||||
nsAccessibleWrap::Shutdown();
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// nsIAccessibleTable
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsARIAGridAccessible::GetCaption(nsIAccessible **aCaption)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aCaption);
|
||||
*aCaption = nsnull;
|
||||
|
||||
if (IsDefunct())
|
||||
return NS_ERROR_FAILURE;
|
||||
|
||||
// XXX: should be pointed by aria-labelledby on grid?
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsARIAGridAccessible::GetSummary(nsAString &aSummary)
|
||||
{
|
||||
@ -707,6 +710,15 @@ nsARIAGridAccessible::UnselectColumn(PRInt32 aColumn)
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsARIAGridAccessible::IsProbablyForLayout(bool *aIsProbablyForLayout)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aIsProbablyForLayout);
|
||||
*aIsProbablyForLayout = false;
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// Protected
|
||||
|
||||
|
@ -42,16 +42,12 @@
|
||||
#include "nsIAccessibleTable.h"
|
||||
|
||||
#include "nsHyperTextAccessibleWrap.h"
|
||||
#include "TableAccessible.h"
|
||||
#include "xpcAccessibleTable.h"
|
||||
|
||||
/**
|
||||
* Accessible for ARIA grid and treegrid.
|
||||
*/
|
||||
class nsARIAGridAccessible : public nsAccessibleWrap,
|
||||
public xpcAccessibleTable,
|
||||
public nsIAccessibleTable,
|
||||
public mozilla::a11y::TableAccessible
|
||||
public nsIAccessibleTable
|
||||
{
|
||||
public:
|
||||
nsARIAGridAccessible(nsIContent* aContent, nsDocAccessible* aDoc);
|
||||
@ -60,13 +56,7 @@ public:
|
||||
NS_DECL_ISUPPORTS_INHERITED
|
||||
|
||||
// nsIAccessibleTable
|
||||
NS_DECL_OR_FORWARD_NSIACCESSIBLETABLE_WITH_XPCACCESSIBLETABLE
|
||||
|
||||
// nsAccessible
|
||||
virtual mozilla::a11y::TableAccessible* AsTable() { return this; }
|
||||
|
||||
// nsAccessNode
|
||||
virtual void Shutdown();
|
||||
NS_DECL_NSIACCESSIBLETABLE
|
||||
|
||||
protected:
|
||||
/**
|
||||
|
@ -66,11 +66,6 @@ class nsHTMLImageMapAccessible;
|
||||
class nsHTMLLIAccessible;
|
||||
struct nsRoleMapEntry;
|
||||
class Relation;
|
||||
namespace mozilla {
|
||||
namespace a11y {
|
||||
class TableAccessible;
|
||||
}
|
||||
}
|
||||
class nsTextAccessible;
|
||||
|
||||
struct nsRect;
|
||||
@ -476,8 +471,6 @@ public:
|
||||
inline bool IsRoot() const { return mFlags & eRootAccessible; }
|
||||
nsRootAccessible* AsRoot();
|
||||
|
||||
virtual mozilla::a11y::TableAccessible* AsTable() { return nsnull; }
|
||||
|
||||
inline bool IsTextLeaf() const { return mFlags & eTextLeafAccessible; }
|
||||
nsTextAccessible* AsTextLeaf();
|
||||
|
||||
|
@ -1,170 +0,0 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* vim: set ts=2 et sw=2 tw=80: */
|
||||
/* 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/. */
|
||||
|
||||
#ifndef TABLE_ACCESSIBLE_H
|
||||
#define TABLE_ACCESSIBLE_H
|
||||
|
||||
#include "nsString.h"
|
||||
#include "nsTArray.h"
|
||||
#include "prtypes.h"
|
||||
|
||||
class nsAccessible;
|
||||
|
||||
namespace mozilla {
|
||||
namespace a11y {
|
||||
|
||||
/**
|
||||
* Accessible table interface.
|
||||
*/
|
||||
class TableAccessible
|
||||
{
|
||||
public:
|
||||
|
||||
/**
|
||||
* Return the caption accessible if any for this table.
|
||||
*/
|
||||
virtual nsAccessible* Caption() { return nsnull; }
|
||||
|
||||
/**
|
||||
* Get the summary for this table.
|
||||
*/
|
||||
virtual void Summary(nsString& aSummary) { aSummary.Truncate(); }
|
||||
|
||||
/**
|
||||
* Return the number of columns in the table.
|
||||
*/
|
||||
virtual PRUint32 ColCount() { return 0; }
|
||||
|
||||
/**
|
||||
* Return the number of rows in the table.
|
||||
*/
|
||||
virtual PRUint32 RowCount() { return 0; }
|
||||
|
||||
/**
|
||||
* Return the accessible for the cell at the given row and column indices.
|
||||
*/
|
||||
virtual nsAccessible* CellAt(PRUint32 aRowIdx, PRUint32 aColIdx) { return nsnull; }
|
||||
|
||||
/**
|
||||
* Return the index of the cell at the given row and column.
|
||||
*/
|
||||
virtual PRInt32 CellIndexAt(PRUint32 aRowIdx, PRUint32 aColIdx) { return -1; }
|
||||
|
||||
/**
|
||||
* Return the column index of the cell with the given index.
|
||||
*/
|
||||
virtual PRInt32 ColIndexAt(PRUint32 aCellIdx) { return -1; }
|
||||
|
||||
/**
|
||||
* Return the row index of the cell with the given index.
|
||||
*/
|
||||
virtual PRInt32 RowIndexAt(PRUint32 aCellIdx) { return -1; }
|
||||
|
||||
/**
|
||||
* Get the row and column indices for the cell at the given index.
|
||||
*/
|
||||
virtual void RowAndColIndicesAt(PRUint32 aCellIdx, PRInt32* aRowIdx,
|
||||
PRInt32* aColIdx) {}
|
||||
|
||||
/**
|
||||
* Return the number of columns occupied by the cell at the given row and
|
||||
* column indices.
|
||||
*/
|
||||
virtual PRUint32 ColExtentAt(PRUint32 aRowIdx, PRUint32 aColIdx) { return 1; }
|
||||
|
||||
/**
|
||||
* Return the number of rows occupied by the cell at the given row and column
|
||||
* indices.
|
||||
*/
|
||||
virtual PRUint32 RowExtentAt(PRUint32 aRowIdx, PRUint32 aColIdx) { return 1; }
|
||||
|
||||
/**
|
||||
* Get the description of the given column.
|
||||
*/
|
||||
virtual void ColDescription(PRUint32 aColIdx, nsString& aDescription)
|
||||
{ aDescription.Truncate(); }
|
||||
|
||||
/**
|
||||
* Get the description for the given row.
|
||||
*/
|
||||
virtual void RowDescription(PRUint32 aRowIdx, nsString& aDescription)
|
||||
{ aDescription.Truncate(); }
|
||||
|
||||
/**
|
||||
* Return true if the given column is selected.
|
||||
*/
|
||||
virtual bool IsColSelected(PRUint32 aColIdx) { return false; }
|
||||
|
||||
/**
|
||||
* Return true if the given row is selected.
|
||||
*/
|
||||
virtual bool IsRowSelected(PRUint32 aRowIdx) { return false; }
|
||||
|
||||
/**
|
||||
* Return true if the given cell is selected.
|
||||
*/
|
||||
virtual bool IsCellSelected(PRUint32 aRowIdx, PRUint32 aColIdx) { return false; }
|
||||
|
||||
/**
|
||||
* Return the number of selected cells.
|
||||
*/
|
||||
virtual PRUint32 SelectedCellCount() { return 0; }
|
||||
|
||||
/**
|
||||
* Return the number of selected columns.
|
||||
*/
|
||||
virtual PRUint32 SelectedColCount() { return 0; }
|
||||
|
||||
/**
|
||||
* Return the number of selected rows.
|
||||
*/
|
||||
virtual PRUint32 SelectedRowCount() { return 0; }
|
||||
|
||||
/**
|
||||
* Get the set of selected cells.
|
||||
*/
|
||||
virtual void SelectedCells(nsTArray<nsAccessible*>* aCells) {}
|
||||
|
||||
/**
|
||||
* Get the set of selected column indices.
|
||||
*/
|
||||
virtual void SelectedColIndices(nsTArray<PRUint32>* aCols) {}
|
||||
|
||||
/**
|
||||
* Get the set of selected row indices.
|
||||
*/
|
||||
virtual void SelectedRowIndices(nsTArray<PRUint32>* aRows) {}
|
||||
|
||||
/**
|
||||
* Select the given column unselecting any other selected columns.
|
||||
*/
|
||||
virtual void SelectCol(PRUint32 aColIdx) {}
|
||||
|
||||
/**
|
||||
* Select the given row unselecting all other previously selected rows.
|
||||
*/
|
||||
virtual void SelectRow(PRUint32 aRowIdx) {}
|
||||
|
||||
/**
|
||||
* Unselect the given column leaving other selected columns selected.
|
||||
*/
|
||||
virtual void UnselectCol(PRUint32 aColIdx) {}
|
||||
|
||||
/**
|
||||
* Unselect the given row leaving other selected rows selected.
|
||||
*/
|
||||
virtual void UnselectRow(PRUint32 aRowIdx) {}
|
||||
|
||||
/**
|
||||
* Return true if the table is probably for layout.
|
||||
*/
|
||||
virtual bool IsProbablyLayoutTable() { return false; }
|
||||
};
|
||||
|
||||
} // namespace a11y
|
||||
} // namespace mozilla
|
||||
|
||||
#endif
|
@ -73,8 +73,6 @@ include $(topsrcdir)/config/rules.mk
|
||||
|
||||
LOCAL_INCLUDES = \
|
||||
-I$(srcdir)/../base \
|
||||
-I$(srcdir)/../generic \
|
||||
-I$(srcdir)/../xpcom \
|
||||
-I$(srcdir)/../../../layout/generic \
|
||||
-I$(srcdir)/../../../layout/xul/base/src \
|
||||
$(NULL)
|
||||
|
@ -436,7 +436,7 @@ nsHTMLTableHeaderCellAccessible::NativeRole()
|
||||
|
||||
nsHTMLTableAccessible::
|
||||
nsHTMLTableAccessible(nsIContent* aContent, nsDocAccessible* aDoc) :
|
||||
nsAccessibleWrap(aContent, aDoc), xpcAccessibleTable(this)
|
||||
nsAccessibleWrap(aContent, aDoc)
|
||||
{
|
||||
}
|
||||
|
||||
@ -446,16 +446,6 @@ nsHTMLTableAccessible::
|
||||
NS_IMPL_ISUPPORTS_INHERITED2(nsHTMLTableAccessible, nsAccessible,
|
||||
nsHTMLTableAccessible, nsIAccessibleTable)
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
//nsAccessNode
|
||||
|
||||
void
|
||||
nsHTMLTableAccessible::Shutdown()
|
||||
{
|
||||
mTable = nsnull;
|
||||
nsAccessibleWrap::Shutdown();
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// nsHTMLTableAccessible: nsAccessible implementation
|
||||
@ -521,7 +511,9 @@ nsHTMLTableAccessible::GetAttributesInternal(nsIPersistentProperties *aAttribute
|
||||
nsresult rv = nsAccessibleWrap::GetAttributesInternal(aAttributes);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
if (IsProbablyLayoutTable()) {
|
||||
bool isProbablyForLayout;
|
||||
IsProbablyForLayout(&isProbablyForLayout);
|
||||
if (isProbablyForLayout) {
|
||||
nsAutoString oldValueUnused;
|
||||
aAttributes->SetStringProperty(NS_LITERAL_CSTRING("layout-guess"),
|
||||
NS_LITERAL_STRING("true"), oldValueUnused);
|
||||
@ -546,11 +538,13 @@ nsHTMLTableAccessible::RelationByType(PRUint32 aType)
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// nsHTMLTableAccessible: nsIAccessibleTable implementation
|
||||
|
||||
nsAccessible*
|
||||
nsHTMLTableAccessible::Caption()
|
||||
NS_IMETHODIMP
|
||||
nsHTMLTableAccessible::GetCaption(nsIAccessible **aCaption)
|
||||
{
|
||||
nsAccessible* child = mChildren.SafeElementAt(0, nsnull);
|
||||
return child && child->Role() == roles::CAPTION ? child : nsnull;
|
||||
NS_ENSURE_ARG_POINTER(aCaption);
|
||||
|
||||
NS_IF_ADDREF(*aCaption = Caption());
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
@ -1313,7 +1307,8 @@ nsHTMLTableAccessible::Description(nsString& aDescription)
|
||||
|
||||
#ifdef SHOW_LAYOUT_HEURISTIC
|
||||
if (aDescription.IsEmpty()) {
|
||||
bool isProbablyForLayout = IsProbablyLayoutTable();
|
||||
bool isProbablyForLayout;
|
||||
IsProbablyForLayout(&isProbablyForLayout);
|
||||
aDescription = mLayoutHeuristic;
|
||||
}
|
||||
#ifdef DEBUG_A11Y
|
||||
@ -1362,8 +1357,8 @@ nsHTMLTableAccessible::HasDescendant(const nsAString& aTagName,
|
||||
return !!foundItem;
|
||||
}
|
||||
|
||||
bool
|
||||
nsHTMLTableAccessible::IsProbablyLayoutTable()
|
||||
NS_IMETHODIMP
|
||||
nsHTMLTableAccessible::IsProbablyForLayout(bool *aIsProbablyForLayout)
|
||||
{
|
||||
// Implement a heuristic to determine if table is most likely used for layout
|
||||
// XXX do we want to look for rowspan or colspan, especialy that span all but a couple cells
|
||||
@ -1375,16 +1370,18 @@ nsHTMLTableAccessible::IsProbablyLayoutTable()
|
||||
// Change to |#define SHOW_LAYOUT_HEURISTIC DEBUG| before final release
|
||||
#ifdef SHOW_LAYOUT_HEURISTIC
|
||||
#define RETURN_LAYOUT_ANSWER(isLayout, heuristic) \
|
||||
{ \
|
||||
mLayoutHeuristic = isLayout ? \
|
||||
NS_LITERAL_STRING("layout table: " heuristic) : \
|
||||
NS_LITERAL_STRING("data table: " heuristic); \
|
||||
return isLayout; \
|
||||
}
|
||||
{ *aIsProbablyForLayout = isLayout; \
|
||||
mLayoutHeuristic = isLayout ? NS_LITERAL_STRING("layout table: ") : NS_LITERAL_STRING("data table: "); \
|
||||
mLayoutHeuristic += NS_LITERAL_STRING(heuristic); return NS_OK; }
|
||||
#else
|
||||
#define RETURN_LAYOUT_ANSWER(isLayout, heuristic) { return isLayout; }
|
||||
#define RETURN_LAYOUT_ANSWER(isLayout, heuristic) { *aIsProbablyForLayout = isLayout; return NS_OK; }
|
||||
#endif
|
||||
|
||||
*aIsProbablyForLayout = false;
|
||||
|
||||
if (IsDefunct())
|
||||
return NS_ERROR_FAILURE;
|
||||
|
||||
nsDocAccessible* docAccessible = Document();
|
||||
if (docAccessible) {
|
||||
PRUint64 docState = docAccessible->State();
|
||||
|
@ -41,8 +41,6 @@
|
||||
|
||||
#include "nsHyperTextAccessibleWrap.h"
|
||||
#include "nsIAccessibleTable.h"
|
||||
#include "TableAccessible.h"
|
||||
#include "xpcAccessibleTable.h"
|
||||
|
||||
class nsITableLayout;
|
||||
class nsITableCellLayout;
|
||||
@ -123,28 +121,16 @@ public:
|
||||
}
|
||||
|
||||
class nsHTMLTableAccessible : public nsAccessibleWrap,
|
||||
public xpcAccessibleTable,
|
||||
public nsIAccessibleTable,
|
||||
public mozilla::a11y::TableAccessible
|
||||
public nsIAccessibleTable
|
||||
{
|
||||
public:
|
||||
nsHTMLTableAccessible(nsIContent* aContent, nsDocAccessible* aDoc);
|
||||
|
||||
NS_DECL_ISUPPORTS_INHERITED
|
||||
NS_DECL_NSIACCESSIBLETABLE
|
||||
NS_DECLARE_STATIC_IID_ACCESSOR(NS_TABLEACCESSIBLE_IMPL_CID)
|
||||
|
||||
// nsIAccessible Table
|
||||
NS_DECL_OR_FORWARD_NSIACCESSIBLETABLE_WITH_XPCACCESSIBLETABLE
|
||||
|
||||
// TableAccessible
|
||||
virtual nsAccessible* Caption();
|
||||
virtual bool IsProbablyLayoutTable();
|
||||
|
||||
// nsAccessNode
|
||||
virtual void Shutdown();
|
||||
|
||||
// nsAccessible
|
||||
virtual mozilla::a11y::TableAccessible* AsTable() { return this; }
|
||||
virtual void Description(nsString& aDescription);
|
||||
virtual nsresult GetNameInternal(nsAString& aName);
|
||||
virtual mozilla::a11y::role NativeRole();
|
||||
@ -152,6 +138,13 @@ public:
|
||||
virtual nsresult GetAttributesInternal(nsIPersistentProperties *aAttributes);
|
||||
virtual Relation RelationByType(PRUint32 aRelationType);
|
||||
|
||||
// TableAccessible
|
||||
inline nsAccessible* Caption() const
|
||||
{
|
||||
nsAccessible* child = mChildren.SafeElementAt(0, nsnull);
|
||||
return child && child->Role() == mozilla::a11y::roles::CAPTION ? child : nsnull;
|
||||
}
|
||||
|
||||
// nsHTMLTableAccessible
|
||||
|
||||
/**
|
||||
|
@ -50,7 +50,6 @@ LIBXUL_LIBRARY = 1
|
||||
CPPSRCS = \
|
||||
nsAccEvent.cpp \
|
||||
nsAccessibleRelation.cpp \
|
||||
xpcAccessibleTable.cpp \
|
||||
$(NULL)
|
||||
|
||||
# we don't want the shared lib, but we want to force the creation of a static lib.
|
||||
@ -60,5 +59,4 @@ include $(topsrcdir)/config/rules.mk
|
||||
|
||||
LOCAL_INCLUDES = \
|
||||
-I$(srcdir)/../base \
|
||||
-I$(srcdir)/../generic \
|
||||
$(NULL)
|
||||
|
@ -1,34 +0,0 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* vim: set ts=2 et sw=2 tw=80: */
|
||||
/* 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 "xpcAccessibleTable.h"
|
||||
|
||||
#include "nsAccessible.h"
|
||||
#include "TableAccessible.h"
|
||||
|
||||
nsresult
|
||||
xpcAccessibleTable::GetCaption(nsIAccessible** aCaption)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aCaption);
|
||||
*aCaption = nsnull;
|
||||
if (!mTable)
|
||||
return NS_ERROR_FAILURE;
|
||||
|
||||
NS_IF_ADDREF(*aCaption = mTable->Caption());
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsresult
|
||||
xpcAccessibleTable::IsProbablyForLayout(bool* aResult)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aResult);
|
||||
*aResult = false;
|
||||
if (!mTable)
|
||||
return NS_ERROR_FAILURE;
|
||||
|
||||
*aResult = mTable->IsProbablyLayoutTable();
|
||||
return NS_OK;
|
||||
}
|
@ -1,63 +0,0 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* vim: set ts=2 et sw=2 tw=80: */
|
||||
/* 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/. */
|
||||
|
||||
#ifndef MOZILLA_A11Y_XPCOM_XPACCESSIBLETABLE_H_
|
||||
#define MOZILLA_A11Y_XPCOM_XPACCESSIBLETABLE_H_
|
||||
|
||||
#include "nscore.h"
|
||||
|
||||
class nsIAccessible;
|
||||
namespace mozilla {
|
||||
namespace a11y {
|
||||
class TableAccessible;
|
||||
}
|
||||
}
|
||||
|
||||
class xpcAccessibleTable
|
||||
{
|
||||
public:
|
||||
xpcAccessibleTable(mozilla::a11y::TableAccessible* aTable) : mTable(aTable) { }
|
||||
|
||||
nsresult GetCaption(nsIAccessible** aCaption);
|
||||
nsresult IsProbablyForLayout(bool* aIsForLayout);
|
||||
|
||||
protected:
|
||||
mozilla::a11y::TableAccessible* mTable;
|
||||
};
|
||||
|
||||
#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 GetColumnCount(PRInt32 *aColumnCount); \
|
||||
NS_SCRIPTABLE NS_IMETHOD GetRowCount(PRInt32 *aRowCount); \
|
||||
NS_SCRIPTABLE NS_IMETHOD GetCellAt(PRInt32 rowIndex, PRInt32 columnIndex, nsIAccessible * *_retval NS_OUTPARAM); \
|
||||
NS_SCRIPTABLE NS_IMETHOD GetCellIndexAt(PRInt32 rowIndex, PRInt32 columnIndex, PRInt32 *_retval NS_OUTPARAM); \
|
||||
NS_SCRIPTABLE NS_IMETHOD GetColumnIndexAt(PRInt32 cellIndex, PRInt32 *_retval NS_OUTPARAM); \
|
||||
NS_SCRIPTABLE NS_IMETHOD GetRowIndexAt(PRInt32 cellIndex, PRInt32 *_retval NS_OUTPARAM); \
|
||||
NS_SCRIPTABLE NS_IMETHOD GetRowAndColumnIndicesAt(PRInt32 cellIndex, PRInt32 *rowIndex NS_OUTPARAM, PRInt32 *columnIndex NS_OUTPARAM); \
|
||||
NS_SCRIPTABLE NS_IMETHOD GetColumnExtentAt(PRInt32 row, PRInt32 column, PRInt32 *_retval NS_OUTPARAM); \
|
||||
NS_SCRIPTABLE NS_IMETHOD GetRowExtentAt(PRInt32 row, PRInt32 column, PRInt32 *_retval NS_OUTPARAM); \
|
||||
NS_SCRIPTABLE NS_IMETHOD GetColumnDescription(PRInt32 columnIndex, nsAString & _retval NS_OUTPARAM); \
|
||||
NS_SCRIPTABLE NS_IMETHOD GetRowDescription(PRInt32 rowIndex, nsAString & _retval NS_OUTPARAM); \
|
||||
NS_SCRIPTABLE NS_IMETHOD IsColumnSelected(PRInt32 columnIndex, bool *_retval NS_OUTPARAM); \
|
||||
NS_SCRIPTABLE NS_IMETHOD IsRowSelected(PRInt32 rowIndex, bool *_retval NS_OUTPARAM); \
|
||||
NS_SCRIPTABLE NS_IMETHOD IsCellSelected(PRInt32 rowIndex, PRInt32 columnIndex, bool *_retval NS_OUTPARAM); \
|
||||
NS_SCRIPTABLE NS_IMETHOD GetSelectedCellCount(PRUint32 *aSelectedCellCount); \
|
||||
NS_SCRIPTABLE NS_IMETHOD GetSelectedColumnCount(PRUint32 *aSelectedColumnCount); \
|
||||
NS_SCRIPTABLE NS_IMETHOD GetSelectedRowCount(PRUint32 *aSelectedRowCount); \
|
||||
NS_SCRIPTABLE NS_IMETHOD GetSelectedCells(nsIArray * *aSelectedCells); \
|
||||
NS_SCRIPTABLE NS_IMETHOD GetSelectedCellIndices(PRUint32 *cellsArraySize NS_OUTPARAM, PRInt32 **cellsArray NS_OUTPARAM); \
|
||||
NS_SCRIPTABLE NS_IMETHOD GetSelectedColumnIndices(PRUint32 *rowsArraySize NS_OUTPARAM, PRInt32 **rowsArray NS_OUTPARAM); \
|
||||
NS_SCRIPTABLE NS_IMETHOD GetSelectedRowIndices(PRUint32 *rowsArraySize NS_OUTPARAM, PRInt32 **rowsArray NS_OUTPARAM); \
|
||||
NS_SCRIPTABLE NS_IMETHOD SelectRow(PRInt32 rowIndex); \
|
||||
NS_SCRIPTABLE NS_IMETHOD SelectColumn(PRInt32 columnIndex); \
|
||||
NS_SCRIPTABLE NS_IMETHOD UnselectColumn(PRInt32 columnIndex); \
|
||||
NS_IMETHOD UnselectRow(PRInt32 aRowIdx); \
|
||||
NS_IMETHOD IsProbablyForLayout(bool* aResult) \
|
||||
{ return xpcAccessibleTable::IsProbablyForLayout(aResult); } \
|
||||
|
||||
#endif // MOZILLA_A11Y_XPCOM_XPACCESSIBLETABLE_H_
|
@ -72,9 +72,7 @@ include $(topsrcdir)/config/rules.mk
|
||||
LOCAL_INCLUDES = \
|
||||
-I$(srcdir) \
|
||||
-I$(srcdir)/../base \
|
||||
-I$(srcdir)/../generic \
|
||||
-I$(srcdir)/../html \
|
||||
-I$(srcdir)/../xpcom \
|
||||
-I$(srcdir)/../../../layout/generic \
|
||||
-I$(srcdir)/../../../layout/xul/base/src \
|
||||
$(NULL)
|
||||
|
@ -134,7 +134,7 @@ nsXULColumnItemAccessible::DoAction(PRUint8 aIndex)
|
||||
|
||||
nsXULListboxAccessible::
|
||||
nsXULListboxAccessible(nsIContent* aContent, nsDocAccessible* aDoc) :
|
||||
XULSelectControlAccessible(aContent, aDoc), xpcAccessibleTable(this)
|
||||
XULSelectControlAccessible(aContent, aDoc)
|
||||
{
|
||||
nsIContent* parentContent = mContent->GetParent();
|
||||
if (parentContent) {
|
||||
@ -164,16 +164,6 @@ nsXULListboxAccessible::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
return NS_ERROR_NO_INTERFACE;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
//nsAccessNode
|
||||
|
||||
void
|
||||
nsXULListboxAccessible::Shutdown()
|
||||
{
|
||||
mTable = nsnull;
|
||||
XULSelectControlAccessible::Shutdown();
|
||||
}
|
||||
|
||||
bool
|
||||
nsXULListboxAccessible::IsMulticolumn()
|
||||
{
|
||||
@ -239,6 +229,15 @@ nsXULListboxAccessible::NativeRole()
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// nsXULListboxAccessible. nsIAccessibleTable
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsXULListboxAccessible::GetCaption(nsIAccessible **aCaption)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aCaption);
|
||||
*aCaption = nsnull;
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsXULListboxAccessible::GetSummary(nsAString &aSummary)
|
||||
{
|
||||
@ -821,6 +820,15 @@ nsXULListboxAccessible::UnselectColumn(PRInt32 aColumn)
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsXULListboxAccessible::IsProbablyForLayout(bool *aIsProbablyForLayout)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aIsProbablyForLayout);
|
||||
*aIsProbablyForLayout = false;
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// nsXULListboxAccessible: Widgets
|
||||
|
||||
|
@ -40,12 +40,11 @@
|
||||
#ifndef __nsXULListboxAccessible_h__
|
||||
#define __nsXULListboxAccessible_h__
|
||||
|
||||
#include "nsIAccessibleTable.h"
|
||||
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsXULMenuAccessible.h"
|
||||
#include "nsBaseWidgetAccessible.h"
|
||||
#include "nsIAccessibleTable.h"
|
||||
#include "TableAccessible.h"
|
||||
#include "xpcAccessibleTable.h"
|
||||
#include "XULSelectControlAccessible.h"
|
||||
|
||||
class nsIWeakReference;
|
||||
@ -91,27 +90,19 @@ public:
|
||||
* A class the represents the XUL Listbox widget.
|
||||
*/
|
||||
class nsXULListboxAccessible : public XULSelectControlAccessible,
|
||||
public xpcAccessibleTable,
|
||||
public nsIAccessibleTable,
|
||||
public mozilla::a11y::TableAccessible
|
||||
public nsIAccessibleTable
|
||||
{
|
||||
public:
|
||||
nsXULListboxAccessible(nsIContent* aContent, nsDocAccessible* aDoc);
|
||||
virtual ~nsXULListboxAccessible() {}
|
||||
|
||||
NS_DECL_ISUPPORTS_INHERITED
|
||||
|
||||
// nsIAccessibleTable
|
||||
NS_DECL_OR_FORWARD_NSIACCESSIBLETABLE_WITH_XPCACCESSIBLETABLE
|
||||
NS_DECL_NSIACCESSIBLETABLE
|
||||
|
||||
// nsIAccessible
|
||||
NS_IMETHOD GetValue(nsAString& aValue);
|
||||
|
||||
// nsAccessNode
|
||||
virtual void Shutdown();
|
||||
|
||||
// nsAccessible
|
||||
virtual mozilla::a11y::TableAccessible* AsTable() { return this; }
|
||||
virtual mozilla::a11y::role NativeRole();
|
||||
virtual PRUint64 NativeState();
|
||||
|
||||
|
@ -58,7 +58,7 @@ using namespace mozilla::a11y;
|
||||
|
||||
nsXULTreeGridAccessible::
|
||||
nsXULTreeGridAccessible(nsIContent* aContent, nsDocAccessible* aDoc) :
|
||||
nsXULTreeAccessible(aContent, aDoc), xpcAccessibleTable(this)
|
||||
nsXULTreeAccessible(aContent, aDoc)
|
||||
{
|
||||
}
|
||||
|
||||
@ -72,6 +72,15 @@ NS_IMPL_ISUPPORTS_INHERITED1(nsXULTreeGridAccessible,
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// nsXULTreeGridAccessible: nsIAccessibleTable implementation
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsXULTreeGridAccessible::GetCaption(nsIAccessible **aCaption)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aCaption);
|
||||
*aCaption = nsnull;
|
||||
|
||||
return IsDefunct() ? NS_ERROR_FAILURE : NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsXULTreeGridAccessible::GetSummary(nsAString &aSummary)
|
||||
{
|
||||
@ -561,14 +570,13 @@ nsXULTreeGridAccessible::UnselectColumn(PRInt32 aColumnIndex)
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// nsXULTreeGridAccessible: nsAccessNode implementation
|
||||
|
||||
void
|
||||
nsXULTreeGridAccessible::Shutdown()
|
||||
NS_IMETHODIMP
|
||||
nsXULTreeGridAccessible::IsProbablyForLayout(bool *aIsProbablyForLayout)
|
||||
{
|
||||
mTable = nsnull;
|
||||
nsXULTreeAccessible::Shutdown();
|
||||
NS_ENSURE_ARG_POINTER(aIsProbablyForLayout);
|
||||
*aIsProbablyForLayout = false;
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -39,17 +39,15 @@
|
||||
#ifndef __nsXULTreeGridAccessible_h__
|
||||
#define __nsXULTreeGridAccessible_h__
|
||||
|
||||
#include "nsIAccessibleTable.h"
|
||||
|
||||
#include "nsXULTreeAccessible.h"
|
||||
#include "TableAccessible.h"
|
||||
#include "xpcAccessibleTable.h"
|
||||
|
||||
/**
|
||||
* Represents accessible for XUL tree in the case when it has multiple columns.
|
||||
*/
|
||||
class nsXULTreeGridAccessible : public nsXULTreeAccessible,
|
||||
public xpcAccessibleTable,
|
||||
public nsIAccessibleTable,
|
||||
public mozilla::a11y::TableAccessible
|
||||
public nsIAccessibleTable
|
||||
{
|
||||
public:
|
||||
nsXULTreeGridAccessible(nsIContent* aContent, nsDocAccessible* aDoc);
|
||||
@ -58,13 +56,9 @@ public:
|
||||
NS_DECL_ISUPPORTS_INHERITED
|
||||
|
||||
// nsIAccessibleTable
|
||||
NS_DECL_OR_FORWARD_NSIACCESSIBLETABLE_WITH_XPCACCESSIBLETABLE
|
||||
|
||||
// nsAccessNode
|
||||
virtual void Shutdown();
|
||||
NS_DECL_NSIACCESSIBLETABLE
|
||||
|
||||
// nsAccessible
|
||||
virtual mozilla::a11y::TableAccessible* AsTable() { return this; }
|
||||
virtual mozilla::a11y::role NativeRole();
|
||||
|
||||
protected:
|
||||
|
Loading…
Reference in New Issue
Block a user