зеркало из https://github.com/mozilla/gecko-dev.git
Merge m-c onto Ionmonkey.
--HG-- rename : accessible/src/atk/nsAccessibleWrap.cpp => accessible/src/atk/AccessibleWrap.cpp rename : accessible/src/atk/nsAccessibleWrap.h => accessible/src/atk/AccessibleWrap.h rename : accessible/src/atk/nsDocAccessibleWrap.h => accessible/src/atk/DocAccessibleWrap.h rename : accessible/src/base/nsAccessible.cpp => accessible/src/generic/Accessible.cpp rename : accessible/src/base/nsAccessible.h => accessible/src/generic/Accessible.h rename : accessible/src/base/nsDocAccessible.cpp => accessible/src/generic/DocAccessible.cpp rename : accessible/src/base/nsDocAccessible.h => accessible/src/generic/DocAccessible.h rename : accessible/src/mac/nsAccessibleWrap.h => accessible/src/mac/AccessibleWrap.h rename : accessible/src/mac/nsAccessibleWrap.mm => accessible/src/mac/AccessibleWrap.mm rename : accessible/src/mac/nsDocAccessibleWrap.h => accessible/src/mac/DocAccessibleWrap.h rename : accessible/src/mac/nsDocAccessibleWrap.mm => accessible/src/mac/DocAccessibleWrap.mm rename : accessible/src/msaa/nsAccessibleWrap.cpp => accessible/src/msaa/AccessibleWrap.cpp rename : accessible/src/msaa/nsDocAccessibleWrap.cpp => accessible/src/msaa/DocAccessibleWrap.cpp rename : accessible/src/msaa/nsTextAccessibleWrap.cpp => accessible/src/msaa/TextLeafAccessibleWrap.cpp rename : accessible/src/msaa/nsTextAccessibleWrap.h => accessible/src/msaa/TextLeafAccessibleWrap.h rename : netwerk/protocol/http/SpdySession.cpp => netwerk/protocol/http/SpdySession2.cpp rename : netwerk/protocol/http/SpdySession.h => netwerk/protocol/http/SpdySession2.h rename : netwerk/protocol/http/SpdySession.cpp => netwerk/protocol/http/SpdySession3.cpp rename : netwerk/protocol/http/SpdySession.h => netwerk/protocol/http/SpdySession3.h rename : netwerk/protocol/http/SpdyStream.cpp => netwerk/protocol/http/SpdyStream2.cpp rename : netwerk/protocol/http/SpdyStream.cpp => netwerk/protocol/http/SpdyStream3.cpp
This commit is contained in:
Коммит
169aba0505
|
@ -12,7 +12,7 @@
|
|||
|
||||
#include "nsAutoPtr.h"
|
||||
|
||||
class nsAccessible;
|
||||
class Accessible;
|
||||
class nsINode;
|
||||
class nsIContent;
|
||||
class nsIDocument;
|
||||
|
@ -37,8 +37,8 @@ public:
|
|||
* @param aPresShell [in] the presentation shell which contains layout info
|
||||
* for the DOM node
|
||||
*/
|
||||
virtual nsAccessible* GetAccessible(nsINode* aNode,
|
||||
nsIPresShell* aPresShell) = 0;
|
||||
virtual Accessible* GetAccessible(nsINode* aNode,
|
||||
nsIPresShell* aPresShell) = 0;
|
||||
|
||||
/**
|
||||
* Return root document accessible that is or contains a document accessible
|
||||
|
@ -48,15 +48,15 @@ public:
|
|||
* @param aCanCreate [in] points whether the root document accessible
|
||||
* should be returned from the cache or can be created
|
||||
*/
|
||||
virtual nsAccessible* GetRootDocumentAccessible(nsIPresShell* aPresShell,
|
||||
bool aCanCreate) = 0;
|
||||
virtual Accessible* GetRootDocumentAccessible(nsIPresShell* aPresShell,
|
||||
bool aCanCreate) = 0;
|
||||
|
||||
/**
|
||||
* Adds/remove ATK root accessible for gtk+ native window to/from children
|
||||
* of the application accessible.
|
||||
*/
|
||||
virtual nsAccessible* AddNativeRootAccessible(void* aAtkAccessible) = 0;
|
||||
virtual void RemoveNativeRootAccessible(nsAccessible* aRootAccessible) = 0;
|
||||
virtual Accessible* AddNativeRootAccessible(void* aAtkAccessible) = 0;
|
||||
virtual void RemoveNativeRootAccessible(Accessible* aRootAccessible) = 0;
|
||||
|
||||
/**
|
||||
* Notification used to update the accessible tree when new content is
|
||||
|
@ -91,7 +91,7 @@ public:
|
|||
* @param aEvent [in] accessible event type
|
||||
* @param aTarget [in] target of accessible event
|
||||
*/
|
||||
virtual void FireAccessibleEvent(PRUint32 aEvent, nsAccessible* aTarget) = 0;
|
||||
virtual void FireAccessibleEvent(PRUint32 aEvent, Accessible* aTarget) = 0;
|
||||
};
|
||||
|
||||
NS_DEFINE_STATIC_IID_ACCESSOR(nsIAccessibilityService,
|
||||
|
|
|
@ -23,7 +23,7 @@ interface nsIAccessibleRelation;
|
|||
* Mozilla creates the implementations of nsIAccessible on demand.
|
||||
* See http://www.mozilla.org/projects/ui/accessibility for more information.
|
||||
*/
|
||||
[scriptable, uuid(46d422d1-c92f-4536-bdef-f77bc8350ec7)]
|
||||
[scriptable, uuid(45ce2c92-4d92-49d2-bff1-855934443261)]
|
||||
interface nsIAccessible : nsISupports
|
||||
{
|
||||
/**
|
||||
|
@ -254,7 +254,7 @@ interface nsIAccessible : nsISupports
|
|||
/**
|
||||
* The number of accessible actions associated with this accessible
|
||||
*/
|
||||
readonly attribute PRUint8 numActions;
|
||||
readonly attribute PRUint8 actionCount;
|
||||
|
||||
/**
|
||||
* The name of the accessible action at the given zero-based index
|
||||
|
|
|
@ -19,7 +19,7 @@ interface nsIAccessiblePivotObserver;
|
|||
* provides traversal methods to move the pivot to next/prev state that complies
|
||||
* to a given rule.
|
||||
*/
|
||||
[scriptable, uuid(689058ae-e301-444f-acb0-b5c2b189f350)]
|
||||
[scriptable, uuid(15ff23de-879e-47ea-b536-6532466108c5)]
|
||||
interface nsIAccessiblePivot : nsISupports
|
||||
{
|
||||
const TextBoundaryType CHAR_BOUNDARY = 0;
|
||||
|
@ -61,20 +61,32 @@ interface nsIAccessiblePivot : nsISupports
|
|||
in long aStartOffset, in long aEndOffset);
|
||||
|
||||
/**
|
||||
* Move pivot to next object complying to given traversal rule.
|
||||
* Move pivot to next object, from current position or given anchor,
|
||||
* complying to given traversal rule.
|
||||
*
|
||||
* @param aRule [in] traversal rule to use.
|
||||
* @param aRule [in] traversal rule to use.
|
||||
* @param aAnchor [in] accessible to start search from, if not provided,
|
||||
* current position will be used.
|
||||
* @param aIncludeStart [in] include anchor accessible in search.
|
||||
* @return true on success, false if there are no new nodes to traverse to.
|
||||
*/
|
||||
boolean moveNext(in nsIAccessibleTraversalRule aRule);
|
||||
[optional_argc] boolean moveNext(in nsIAccessibleTraversalRule aRule,
|
||||
[optional] in nsIAccessible aAnchor,
|
||||
[optional] in boolean aIncludeStart);
|
||||
|
||||
/**
|
||||
* Move pivot to previous object complying to given traversal rule.
|
||||
* Move pivot to previous object, from current position or given anchor,
|
||||
* complying to given traversal rule.
|
||||
*
|
||||
* @param aRule [in] traversal rule to use.
|
||||
* @param aRule [in] traversal rule to use.
|
||||
* @param aAnchor [in] accessible to start search from, if not provided,
|
||||
* current position will be used.
|
||||
* @param aIncludeStart [in] include anchor accessible in search.
|
||||
* @return true on success, false if there are no new nodes to traverse to.
|
||||
*/
|
||||
boolean movePrevious(in nsIAccessibleTraversalRule aRule);
|
||||
[optional_argc] boolean movePrevious(in nsIAccessibleTraversalRule aRule,
|
||||
[optional] in nsIAccessible aAnchor,
|
||||
[optional] in boolean aIncludeStart);
|
||||
|
||||
/**
|
||||
* Move pivot to first object in subtree complying to given traversal rule.
|
||||
|
|
|
@ -18,7 +18,7 @@ interface nsIAccessiblePivot;
|
|||
* nsIAccessible for a given DOM node. More documentation at:
|
||||
* http://www.mozilla.org/projects/ui/accessibility
|
||||
*/
|
||||
[scriptable, uuid(310ce77d-c92b-4761-82e8-77e1a728e8d4)]
|
||||
[scriptable, uuid(aed712cb-708b-4caa-981d-767be0fba984)]
|
||||
interface nsIAccessibleRetrieval : nsISupports
|
||||
{
|
||||
/**
|
||||
|
@ -84,6 +84,16 @@ interface nsIAccessibleRetrieval : nsISupports
|
|||
* @return a new pivot
|
||||
*/
|
||||
nsIAccessiblePivot createAccessiblePivot(in nsIAccessible aRoot);
|
||||
|
||||
/**
|
||||
* Enable logging for the given modules, all other modules aren't logged.
|
||||
*
|
||||
* @param aModules [in] list of modules, format is comma separated list
|
||||
* like 'docload,doccreate'.
|
||||
* @note Works on debug build only.
|
||||
* @see Logging.cpp for list of possible values.
|
||||
*/
|
||||
void setLogging(in ACString aModules);
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
#include "nsISupports.idl"
|
||||
|
||||
typedef long nsAccessibleTextBoundary;
|
||||
typedef long AccessibleTextBoundary;
|
||||
|
||||
interface nsIAccessible;
|
||||
interface nsIPersistentProperties;
|
||||
|
@ -20,14 +20,14 @@ interface nsIAccessibleText : nsISupports
|
|||
const PRInt32 TEXT_OFFSET_END_OF_TEXT = -1;
|
||||
const PRInt32 TEXT_OFFSET_CARET = -2;
|
||||
|
||||
const nsAccessibleTextBoundary BOUNDARY_CHAR = 0;
|
||||
const nsAccessibleTextBoundary BOUNDARY_WORD_START = 1;
|
||||
const nsAccessibleTextBoundary BOUNDARY_WORD_END = 2;
|
||||
const nsAccessibleTextBoundary BOUNDARY_SENTENCE_START = 3; // don't use, deprecated
|
||||
const nsAccessibleTextBoundary BOUNDARY_SENTENCE_END = 4; // don't use, deprecated
|
||||
const nsAccessibleTextBoundary BOUNDARY_LINE_START = 5;
|
||||
const nsAccessibleTextBoundary BOUNDARY_LINE_END = 6;
|
||||
const nsAccessibleTextBoundary BOUNDARY_ATTRIBUTE_RANGE = 7;
|
||||
const AccessibleTextBoundary BOUNDARY_CHAR = 0;
|
||||
const AccessibleTextBoundary BOUNDARY_WORD_START = 1;
|
||||
const AccessibleTextBoundary BOUNDARY_WORD_END = 2;
|
||||
const AccessibleTextBoundary BOUNDARY_SENTENCE_START = 3; // don't use, deprecated
|
||||
const AccessibleTextBoundary BOUNDARY_SENTENCE_END = 4; // don't use, deprecated
|
||||
const AccessibleTextBoundary BOUNDARY_LINE_START = 5;
|
||||
const AccessibleTextBoundary BOUNDARY_LINE_END = 6;
|
||||
const AccessibleTextBoundary BOUNDARY_ATTRIBUTE_RANGE = 7;
|
||||
|
||||
/**
|
||||
* The current current caret offset.
|
||||
|
@ -47,17 +47,17 @@ interface nsIAccessibleText : nsISupports
|
|||
AString getText (in long startOffset, in long endOffset);
|
||||
|
||||
AString getTextAfterOffset (in long offset,
|
||||
in nsAccessibleTextBoundary boundaryType,
|
||||
in AccessibleTextBoundary boundaryType,
|
||||
out long startOffset,
|
||||
out long endOffset);
|
||||
|
||||
AString getTextAtOffset (in long offset,
|
||||
in nsAccessibleTextBoundary boundaryType,
|
||||
in AccessibleTextBoundary boundaryType,
|
||||
out long startOffset,
|
||||
out long endOffset);
|
||||
|
||||
AString getTextBeforeOffset (in long offset,
|
||||
in nsAccessibleTextBoundary boundaryType,
|
||||
in AccessibleTextBoundary boundaryType,
|
||||
out long startOffset,
|
||||
out long endOffset);
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
* 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 "nsAccessibleWrap.h"
|
||||
#include "AccessibleWrap.h"
|
||||
|
||||
#include "Accessible-inl.h"
|
||||
#include "ApplicationAccessibleWrap.h"
|
||||
|
@ -30,7 +30,7 @@
|
|||
using namespace mozilla;
|
||||
using namespace mozilla::a11y;
|
||||
|
||||
nsAccessibleWrap::EAvailableAtkSignals nsAccessibleWrap::gAvailableAtkSignals =
|
||||
AccessibleWrap::EAvailableAtkSignals AccessibleWrap::gAvailableAtkSignals =
|
||||
eUnknown;
|
||||
|
||||
//defined in ApplicationAccessibleWrap.cpp
|
||||
|
@ -125,12 +125,12 @@ static const GInterfaceInfo atk_if_infos[] = {
|
|||
*/
|
||||
struct MaiAtkObject
|
||||
{
|
||||
AtkObject parent;
|
||||
/*
|
||||
* The nsAccessibleWrap whose properties and features are exported
|
||||
* via this object instance.
|
||||
*/
|
||||
nsAccessibleWrap *accWrap;
|
||||
AtkObject parent;
|
||||
/*
|
||||
* The AccessibleWrap whose properties and features are exported
|
||||
* via this object instance.
|
||||
*/
|
||||
AccessibleWrap* accWrap;
|
||||
};
|
||||
|
||||
struct MaiAtkObjectClass
|
||||
|
@ -232,35 +232,36 @@ mai_atk_object_get_type(void)
|
|||
}
|
||||
|
||||
#ifdef MAI_LOGGING
|
||||
PRInt32 nsAccessibleWrap::mAccWrapCreated = 0;
|
||||
PRInt32 nsAccessibleWrap::mAccWrapDeleted = 0;
|
||||
PRInt32 AccessibleWrap::mAccWrapCreated = 0;
|
||||
PRInt32 AccessibleWrap::mAccWrapDeleted = 0;
|
||||
#endif
|
||||
|
||||
nsAccessibleWrap::
|
||||
nsAccessibleWrap(nsIContent* aContent, nsDocAccessible* aDoc) :
|
||||
nsAccessible(aContent, aDoc), mAtkObject(nsnull)
|
||||
AccessibleWrap::
|
||||
AccessibleWrap(nsIContent* aContent, DocAccessible* aDoc) :
|
||||
Accessible(aContent, aDoc), mAtkObject(nsnull)
|
||||
{
|
||||
#ifdef MAI_LOGGING
|
||||
++mAccWrapCreated;
|
||||
++mAccWrapCreated;
|
||||
#endif
|
||||
MAI_LOG_DEBUG(("==nsAccessibleWrap creating: this=%p,total=%d left=%d\n",
|
||||
(void*)this, mAccWrapCreated,
|
||||
(mAccWrapCreated-mAccWrapDeleted)));
|
||||
MAI_LOG_DEBUG(("==AccessibleWrap creating: this=%p,total=%d left=%d\n",
|
||||
(void*)this, mAccWrapCreated,
|
||||
(mAccWrapCreated-mAccWrapDeleted)));
|
||||
}
|
||||
|
||||
nsAccessibleWrap::~nsAccessibleWrap()
|
||||
AccessibleWrap::~AccessibleWrap()
|
||||
{
|
||||
NS_ASSERTION(!mAtkObject, "ShutdownAtkObject() is not called");
|
||||
|
||||
#ifdef MAI_LOGGING
|
||||
++mAccWrapDeleted;
|
||||
#endif
|
||||
MAI_LOG_DEBUG(("==nsAccessibleWrap deleting: this=%p,total=%d left=%d\n",
|
||||
MAI_LOG_DEBUG(("==AccessibleWrap deleting: this=%p,total=%d left=%d\n",
|
||||
(void*)this, mAccWrapDeleted,
|
||||
(mAccWrapCreated-mAccWrapDeleted)));
|
||||
}
|
||||
|
||||
void nsAccessibleWrap::ShutdownAtkObject()
|
||||
void
|
||||
AccessibleWrap::ShutdownAtkObject()
|
||||
{
|
||||
if (mAtkObject) {
|
||||
if (IS_MAI_OBJECT(mAtkObject)) {
|
||||
|
@ -273,13 +274,14 @@ void nsAccessibleWrap::ShutdownAtkObject()
|
|||
}
|
||||
|
||||
void
|
||||
nsAccessibleWrap::Shutdown()
|
||||
AccessibleWrap::Shutdown()
|
||||
{
|
||||
ShutdownAtkObject();
|
||||
nsAccessible::Shutdown();
|
||||
ShutdownAtkObject();
|
||||
Accessible::Shutdown();
|
||||
}
|
||||
|
||||
MaiHyperlink* nsAccessibleWrap::GetMaiHyperlink(bool aCreate /* = true */)
|
||||
MaiHyperlink*
|
||||
AccessibleWrap::GetMaiHyperlink(bool aCreate /* = true */)
|
||||
{
|
||||
// make sure mAtkObject is created
|
||||
GetAtkObject();
|
||||
|
@ -298,7 +300,8 @@ MaiHyperlink* nsAccessibleWrap::GetMaiHyperlink(bool aCreate /* = true */)
|
|||
return maiHyperlink;
|
||||
}
|
||||
|
||||
void nsAccessibleWrap::SetMaiHyperlink(MaiHyperlink* aMaiHyperlink)
|
||||
void
|
||||
AccessibleWrap::SetMaiHyperlink(MaiHyperlink* aMaiHyperlink)
|
||||
{
|
||||
NS_ASSERTION(quark_mai_hyperlink, "quark_mai_hyperlink not initialized");
|
||||
NS_ASSERTION(IS_MAI_OBJECT(mAtkObject), "Invalid AtkObject");
|
||||
|
@ -313,7 +316,8 @@ void nsAccessibleWrap::SetMaiHyperlink(MaiHyperlink* aMaiHyperlink)
|
|||
}
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsAccessibleWrap::GetNativeInterface(void **aOutAccessible)
|
||||
NS_IMETHODIMP
|
||||
AccessibleWrap::GetNativeInterface(void** aOutAccessible)
|
||||
{
|
||||
*aOutAccessible = nsnull;
|
||||
|
||||
|
@ -341,7 +345,7 @@ NS_IMETHODIMP nsAccessibleWrap::GetNativeInterface(void **aOutAccessible)
|
|||
}
|
||||
|
||||
AtkObject *
|
||||
nsAccessibleWrap::GetAtkObject(void)
|
||||
AccessibleWrap::GetAtkObject(void)
|
||||
{
|
||||
void *atkObj = nsnull;
|
||||
GetNativeInterface(&atkObj);
|
||||
|
@ -351,7 +355,7 @@ nsAccessibleWrap::GetAtkObject(void)
|
|||
// Get AtkObject from nsIAccessible interface
|
||||
/* static */
|
||||
AtkObject *
|
||||
nsAccessibleWrap::GetAtkObject(nsIAccessible * acc)
|
||||
AccessibleWrap::GetAtkObject(nsIAccessible* acc)
|
||||
{
|
||||
void *atkObjPtr = nsnull;
|
||||
acc->GetNativeInterface(&atkObjPtr);
|
||||
|
@ -360,7 +364,7 @@ nsAccessibleWrap::GetAtkObject(nsIAccessible * acc)
|
|||
|
||||
/* private */
|
||||
PRUint16
|
||||
nsAccessibleWrap::CreateMaiInterfaces(void)
|
||||
AccessibleWrap::CreateMaiInterfaces(void)
|
||||
{
|
||||
PRUint16 interfacesBits = 0;
|
||||
|
||||
|
@ -469,7 +473,7 @@ GetMaiAtkType(PRUint16 interfacesBits)
|
|||
return type;
|
||||
}
|
||||
|
||||
static const char *
|
||||
static const char*
|
||||
GetUniqueMaiAtkTypeName(PRUint16 interfacesBits)
|
||||
{
|
||||
#define MAI_ATK_TYPE_NAME_LEN (30) /* 10+sizeof(PRUint16)*8/4+1 < 30 */
|
||||
|
@ -486,7 +490,8 @@ GetUniqueMaiAtkTypeName(PRUint16 interfacesBits)
|
|||
return name;
|
||||
}
|
||||
|
||||
bool nsAccessibleWrap::IsValidObject()
|
||||
bool
|
||||
AccessibleWrap::IsValidObject()
|
||||
{
|
||||
// to ensure we are not shut down
|
||||
return !IsDefunct();
|
||||
|
@ -598,9 +603,9 @@ initializeCB(AtkObject *aAtkObj, gpointer aData)
|
|||
if (ATK_OBJECT_CLASS(parent_class)->initialize)
|
||||
ATK_OBJECT_CLASS(parent_class)->initialize(aAtkObj, aData);
|
||||
|
||||
/* initialize object */
|
||||
MAI_ATK_OBJECT(aAtkObj)->accWrap =
|
||||
static_cast<nsAccessibleWrap*>(aData);
|
||||
/* initialize object */
|
||||
MAI_ATK_OBJECT(aAtkObj)->accWrap =
|
||||
static_cast<AccessibleWrap*>(aData);
|
||||
|
||||
#ifdef MAI_LOGGING
|
||||
++sMaiAtkObjCreated;
|
||||
|
@ -633,7 +638,7 @@ finalizeCB(GObject *aObj)
|
|||
const gchar*
|
||||
getNameCB(AtkObject* aAtkObj)
|
||||
{
|
||||
nsAccessibleWrap* accWrap = GetAccessibleWrap(aAtkObj);
|
||||
AccessibleWrap* accWrap = GetAccessibleWrap(aAtkObj);
|
||||
if (!accWrap)
|
||||
return nsnull;
|
||||
|
||||
|
@ -650,7 +655,7 @@ getNameCB(AtkObject* aAtkObj)
|
|||
const gchar *
|
||||
getDescriptionCB(AtkObject *aAtkObj)
|
||||
{
|
||||
nsAccessibleWrap *accWrap = GetAccessibleWrap(aAtkObj);
|
||||
AccessibleWrap* accWrap = GetAccessibleWrap(aAtkObj);
|
||||
if (!accWrap || accWrap->IsDefunct())
|
||||
return nsnull;
|
||||
|
||||
|
@ -669,7 +674,7 @@ getDescriptionCB(AtkObject *aAtkObj)
|
|||
AtkRole
|
||||
getRoleCB(AtkObject *aAtkObj)
|
||||
{
|
||||
nsAccessibleWrap* accWrap = GetAccessibleWrap(aAtkObj);
|
||||
AccessibleWrap* accWrap = GetAccessibleWrap(aAtkObj);
|
||||
if (!accWrap)
|
||||
return ATK_ROLE_INVALID;
|
||||
|
||||
|
@ -737,7 +742,7 @@ ConvertToAtkAttributeSet(nsIPersistentProperties* aAttributes)
|
|||
}
|
||||
|
||||
AtkAttributeSet*
|
||||
GetAttributeSet(nsAccessible* aAccessible)
|
||||
GetAttributeSet(Accessible* aAccessible)
|
||||
{
|
||||
nsCOMPtr<nsIPersistentProperties> attributes;
|
||||
aAccessible->GetAttributes(getter_AddRefs(attributes));
|
||||
|
@ -760,24 +765,23 @@ GetAttributeSet(nsAccessible* aAccessible)
|
|||
AtkAttributeSet *
|
||||
getAttributesCB(AtkObject *aAtkObj)
|
||||
{
|
||||
nsAccessibleWrap *accWrap = GetAccessibleWrap(aAtkObj);
|
||||
|
||||
return accWrap ? GetAttributeSet(accWrap) : nsnull;
|
||||
AccessibleWrap* accWrap = GetAccessibleWrap(aAtkObj);
|
||||
return accWrap ? GetAttributeSet(accWrap) : nsnull;
|
||||
}
|
||||
|
||||
AtkObject *
|
||||
getParentCB(AtkObject *aAtkObj)
|
||||
{
|
||||
if (!aAtkObj->accessible_parent) {
|
||||
nsAccessibleWrap* accWrap = GetAccessibleWrap(aAtkObj);
|
||||
AccessibleWrap* accWrap = GetAccessibleWrap(aAtkObj);
|
||||
if (!accWrap)
|
||||
return nsnull;
|
||||
|
||||
nsAccessible* accParent = accWrap->Parent();
|
||||
Accessible* accParent = accWrap->Parent();
|
||||
if (!accParent)
|
||||
return nsnull;
|
||||
|
||||
AtkObject* parent = nsAccessibleWrap::GetAtkObject(accParent);
|
||||
AtkObject* parent = AccessibleWrap::GetAtkObject(accParent);
|
||||
if (parent)
|
||||
atk_object_set_parent(aAtkObj, parent);
|
||||
}
|
||||
|
@ -787,12 +791,12 @@ getParentCB(AtkObject *aAtkObj)
|
|||
gint
|
||||
getChildCountCB(AtkObject *aAtkObj)
|
||||
{
|
||||
nsAccessibleWrap *accWrap = GetAccessibleWrap(aAtkObj);
|
||||
AccessibleWrap* accWrap = GetAccessibleWrap(aAtkObj);
|
||||
if (!accWrap || nsAccUtils::MustPrune(accWrap)) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
return accWrap->GetEmbeddedChildCount();
|
||||
return static_cast<gint>(accWrap->EmbeddedChildCount());
|
||||
}
|
||||
|
||||
AtkObject *
|
||||
|
@ -803,16 +807,16 @@ refChildCB(AtkObject *aAtkObj, gint aChildIndex)
|
|||
return nsnull;
|
||||
}
|
||||
|
||||
nsAccessibleWrap *accWrap = GetAccessibleWrap(aAtkObj);
|
||||
AccessibleWrap* accWrap = GetAccessibleWrap(aAtkObj);
|
||||
if (!accWrap || nsAccUtils::MustPrune(accWrap)) {
|
||||
return nsnull;
|
||||
}
|
||||
|
||||
nsAccessible* accChild = accWrap->GetEmbeddedChildAt(aChildIndex);
|
||||
Accessible* accChild = accWrap->GetEmbeddedChildAt(aChildIndex);
|
||||
if (!accChild)
|
||||
return nsnull;
|
||||
|
||||
AtkObject* childAtkObj = nsAccessibleWrap::GetAtkObject(accChild);
|
||||
AtkObject* childAtkObj = AccessibleWrap::GetAtkObject(accChild);
|
||||
|
||||
NS_ASSERTION(childAtkObj, "Fail to get AtkObj");
|
||||
if (!childAtkObj)
|
||||
|
@ -830,12 +834,12 @@ getIndexInParentCB(AtkObject *aAtkObj)
|
|||
{
|
||||
// We don't use nsIAccessible::GetIndexInParent() because
|
||||
// for ATK we don't want to include text leaf nodes as children
|
||||
nsAccessibleWrap *accWrap = GetAccessibleWrap(aAtkObj);
|
||||
AccessibleWrap* accWrap = GetAccessibleWrap(aAtkObj);
|
||||
if (!accWrap) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
nsAccessible* parent = accWrap->Parent();
|
||||
Accessible* parent = accWrap->Parent();
|
||||
if (!parent)
|
||||
return -1; // No parent
|
||||
|
||||
|
@ -870,7 +874,7 @@ refStateSetCB(AtkObject *aAtkObj)
|
|||
AtkStateSet *state_set = nsnull;
|
||||
state_set = ATK_OBJECT_CLASS(parent_class)->ref_state_set(aAtkObj);
|
||||
|
||||
nsAccessibleWrap *accWrap = GetAccessibleWrap(aAtkObj);
|
||||
AccessibleWrap* accWrap = GetAccessibleWrap(aAtkObj);
|
||||
if (!accWrap) {
|
||||
TranslateStates(states::DEFUNCT, state_set);
|
||||
return state_set;
|
||||
|
@ -888,7 +892,7 @@ refRelationSetCB(AtkObject *aAtkObj)
|
|||
AtkRelationSet* relation_set =
|
||||
ATK_OBJECT_CLASS(parent_class)->ref_relation_set(aAtkObj);
|
||||
|
||||
nsAccessibleWrap *accWrap = GetAccessibleWrap(aAtkObj);
|
||||
AccessibleWrap* accWrap = GetAccessibleWrap(aAtkObj);
|
||||
if (!accWrap)
|
||||
return relation_set;
|
||||
|
||||
|
@ -914,9 +918,9 @@ refRelationSetCB(AtkObject *aAtkObj)
|
|||
|
||||
Relation rel(accWrap->RelationByType(relationTypes[i]));
|
||||
nsTArray<AtkObject*> targets;
|
||||
nsAccessible* tempAcc = nsnull;
|
||||
Accessible* tempAcc = nsnull;
|
||||
while ((tempAcc = rel.Next()))
|
||||
targets.AppendElement(nsAccessibleWrap::GetAtkObject(tempAcc));
|
||||
targets.AppendElement(AccessibleWrap::GetAtkObject(tempAcc));
|
||||
|
||||
if (targets.Length()) {
|
||||
atkRelation = atk_relation_new(targets.Elements(), targets.Length(), atkType);
|
||||
|
@ -928,12 +932,13 @@ refRelationSetCB(AtkObject *aAtkObj)
|
|||
return relation_set;
|
||||
}
|
||||
|
||||
// Check if aAtkObj is a valid MaiAtkObject, and return the nsAccessibleWrap
|
||||
// Check if aAtkObj is a valid MaiAtkObject, and return the AccessibleWrap
|
||||
// for it.
|
||||
nsAccessibleWrap *GetAccessibleWrap(AtkObject *aAtkObj)
|
||||
AccessibleWrap*
|
||||
GetAccessibleWrap(AtkObject* aAtkObj)
|
||||
{
|
||||
NS_ENSURE_TRUE(IS_MAI_OBJECT(aAtkObj), nsnull);
|
||||
nsAccessibleWrap* accWrap = MAI_ATK_OBJECT(aAtkObj)->accWrap;
|
||||
AccessibleWrap* accWrap = MAI_ATK_OBJECT(aAtkObj)->accWrap;
|
||||
|
||||
// Check if the accessible was deconstructed.
|
||||
if (!accWrap)
|
||||
|
@ -941,7 +946,7 @@ nsAccessibleWrap *GetAccessibleWrap(AtkObject *aAtkObj)
|
|||
|
||||
NS_ENSURE_TRUE(accWrap->GetAtkObject() == aAtkObj, nsnull);
|
||||
|
||||
nsAccessibleWrap* appAccWrap = nsAccessNode::GetApplicationAccessible();
|
||||
AccessibleWrap* appAccWrap = nsAccessNode::GetApplicationAccessible();
|
||||
if (appAccWrap != accWrap && !accWrap->IsValidObject())
|
||||
return nsnull;
|
||||
|
||||
|
@ -949,23 +954,23 @@ nsAccessibleWrap *GetAccessibleWrap(AtkObject *aAtkObj)
|
|||
}
|
||||
|
||||
nsresult
|
||||
nsAccessibleWrap::HandleAccEvent(AccEvent* aEvent)
|
||||
AccessibleWrap::HandleAccEvent(AccEvent* aEvent)
|
||||
{
|
||||
nsresult rv = nsAccessible::HandleAccEvent(aEvent);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
nsresult rv = Accessible::HandleAccEvent(aEvent);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
return FirePlatformEvent(aEvent);
|
||||
return FirePlatformEvent(aEvent);
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsAccessibleWrap::FirePlatformEvent(AccEvent* aEvent)
|
||||
AccessibleWrap::FirePlatformEvent(AccEvent* aEvent)
|
||||
{
|
||||
nsAccessible *accessible = aEvent->GetAccessible();
|
||||
Accessible* accessible = aEvent->GetAccessible();
|
||||
NS_ENSURE_TRUE(accessible, NS_ERROR_FAILURE);
|
||||
|
||||
PRUint32 type = aEvent->GetEventType();
|
||||
|
||||
AtkObject *atkObj = nsAccessibleWrap::GetAtkObject(accessible);
|
||||
AtkObject* atkObj = AccessibleWrap::GetAtkObject(accessible);
|
||||
|
||||
// We don't create ATK objects for nsIAccessible plain text leaves,
|
||||
// just return NS_OK in such case
|
||||
|
@ -976,7 +981,7 @@ nsAccessibleWrap::FirePlatformEvent(AccEvent* aEvent)
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
nsAccessibleWrap *accWrap = GetAccessibleWrap(atkObj);
|
||||
AccessibleWrap* accWrap = GetAccessibleWrap(atkObj);
|
||||
if (!accWrap) {
|
||||
return NS_OK; // Node is shut down
|
||||
}
|
||||
|
@ -1030,7 +1035,7 @@ nsAccessibleWrap::FirePlatformEvent(AccEvent* aEvent)
|
|||
// XXX: dupe events may be fired
|
||||
MAI_LOG_DEBUG(("\n\nReceived: EVENT_SELECTION_CHANGED\n"));
|
||||
AccSelChangeEvent* selChangeEvent = downcast_accEvent(aEvent);
|
||||
g_signal_emit_by_name(nsAccessibleWrap::GetAtkObject(selChangeEvent->Widget()),
|
||||
g_signal_emit_by_name(AccessibleWrap::GetAtkObject(selChangeEvent->Widget()),
|
||||
"selection_changed");
|
||||
break;
|
||||
}
|
||||
|
@ -1258,8 +1263,8 @@ nsAccessibleWrap::FirePlatformEvent(AccEvent* aEvent)
|
|||
}
|
||||
|
||||
nsresult
|
||||
nsAccessibleWrap::FireAtkStateChangeEvent(AccEvent* aEvent,
|
||||
AtkObject *aObject)
|
||||
AccessibleWrap::FireAtkStateChangeEvent(AccEvent* aEvent,
|
||||
AtkObject* aObject)
|
||||
{
|
||||
MAI_LOG_DEBUG(("\n\nReceived: EVENT_STATE_CHANGE\n"));
|
||||
|
||||
|
@ -1290,8 +1295,8 @@ nsAccessibleWrap::FireAtkStateChangeEvent(AccEvent* aEvent,
|
|||
}
|
||||
|
||||
nsresult
|
||||
nsAccessibleWrap::FireAtkTextChangedEvent(AccEvent* aEvent,
|
||||
AtkObject *aObject)
|
||||
AccessibleWrap::FireAtkTextChangedEvent(AccEvent* aEvent,
|
||||
AtkObject* aObject)
|
||||
{
|
||||
MAI_LOG_DEBUG(("\n\nReceived: EVENT_TEXT_REMOVED/INSERTED\n"));
|
||||
|
||||
|
@ -1331,8 +1336,8 @@ nsAccessibleWrap::FireAtkTextChangedEvent(AccEvent* aEvent,
|
|||
}
|
||||
|
||||
nsresult
|
||||
nsAccessibleWrap::FireAtkShowHideEvent(AccEvent* aEvent,
|
||||
AtkObject *aObject, bool aIsAdded)
|
||||
AccessibleWrap::FireAtkShowHideEvent(AccEvent* aEvent,
|
||||
AtkObject* aObject, bool aIsAdded)
|
||||
{
|
||||
if (aIsAdded) {
|
||||
MAI_LOG_DEBUG(("\n\nReceived: Show event\n"));
|
|
@ -0,0 +1,113 @@
|
|||
/* -*- 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 __NS_ACCESSIBLE_WRAP_H__
|
||||
#define __NS_ACCESSIBLE_WRAP_H__
|
||||
|
||||
#include "nsCOMPtr.h"
|
||||
#include "Accessible.h"
|
||||
#include "prlog.h"
|
||||
|
||||
#ifdef PR_LOGGING
|
||||
#define MAI_LOGGING
|
||||
#endif /* #ifdef PR_LOGGING */
|
||||
|
||||
struct _AtkObject;
|
||||
typedef struct _AtkObject AtkObject;
|
||||
|
||||
enum AtkProperty {
|
||||
PROP_0, // gobject convention
|
||||
PROP_NAME,
|
||||
PROP_DESCRIPTION,
|
||||
PROP_PARENT, // ancestry has changed
|
||||
PROP_ROLE,
|
||||
PROP_LAYER,
|
||||
PROP_MDI_ZORDER,
|
||||
PROP_TABLE_CAPTION,
|
||||
PROP_TABLE_COLUMN_DESCRIPTION,
|
||||
PROP_TABLE_COLUMN_HEADER,
|
||||
PROP_TABLE_ROW_DESCRIPTION,
|
||||
PROP_TABLE_ROW_HEADER,
|
||||
PROP_TABLE_SUMMARY,
|
||||
PROP_LAST // gobject convention
|
||||
};
|
||||
|
||||
struct AtkPropertyChange {
|
||||
PRInt32 type; // property type as listed above
|
||||
void *oldvalue;
|
||||
void *newvalue;
|
||||
};
|
||||
|
||||
class MaiHyperlink;
|
||||
|
||||
/**
|
||||
* AccessibleWrap, and its descendents in atk directory provide the
|
||||
* implementation of AtkObject.
|
||||
*/
|
||||
class AccessibleWrap : public Accessible
|
||||
{
|
||||
public:
|
||||
AccessibleWrap(nsIContent* aContent, DocAccessible* aDoc);
|
||||
virtual ~AccessibleWrap();
|
||||
void ShutdownAtkObject();
|
||||
|
||||
// nsAccessNode
|
||||
virtual void Shutdown();
|
||||
|
||||
#ifdef MAI_LOGGING
|
||||
virtual void DumpAccessibleWrapInfo(int aDepth) {}
|
||||
static PRInt32 mAccWrapCreated;
|
||||
static PRInt32 mAccWrapDeleted;
|
||||
#endif
|
||||
|
||||
// return the atk object for this AccessibleWrap
|
||||
NS_IMETHOD GetNativeInterface(void **aOutAccessible);
|
||||
virtual nsresult HandleAccEvent(AccEvent* aEvent);
|
||||
|
||||
AtkObject * GetAtkObject(void);
|
||||
static AtkObject * GetAtkObject(nsIAccessible * acc);
|
||||
|
||||
bool IsValidObject();
|
||||
|
||||
// get/set the MaiHyperlink object for this AccessibleWrap
|
||||
MaiHyperlink* GetMaiHyperlink(bool aCreate = true);
|
||||
void SetMaiHyperlink(MaiHyperlink* aMaiHyperlink);
|
||||
|
||||
static const char * ReturnString(nsAString &aString) {
|
||||
static nsCString returnedString;
|
||||
returnedString = NS_ConvertUTF16toUTF8(aString);
|
||||
return returnedString.get();
|
||||
}
|
||||
|
||||
protected:
|
||||
virtual nsresult FirePlatformEvent(AccEvent* aEvent);
|
||||
|
||||
nsresult FireAtkStateChangeEvent(AccEvent* aEvent, AtkObject *aObject);
|
||||
nsresult FireAtkTextChangedEvent(AccEvent* aEvent, AtkObject *aObject);
|
||||
nsresult FireAtkShowHideEvent(AccEvent* aEvent, AtkObject *aObject,
|
||||
bool aIsAdded);
|
||||
|
||||
AtkObject *mAtkObject;
|
||||
|
||||
private:
|
||||
|
||||
/*
|
||||
* do we have text-remove and text-insert signals if not we need to use
|
||||
* text-changed see AccessibleWrap::FireAtkTextChangedEvent() and
|
||||
* bug 619002
|
||||
*/
|
||||
enum EAvailableAtkSignals {
|
||||
eUnknown,
|
||||
eHaveNewAtkTextSignals,
|
||||
eNoNewAtkSignals
|
||||
};
|
||||
|
||||
static EAvailableAtkSignals gAvailableAtkSignals;
|
||||
|
||||
PRUint16 CreateMaiInterfaces(void);
|
||||
};
|
||||
|
||||
#endif /* __NS_ACCESSIBLE_WRAP_H__ */
|
|
@ -520,8 +520,8 @@ ApplicationAccessibleWrap::ApplicationAccessibleWrap():
|
|||
|
||||
ApplicationAccessibleWrap::~ApplicationAccessibleWrap()
|
||||
{
|
||||
MAI_LOG_DEBUG(("======Destory AppRootAcc=%p\n", (void*)this));
|
||||
nsAccessibleWrap::ShutdownAtkObject();
|
||||
MAI_LOG_DEBUG(("======Destory AppRootAcc=%p\n", (void*)this));
|
||||
AccessibleWrap::ShutdownAtkObject();
|
||||
}
|
||||
|
||||
static gboolean
|
||||
|
@ -551,15 +551,15 @@ toplevel_event_watcher(GSignalInvocationHint* ihint,
|
|||
if (data == reinterpret_cast<gpointer>(nsIAccessibleEvent::EVENT_SHOW)) {
|
||||
|
||||
// Attach the dialog accessible to app accessible tree
|
||||
nsAccessible* windowAcc = GetAccService()->AddNativeRootAccessible(child);
|
||||
Accessible* windowAcc = GetAccService()->AddNativeRootAccessible(child);
|
||||
g_object_set_qdata(G_OBJECT(child), sQuark_gecko_acc_obj,
|
||||
reinterpret_cast<gpointer>(windowAcc));
|
||||
|
||||
} else {
|
||||
|
||||
// Deattach the dialog accessible
|
||||
nsAccessible* windowAcc =
|
||||
reinterpret_cast<nsAccessible*>
|
||||
Accessible* windowAcc =
|
||||
reinterpret_cast<Accessible*>
|
||||
(g_object_get_qdata(G_OBJECT(child), sQuark_gecko_acc_obj));
|
||||
if (windowAcc) {
|
||||
GetAccService()->RemoveNativeRootAccessible(windowAcc);
|
||||
|
@ -706,13 +706,13 @@ gboolean fireRootAccessibleAddedCB(gpointer data)
|
|||
}
|
||||
|
||||
bool
|
||||
ApplicationAccessibleWrap::AppendChild(nsAccessible* aChild)
|
||||
ApplicationAccessibleWrap::AppendChild(Accessible* aChild)
|
||||
{
|
||||
if (!ApplicationAccessible::AppendChild(aChild))
|
||||
return false;
|
||||
if (!ApplicationAccessible::AppendChild(aChild))
|
||||
return false;
|
||||
|
||||
AtkObject *atkAccessible = nsAccessibleWrap::GetAtkObject(aChild);
|
||||
atk_object_set_parent(atkAccessible, mAtkObject);
|
||||
AtkObject* atkAccessible = AccessibleWrap::GetAtkObject(aChild);
|
||||
atk_object_set_parent(atkAccessible, mAtkObject);
|
||||
|
||||
PRUint32 count = mChildren.Length();
|
||||
|
||||
|
@ -733,16 +733,16 @@ ApplicationAccessibleWrap::AppendChild(nsAccessible* aChild)
|
|||
}
|
||||
|
||||
bool
|
||||
ApplicationAccessibleWrap::RemoveChild(nsAccessible* aChild)
|
||||
ApplicationAccessibleWrap::RemoveChild(Accessible* aChild)
|
||||
{
|
||||
PRInt32 index = aChild->IndexInParent();
|
||||
PRInt32 index = aChild->IndexInParent();
|
||||
|
||||
AtkObject *atkAccessible = nsAccessibleWrap::GetAtkObject(aChild);
|
||||
atk_object_set_parent(atkAccessible, NULL);
|
||||
g_signal_emit_by_name(mAtkObject, "children_changed::remove", index,
|
||||
atkAccessible, NULL);
|
||||
AtkObject* atkAccessible = AccessibleWrap::GetAtkObject(aChild);
|
||||
atk_object_set_parent(atkAccessible, NULL);
|
||||
g_signal_emit_by_name(mAtkObject, "children_changed::remove", index,
|
||||
atkAccessible, NULL);
|
||||
|
||||
return ApplicationAccessible::RemoveChild(aChild);
|
||||
return ApplicationAccessible::RemoveChild(aChild);
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -25,10 +25,10 @@ public:
|
|||
// nsAccessNode
|
||||
virtual bool Init();
|
||||
|
||||
// nsAccessible
|
||||
// Accessible
|
||||
virtual mozilla::a11y::ENameValueFlag Name(nsString& aName);
|
||||
virtual bool AppendChild(nsAccessible* aChild);
|
||||
virtual bool RemoveChild(nsAccessible* aChild);
|
||||
virtual bool AppendChild(Accessible* aChild);
|
||||
virtual bool RemoveChild(Accessible* aChild);
|
||||
|
||||
/**
|
||||
* Return the atk object for app root accessible.
|
||||
|
|
|
@ -40,7 +40,7 @@ typedef struct _MaiAtkSocket
|
|||
{
|
||||
AtkSocket parent;
|
||||
|
||||
nsAccessibleWrap* accWrap;
|
||||
AccessibleWrap* accWrap;
|
||||
} MaiAtkSocket;
|
||||
|
||||
typedef struct _MaiAtkSocketClass
|
||||
|
@ -64,7 +64,7 @@ mai_atk_socket_init(MaiAtkSocket* aAcc)
|
|||
}
|
||||
|
||||
static AtkObject*
|
||||
mai_atk_socket_new(nsAccessibleWrap* aAccWrap)
|
||||
mai_atk_socket_new(AccessibleWrap* aAccWrap)
|
||||
{
|
||||
NS_ENSURE_TRUE(aAccWrap, NULL);
|
||||
|
||||
|
@ -113,9 +113,9 @@ mai_atk_component_iface_init(AtkComponentIface* aIface)
|
|||
}
|
||||
|
||||
AtkSocketAccessible::AtkSocketAccessible(nsIContent* aContent,
|
||||
nsDocAccessible* aDoc,
|
||||
DocAccessible* aDoc,
|
||||
const nsCString& aPlugId) :
|
||||
nsAccessibleWrap(aContent, aDoc)
|
||||
AccessibleWrap(aContent, aDoc)
|
||||
{
|
||||
mAtkObject = mai_atk_socket_new(this);
|
||||
if (!mAtkObject)
|
||||
|
@ -149,5 +149,5 @@ AtkSocketAccessible::Shutdown()
|
|||
g_object_unref(mAtkObject);
|
||||
mAtkObject = nsnull;
|
||||
}
|
||||
nsAccessibleWrap::Shutdown();
|
||||
AccessibleWrap::Shutdown();
|
||||
}
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
#ifndef _AtkSocketAccessible_H_
|
||||
#define _AtkSocketAccessible_H_
|
||||
|
||||
#include "nsAccessibleWrap.h"
|
||||
#include "AccessibleWrap.h"
|
||||
|
||||
// This file gets included by nsAccessibilityService.cpp, which can't include
|
||||
// atk.h (or glib.h), so we can't rely on it being included.
|
||||
|
@ -18,10 +18,10 @@ extern "C" typedef void (*AtkSocketEmbedType) (void*, void*);
|
|||
#endif
|
||||
|
||||
/**
|
||||
* Provides a nsAccessibleWrap wrapper around AtkSocket for out-of-process
|
||||
* Provides a AccessibleWrap wrapper around AtkSocket for out-of-process
|
||||
* accessibles.
|
||||
*/
|
||||
class AtkSocketAccessible: public nsAccessibleWrap
|
||||
class AtkSocketAccessible : public AccessibleWrap
|
||||
{
|
||||
public:
|
||||
|
||||
|
@ -39,7 +39,7 @@ public:
|
|||
*/
|
||||
static bool gCanEmbed;
|
||||
|
||||
AtkSocketAccessible(nsIContent* aContent, nsDocAccessible* aDoc,
|
||||
AtkSocketAccessible(nsIContent* aContent, DocAccessible* aDoc,
|
||||
const nsCString& aPlugId);
|
||||
|
||||
// nsAccessNode
|
||||
|
|
|
@ -5,20 +5,20 @@
|
|||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#include "nsMai.h"
|
||||
#include "nsDocAccessibleWrap.h"
|
||||
#include "DocAccessibleWrap.h"
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// nsDocAccessibleWrap
|
||||
// DocAccessibleWrap
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
nsDocAccessibleWrap::
|
||||
nsDocAccessibleWrap(nsIDocument* aDocument, nsIContent* aRootContent,
|
||||
nsIPresShell* aPresShell) :
|
||||
nsDocAccessible(aDocument, aRootContent, aPresShell), mActivated(false)
|
||||
DocAccessibleWrap::
|
||||
DocAccessibleWrap(nsIDocument* aDocument, nsIContent* aRootContent,
|
||||
nsIPresShell* aPresShell) :
|
||||
DocAccessible(aDocument, aRootContent, aPresShell), mActivated(false)
|
||||
{
|
||||
}
|
||||
|
||||
nsDocAccessibleWrap::~nsDocAccessibleWrap()
|
||||
DocAccessibleWrap::~DocAccessibleWrap()
|
||||
{
|
||||
}
|
||||
|
|
@ -8,17 +8,17 @@
|
|||
* see http://lxr.mozilla.org/seamonkey/source/accessible/accessible-docs.html
|
||||
*/
|
||||
|
||||
#ifndef _nsDocAccessibleWrap_H_
|
||||
#define _nsDocAccessibleWrap_H_
|
||||
#ifndef mozilla_a11y_DocAccessibleWrap_h__
|
||||
#define mozilla_a11y_DocAccessibleWrap_h__
|
||||
|
||||
#include "nsDocAccessible.h"
|
||||
#include "DocAccessible.h"
|
||||
|
||||
class nsDocAccessibleWrap: public nsDocAccessible
|
||||
class DocAccessibleWrap : public DocAccessible
|
||||
{
|
||||
public:
|
||||
nsDocAccessibleWrap(nsIDocument* aDocument, nsIContent* aRootContent,
|
||||
nsIPresShell* aPresShell);
|
||||
virtual ~nsDocAccessibleWrap();
|
||||
DocAccessibleWrap(nsIDocument* aDocument, nsIContent* aRootContent,
|
||||
nsIPresShell* aPresShell);
|
||||
virtual ~DocAccessibleWrap();
|
||||
|
||||
bool mActivated;
|
||||
};
|
|
@ -9,7 +9,7 @@
|
|||
|
||||
#include <atk/atk.h>
|
||||
|
||||
class nsAccessibleWrap;
|
||||
class AccessibleWrap;
|
||||
|
||||
extern "C" {
|
||||
void actionInterfaceInitCB(AtkActionIface* aIface);
|
||||
|
@ -28,9 +28,9 @@ void valueInterfaceInitCB(AtkValueIface *aIface);
|
|||
/**
|
||||
* XXX these should live in a file of utils for atk.
|
||||
*/
|
||||
AtkObject* refAccessibleAtPointHelper(nsAccessibleWrap* aAccWrap,
|
||||
AtkObject* refAccessibleAtPointHelper(AccessibleWrap* aAccWrap,
|
||||
gint aX, gint aY, AtkCoordType aCoordType);
|
||||
void getExtentsHelper(nsAccessibleWrap* aAccWrap,
|
||||
void getExtentsHelper(AccessibleWrap* aAccWrap,
|
||||
gint* aX, gint* aY, gint* aWidth, gint* aHeight,
|
||||
AtkCoordType aCoordType);
|
||||
|
||||
|
|
|
@ -16,11 +16,11 @@ LIBXUL_LIBRARY = 1
|
|||
|
||||
|
||||
CPPSRCS = \
|
||||
AtkSocketAccessible.cpp \
|
||||
nsAccessNodeWrap.cpp \
|
||||
nsAccessibleWrap.cpp \
|
||||
nsDocAccessibleWrap.cpp \
|
||||
AccessibleWrap.cpp \
|
||||
ApplicationAccessibleWrap.cpp \
|
||||
AtkSocketAccessible.cpp \
|
||||
DocAccessibleWrap.cpp \
|
||||
nsAccessNodeWrap.cpp \
|
||||
nsMaiInterfaceComponent.cpp \
|
||||
nsMaiInterfaceAction.cpp \
|
||||
nsMaiInterfaceText.cpp \
|
||||
|
|
|
@ -4,11 +4,17 @@
|
|||
* 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 _nsTextAccessibleWrap_H_
|
||||
#define _nsTextAccessibleWrap_H_
|
||||
#ifndef mozilla_a11y_TextLeafAccessibleWrap_h__
|
||||
#define mozilla_a11y_TextLeafAccessibleWrap_h__
|
||||
|
||||
#include "nsTextAccessible.h"
|
||||
#include "TextLeafAccessible.h"
|
||||
|
||||
typedef class nsTextAccessible nsTextAccessibleWrap;
|
||||
namespace mozilla {
|
||||
namespace a11y {
|
||||
|
||||
typedef class TextLeafAccessible TextLeafAccessibleWrap;
|
||||
|
||||
} // namespace a11y
|
||||
} // namespace mozilla
|
||||
|
||||
#endif
|
|
@ -20,7 +20,7 @@
|
|||
//-----------------------------------------------------
|
||||
|
||||
nsAccessNodeWrap::
|
||||
nsAccessNodeWrap(nsIContent* aContent, nsDocAccessible* aDoc) :
|
||||
nsAccessNodeWrap(nsIContent* aContent, DocAccessible* aDoc) :
|
||||
nsAccessNode(aContent, aDoc)
|
||||
{
|
||||
}
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
class nsAccessNodeWrap : public nsAccessNode
|
||||
{
|
||||
public: // construction, destruction
|
||||
nsAccessNodeWrap(nsIContent* aContent, nsDocAccessible* aDoc);
|
||||
nsAccessNodeWrap(nsIContent* aContent, DocAccessible* aDoc);
|
||||
virtual ~nsAccessNodeWrap();
|
||||
|
||||
static void InitAccessibility();
|
||||
|
|
|
@ -1,113 +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 __NS_ACCESSIBLE_WRAP_H__
|
||||
#define __NS_ACCESSIBLE_WRAP_H__
|
||||
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsAccessible.h"
|
||||
#include "prlog.h"
|
||||
|
||||
#ifdef PR_LOGGING
|
||||
#define MAI_LOGGING
|
||||
#endif /* #ifdef PR_LOGGING */
|
||||
|
||||
struct _AtkObject;
|
||||
typedef struct _AtkObject AtkObject;
|
||||
|
||||
enum AtkProperty {
|
||||
PROP_0, // gobject convention
|
||||
PROP_NAME,
|
||||
PROP_DESCRIPTION,
|
||||
PROP_PARENT, // ancestry has changed
|
||||
PROP_ROLE,
|
||||
PROP_LAYER,
|
||||
PROP_MDI_ZORDER,
|
||||
PROP_TABLE_CAPTION,
|
||||
PROP_TABLE_COLUMN_DESCRIPTION,
|
||||
PROP_TABLE_COLUMN_HEADER,
|
||||
PROP_TABLE_ROW_DESCRIPTION,
|
||||
PROP_TABLE_ROW_HEADER,
|
||||
PROP_TABLE_SUMMARY,
|
||||
PROP_LAST // gobject convention
|
||||
};
|
||||
|
||||
struct AtkPropertyChange {
|
||||
PRInt32 type; // property type as listed above
|
||||
void *oldvalue;
|
||||
void *newvalue;
|
||||
};
|
||||
|
||||
class MaiHyperlink;
|
||||
|
||||
/**
|
||||
* nsAccessibleWrap, and its descendents in atk directory provide the
|
||||
* implementation of AtkObject.
|
||||
*/
|
||||
class nsAccessibleWrap: public nsAccessible
|
||||
{
|
||||
public:
|
||||
nsAccessibleWrap(nsIContent* aContent, nsDocAccessible* aDoc);
|
||||
virtual ~nsAccessibleWrap();
|
||||
void ShutdownAtkObject();
|
||||
|
||||
// nsAccessNode
|
||||
virtual void Shutdown();
|
||||
|
||||
#ifdef MAI_LOGGING
|
||||
virtual void DumpnsAccessibleWrapInfo(int aDepth) {}
|
||||
static PRInt32 mAccWrapCreated;
|
||||
static PRInt32 mAccWrapDeleted;
|
||||
#endif
|
||||
|
||||
// return the atk object for this nsAccessibleWrap
|
||||
NS_IMETHOD GetNativeInterface(void **aOutAccessible);
|
||||
virtual nsresult HandleAccEvent(AccEvent* aEvent);
|
||||
|
||||
AtkObject * GetAtkObject(void);
|
||||
static AtkObject * GetAtkObject(nsIAccessible * acc);
|
||||
|
||||
bool IsValidObject();
|
||||
|
||||
// get/set the MaiHyperlink object for this nsAccessibleWrap
|
||||
MaiHyperlink* GetMaiHyperlink(bool aCreate = true);
|
||||
void SetMaiHyperlink(MaiHyperlink* aMaiHyperlink);
|
||||
|
||||
static const char * ReturnString(nsAString &aString) {
|
||||
static nsCString returnedString;
|
||||
returnedString = NS_ConvertUTF16toUTF8(aString);
|
||||
return returnedString.get();
|
||||
}
|
||||
|
||||
protected:
|
||||
virtual nsresult FirePlatformEvent(AccEvent* aEvent);
|
||||
|
||||
nsresult FireAtkStateChangeEvent(AccEvent* aEvent, AtkObject *aObject);
|
||||
nsresult FireAtkTextChangedEvent(AccEvent* aEvent, AtkObject *aObject);
|
||||
nsresult FireAtkShowHideEvent(AccEvent* aEvent, AtkObject *aObject,
|
||||
bool aIsAdded);
|
||||
|
||||
AtkObject *mAtkObject;
|
||||
|
||||
private:
|
||||
|
||||
/*
|
||||
* do we have text-remove and text-insert signals if not we need to use
|
||||
* text-changed see nsAccessibleWrap::FireAtkTextChangedEvent() and
|
||||
* bug 619002
|
||||
*/
|
||||
enum EAvailableAtkSignals {
|
||||
eUnknown,
|
||||
eHaveNewAtkTextSignals,
|
||||
eNoNewAtkSignals
|
||||
};
|
||||
|
||||
static EAvailableAtkSignals gAvailableAtkSignals;
|
||||
|
||||
PRUint16 CreateMaiInterfaces(void);
|
||||
};
|
||||
|
||||
#endif /* __NS_ACCESSIBLE_WRAP_H__ */
|
|
@ -11,7 +11,7 @@
|
|||
#include <glib.h>
|
||||
#include <glib-object.h>
|
||||
|
||||
#include "nsAccessibleWrap.h"
|
||||
#include "AccessibleWrap.h"
|
||||
|
||||
extern PRLogModuleInfo *gMaiLog;
|
||||
|
||||
|
@ -46,6 +46,6 @@ PR_END_MACRO
|
|||
MAI_TYPE_ATK_OBJECT, \
|
||||
MaiAtkObjectClass))
|
||||
GType mai_atk_object_get_type(void);
|
||||
nsAccessibleWrap *GetAccessibleWrap(AtkObject *aAtkObj);
|
||||
AccessibleWrap* GetAccessibleWrap(AtkObject* aAtkObj);
|
||||
|
||||
#endif /* __NS_MAI_H__ */
|
||||
|
|
|
@ -59,7 +59,7 @@ static gint getAnchorCountCB(AtkHyperlink *aLink);
|
|||
G_END_DECLS
|
||||
|
||||
static gpointer parent_class = NULL;
|
||||
static nsAccessible*
|
||||
static Accessible*
|
||||
get_accessible_hyperlink(AtkHyperlink *aHyperlink);
|
||||
|
||||
GType
|
||||
|
@ -88,7 +88,7 @@ mai_atk_hyperlink_get_type(void)
|
|||
return type;
|
||||
}
|
||||
|
||||
MaiHyperlink::MaiHyperlink(nsAccessible* aHyperLink) :
|
||||
MaiHyperlink::MaiHyperlink(Accessible* aHyperLink) :
|
||||
mHyperlink(aHyperLink),
|
||||
mMaiAtkHyperlink(nsnull)
|
||||
{
|
||||
|
@ -179,7 +179,7 @@ finalizeCB(GObject *aObj)
|
|||
gchar *
|
||||
getUriCB(AtkHyperlink *aLink, gint aLinkIndex)
|
||||
{
|
||||
nsAccessible* hyperlink = get_accessible_hyperlink(aLink);
|
||||
Accessible* hyperlink = get_accessible_hyperlink(aLink);
|
||||
NS_ENSURE_TRUE(hyperlink, nsnull);
|
||||
|
||||
nsCOMPtr<nsIURI> uri = hyperlink->AnchorURIAt(aLinkIndex);
|
||||
|
@ -196,13 +196,13 @@ getUriCB(AtkHyperlink *aLink, gint aLinkIndex)
|
|||
AtkObject *
|
||||
getObjectCB(AtkHyperlink *aLink, gint aLinkIndex)
|
||||
{
|
||||
nsAccessible* hyperlink = get_accessible_hyperlink(aLink);
|
||||
Accessible* hyperlink = get_accessible_hyperlink(aLink);
|
||||
NS_ENSURE_TRUE(hyperlink, nsnull);
|
||||
|
||||
nsAccessible* anchor = hyperlink->AnchorAt(aLinkIndex);
|
||||
Accessible* anchor = hyperlink->AnchorAt(aLinkIndex);
|
||||
NS_ENSURE_TRUE(anchor, nsnull);
|
||||
|
||||
AtkObject *atkObj = nsAccessibleWrap::GetAtkObject(anchor);
|
||||
AtkObject* atkObj = AccessibleWrap::GetAtkObject(anchor);
|
||||
//no need to add ref it, because it is "get" not "ref"
|
||||
return atkObj;
|
||||
}
|
||||
|
@ -210,7 +210,7 @@ getObjectCB(AtkHyperlink *aLink, gint aLinkIndex)
|
|||
gint
|
||||
getEndIndexCB(AtkHyperlink *aLink)
|
||||
{
|
||||
nsAccessible* hyperlink = get_accessible_hyperlink(aLink);
|
||||
Accessible* hyperlink = get_accessible_hyperlink(aLink);
|
||||
NS_ENSURE_TRUE(hyperlink, -1);
|
||||
|
||||
return static_cast<gint>(hyperlink->EndOffset());
|
||||
|
@ -219,7 +219,7 @@ getEndIndexCB(AtkHyperlink *aLink)
|
|||
gint
|
||||
getStartIndexCB(AtkHyperlink *aLink)
|
||||
{
|
||||
nsAccessible* hyperlink = get_accessible_hyperlink(aLink);
|
||||
Accessible* hyperlink = get_accessible_hyperlink(aLink);
|
||||
NS_ENSURE_TRUE(hyperlink, -1);
|
||||
|
||||
return static_cast<gint>(hyperlink->StartOffset());
|
||||
|
@ -228,7 +228,7 @@ getStartIndexCB(AtkHyperlink *aLink)
|
|||
gboolean
|
||||
isValidCB(AtkHyperlink *aLink)
|
||||
{
|
||||
nsAccessible* hyperlink = get_accessible_hyperlink(aLink);
|
||||
Accessible* hyperlink = get_accessible_hyperlink(aLink);
|
||||
NS_ENSURE_TRUE(hyperlink, FALSE);
|
||||
|
||||
return static_cast<gboolean>(hyperlink->IsLinkValid());
|
||||
|
@ -237,7 +237,7 @@ isValidCB(AtkHyperlink *aLink)
|
|||
gint
|
||||
getAnchorCountCB(AtkHyperlink *aLink)
|
||||
{
|
||||
nsAccessible* hyperlink = get_accessible_hyperlink(aLink);
|
||||
Accessible* hyperlink = get_accessible_hyperlink(aLink);
|
||||
NS_ENSURE_TRUE(hyperlink, -1);
|
||||
|
||||
return static_cast<gint>(hyperlink->AnchorCount());
|
||||
|
@ -245,7 +245,7 @@ getAnchorCountCB(AtkHyperlink *aLink)
|
|||
|
||||
// Check if aHyperlink is a valid MaiHyperlink, and return the
|
||||
// HyperLinkAccessible related.
|
||||
nsAccessible*
|
||||
Accessible*
|
||||
get_accessible_hyperlink(AtkHyperlink *aHyperlink)
|
||||
{
|
||||
NS_ENSURE_TRUE(MAI_IS_ATK_HYPERLINK(aHyperlink), nsnull);
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
#define __MAI_HYPERLINK_H__
|
||||
|
||||
#include "nsMai.h"
|
||||
#include "nsAccessible.h"
|
||||
#include "Accessible.h"
|
||||
|
||||
struct _AtkHyperlink;
|
||||
typedef struct _AtkHyperlink AtkHyperlink;
|
||||
|
@ -20,18 +20,18 @@ typedef struct _AtkHyperlink AtkHyperlink;
|
|||
class MaiHyperlink
|
||||
{
|
||||
public:
|
||||
MaiHyperlink(nsAccessible* aHyperLink);
|
||||
~MaiHyperlink();
|
||||
MaiHyperlink(Accessible* aHyperLink);
|
||||
~MaiHyperlink();
|
||||
|
||||
public:
|
||||
AtkHyperlink *GetAtkHyperlink(void);
|
||||
nsAccessible* GetAccHyperlink()
|
||||
{ return mHyperlink && mHyperlink->IsLink() ? mHyperlink : nsnull; }
|
||||
AtkHyperlink *GetAtkHyperlink(void);
|
||||
Accessible* GetAccHyperlink()
|
||||
{ return mHyperlink && mHyperlink->IsLink() ? mHyperlink : nsnull; }
|
||||
|
||||
protected:
|
||||
nsAccessible* mHyperlink;
|
||||
AtkHyperlink *mMaiAtkHyperlink;
|
||||
Accessible* mHyperlink;
|
||||
AtkHyperlink* mMaiAtkHyperlink;
|
||||
public:
|
||||
static nsresult Initialize(AtkHyperlink *aObj, MaiHyperlink *aClass);
|
||||
static nsresult Initialize(AtkHyperlink *aObj, MaiHyperlink *aClass);
|
||||
};
|
||||
#endif /* __MAI_HYPERLINK_H__ */
|
||||
|
|
|
@ -19,51 +19,51 @@ extern "C" {
|
|||
static gboolean
|
||||
doActionCB(AtkAction *aAction, gint aActionIndex)
|
||||
{
|
||||
nsAccessibleWrap *accWrap = GetAccessibleWrap(ATK_OBJECT(aAction));
|
||||
if (!accWrap)
|
||||
return FALSE;
|
||||
AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aAction));
|
||||
if (!accWrap)
|
||||
return FALSE;
|
||||
|
||||
nsresult rv = accWrap->DoAction(aActionIndex);
|
||||
return (NS_FAILED(rv)) ? FALSE : TRUE;
|
||||
nsresult rv = accWrap->DoAction(aActionIndex);
|
||||
return (NS_FAILED(rv)) ? FALSE : TRUE;
|
||||
}
|
||||
|
||||
static gint
|
||||
getActionCountCB(AtkAction *aAction)
|
||||
{
|
||||
nsAccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aAction));
|
||||
AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aAction));
|
||||
return accWrap ? accWrap->ActionCount() : 0;
|
||||
}
|
||||
|
||||
static const gchar*
|
||||
getActionDescriptionCB(AtkAction *aAction, gint aActionIndex)
|
||||
{
|
||||
nsAccessibleWrap *accWrap = GetAccessibleWrap(ATK_OBJECT(aAction));
|
||||
if (!accWrap)
|
||||
return nsnull;
|
||||
AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aAction));
|
||||
if (!accWrap)
|
||||
return nsnull;
|
||||
|
||||
nsAutoString description;
|
||||
nsresult rv = accWrap->GetActionDescription(aActionIndex, description);
|
||||
NS_ENSURE_SUCCESS(rv, nsnull);
|
||||
return nsAccessibleWrap::ReturnString(description);
|
||||
nsAutoString description;
|
||||
nsresult rv = accWrap->GetActionDescription(aActionIndex, description);
|
||||
NS_ENSURE_SUCCESS(rv, nsnull);
|
||||
return AccessibleWrap::ReturnString(description);
|
||||
}
|
||||
|
||||
static const gchar*
|
||||
getActionNameCB(AtkAction *aAction, gint aActionIndex)
|
||||
{
|
||||
nsAccessibleWrap *accWrap = GetAccessibleWrap(ATK_OBJECT(aAction));
|
||||
AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aAction));
|
||||
if (!accWrap)
|
||||
return nsnull;
|
||||
|
||||
nsAutoString autoStr;
|
||||
nsresult rv = accWrap->GetActionName(aActionIndex, autoStr);
|
||||
NS_ENSURE_SUCCESS(rv, nsnull);
|
||||
return nsAccessibleWrap::ReturnString(autoStr);
|
||||
return AccessibleWrap::ReturnString(autoStr);
|
||||
}
|
||||
|
||||
static const gchar*
|
||||
getKeyBindingCB(AtkAction *aAction, gint aActionIndex)
|
||||
{
|
||||
nsAccessibleWrap* acc = GetAccessibleWrap(ATK_OBJECT(aAction));
|
||||
AccessibleWrap* acc = GetAccessibleWrap(ATK_OBJECT(aAction));
|
||||
if (!acc)
|
||||
return nsnull;
|
||||
|
||||
|
@ -75,7 +75,7 @@ getKeyBindingCB(AtkAction *aAction, gint aActionIndex)
|
|||
if (!keyBinding.IsEmpty()) {
|
||||
keyBinding.AppendToString(keyBindingsStr, KeyBinding::eAtkFormat);
|
||||
|
||||
nsAccessible* parent = acc->Parent();
|
||||
Accessible* parent = acc->Parent();
|
||||
roles::Role role = parent ? parent->Role() : roles::NOTHING;
|
||||
if (role == roles::PARENT_MENUITEM || role == roles::MENUITEM ||
|
||||
role == roles::RADIO_MENU_ITEM || role == roles::CHECK_MENU_ITEM) {
|
||||
|
@ -108,7 +108,7 @@ getKeyBindingCB(AtkAction *aAction, gint aActionIndex)
|
|||
keyBinding.AppendToString(keyBindingsStr, KeyBinding::eAtkFormat);
|
||||
}
|
||||
|
||||
return nsAccessibleWrap::ReturnString(keyBindingsStr);
|
||||
return AccessibleWrap::ReturnString(keyBindingsStr);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
#include "InterfaceInitFuncs.h"
|
||||
|
||||
#include "nsAccessibleWrap.h"
|
||||
#include "AccessibleWrap.h"
|
||||
#include "nsAccUtils.h"
|
||||
#include "nsCoreUtils.h"
|
||||
#include "nsMai.h"
|
||||
|
@ -32,7 +32,7 @@ getExtentsCB(AtkComponent* aComponent, gint* aX, gint* aY,
|
|||
static gboolean
|
||||
grabFocusCB(AtkComponent* aComponent)
|
||||
{
|
||||
nsAccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aComponent));
|
||||
AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aComponent));
|
||||
if (!accWrap)
|
||||
return FALSE;
|
||||
|
||||
|
@ -42,13 +42,13 @@ grabFocusCB(AtkComponent* aComponent)
|
|||
}
|
||||
|
||||
AtkObject*
|
||||
refAccessibleAtPointHelper(nsAccessibleWrap* aAccWrap, gint aX, gint aY,
|
||||
refAccessibleAtPointHelper(AccessibleWrap* aAccWrap, gint aX, gint aY,
|
||||
AtkCoordType aCoordType)
|
||||
{
|
||||
if (!aAccWrap || aAccWrap->IsDefunct() || nsAccUtils::MustPrune(aAccWrap))
|
||||
return nsnull;
|
||||
|
||||
// nsAccessible::ChildAtPoint(x,y) is in screen pixels.
|
||||
// Accessible::ChildAtPoint(x,y) is in screen pixels.
|
||||
if (aCoordType == ATK_XY_WINDOW) {
|
||||
nsIntPoint winCoords =
|
||||
nsCoreUtils::GetScreenCoordsForWindow(aAccWrap->GetNode());
|
||||
|
@ -56,19 +56,19 @@ refAccessibleAtPointHelper(nsAccessibleWrap* aAccWrap, gint aX, gint aY,
|
|||
aY += winCoords.y;
|
||||
}
|
||||
|
||||
nsAccessible* accAtPoint = aAccWrap->ChildAtPoint(aX, aY,
|
||||
nsAccessible::eDirectChild);
|
||||
Accessible* accAtPoint = aAccWrap->ChildAtPoint(aX, aY,
|
||||
Accessible::eDirectChild);
|
||||
if (!accAtPoint)
|
||||
return nsnull;
|
||||
|
||||
AtkObject* atkObj = nsAccessibleWrap::GetAtkObject(accAtPoint);
|
||||
AtkObject* atkObj = AccessibleWrap::GetAtkObject(accAtPoint);
|
||||
if (atkObj)
|
||||
g_object_ref(atkObj);
|
||||
return atkObj;
|
||||
}
|
||||
|
||||
void
|
||||
getExtentsHelper(nsAccessibleWrap* aAccWrap,
|
||||
getExtentsHelper(AccessibleWrap* aAccWrap,
|
||||
gint* aX, gint* aY, gint* aWidth, gint* aHeight,
|
||||
AtkCoordType aCoordType)
|
||||
{
|
||||
|
|
|
@ -6,8 +6,8 @@
|
|||
|
||||
#include "InterfaceInitFuncs.h"
|
||||
|
||||
#include "nsAccessibleWrap.h"
|
||||
#include "nsDocAccessible.h"
|
||||
#include "AccessibleWrap.h"
|
||||
#include "DocAccessible.h"
|
||||
#include "nsMai.h"
|
||||
|
||||
static const char* const kDocTypeName = "W3C-doctype";
|
||||
|
@ -42,13 +42,13 @@ documentInterfaceInitCB(AtkDocumentIface *aIface)
|
|||
const gchar *
|
||||
getDocumentLocaleCB(AtkDocument *aDocument)
|
||||
{
|
||||
nsAccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aDocument));
|
||||
AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aDocument));
|
||||
if (!accWrap)
|
||||
return nsnull;
|
||||
|
||||
nsAutoString locale;
|
||||
accWrap->Language(locale);
|
||||
return locale.IsEmpty() ? nsnull : nsAccessibleWrap::ReturnString(locale);
|
||||
return locale.IsEmpty() ? nsnull : AccessibleWrap::ReturnString(locale);
|
||||
}
|
||||
|
||||
static inline GSList *
|
||||
|
@ -67,13 +67,13 @@ prependToList(GSList *aList, const char *const aName, const nsAutoString &aValue
|
|||
AtkAttributeSet *
|
||||
getDocumentAttributesCB(AtkDocument *aDocument)
|
||||
{
|
||||
nsAccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aDocument));
|
||||
AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aDocument));
|
||||
if (!accWrap || !accWrap->IsDoc())
|
||||
return nsnull;
|
||||
|
||||
// according to atkobject.h, AtkAttributeSet is a GSList
|
||||
GSList* attributes = nsnull;
|
||||
nsDocAccessible* document = accWrap->AsDoc();
|
||||
DocAccessible* document = accWrap->AsDoc();
|
||||
nsAutoString aURL;
|
||||
nsresult rv = document->GetURL(aURL);
|
||||
if (NS_SUCCEEDED(rv))
|
||||
|
@ -96,11 +96,11 @@ const gchar *
|
|||
getDocumentAttributeValueCB(AtkDocument *aDocument,
|
||||
const gchar *aAttrName)
|
||||
{
|
||||
nsAccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aDocument));
|
||||
AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aDocument));
|
||||
if (!accWrap || !accWrap->IsDoc())
|
||||
return nsnull;
|
||||
|
||||
nsDocAccessible* document = accWrap->AsDoc();
|
||||
DocAccessible* document = accWrap->AsDoc();
|
||||
nsresult rv;
|
||||
nsAutoString attrValue;
|
||||
if (!strcasecmp(aAttrName, kDocTypeName))
|
||||
|
@ -113,6 +113,6 @@ getDocumentAttributeValueCB(AtkDocument *aDocument,
|
|||
return nsnull;
|
||||
|
||||
NS_ENSURE_SUCCESS(rv, nsnull);
|
||||
return attrValue.IsEmpty() ? nsnull : nsAccessibleWrap::ReturnString(attrValue);
|
||||
return attrValue.IsEmpty() ? nsnull : AccessibleWrap::ReturnString(attrValue);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -17,9 +17,9 @@ static gboolean
|
|||
setRunAttributesCB(AtkEditableText *aText, AtkAttributeSet *aAttribSet,
|
||||
gint aStartOffset, gint aEndOffset)
|
||||
{
|
||||
nsAccessibleWrap *accWrap = GetAccessibleWrap(ATK_OBJECT(aText));
|
||||
if (!accWrap)
|
||||
return FALSE;
|
||||
AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aText));
|
||||
if (!accWrap)
|
||||
return FALSE;
|
||||
|
||||
nsCOMPtr<nsIAccessibleEditableText> accText;
|
||||
accWrap->QueryInterface(NS_GET_IID(nsIAccessibleEditableText),
|
||||
|
@ -37,9 +37,9 @@ setRunAttributesCB(AtkEditableText *aText, AtkAttributeSet *aAttribSet,
|
|||
static void
|
||||
setTextContentsCB(AtkEditableText *aText, const gchar *aString)
|
||||
{
|
||||
nsAccessibleWrap *accWrap = GetAccessibleWrap(ATK_OBJECT(aText));
|
||||
if (!accWrap)
|
||||
return;
|
||||
AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aText));
|
||||
if (!accWrap)
|
||||
return;
|
||||
|
||||
nsCOMPtr<nsIAccessibleEditableText> accText;
|
||||
accWrap->QueryInterface(NS_GET_IID(nsIAccessibleEditableText),
|
||||
|
@ -57,9 +57,9 @@ static void
|
|||
insertTextCB(AtkEditableText *aText,
|
||||
const gchar *aString, gint aLength, gint *aPosition)
|
||||
{
|
||||
nsAccessibleWrap *accWrap = GetAccessibleWrap(ATK_OBJECT(aText));
|
||||
if (!accWrap)
|
||||
return;
|
||||
AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aText));
|
||||
if (!accWrap)
|
||||
return;
|
||||
|
||||
nsCOMPtr<nsIAccessibleEditableText> accText;
|
||||
accWrap->QueryInterface(NS_GET_IID(nsIAccessibleEditableText),
|
||||
|
@ -84,9 +84,9 @@ insertTextCB(AtkEditableText *aText,
|
|||
static void
|
||||
copyTextCB(AtkEditableText *aText, gint aStartPos, gint aEndPos)
|
||||
{
|
||||
nsAccessibleWrap *accWrap = GetAccessibleWrap(ATK_OBJECT(aText));
|
||||
if (!accWrap)
|
||||
return;
|
||||
AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aText));
|
||||
if (!accWrap)
|
||||
return;
|
||||
|
||||
nsCOMPtr<nsIAccessibleEditableText> accText;
|
||||
accWrap->QueryInterface(NS_GET_IID(nsIAccessibleEditableText),
|
||||
|
@ -102,9 +102,9 @@ copyTextCB(AtkEditableText *aText, gint aStartPos, gint aEndPos)
|
|||
static void
|
||||
cutTextCB(AtkEditableText *aText, gint aStartPos, gint aEndPos)
|
||||
{
|
||||
nsAccessibleWrap *accWrap = GetAccessibleWrap(ATK_OBJECT(aText));
|
||||
if (!accWrap)
|
||||
return;
|
||||
AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aText));
|
||||
if (!accWrap)
|
||||
return;
|
||||
|
||||
nsCOMPtr<nsIAccessibleEditableText> accText;
|
||||
accWrap->QueryInterface(NS_GET_IID(nsIAccessibleEditableText),
|
||||
|
@ -119,9 +119,9 @@ cutTextCB(AtkEditableText *aText, gint aStartPos, gint aEndPos)
|
|||
static void
|
||||
deleteTextCB(AtkEditableText *aText, gint aStartPos, gint aEndPos)
|
||||
{
|
||||
nsAccessibleWrap *accWrap = GetAccessibleWrap(ATK_OBJECT(aText));
|
||||
if (!accWrap)
|
||||
return;
|
||||
AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aText));
|
||||
if (!accWrap)
|
||||
return;
|
||||
|
||||
nsCOMPtr<nsIAccessibleEditableText> accText;
|
||||
accWrap->QueryInterface(NS_GET_IID(nsIAccessibleEditableText),
|
||||
|
@ -137,9 +137,9 @@ deleteTextCB(AtkEditableText *aText, gint aStartPos, gint aEndPos)
|
|||
static void
|
||||
pasteTextCB(AtkEditableText *aText, gint aPosition)
|
||||
{
|
||||
nsAccessibleWrap *accWrap = GetAccessibleWrap(ATK_OBJECT(aText));
|
||||
if (!accWrap)
|
||||
return;
|
||||
AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aText));
|
||||
if (!accWrap)
|
||||
return;
|
||||
|
||||
nsCOMPtr<nsIAccessibleEditableText> accText;
|
||||
accWrap->QueryInterface(NS_GET_IID(nsIAccessibleEditableText),
|
||||
|
|
|
@ -12,7 +12,7 @@ extern "C" {
|
|||
static AtkHyperlink*
|
||||
getHyperlinkCB(AtkHyperlinkImpl* aImpl)
|
||||
{
|
||||
nsAccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aImpl));
|
||||
AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aImpl));
|
||||
if (!accWrap)
|
||||
return nsnull;
|
||||
|
||||
|
|
|
@ -15,54 +15,54 @@ extern "C" {
|
|||
static AtkHyperlink*
|
||||
getLinkCB(AtkHypertext *aText, gint aLinkIndex)
|
||||
{
|
||||
nsAccessibleWrap *accWrap = GetAccessibleWrap(ATK_OBJECT(aText));
|
||||
if (!accWrap)
|
||||
return nsnull;
|
||||
AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aText));
|
||||
if (!accWrap)
|
||||
return nsnull;
|
||||
|
||||
nsHyperTextAccessible* hyperText = accWrap->AsHyperText();
|
||||
NS_ENSURE_TRUE(hyperText, nsnull);
|
||||
nsHyperTextAccessible* hyperText = accWrap->AsHyperText();
|
||||
NS_ENSURE_TRUE(hyperText, nsnull);
|
||||
|
||||
nsAccessible* hyperLink = hyperText->GetLinkAt(aLinkIndex);
|
||||
if (!hyperLink)
|
||||
return nsnull;
|
||||
Accessible* hyperLink = hyperText->GetLinkAt(aLinkIndex);
|
||||
if (!hyperLink)
|
||||
return nsnull;
|
||||
|
||||
AtkObject* hyperLinkAtkObj = nsAccessibleWrap::GetAtkObject(hyperLink);
|
||||
nsAccessibleWrap *accChild = GetAccessibleWrap(hyperLinkAtkObj);
|
||||
NS_ENSURE_TRUE(accChild, nsnull);
|
||||
AtkObject* hyperLinkAtkObj = AccessibleWrap::GetAtkObject(hyperLink);
|
||||
AccessibleWrap* accChild = GetAccessibleWrap(hyperLinkAtkObj);
|
||||
NS_ENSURE_TRUE(accChild, nsnull);
|
||||
|
||||
MaiHyperlink *maiHyperlink = accChild->GetMaiHyperlink();
|
||||
NS_ENSURE_TRUE(maiHyperlink, nsnull);
|
||||
return maiHyperlink->GetAtkHyperlink();
|
||||
MaiHyperlink *maiHyperlink = accChild->GetMaiHyperlink();
|
||||
NS_ENSURE_TRUE(maiHyperlink, nsnull);
|
||||
return maiHyperlink->GetAtkHyperlink();
|
||||
}
|
||||
|
||||
static gint
|
||||
getLinkCountCB(AtkHypertext *aText)
|
||||
{
|
||||
nsAccessibleWrap *accWrap = GetAccessibleWrap(ATK_OBJECT(aText));
|
||||
if (!accWrap)
|
||||
return -1;
|
||||
AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aText));
|
||||
if (!accWrap)
|
||||
return -1;
|
||||
|
||||
nsHyperTextAccessible* hyperText = accWrap->AsHyperText();
|
||||
NS_ENSURE_TRUE(hyperText, -1);
|
||||
nsHyperTextAccessible* hyperText = accWrap->AsHyperText();
|
||||
NS_ENSURE_TRUE(hyperText, -1);
|
||||
|
||||
return hyperText->GetLinkCount();
|
||||
return hyperText->GetLinkCount();
|
||||
}
|
||||
|
||||
static gint
|
||||
getLinkIndexCB(AtkHypertext *aText, gint aCharIndex)
|
||||
{
|
||||
nsAccessibleWrap *accWrap = GetAccessibleWrap(ATK_OBJECT(aText));
|
||||
if (!accWrap)
|
||||
return -1;
|
||||
AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aText));
|
||||
if (!accWrap)
|
||||
return -1;
|
||||
|
||||
nsHyperTextAccessible* hyperText = accWrap->AsHyperText();
|
||||
NS_ENSURE_TRUE(hyperText, -1);
|
||||
nsHyperTextAccessible* hyperText = accWrap->AsHyperText();
|
||||
NS_ENSURE_TRUE(hyperText, -1);
|
||||
|
||||
PRInt32 index = -1;
|
||||
nsresult rv = hyperText->GetLinkIndexAtOffset(aCharIndex, &index);
|
||||
NS_ENSURE_SUCCESS(rv, -1);
|
||||
PRInt32 index = -1;
|
||||
nsresult rv = hyperText->GetLinkIndexAtOffset(aCharIndex, &index);
|
||||
NS_ENSURE_SUCCESS(rv, -1);
|
||||
|
||||
return index;
|
||||
return index;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
#include "InterfaceInitFuncs.h"
|
||||
|
||||
#include "nsAccessibleWrap.h"
|
||||
#include "AccessibleWrap.h"
|
||||
#include "nsHTMLImageAccessible.h"
|
||||
#include "nsMai.h"
|
||||
|
||||
|
@ -17,7 +17,7 @@ static void
|
|||
getImagePositionCB(AtkImage* aImage, gint* aAccX, gint* aAccY,
|
||||
AtkCoordType aCoordType)
|
||||
{
|
||||
nsAccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aImage));
|
||||
AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aImage));
|
||||
if (!accWrap || !accWrap->IsImage())
|
||||
return;
|
||||
|
||||
|
@ -38,7 +38,7 @@ getImageDescriptionCB(AtkImage* aImage)
|
|||
static void
|
||||
getImageSizeCB(AtkImage* aImage, gint* aAccWidth, gint* aAccHeight)
|
||||
{
|
||||
nsAccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aImage));
|
||||
AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aImage));
|
||||
if (!accWrap || !accWrap->IsImage())
|
||||
return;
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
#include "InterfaceInitFuncs.h"
|
||||
|
||||
#include "nsAccessibleWrap.h"
|
||||
#include "AccessibleWrap.h"
|
||||
#include "nsMai.h"
|
||||
|
||||
#include <atk/atk.h>
|
||||
|
@ -16,79 +16,79 @@ extern "C" {
|
|||
static gboolean
|
||||
addSelectionCB(AtkSelection *aSelection, gint i)
|
||||
{
|
||||
nsAccessibleWrap *accWrap = GetAccessibleWrap(ATK_OBJECT(aSelection));
|
||||
if (!accWrap || !accWrap->IsSelect())
|
||||
return FALSE;
|
||||
AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aSelection));
|
||||
if (!accWrap || !accWrap->IsSelect())
|
||||
return FALSE;
|
||||
|
||||
return accWrap->AddItemToSelection(i);
|
||||
return accWrap->AddItemToSelection(i);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
clearSelectionCB(AtkSelection *aSelection)
|
||||
{
|
||||
nsAccessibleWrap *accWrap = GetAccessibleWrap(ATK_OBJECT(aSelection));
|
||||
if (!accWrap || !accWrap->IsSelect())
|
||||
return FALSE;
|
||||
AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aSelection));
|
||||
if (!accWrap || !accWrap->IsSelect())
|
||||
return FALSE;
|
||||
|
||||
return accWrap->UnselectAll();
|
||||
return accWrap->UnselectAll();
|
||||
}
|
||||
|
||||
static AtkObject*
|
||||
refSelectionCB(AtkSelection *aSelection, gint i)
|
||||
{
|
||||
nsAccessibleWrap *accWrap = GetAccessibleWrap(ATK_OBJECT(aSelection));
|
||||
if (!accWrap || !accWrap->IsSelect())
|
||||
return nsnull;
|
||||
AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aSelection));
|
||||
if (!accWrap || !accWrap->IsSelect())
|
||||
return nsnull;
|
||||
|
||||
nsAccessible* selectedItem = accWrap->GetSelectedItem(i);
|
||||
if (!selectedItem)
|
||||
return nsnull;
|
||||
Accessible* selectedItem = accWrap->GetSelectedItem(i);
|
||||
if (!selectedItem)
|
||||
return nsnull;
|
||||
|
||||
AtkObject* atkObj = nsAccessibleWrap::GetAtkObject(selectedItem);
|
||||
if (atkObj) {
|
||||
g_object_ref(atkObj);
|
||||
}
|
||||
return atkObj;
|
||||
AtkObject* atkObj = AccessibleWrap::GetAtkObject(selectedItem);
|
||||
if (atkObj)
|
||||
g_object_ref(atkObj);
|
||||
|
||||
return atkObj;
|
||||
}
|
||||
|
||||
static gint
|
||||
getSelectionCountCB(AtkSelection *aSelection)
|
||||
{
|
||||
nsAccessibleWrap *accWrap = GetAccessibleWrap(ATK_OBJECT(aSelection));
|
||||
if (!accWrap || !accWrap->IsSelect())
|
||||
return -1;
|
||||
AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aSelection));
|
||||
if (!accWrap || !accWrap->IsSelect())
|
||||
return -1;
|
||||
|
||||
return accWrap->SelectedItemCount();
|
||||
return accWrap->SelectedItemCount();
|
||||
}
|
||||
|
||||
static gboolean
|
||||
isChildSelectedCB(AtkSelection *aSelection, gint i)
|
||||
{
|
||||
nsAccessibleWrap *accWrap = GetAccessibleWrap(ATK_OBJECT(aSelection));
|
||||
if (!accWrap || !accWrap->IsSelect())
|
||||
return FALSE;
|
||||
AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aSelection));
|
||||
if (!accWrap || !accWrap->IsSelect())
|
||||
return FALSE;
|
||||
|
||||
return accWrap->IsItemSelected(i);
|
||||
return accWrap->IsItemSelected(i);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
removeSelectionCB(AtkSelection *aSelection, gint i)
|
||||
{
|
||||
nsAccessibleWrap *accWrap = GetAccessibleWrap(ATK_OBJECT(aSelection));
|
||||
if (!accWrap || !accWrap->IsSelect())
|
||||
return FALSE;
|
||||
AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aSelection));
|
||||
if (!accWrap || !accWrap->IsSelect())
|
||||
return FALSE;
|
||||
|
||||
return accWrap->RemoveItemFromSelection(i);
|
||||
return accWrap->RemoveItemFromSelection(i);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
selectAllSelectionCB(AtkSelection *aSelection)
|
||||
{
|
||||
nsAccessibleWrap *accWrap = GetAccessibleWrap(ATK_OBJECT(aSelection));
|
||||
if (!accWrap || !accWrap->IsSelect())
|
||||
return FALSE;
|
||||
AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aSelection));
|
||||
if (!accWrap || !accWrap->IsSelect())
|
||||
return FALSE;
|
||||
|
||||
return accWrap->SelectAll();
|
||||
return accWrap->SelectAll();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
#include "InterfaceInitFuncs.h"
|
||||
|
||||
#include "nsAccessibleWrap.h"
|
||||
#include "AccessibleWrap.h"
|
||||
#include "nsAccUtils.h"
|
||||
#include "nsIAccessibleTable.h"
|
||||
#include "TableAccessible.h"
|
||||
|
@ -20,9 +20,9 @@ extern "C" {
|
|||
static AtkObject*
|
||||
refAtCB(AtkTable *aTable, gint aRow, gint aColumn)
|
||||
{
|
||||
nsAccessibleWrap *accWrap = GetAccessibleWrap(ATK_OBJECT(aTable));
|
||||
if (!accWrap)
|
||||
return nsnull;
|
||||
AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aTable));
|
||||
if (!accWrap)
|
||||
return nsnull;
|
||||
|
||||
nsCOMPtr<nsIAccessibleTable> accTable;
|
||||
accWrap->QueryInterface(NS_GET_IID(nsIAccessibleTable),
|
||||
|
@ -34,7 +34,7 @@ refAtCB(AtkTable *aTable, gint aRow, gint aColumn)
|
|||
if (NS_FAILED(rv) || !cell)
|
||||
return nsnull;
|
||||
|
||||
AtkObject *cellAtkObj = nsAccessibleWrap::GetAtkObject(cell);
|
||||
AtkObject* cellAtkObj = AccessibleWrap::GetAtkObject(cell);
|
||||
if (cellAtkObj) {
|
||||
g_object_ref(cellAtkObj);
|
||||
}
|
||||
|
@ -44,7 +44,7 @@ refAtCB(AtkTable *aTable, gint aRow, gint aColumn)
|
|||
static gint
|
||||
getIndexAtCB(AtkTable* aTable, gint aRow, gint aColumn)
|
||||
{
|
||||
nsAccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aTable));
|
||||
AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aTable));
|
||||
if (!accWrap)
|
||||
return -1;
|
||||
|
||||
|
@ -57,9 +57,9 @@ getIndexAtCB(AtkTable* aTable, gint aRow, gint aColumn)
|
|||
static gint
|
||||
getColumnAtIndexCB(AtkTable *aTable, gint aIndex)
|
||||
{
|
||||
nsAccessibleWrap *accWrap = GetAccessibleWrap(ATK_OBJECT(aTable));
|
||||
if (!accWrap)
|
||||
return -1;
|
||||
AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aTable));
|
||||
if (!accWrap)
|
||||
return -1;
|
||||
|
||||
nsCOMPtr<nsIAccessibleTable> accTable;
|
||||
accWrap->QueryInterface(NS_GET_IID(nsIAccessibleTable),
|
||||
|
@ -76,9 +76,9 @@ getColumnAtIndexCB(AtkTable *aTable, gint aIndex)
|
|||
static gint
|
||||
getRowAtIndexCB(AtkTable *aTable, gint aIndex)
|
||||
{
|
||||
nsAccessibleWrap *accWrap = GetAccessibleWrap(ATK_OBJECT(aTable));
|
||||
if (!accWrap)
|
||||
return -1;
|
||||
AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aTable));
|
||||
if (!accWrap)
|
||||
return -1;
|
||||
|
||||
nsCOMPtr<nsIAccessibleTable> accTable;
|
||||
accWrap->QueryInterface(NS_GET_IID(nsIAccessibleTable),
|
||||
|
@ -95,9 +95,9 @@ getRowAtIndexCB(AtkTable *aTable, gint aIndex)
|
|||
static gint
|
||||
getColumnCountCB(AtkTable *aTable)
|
||||
{
|
||||
nsAccessibleWrap *accWrap = GetAccessibleWrap(ATK_OBJECT(aTable));
|
||||
if (!accWrap)
|
||||
return -1;
|
||||
AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aTable));
|
||||
if (!accWrap)
|
||||
return -1;
|
||||
|
||||
nsCOMPtr<nsIAccessibleTable> accTable;
|
||||
accWrap->QueryInterface(NS_GET_IID(nsIAccessibleTable),
|
||||
|
@ -114,9 +114,9 @@ getColumnCountCB(AtkTable *aTable)
|
|||
static gint
|
||||
getRowCountCB(AtkTable *aTable)
|
||||
{
|
||||
nsAccessibleWrap *accWrap = GetAccessibleWrap(ATK_OBJECT(aTable));
|
||||
if (!accWrap)
|
||||
return -1;
|
||||
AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aTable));
|
||||
if (!accWrap)
|
||||
return -1;
|
||||
|
||||
nsCOMPtr<nsIAccessibleTable> accTable;
|
||||
accWrap->QueryInterface(NS_GET_IID(nsIAccessibleTable),
|
||||
|
@ -134,9 +134,9 @@ static gint
|
|||
getColumnExtentAtCB(AtkTable *aTable,
|
||||
gint aRow, gint aColumn)
|
||||
{
|
||||
nsAccessibleWrap *accWrap = GetAccessibleWrap(ATK_OBJECT(aTable));
|
||||
if (!accWrap)
|
||||
return -1;
|
||||
AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aTable));
|
||||
if (!accWrap)
|
||||
return -1;
|
||||
|
||||
nsCOMPtr<nsIAccessibleTable> accTable;
|
||||
accWrap->QueryInterface(NS_GET_IID(nsIAccessibleTable),
|
||||
|
@ -154,9 +154,9 @@ static gint
|
|||
getRowExtentAtCB(AtkTable *aTable,
|
||||
gint aRow, gint aColumn)
|
||||
{
|
||||
nsAccessibleWrap *accWrap = GetAccessibleWrap(ATK_OBJECT(aTable));
|
||||
if (!accWrap)
|
||||
return -1;
|
||||
AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aTable));
|
||||
if (!accWrap)
|
||||
return -1;
|
||||
|
||||
nsCOMPtr<nsIAccessibleTable> accTable;
|
||||
accWrap->QueryInterface(NS_GET_IID(nsIAccessibleTable),
|
||||
|
@ -173,23 +173,23 @@ getRowExtentAtCB(AtkTable *aTable,
|
|||
static AtkObject*
|
||||
getCaptionCB(AtkTable* aTable)
|
||||
{
|
||||
nsAccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aTable));
|
||||
AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aTable));
|
||||
if (!accWrap)
|
||||
return nsnull;
|
||||
|
||||
TableAccessible* table = accWrap->AsTable();
|
||||
NS_ENSURE_TRUE(table, nsnull);
|
||||
|
||||
nsAccessible* caption = table->Caption();
|
||||
return caption ? nsAccessibleWrap::GetAtkObject(caption) : nsnull;
|
||||
Accessible* caption = table->Caption();
|
||||
return caption ? AccessibleWrap::GetAtkObject(caption) : nsnull;
|
||||
}
|
||||
|
||||
static const gchar*
|
||||
getColumnDescriptionCB(AtkTable *aTable, gint aColumn)
|
||||
{
|
||||
nsAccessibleWrap *accWrap = GetAccessibleWrap(ATK_OBJECT(aTable));
|
||||
if (!accWrap)
|
||||
return nsnull;
|
||||
AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aTable));
|
||||
if (!accWrap)
|
||||
return nsnull;
|
||||
|
||||
nsCOMPtr<nsIAccessibleTable> accTable;
|
||||
accWrap->QueryInterface(NS_GET_IID(nsIAccessibleTable),
|
||||
|
@ -200,15 +200,15 @@ getColumnDescriptionCB(AtkTable *aTable, gint aColumn)
|
|||
nsresult rv = accTable->GetColumnDescription(aColumn, autoStr);
|
||||
NS_ENSURE_SUCCESS(rv, nsnull);
|
||||
|
||||
return nsAccessibleWrap::ReturnString(autoStr);
|
||||
return AccessibleWrap::ReturnString(autoStr);
|
||||
}
|
||||
|
||||
static AtkObject*
|
||||
getColumnHeaderCB(AtkTable *aTable, gint aColumn)
|
||||
{
|
||||
nsAccessibleWrap *accWrap = GetAccessibleWrap(ATK_OBJECT(aTable));
|
||||
if (!accWrap)
|
||||
return nsnull;
|
||||
AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aTable));
|
||||
if (!accWrap)
|
||||
return nsnull;
|
||||
|
||||
nsCOMPtr<nsIAccessibleTable> accTable;
|
||||
accWrap->QueryInterface(NS_GET_IID(nsIAccessibleTable),
|
||||
|
@ -223,7 +223,7 @@ getColumnHeaderCB(AtkTable *aTable, gint aColumn)
|
|||
// If the cell at the first row is column header then assume it is column
|
||||
// header for all rows,
|
||||
if (nsAccUtils::Role(accCell) == nsIAccessibleRole::ROLE_COLUMNHEADER)
|
||||
return nsAccessibleWrap::GetAtkObject(accCell);
|
||||
return AccessibleWrap::GetAtkObject(accCell);
|
||||
|
||||
// otherwise get column header for the data cell at the first row.
|
||||
nsCOMPtr<nsIAccessibleTableCell> accTableCell =
|
||||
|
@ -238,7 +238,7 @@ getColumnHeaderCB(AtkTable *aTable, gint aColumn)
|
|||
do_QueryElementAt(headerCells, 0, &rv);
|
||||
NS_ENSURE_SUCCESS(rv, nsnull);
|
||||
|
||||
return nsAccessibleWrap::GetAtkObject(accHeaderCell);
|
||||
return AccessibleWrap::GetAtkObject(accHeaderCell);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -248,9 +248,9 @@ getColumnHeaderCB(AtkTable *aTable, gint aColumn)
|
|||
static const gchar*
|
||||
getRowDescriptionCB(AtkTable *aTable, gint aRow)
|
||||
{
|
||||
nsAccessibleWrap *accWrap = GetAccessibleWrap(ATK_OBJECT(aTable));
|
||||
if (!accWrap)
|
||||
return nsnull;
|
||||
AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aTable));
|
||||
if (!accWrap)
|
||||
return nsnull;
|
||||
|
||||
nsCOMPtr<nsIAccessibleTable> accTable;
|
||||
accWrap->QueryInterface(NS_GET_IID(nsIAccessibleTable),
|
||||
|
@ -261,15 +261,15 @@ getRowDescriptionCB(AtkTable *aTable, gint aRow)
|
|||
nsresult rv = accTable->GetRowDescription(aRow, autoStr);
|
||||
NS_ENSURE_SUCCESS(rv, nsnull);
|
||||
|
||||
return nsAccessibleWrap::ReturnString(autoStr);
|
||||
return AccessibleWrap::ReturnString(autoStr);
|
||||
}
|
||||
|
||||
static AtkObject*
|
||||
getRowHeaderCB(AtkTable *aTable, gint aRow)
|
||||
{
|
||||
nsAccessibleWrap *accWrap = GetAccessibleWrap(ATK_OBJECT(aTable));
|
||||
if (!accWrap)
|
||||
return nsnull;
|
||||
AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aTable));
|
||||
if (!accWrap)
|
||||
return nsnull;
|
||||
|
||||
nsCOMPtr<nsIAccessibleTable> accTable;
|
||||
accWrap->QueryInterface(NS_GET_IID(nsIAccessibleTable),
|
||||
|
@ -284,7 +284,7 @@ getRowHeaderCB(AtkTable *aTable, gint aRow)
|
|||
// If the cell at the first column is row header then assume it is row
|
||||
// header for all columns,
|
||||
if (nsAccUtils::Role(accCell) == nsIAccessibleRole::ROLE_ROWHEADER)
|
||||
return nsAccessibleWrap::GetAtkObject(accCell);
|
||||
return AccessibleWrap::GetAtkObject(accCell);
|
||||
|
||||
// otherwise get row header for the data cell at the first column.
|
||||
nsCOMPtr<nsIAccessibleTableCell> accTableCell =
|
||||
|
@ -299,7 +299,7 @@ getRowHeaderCB(AtkTable *aTable, gint aRow)
|
|||
do_QueryElementAt(headerCells, 0, &rv);
|
||||
NS_ENSURE_SUCCESS(rv, nsnull);
|
||||
|
||||
return nsAccessibleWrap::GetAtkObject(accHeaderCell);
|
||||
return AccessibleWrap::GetAtkObject(accHeaderCell);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -309,19 +309,19 @@ getRowHeaderCB(AtkTable *aTable, gint aRow)
|
|||
static AtkObject*
|
||||
getSummaryCB(AtkTable *aTable)
|
||||
{
|
||||
// Neither html:table nor xul:tree nor ARIA grid/tree have an ability to
|
||||
// link an accessible object to specify a summary. There is closes method
|
||||
// in nsIAccessibleTable::summary to get a summary as a string which is not
|
||||
// mapped directly to ATK.
|
||||
return nsnull;
|
||||
// Neither html:table nor xul:tree nor ARIA grid/tree have an ability to
|
||||
// link an accessible object to specify a summary. There is closes method
|
||||
// in nsIAccessibleTable::summary to get a summary as a string which is not
|
||||
// mapped directly to ATK.
|
||||
return nsnull;
|
||||
}
|
||||
|
||||
static gint
|
||||
getSelectedColumnsCB(AtkTable *aTable, gint **aSelected)
|
||||
{
|
||||
nsAccessibleWrap *accWrap = GetAccessibleWrap(ATK_OBJECT(aTable));
|
||||
if (!accWrap)
|
||||
return 0;
|
||||
AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aTable));
|
||||
if (!accWrap)
|
||||
return 0;
|
||||
|
||||
nsCOMPtr<nsIAccessibleTable> accTable;
|
||||
accWrap->QueryInterface(NS_GET_IID(nsIAccessibleTable),
|
||||
|
@ -354,7 +354,7 @@ getSelectedColumnsCB(AtkTable *aTable, gint **aSelected)
|
|||
static gint
|
||||
getSelectedRowsCB(AtkTable *aTable, gint **aSelected)
|
||||
{
|
||||
nsAccessibleWrap *accWrap = GetAccessibleWrap(ATK_OBJECT(aTable));
|
||||
AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aTable));
|
||||
if (!accWrap)
|
||||
return 0;
|
||||
|
||||
|
@ -389,7 +389,7 @@ getSelectedRowsCB(AtkTable *aTable, gint **aSelected)
|
|||
static gboolean
|
||||
isColumnSelectedCB(AtkTable *aTable, gint aColumn)
|
||||
{
|
||||
nsAccessibleWrap *accWrap = GetAccessibleWrap(ATK_OBJECT(aTable));
|
||||
AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aTable));
|
||||
if (!accWrap)
|
||||
return FALSE;
|
||||
|
||||
|
@ -406,9 +406,9 @@ isColumnSelectedCB(AtkTable *aTable, gint aColumn)
|
|||
static gboolean
|
||||
isRowSelectedCB(AtkTable *aTable, gint aRow)
|
||||
{
|
||||
nsAccessibleWrap *accWrap = GetAccessibleWrap(ATK_OBJECT(aTable));
|
||||
if (!accWrap)
|
||||
return FALSE;
|
||||
AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aTable));
|
||||
if (!accWrap)
|
||||
return FALSE;
|
||||
|
||||
nsCOMPtr<nsIAccessibleTable> accTable;
|
||||
accWrap->QueryInterface(NS_GET_IID(nsIAccessibleTable),
|
||||
|
@ -423,9 +423,9 @@ isRowSelectedCB(AtkTable *aTable, gint aRow)
|
|||
static gboolean
|
||||
isCellSelectedCB(AtkTable *aTable, gint aRow, gint aColumn)
|
||||
{
|
||||
nsAccessibleWrap *accWrap = GetAccessibleWrap(ATK_OBJECT(aTable));
|
||||
if (!accWrap)
|
||||
return FALSE;
|
||||
AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aTable));
|
||||
if (!accWrap)
|
||||
return FALSE;
|
||||
|
||||
nsCOMPtr<nsIAccessibleTable> accTable;
|
||||
accWrap->QueryInterface(NS_GET_IID(nsIAccessibleTable),
|
||||
|
|
|
@ -16,7 +16,7 @@ using namespace mozilla::a11y;
|
|||
AtkAttributeSet* ConvertToAtkAttributeSet(nsIPersistentProperties* aAttributes);
|
||||
|
||||
static void
|
||||
ConvertTexttoAsterisks(nsAccessibleWrap* accWrap, nsAString& aString)
|
||||
ConvertTexttoAsterisks(AccessibleWrap* accWrap, nsAString& aString)
|
||||
{
|
||||
// convert each char to "*" when it's "password text"
|
||||
if (accWrap->NativeRole() == roles::PASSWORD_TEXT) {
|
||||
|
@ -30,9 +30,9 @@ extern "C" {
|
|||
static gchar*
|
||||
getTextCB(AtkText *aText, gint aStartOffset, gint aEndOffset)
|
||||
{
|
||||
nsAccessibleWrap *accWrap = GetAccessibleWrap(ATK_OBJECT(aText));
|
||||
if (!accWrap)
|
||||
return nsnull;
|
||||
AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aText));
|
||||
if (!accWrap)
|
||||
return nsnull;
|
||||
|
||||
nsCOMPtr<nsIAccessibleText> accText;
|
||||
accWrap->QueryInterface(NS_GET_IID(nsIAccessibleText),
|
||||
|
@ -55,9 +55,9 @@ getTextAfterOffsetCB(AtkText *aText, gint aOffset,
|
|||
AtkTextBoundary aBoundaryType,
|
||||
gint *aStartOffset, gint *aEndOffset)
|
||||
{
|
||||
nsAccessibleWrap *accWrap = GetAccessibleWrap(ATK_OBJECT(aText));
|
||||
if (!accWrap)
|
||||
return nsnull;
|
||||
AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aText));
|
||||
if (!accWrap)
|
||||
return nsnull;
|
||||
|
||||
nsCOMPtr<nsIAccessibleText> accText;
|
||||
accWrap->QueryInterface(NS_GET_IID(nsIAccessibleText),
|
||||
|
@ -84,9 +84,9 @@ getTextAtOffsetCB(AtkText *aText, gint aOffset,
|
|||
AtkTextBoundary aBoundaryType,
|
||||
gint *aStartOffset, gint *aEndOffset)
|
||||
{
|
||||
nsAccessibleWrap *accWrap = GetAccessibleWrap(ATK_OBJECT(aText));
|
||||
if (!accWrap)
|
||||
return nsnull;
|
||||
AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aText));
|
||||
if (!accWrap)
|
||||
return nsnull;
|
||||
|
||||
nsCOMPtr<nsIAccessibleText> accText;
|
||||
accWrap->QueryInterface(NS_GET_IID(nsIAccessibleText),
|
||||
|
@ -111,7 +111,7 @@ getTextAtOffsetCB(AtkText *aText, gint aOffset,
|
|||
static gunichar
|
||||
getCharacterAtOffsetCB(AtkText* aText, gint aOffset)
|
||||
{
|
||||
nsAccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aText));
|
||||
AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aText));
|
||||
if (!accWrap)
|
||||
return 0;
|
||||
|
||||
|
@ -139,9 +139,9 @@ getTextBeforeOffsetCB(AtkText *aText, gint aOffset,
|
|||
AtkTextBoundary aBoundaryType,
|
||||
gint *aStartOffset, gint *aEndOffset)
|
||||
{
|
||||
nsAccessibleWrap *accWrap = GetAccessibleWrap(ATK_OBJECT(aText));
|
||||
if (!accWrap)
|
||||
return nsnull;
|
||||
AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aText));
|
||||
if (!accWrap)
|
||||
return nsnull;
|
||||
|
||||
nsCOMPtr<nsIAccessibleText> accText;
|
||||
accWrap->QueryInterface(NS_GET_IID(nsIAccessibleText),
|
||||
|
@ -166,9 +166,9 @@ getTextBeforeOffsetCB(AtkText *aText, gint aOffset,
|
|||
static gint
|
||||
getCaretOffsetCB(AtkText *aText)
|
||||
{
|
||||
nsAccessibleWrap *accWrap = GetAccessibleWrap(ATK_OBJECT(aText));
|
||||
if (!accWrap)
|
||||
return 0;
|
||||
AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aText));
|
||||
if (!accWrap)
|
||||
return 0;
|
||||
|
||||
nsCOMPtr<nsIAccessibleText> accText;
|
||||
accWrap->QueryInterface(NS_GET_IID(nsIAccessibleText),
|
||||
|
@ -185,12 +185,12 @@ getRunAttributesCB(AtkText *aText, gint aOffset,
|
|||
gint *aStartOffset,
|
||||
gint *aEndOffset)
|
||||
{
|
||||
*aStartOffset = -1;
|
||||
*aEndOffset = -1;
|
||||
*aStartOffset = -1;
|
||||
*aEndOffset = -1;
|
||||
|
||||
nsAccessibleWrap *accWrap = GetAccessibleWrap(ATK_OBJECT(aText));
|
||||
if (!accWrap)
|
||||
return nsnull;
|
||||
AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aText));
|
||||
if (!accWrap)
|
||||
return nsnull;
|
||||
|
||||
nsCOMPtr<nsIAccessibleText> accText;
|
||||
accWrap->QueryInterface(NS_GET_IID(nsIAccessibleText),
|
||||
|
@ -213,9 +213,9 @@ getRunAttributesCB(AtkText *aText, gint aOffset,
|
|||
static AtkAttributeSet*
|
||||
getDefaultAttributesCB(AtkText *aText)
|
||||
{
|
||||
nsAccessibleWrap *accWrap = GetAccessibleWrap(ATK_OBJECT(aText));
|
||||
if (!accWrap)
|
||||
return nsnull;
|
||||
AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aText));
|
||||
if (!accWrap)
|
||||
return nsnull;
|
||||
|
||||
nsCOMPtr<nsIAccessibleText> accText;
|
||||
accWrap->QueryInterface(NS_GET_IID(nsIAccessibleText),
|
||||
|
@ -236,9 +236,9 @@ getCharacterExtentsCB(AtkText *aText, gint aOffset,
|
|||
gint *aWidth, gint *aHeight,
|
||||
AtkCoordType aCoords)
|
||||
{
|
||||
nsAccessibleWrap *accWrap = GetAccessibleWrap(ATK_OBJECT(aText));
|
||||
if(!accWrap || !aX || !aY || !aWidth || !aHeight)
|
||||
return;
|
||||
AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aText));
|
||||
if(!accWrap || !aX || !aY || !aWidth || !aHeight)
|
||||
return;
|
||||
|
||||
nsCOMPtr<nsIAccessibleText> accText;
|
||||
accWrap->QueryInterface(NS_GET_IID(nsIAccessibleText),
|
||||
|
@ -273,9 +273,9 @@ static void
|
|||
getRangeExtentsCB(AtkText *aText, gint aStartOffset, gint aEndOffset,
|
||||
AtkCoordType aCoords, AtkTextRectangle *aRect)
|
||||
{
|
||||
nsAccessibleWrap *accWrap = GetAccessibleWrap(ATK_OBJECT(aText));
|
||||
if(!accWrap || !aRect)
|
||||
return;
|
||||
AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aText));
|
||||
if(!accWrap || !aRect)
|
||||
return;
|
||||
|
||||
nsCOMPtr<nsIAccessibleText> accText;
|
||||
accWrap->QueryInterface(NS_GET_IID(nsIAccessibleText),
|
||||
|
@ -310,13 +310,13 @@ getRangeExtentsCB(AtkText *aText, gint aStartOffset, gint aEndOffset,
|
|||
static gint
|
||||
getCharacterCountCB(AtkText *aText)
|
||||
{
|
||||
nsAccessibleWrap *accWrap = GetAccessibleWrap(ATK_OBJECT(aText));
|
||||
if (!accWrap)
|
||||
return 0;
|
||||
AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aText));
|
||||
if (!accWrap)
|
||||
return 0;
|
||||
|
||||
nsHyperTextAccessible* textAcc = accWrap->AsHyperText();
|
||||
return textAcc->IsDefunct() ?
|
||||
0 : static_cast<gint>(textAcc->CharacterCount());
|
||||
nsHyperTextAccessible* textAcc = accWrap->AsHyperText();
|
||||
return textAcc->IsDefunct() ?
|
||||
0 : static_cast<gint>(textAcc->CharacterCount());
|
||||
}
|
||||
|
||||
static gint
|
||||
|
@ -324,9 +324,9 @@ getOffsetAtPointCB(AtkText *aText,
|
|||
gint aX, gint aY,
|
||||
AtkCoordType aCoords)
|
||||
{
|
||||
nsAccessibleWrap *accWrap = GetAccessibleWrap(ATK_OBJECT(aText));
|
||||
if (!accWrap)
|
||||
return -1;
|
||||
AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aText));
|
||||
if (!accWrap)
|
||||
return -1;
|
||||
|
||||
nsCOMPtr<nsIAccessibleText> accText;
|
||||
accWrap->QueryInterface(NS_GET_IID(nsIAccessibleText),
|
||||
|
@ -347,9 +347,9 @@ getOffsetAtPointCB(AtkText *aText,
|
|||
static gint
|
||||
getTextSelectionCountCB(AtkText *aText)
|
||||
{
|
||||
nsAccessibleWrap *accWrap = GetAccessibleWrap(ATK_OBJECT(aText));
|
||||
if (!accWrap)
|
||||
return nsnull;
|
||||
AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aText));
|
||||
if (!accWrap)
|
||||
return nsnull;
|
||||
|
||||
nsCOMPtr<nsIAccessibleText> accText;
|
||||
accWrap->QueryInterface(NS_GET_IID(nsIAccessibleText),
|
||||
|
@ -366,9 +366,9 @@ static gchar*
|
|||
getTextSelectionCB(AtkText *aText, gint aSelectionNum,
|
||||
gint *aStartOffset, gint *aEndOffset)
|
||||
{
|
||||
nsAccessibleWrap *accWrap = GetAccessibleWrap(ATK_OBJECT(aText));
|
||||
if (!accWrap)
|
||||
return nsnull;
|
||||
AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aText));
|
||||
if (!accWrap)
|
||||
return nsnull;
|
||||
|
||||
nsCOMPtr<nsIAccessibleText> accText;
|
||||
accWrap->QueryInterface(NS_GET_IID(nsIAccessibleText),
|
||||
|
@ -393,9 +393,9 @@ addTextSelectionCB(AtkText *aText,
|
|||
gint aStartOffset,
|
||||
gint aEndOffset)
|
||||
{
|
||||
nsAccessibleWrap *accWrap = GetAccessibleWrap(ATK_OBJECT(aText));
|
||||
if (!accWrap)
|
||||
return FALSE;
|
||||
AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aText));
|
||||
if (!accWrap)
|
||||
return FALSE;
|
||||
|
||||
nsCOMPtr<nsIAccessibleText> accText;
|
||||
accWrap->QueryInterface(NS_GET_IID(nsIAccessibleText),
|
||||
|
@ -411,9 +411,9 @@ static gboolean
|
|||
removeTextSelectionCB(AtkText *aText,
|
||||
gint aSelectionNum)
|
||||
{
|
||||
nsAccessibleWrap *accWrap = GetAccessibleWrap(ATK_OBJECT(aText));
|
||||
if (!accWrap)
|
||||
return FALSE;
|
||||
AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aText));
|
||||
if (!accWrap)
|
||||
return FALSE;
|
||||
|
||||
nsCOMPtr<nsIAccessibleText> accText;
|
||||
accWrap->QueryInterface(NS_GET_IID(nsIAccessibleText),
|
||||
|
@ -429,9 +429,9 @@ static gboolean
|
|||
setTextSelectionCB(AtkText *aText, gint aSelectionNum,
|
||||
gint aStartOffset, gint aEndOffset)
|
||||
{
|
||||
nsAccessibleWrap *accWrap = GetAccessibleWrap(ATK_OBJECT(aText));
|
||||
if (!accWrap)
|
||||
return FALSE;
|
||||
AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aText));
|
||||
if (!accWrap)
|
||||
return FALSE;
|
||||
|
||||
nsCOMPtr<nsIAccessibleText> accText;
|
||||
accWrap->QueryInterface(NS_GET_IID(nsIAccessibleText),
|
||||
|
@ -446,9 +446,9 @@ setTextSelectionCB(AtkText *aText, gint aSelectionNum,
|
|||
static gboolean
|
||||
setCaretOffsetCB(AtkText *aText, gint aOffset)
|
||||
{
|
||||
nsAccessibleWrap *accWrap = GetAccessibleWrap(ATK_OBJECT(aText));
|
||||
if (!accWrap)
|
||||
return FALSE;
|
||||
AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aText));
|
||||
if (!accWrap)
|
||||
return FALSE;
|
||||
|
||||
nsCOMPtr<nsIAccessibleText> accText;
|
||||
accWrap->QueryInterface(NS_GET_IID(nsIAccessibleText),
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
#include "InterfaceInitFuncs.h"
|
||||
|
||||
#include "nsAccessibleWrap.h"
|
||||
#include "AccessibleWrap.h"
|
||||
#include "nsMai.h"
|
||||
|
||||
extern "C" {
|
||||
|
@ -14,9 +14,9 @@ extern "C" {
|
|||
static void
|
||||
getCurrentValueCB(AtkValue *obj, GValue *value)
|
||||
{
|
||||
nsAccessibleWrap *accWrap = GetAccessibleWrap(ATK_OBJECT(obj));
|
||||
if (!accWrap)
|
||||
return;
|
||||
AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(obj));
|
||||
if (!accWrap)
|
||||
return;
|
||||
|
||||
nsCOMPtr<nsIAccessibleValue> accValue;
|
||||
accWrap->QueryInterface(NS_GET_IID(nsIAccessibleValue),
|
||||
|
@ -35,9 +35,9 @@ getCurrentValueCB(AtkValue *obj, GValue *value)
|
|||
static void
|
||||
getMaximumValueCB(AtkValue *obj, GValue *value)
|
||||
{
|
||||
nsAccessibleWrap *accWrap = GetAccessibleWrap(ATK_OBJECT(obj));
|
||||
if (!accWrap)
|
||||
return;
|
||||
AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(obj));
|
||||
if (!accWrap)
|
||||
return;
|
||||
|
||||
nsCOMPtr<nsIAccessibleValue> accValue;
|
||||
accWrap->QueryInterface(NS_GET_IID(nsIAccessibleValue),
|
||||
|
@ -56,9 +56,9 @@ getMaximumValueCB(AtkValue *obj, GValue *value)
|
|||
static void
|
||||
getMinimumValueCB(AtkValue *obj, GValue *value)
|
||||
{
|
||||
nsAccessibleWrap *accWrap = GetAccessibleWrap(ATK_OBJECT(obj));
|
||||
if (!accWrap)
|
||||
return;
|
||||
AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(obj));
|
||||
if (!accWrap)
|
||||
return;
|
||||
|
||||
nsCOMPtr<nsIAccessibleValue> accValue;
|
||||
accWrap->QueryInterface(NS_GET_IID(nsIAccessibleValue),
|
||||
|
@ -77,9 +77,9 @@ getMinimumValueCB(AtkValue *obj, GValue *value)
|
|||
static void
|
||||
getMinimumIncrementCB(AtkValue *obj, GValue *minimumIncrement)
|
||||
{
|
||||
nsAccessibleWrap *accWrap = GetAccessibleWrap(ATK_OBJECT(obj));
|
||||
if (!accWrap)
|
||||
return;
|
||||
AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(obj));
|
||||
if (!accWrap)
|
||||
return;
|
||||
|
||||
nsCOMPtr<nsIAccessibleValue> accValue;
|
||||
accWrap->QueryInterface(NS_GET_IID(nsIAccessibleValue),
|
||||
|
@ -98,9 +98,9 @@ getMinimumIncrementCB(AtkValue *obj, GValue *minimumIncrement)
|
|||
static gboolean
|
||||
setCurrentValueCB(AtkValue *obj, const GValue *value)
|
||||
{
|
||||
nsAccessibleWrap *accWrap = GetAccessibleWrap(ATK_OBJECT(obj));
|
||||
if (!accWrap)
|
||||
return FALSE;
|
||||
AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(obj));
|
||||
if (!accWrap)
|
||||
return FALSE;
|
||||
|
||||
nsCOMPtr<nsIAccessibleValue> accValue;
|
||||
accWrap->QueryInterface(NS_GET_IID(nsIAccessibleValue),
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#include <atk/atk.h>
|
||||
#include "nsAccessibleWrap.h"
|
||||
#include "AccessibleWrap.h"
|
||||
|
||||
/******************************************************************************
|
||||
The following nsIAccessible states aren't translated, just ignored:
|
||||
|
|
|
@ -4,14 +4,14 @@
|
|||
|
||||
#include "AccCollector.h"
|
||||
|
||||
#include "nsAccessible.h"
|
||||
#include "Accessible.h"
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// nsAccCollector
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
AccCollector::
|
||||
AccCollector(nsAccessible* aRoot, filters::FilterFuncPtr aFilterFunc) :
|
||||
AccCollector(Accessible* aRoot, filters::FilterFuncPtr aFilterFunc) :
|
||||
mFilterFunc(aFilterFunc), mRoot(aRoot), mRootChildIdx(0)
|
||||
{
|
||||
}
|
||||
|
@ -27,10 +27,10 @@ AccCollector::Count()
|
|||
return mObjects.Length();
|
||||
}
|
||||
|
||||
nsAccessible*
|
||||
Accessible*
|
||||
AccCollector::GetAccessibleAt(PRUint32 aIndex)
|
||||
{
|
||||
nsAccessible *accessible = mObjects.SafeElementAt(aIndex, nsnull);
|
||||
Accessible* accessible = mObjects.SafeElementAt(aIndex, nsnull);
|
||||
if (accessible)
|
||||
return accessible;
|
||||
|
||||
|
@ -38,7 +38,7 @@ AccCollector::GetAccessibleAt(PRUint32 aIndex)
|
|||
}
|
||||
|
||||
PRInt32
|
||||
AccCollector::GetIndexAt(nsAccessible *aAccessible)
|
||||
AccCollector::GetIndexAt(Accessible* aAccessible)
|
||||
{
|
||||
PRInt32 index = mObjects.IndexOf(aAccessible);
|
||||
if (index != -1)
|
||||
|
@ -50,12 +50,12 @@ AccCollector::GetIndexAt(nsAccessible *aAccessible)
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
// nsAccCollector protected
|
||||
|
||||
nsAccessible*
|
||||
Accessible*
|
||||
AccCollector::EnsureNGetObject(PRUint32 aIndex)
|
||||
{
|
||||
PRInt32 childCount = mRoot->GetChildCount();
|
||||
PRUint32 childCount = mRoot->ChildCount();
|
||||
while (mRootChildIdx < childCount) {
|
||||
nsAccessible* child = mRoot->GetChildAt(mRootChildIdx++);
|
||||
Accessible* child = mRoot->GetChildAt(mRootChildIdx++);
|
||||
if (!mFilterFunc(child))
|
||||
continue;
|
||||
|
||||
|
@ -68,11 +68,11 @@ AccCollector::EnsureNGetObject(PRUint32 aIndex)
|
|||
}
|
||||
|
||||
PRInt32
|
||||
AccCollector::EnsureNGetIndex(nsAccessible* aAccessible)
|
||||
AccCollector::EnsureNGetIndex(Accessible* aAccessible)
|
||||
{
|
||||
PRInt32 childCount = mRoot->GetChildCount();
|
||||
PRUint32 childCount = mRoot->ChildCount();
|
||||
while (mRootChildIdx < childCount) {
|
||||
nsAccessible* child = mRoot->GetChildAt(mRootChildIdx++);
|
||||
Accessible* child = mRoot->GetChildAt(mRootChildIdx++);
|
||||
if (!mFilterFunc(child))
|
||||
continue;
|
||||
|
||||
|
@ -85,7 +85,7 @@ AccCollector::EnsureNGetIndex(nsAccessible* aAccessible)
|
|||
}
|
||||
|
||||
void
|
||||
AccCollector::AppendObject(nsAccessible* aAccessible)
|
||||
AccCollector::AppendObject(Accessible* aAccessible)
|
||||
{
|
||||
mObjects.AppendElement(aAccessible);
|
||||
}
|
||||
|
@ -95,7 +95,7 @@ AccCollector::AppendObject(nsAccessible* aAccessible)
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
PRInt32
|
||||
EmbeddedObjCollector::GetIndexAt(nsAccessible *aAccessible)
|
||||
EmbeddedObjCollector::GetIndexAt(Accessible* aAccessible)
|
||||
{
|
||||
if (aAccessible->mParent != mRoot)
|
||||
return -1;
|
||||
|
@ -107,7 +107,7 @@ EmbeddedObjCollector::GetIndexAt(nsAccessible *aAccessible)
|
|||
}
|
||||
|
||||
void
|
||||
EmbeddedObjCollector::AppendObject(nsAccessible* aAccessible)
|
||||
EmbeddedObjCollector::AppendObject(Accessible* aAccessible)
|
||||
{
|
||||
aAccessible->mIndexOfEmbeddedChild = mObjects.Length();
|
||||
mObjects.AppendElement(aAccessible);
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
class AccCollector
|
||||
{
|
||||
public:
|
||||
AccCollector(nsAccessible* aRoot, filters::FilterFuncPtr aFilterFunc);
|
||||
AccCollector(Accessible* aRoot, filters::FilterFuncPtr aFilterFunc);
|
||||
virtual ~AccCollector();
|
||||
|
||||
/**
|
||||
|
@ -28,34 +28,34 @@ public:
|
|||
/**
|
||||
* Return an accessible from the collection at the given index.
|
||||
*/
|
||||
nsAccessible* GetAccessibleAt(PRUint32 aIndex);
|
||||
Accessible* GetAccessibleAt(PRUint32 aIndex);
|
||||
|
||||
/**
|
||||
* Return index of the given accessible within the collection.
|
||||
*/
|
||||
virtual PRInt32 GetIndexAt(nsAccessible* aAccessible);
|
||||
virtual PRInt32 GetIndexAt(Accessible* aAccessible);
|
||||
|
||||
protected:
|
||||
/**
|
||||
* Ensure accessible at the given index is stored and return it.
|
||||
*/
|
||||
nsAccessible* EnsureNGetObject(PRUint32 aIndex);
|
||||
Accessible* EnsureNGetObject(PRUint32 aIndex);
|
||||
|
||||
/**
|
||||
* Ensure index for the given accessible is stored and return it.
|
||||
*/
|
||||
PRInt32 EnsureNGetIndex(nsAccessible* aAccessible);
|
||||
PRInt32 EnsureNGetIndex(Accessible* aAccessible);
|
||||
|
||||
/**
|
||||
* Append the object to collection.
|
||||
*/
|
||||
virtual void AppendObject(nsAccessible* aAccessible);
|
||||
virtual void AppendObject(Accessible* aAccessible);
|
||||
|
||||
filters::FilterFuncPtr mFilterFunc;
|
||||
nsAccessible* mRoot;
|
||||
PRInt32 mRootChildIdx;
|
||||
Accessible* mRoot;
|
||||
PRUint32 mRootChildIdx;
|
||||
|
||||
nsTArray<nsAccessible*> mObjects;
|
||||
nsTArray<Accessible*> mObjects;
|
||||
|
||||
private:
|
||||
AccCollector();
|
||||
|
@ -73,16 +73,16 @@ public:
|
|||
virtual ~EmbeddedObjCollector() { };
|
||||
|
||||
public:
|
||||
virtual PRInt32 GetIndexAt(nsAccessible* aAccessible);
|
||||
virtual PRInt32 GetIndexAt(Accessible* aAccessible);
|
||||
|
||||
protected:
|
||||
// Make sure it's used by nsAccessible class only.
|
||||
EmbeddedObjCollector(nsAccessible* aRoot) :
|
||||
// Make sure it's used by Accessible class only.
|
||||
EmbeddedObjCollector(Accessible* aRoot) :
|
||||
AccCollector(aRoot, filters::GetEmbeddedObject) { }
|
||||
|
||||
virtual void AppendObject(nsAccessible* aAccessible);
|
||||
virtual void AppendObject(Accessible* aAccessible);
|
||||
|
||||
friend class nsAccessible;
|
||||
friend class Accessible;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
#include "ApplicationAccessibleWrap.h"
|
||||
#include "nsAccessibilityService.h"
|
||||
#include "nsAccUtils.h"
|
||||
#include "nsDocAccessible.h"
|
||||
#include "DocAccessible.h"
|
||||
#include "nsIAccessibleText.h"
|
||||
#include "nsAccEvent.h"
|
||||
#include "States.h"
|
||||
|
@ -29,7 +29,7 @@ using namespace mozilla::a11y;
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
// AccEvent constructors
|
||||
|
||||
AccEvent::AccEvent(PRUint32 aEventType, nsAccessible* aAccessible,
|
||||
AccEvent::AccEvent(PRUint32 aEventType, Accessible* aAccessible,
|
||||
EIsFromUserInput aIsFromUserInput, EEventRule aEventRule) :
|
||||
mEventType(aEventType), mEventRule(aEventRule), mAccessible(aAccessible)
|
||||
{
|
||||
|
@ -46,7 +46,7 @@ AccEvent::AccEvent(PRUint32 aEventType, nsINode* aNode,
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
// AccEvent public methods
|
||||
|
||||
nsAccessible *
|
||||
Accessible*
|
||||
AccEvent::GetAccessible()
|
||||
{
|
||||
if (!mAccessible)
|
||||
|
@ -64,7 +64,7 @@ AccEvent::GetNode()
|
|||
return mNode;
|
||||
}
|
||||
|
||||
nsDocAccessible*
|
||||
DocAccessible*
|
||||
AccEvent::GetDocAccessible()
|
||||
{
|
||||
if (mAccessible)
|
||||
|
@ -105,11 +105,11 @@ NS_IMPL_CYCLE_COLLECTION_UNROOT_NATIVE(AccEvent, Release)
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
// AccEvent protected methods
|
||||
|
||||
nsAccessible*
|
||||
Accessible*
|
||||
AccEvent::GetAccessibleForNode() const
|
||||
{
|
||||
if (mNode) {
|
||||
nsDocAccessible* document =
|
||||
DocAccessible* document =
|
||||
GetAccService()->GetDocAccessible(mNode->OwnerDoc());
|
||||
if (document)
|
||||
return document->GetAccessible(mNode);
|
||||
|
@ -168,7 +168,7 @@ AccEvent::CaptureIsFromUserInput(EIsFromUserInput aIsFromUserInput)
|
|||
// support correct state change coalescence (XXX Bug 569356). Also we need to
|
||||
// decide how to coalesce events created via accessible (instead of node).
|
||||
AccStateChangeEvent::
|
||||
AccStateChangeEvent(nsAccessible* aAccessible, PRUint64 aState,
|
||||
AccStateChangeEvent(Accessible* aAccessible, PRUint64 aState,
|
||||
bool aIsEnabled, EIsFromUserInput aIsFromUserInput):
|
||||
AccEvent(nsIAccessibleEvent::EVENT_STATE_CHANGE, aAccessible,
|
||||
aIsFromUserInput, eAllowDupes),
|
||||
|
@ -193,7 +193,7 @@ AccStateChangeEvent::
|
|||
// Use GetAccessibleForNode() because we do not want to store an accessible
|
||||
// since it leads to problems with delayed events in the case when
|
||||
// an accessible gets reorder event before delayed event is processed.
|
||||
nsAccessible *accessible = GetAccessibleForNode();
|
||||
Accessible* accessible = GetAccessibleForNode();
|
||||
mIsEnabled = accessible && ((accessible->State() & mState) != 0);
|
||||
}
|
||||
|
||||
|
@ -211,7 +211,7 @@ AccStateChangeEvent::CreateXPCOMObject()
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// Note: we pass in eAllowDupes to the base class because we don't support text
|
||||
// events coalescence. We fire delayed text change events in nsDocAccessible but
|
||||
// events coalescence. We fire delayed text change events in DocAccessible but
|
||||
// we continue to base the event off the accessible object rather than just the
|
||||
// node. This means we won't try to create an accessible based on the node when
|
||||
// we are ready to fire the event and so we will no longer assert at that point
|
||||
|
@ -219,7 +219,7 @@ AccStateChangeEvent::CreateXPCOMObject()
|
|||
// a defunct accessible so the behaviour should be equivalent.
|
||||
// XXX revisit this when coalescence is faster (eCoalesceFromSameSubtree)
|
||||
AccTextChangeEvent::
|
||||
AccTextChangeEvent(nsAccessible* aAccessible, PRInt32 aStart,
|
||||
AccTextChangeEvent(Accessible* aAccessible, PRInt32 aStart,
|
||||
const nsAString& aModifiedText, bool aIsInserted,
|
||||
EIsFromUserInput aIsFromUserInput)
|
||||
: AccEvent(aIsInserted ?
|
||||
|
@ -250,7 +250,7 @@ AccTextChangeEvent::CreateXPCOMObject()
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
AccMutationEvent::
|
||||
AccMutationEvent(PRUint32 aEventType, nsAccessible* aTarget,
|
||||
AccMutationEvent(PRUint32 aEventType, Accessible* aTarget,
|
||||
nsINode* aTargetNode) :
|
||||
AccEvent(aEventType, aTarget, eAutoDetect, eCoalesceFromSameSubtree)
|
||||
{
|
||||
|
@ -263,7 +263,7 @@ AccMutationEvent::
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
AccHideEvent::
|
||||
AccHideEvent(nsAccessible* aTarget, nsINode* aTargetNode) :
|
||||
AccHideEvent(Accessible* aTarget, nsINode* aTargetNode) :
|
||||
AccMutationEvent(::nsIAccessibleEvent::EVENT_HIDE, aTarget, aTargetNode)
|
||||
{
|
||||
mParent = mAccessible->Parent();
|
||||
|
@ -285,7 +285,7 @@ AccHideEvent::CreateXPCOMObject()
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
AccShowEvent::
|
||||
AccShowEvent(nsAccessible* aTarget, nsINode* aTargetNode) :
|
||||
AccShowEvent(Accessible* aTarget, nsINode* aTargetNode) :
|
||||
AccMutationEvent(::nsIAccessibleEvent::EVENT_SHOW, aTarget, aTargetNode)
|
||||
{
|
||||
}
|
||||
|
@ -296,7 +296,7 @@ AccShowEvent::
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
AccCaretMoveEvent::
|
||||
AccCaretMoveEvent(nsAccessible* aAccessible, PRInt32 aCaretOffset) :
|
||||
AccCaretMoveEvent(Accessible* aAccessible, PRInt32 aCaretOffset) :
|
||||
AccEvent(::nsIAccessibleEvent::EVENT_TEXT_CARET_MOVED, aAccessible),
|
||||
mCaretOffset(aCaretOffset)
|
||||
{
|
||||
|
@ -323,7 +323,7 @@ AccCaretMoveEvent::CreateXPCOMObject()
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
AccSelChangeEvent::
|
||||
AccSelChangeEvent(nsAccessible* aWidget, nsAccessible* aItem,
|
||||
AccSelChangeEvent(Accessible* aWidget, Accessible* aItem,
|
||||
SelChangeType aSelChangeType) :
|
||||
AccEvent(0, aItem, eAutoDetect, eCoalesceSelectionChange),
|
||||
mWidget(aWidget), mItem(aItem), mSelChangeType(aSelChangeType),
|
||||
|
@ -345,7 +345,7 @@ AccSelChangeEvent::
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
AccTableChangeEvent::
|
||||
AccTableChangeEvent(nsAccessible* aAccessible, PRUint32 aEventType,
|
||||
AccTableChangeEvent(Accessible* aAccessible, PRUint32 aEventType,
|
||||
PRInt32 aRowOrColIndex, PRInt32 aNumRowsOrCols) :
|
||||
AccEvent(aEventType, aAccessible),
|
||||
mRowOrColIndex(aRowOrColIndex), mNumRowsOrCols(aNumRowsOrCols)
|
||||
|
@ -366,7 +366,7 @@ AccTableChangeEvent::CreateXPCOMObject()
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
AccVCChangeEvent::
|
||||
AccVCChangeEvent(nsAccessible* aAccessible,
|
||||
AccVCChangeEvent(Accessible* aAccessible,
|
||||
nsIAccessible* aOldAccessible,
|
||||
PRInt32 aOldStart, PRInt32 aOldEnd) :
|
||||
AccEvent(::nsIAccessibleEvent::EVENT_VIRTUALCURSOR_CHANGED, aAccessible),
|
||||
|
|
|
@ -8,10 +8,10 @@
|
|||
|
||||
#include "nsIAccessibleEvent.h"
|
||||
|
||||
#include "nsAccessible.h"
|
||||
#include "Accessible.h"
|
||||
|
||||
class nsAccEvent;
|
||||
class nsDocAccessible;
|
||||
class DocAccessible;
|
||||
|
||||
// Constants used to point whether the event is from user input.
|
||||
enum EIsFromUserInput
|
||||
|
@ -59,7 +59,7 @@ public:
|
|||
};
|
||||
|
||||
// Initialize with an nsIAccessible
|
||||
AccEvent(PRUint32 aEventType, nsAccessible* aAccessible,
|
||||
AccEvent(PRUint32 aEventType, Accessible* aAccessible,
|
||||
EIsFromUserInput aIsFromUserInput = eAutoDetect,
|
||||
EEventRule aEventRule = eRemoveDupes);
|
||||
// Initialize with an nsIDOMNode
|
||||
|
@ -73,8 +73,8 @@ public:
|
|||
EEventRule GetEventRule() const { return mEventRule; }
|
||||
bool IsFromUserInput() const { return mIsFromUserInput; }
|
||||
|
||||
nsAccessible *GetAccessible();
|
||||
nsDocAccessible* GetDocAccessible();
|
||||
Accessible* GetAccessible();
|
||||
DocAccessible* GetDocAccessible();
|
||||
nsINode* GetNode();
|
||||
|
||||
/**
|
||||
|
@ -114,7 +114,7 @@ protected:
|
|||
/**
|
||||
* Get an accessible from event target node.
|
||||
*/
|
||||
nsAccessible *GetAccessibleForNode() const;
|
||||
Accessible* GetAccessibleForNode() const;
|
||||
|
||||
/**
|
||||
* Determine whether the event is from user input by event state manager if
|
||||
|
@ -125,7 +125,7 @@ protected:
|
|||
bool mIsFromUserInput;
|
||||
PRUint32 mEventType;
|
||||
EEventRule mEventRule;
|
||||
nsRefPtr<nsAccessible> mAccessible;
|
||||
nsRefPtr<Accessible> mAccessible;
|
||||
nsCOMPtr<nsINode> mNode;
|
||||
|
||||
friend class NotificationController;
|
||||
|
@ -138,7 +138,7 @@ protected:
|
|||
class AccStateChangeEvent: public AccEvent
|
||||
{
|
||||
public:
|
||||
AccStateChangeEvent(nsAccessible* aAccessible, PRUint64 aState,
|
||||
AccStateChangeEvent(Accessible* aAccessible, PRUint64 aState,
|
||||
bool aIsEnabled,
|
||||
EIsFromUserInput aIsFromUserInput = eAutoDetect);
|
||||
|
||||
|
@ -171,7 +171,7 @@ private:
|
|||
class AccTextChangeEvent: public AccEvent
|
||||
{
|
||||
public:
|
||||
AccTextChangeEvent(nsAccessible* aAccessible, PRInt32 aStart,
|
||||
AccTextChangeEvent(Accessible* aAccessible, PRInt32 aStart,
|
||||
const nsAString& aModifiedText, bool aIsInserted,
|
||||
EIsFromUserInput aIsFromUserInput = eAutoDetect);
|
||||
|
||||
|
@ -206,7 +206,7 @@ private:
|
|||
class AccMutationEvent: public AccEvent
|
||||
{
|
||||
public:
|
||||
AccMutationEvent(PRUint32 aEventType, nsAccessible* aTarget,
|
||||
AccMutationEvent(PRUint32 aEventType, Accessible* aTarget,
|
||||
nsINode* aTargetNode);
|
||||
|
||||
// Event
|
||||
|
@ -233,7 +233,7 @@ protected:
|
|||
class AccHideEvent: public AccMutationEvent
|
||||
{
|
||||
public:
|
||||
AccHideEvent(nsAccessible* aTarget, nsINode* aTargetNode);
|
||||
AccHideEvent(Accessible* aTarget, nsINode* aTargetNode);
|
||||
|
||||
// Event
|
||||
virtual already_AddRefed<nsAccEvent> CreateXPCOMObject();
|
||||
|
@ -245,14 +245,14 @@ public:
|
|||
}
|
||||
|
||||
// AccHideEvent
|
||||
nsAccessible* TargetParent() const { return mParent; }
|
||||
nsAccessible* TargetNextSibling() const { return mNextSibling; }
|
||||
nsAccessible* TargetPrevSibling() const { return mPrevSibling; }
|
||||
Accessible* TargetParent() const { return mParent; }
|
||||
Accessible* TargetNextSibling() const { return mNextSibling; }
|
||||
Accessible* TargetPrevSibling() const { return mPrevSibling; }
|
||||
|
||||
protected:
|
||||
nsRefPtr<nsAccessible> mParent;
|
||||
nsRefPtr<nsAccessible> mNextSibling;
|
||||
nsRefPtr<nsAccessible> mPrevSibling;
|
||||
nsRefPtr<Accessible> mParent;
|
||||
nsRefPtr<Accessible> mNextSibling;
|
||||
nsRefPtr<Accessible> mPrevSibling;
|
||||
|
||||
friend class NotificationController;
|
||||
};
|
||||
|
@ -264,7 +264,7 @@ protected:
|
|||
class AccShowEvent: public AccMutationEvent
|
||||
{
|
||||
public:
|
||||
AccShowEvent(nsAccessible* aTarget, nsINode* aTargetNode);
|
||||
AccShowEvent(Accessible* aTarget, nsINode* aTargetNode);
|
||||
|
||||
// Event
|
||||
static const EventGroup kEventGroup = eShowEvent;
|
||||
|
@ -281,7 +281,7 @@ public:
|
|||
class AccCaretMoveEvent: public AccEvent
|
||||
{
|
||||
public:
|
||||
AccCaretMoveEvent(nsAccessible* aAccessible, PRInt32 aCaretOffset);
|
||||
AccCaretMoveEvent(Accessible* aAccessible, PRInt32 aCaretOffset);
|
||||
AccCaretMoveEvent(nsINode* aNode);
|
||||
|
||||
// AccEvent
|
||||
|
@ -312,7 +312,7 @@ public:
|
|||
eSelectionRemove
|
||||
};
|
||||
|
||||
AccSelChangeEvent(nsAccessible* aWidget, nsAccessible* aItem,
|
||||
AccSelChangeEvent(Accessible* aWidget, Accessible* aItem,
|
||||
SelChangeType aSelChangeType);
|
||||
|
||||
virtual ~AccSelChangeEvent() { }
|
||||
|
@ -325,11 +325,11 @@ public:
|
|||
}
|
||||
|
||||
// AccSelChangeEvent
|
||||
nsAccessible* Widget() const { return mWidget; }
|
||||
Accessible* Widget() const { return mWidget; }
|
||||
|
||||
private:
|
||||
nsRefPtr<nsAccessible> mWidget;
|
||||
nsRefPtr<nsAccessible> mItem;
|
||||
nsRefPtr<Accessible> mWidget;
|
||||
nsRefPtr<Accessible> mItem;
|
||||
SelChangeType mSelChangeType;
|
||||
PRUint32 mPreceedingCount;
|
||||
AccSelChangeEvent* mPackedEvent;
|
||||
|
@ -344,7 +344,7 @@ private:
|
|||
class AccTableChangeEvent : public AccEvent
|
||||
{
|
||||
public:
|
||||
AccTableChangeEvent(nsAccessible* aAccessible, PRUint32 aEventType,
|
||||
AccTableChangeEvent(Accessible* aAccessible, PRUint32 aEventType,
|
||||
PRInt32 aRowOrColIndex, PRInt32 aNumRowsOrCols);
|
||||
|
||||
// AccEvent
|
||||
|
@ -371,7 +371,7 @@ private:
|
|||
class AccVCChangeEvent : public AccEvent
|
||||
{
|
||||
public:
|
||||
AccVCChangeEvent(nsAccessible* aAccessible,
|
||||
AccVCChangeEvent(Accessible* aAccessible,
|
||||
nsIAccessible* aOldAccessible,
|
||||
PRInt32 aOldStart, PRInt32 aOldEnd);
|
||||
|
||||
|
|
|
@ -9,17 +9,18 @@
|
|||
|
||||
using namespace mozilla::a11y;
|
||||
|
||||
AccGroupInfo::AccGroupInfo(nsAccessible* aItem, role aRole) :
|
||||
AccGroupInfo::AccGroupInfo(Accessible* aItem, role aRole) :
|
||||
mPosInSet(0), mSetSize(0), mParent(nsnull)
|
||||
{
|
||||
MOZ_COUNT_CTOR(AccGroupInfo);
|
||||
nsAccessible* parent = aItem->Parent();
|
||||
Accessible* parent = aItem->Parent();
|
||||
if (!parent)
|
||||
return;
|
||||
|
||||
PRInt32 indexInParent = aItem->IndexInParent();
|
||||
PRInt32 siblingCount = parent->GetChildCount();
|
||||
if (siblingCount < indexInParent) {
|
||||
PRUint32 siblingCount = parent->ChildCount();
|
||||
if (indexInParent == -1 ||
|
||||
indexInParent >= static_cast<PRInt32>(siblingCount)) {
|
||||
NS_ERROR("Wrong index in parent! Tree invalidation problem.");
|
||||
return;
|
||||
}
|
||||
|
@ -28,8 +29,8 @@ AccGroupInfo::AccGroupInfo(nsAccessible* aItem, role aRole) :
|
|||
|
||||
// Compute position in set.
|
||||
mPosInSet = 1;
|
||||
for (PRInt32 idx = indexInParent - 1; idx >=0 ; idx--) {
|
||||
nsAccessible* sibling = parent->GetChildAt(idx);
|
||||
for (PRInt32 idx = indexInParent - 1; idx >= 0 ; idx--) {
|
||||
Accessible* sibling = parent->GetChildAt(idx);
|
||||
roles::Role siblingRole = sibling->Role();
|
||||
|
||||
// If the sibling is separator then the group is ended.
|
||||
|
@ -69,8 +70,8 @@ AccGroupInfo::AccGroupInfo(nsAccessible* aItem, role aRole) :
|
|||
// Compute set size.
|
||||
mSetSize = mPosInSet;
|
||||
|
||||
for (PRInt32 idx = indexInParent + 1; idx < siblingCount; idx++) {
|
||||
nsAccessible* sibling = parent->GetChildAt(idx);
|
||||
for (PRUint32 idx = indexInParent + 1; idx < siblingCount; idx++) {
|
||||
Accessible* sibling = parent->GetChildAt(idx);
|
||||
|
||||
roles::Role siblingRole = sibling->Role();
|
||||
|
||||
|
@ -116,7 +117,7 @@ AccGroupInfo::AccGroupInfo(nsAccessible* aItem, role aRole) :
|
|||
if (parentRole != roles::GROUPING || aRole != roles::OUTLINEITEM)
|
||||
return;
|
||||
|
||||
nsAccessible* parentPrevSibling = parent->PrevSibling();
|
||||
Accessible* parentPrevSibling = parent->PrevSibling();
|
||||
if (!parentPrevSibling)
|
||||
return;
|
||||
|
||||
|
|
|
@ -14,17 +14,17 @@
|
|||
class AccGroupInfo
|
||||
{
|
||||
public:
|
||||
AccGroupInfo(nsAccessible* aItem, mozilla::a11y::role aRole);
|
||||
AccGroupInfo(Accessible* aItem, mozilla::a11y::role aRole);
|
||||
~AccGroupInfo() { MOZ_COUNT_DTOR(AccGroupInfo); }
|
||||
|
||||
PRInt32 PosInSet() const { return mPosInSet; }
|
||||
PRUint32 SetSize() const { return mSetSize; }
|
||||
nsAccessible* ConceptualParent() const { return mParent; }
|
||||
Accessible* ConceptualParent() const { return mParent; }
|
||||
|
||||
/**
|
||||
* Create group info.
|
||||
*/
|
||||
static AccGroupInfo* CreateGroupInfo(nsAccessible* aAccessible)
|
||||
static AccGroupInfo* CreateGroupInfo(Accessible* aAccessible)
|
||||
{
|
||||
mozilla::a11y::role role = aAccessible->Role();
|
||||
if (role != mozilla::a11y::roles::ROW &&
|
||||
|
@ -73,7 +73,7 @@ private:
|
|||
|
||||
PRUint32 mPosInSet;
|
||||
PRUint32 mSetSize;
|
||||
nsAccessible* mParent;
|
||||
Accessible* mParent;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
#include "AccIterator.h"
|
||||
|
||||
#include "nsAccessibilityService.h"
|
||||
#include "nsAccessible.h"
|
||||
#include "Accessible.h"
|
||||
|
||||
#include "mozilla/dom/Element.h"
|
||||
#include "nsBindingManager.h"
|
||||
|
@ -16,7 +16,7 @@ using namespace mozilla;
|
|||
// AccIterator
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
AccIterator::AccIterator(nsAccessible *aAccessible,
|
||||
AccIterator::AccIterator(Accessible* aAccessible,
|
||||
filters::FilterFuncPtr aFilterFunc,
|
||||
IterationType aIterationType) :
|
||||
mFilterFunc(aFilterFunc), mIsDeep(aIterationType != eFlatNav)
|
||||
|
@ -33,11 +33,11 @@ AccIterator::~AccIterator()
|
|||
}
|
||||
}
|
||||
|
||||
nsAccessible*
|
||||
Accessible*
|
||||
AccIterator::Next()
|
||||
{
|
||||
while (mState) {
|
||||
nsAccessible *child = mState->mParent->GetChildAt(mState->mIndex++);
|
||||
Accessible* child = mState->mParent->GetChildAt(mState->mIndex++);
|
||||
if (!child) {
|
||||
IteratorState *tmp = mState;
|
||||
mState = mState->mParentState;
|
||||
|
@ -62,7 +62,7 @@ AccIterator::Next()
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
// nsAccIterator::IteratorState
|
||||
|
||||
AccIterator::IteratorState::IteratorState(nsAccessible *aParent,
|
||||
AccIterator::IteratorState::IteratorState(Accessible* aParent,
|
||||
IteratorState *mParentState) :
|
||||
mParent(aParent), mIndex(0), mParentState(mParentState)
|
||||
{
|
||||
|
@ -74,7 +74,7 @@ AccIterator::IteratorState::IteratorState(nsAccessible *aParent,
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
RelatedAccIterator::
|
||||
RelatedAccIterator(nsDocAccessible* aDocument, nsIContent* aDependentContent,
|
||||
RelatedAccIterator(DocAccessible* aDocument, nsIContent* aDependentContent,
|
||||
nsIAtom* aRelAttr) :
|
||||
mDocument(aDocument), mRelAttr(aRelAttr), mProviders(nsnull),
|
||||
mBindingParent(nsnull), mIndex(0)
|
||||
|
@ -88,14 +88,14 @@ RelatedAccIterator::
|
|||
mProviders = mDocument->mDependentIDsHash.Get(id);
|
||||
}
|
||||
|
||||
nsAccessible*
|
||||
Accessible*
|
||||
RelatedAccIterator::Next()
|
||||
{
|
||||
if (!mProviders)
|
||||
return nsnull;
|
||||
|
||||
while (mIndex < mProviders->Length()) {
|
||||
nsDocAccessible::AttrRelProvider* provider = (*mProviders)[mIndex++];
|
||||
DocAccessible::AttrRelProvider* provider = (*mProviders)[mIndex++];
|
||||
|
||||
// Return related accessible for the given attribute and if the provider
|
||||
// content is in the same binding in the case of XBL usage.
|
||||
|
@ -105,7 +105,7 @@ RelatedAccIterator::Next()
|
|||
mBindingParent == provider->mContent;
|
||||
|
||||
if (inScope) {
|
||||
nsAccessible* related = mDocument->GetAccessible(provider->mContent);
|
||||
Accessible* related = mDocument->GetAccessible(provider->mContent);
|
||||
if (related)
|
||||
return related;
|
||||
|
||||
|
@ -126,19 +126,19 @@ RelatedAccIterator::Next()
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
HTMLLabelIterator::
|
||||
HTMLLabelIterator(nsDocAccessible* aDocument, const nsAccessible* aAccessible,
|
||||
HTMLLabelIterator(DocAccessible* aDocument, const Accessible* aAccessible,
|
||||
LabelFilter aFilter) :
|
||||
mRelIter(aDocument, aAccessible->GetContent(), nsGkAtoms::_for),
|
||||
mAcc(aAccessible), mLabelFilter(aFilter)
|
||||
{
|
||||
}
|
||||
|
||||
nsAccessible*
|
||||
Accessible*
|
||||
HTMLLabelIterator::Next()
|
||||
{
|
||||
// Get either <label for="[id]"> element which explicitly points to given
|
||||
// element, or <label> ancestor which implicitly point to it.
|
||||
nsAccessible* label = nsnull;
|
||||
Accessible* label = nsnull;
|
||||
while ((label = mRelIter.Next())) {
|
||||
if (label->GetContent()->Tag() == nsGkAtoms::label)
|
||||
return label;
|
||||
|
@ -151,7 +151,7 @@ HTMLLabelIterator::Next()
|
|||
// Go up tree to get a name of ancestor label if there is one (an ancestor
|
||||
// <label> implicitly points to us). Don't go up farther than form or
|
||||
// document.
|
||||
nsAccessible* walkUp = mAcc->Parent();
|
||||
Accessible* walkUp = mAcc->Parent();
|
||||
while (walkUp && !walkUp->IsDoc()) {
|
||||
nsIContent* walkUpElm = walkUp->GetContent();
|
||||
if (walkUpElm->IsHTML()) {
|
||||
|
@ -177,15 +177,15 @@ HTMLLabelIterator::Next()
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
HTMLOutputIterator::
|
||||
HTMLOutputIterator(nsDocAccessible* aDocument, nsIContent* aElement) :
|
||||
HTMLOutputIterator(DocAccessible* aDocument, nsIContent* aElement) :
|
||||
mRelIter(aDocument, aElement, nsGkAtoms::_for)
|
||||
{
|
||||
}
|
||||
|
||||
nsAccessible*
|
||||
Accessible*
|
||||
HTMLOutputIterator::Next()
|
||||
{
|
||||
nsAccessible* output = nsnull;
|
||||
Accessible* output = nsnull;
|
||||
while ((output = mRelIter.Next())) {
|
||||
if (output->GetContent()->Tag() == nsGkAtoms::output)
|
||||
return output;
|
||||
|
@ -200,15 +200,15 @@ HTMLOutputIterator::Next()
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
XULLabelIterator::
|
||||
XULLabelIterator(nsDocAccessible* aDocument, nsIContent* aElement) :
|
||||
XULLabelIterator(DocAccessible* aDocument, nsIContent* aElement) :
|
||||
mRelIter(aDocument, aElement, nsGkAtoms::control)
|
||||
{
|
||||
}
|
||||
|
||||
nsAccessible*
|
||||
Accessible*
|
||||
XULLabelIterator::Next()
|
||||
{
|
||||
nsAccessible* label = nsnull;
|
||||
Accessible* label = nsnull;
|
||||
while ((label = mRelIter.Next())) {
|
||||
if (label->GetContent()->Tag() == nsGkAtoms::label)
|
||||
return label;
|
||||
|
@ -223,15 +223,15 @@ XULLabelIterator::Next()
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
XULDescriptionIterator::
|
||||
XULDescriptionIterator(nsDocAccessible* aDocument, nsIContent* aElement) :
|
||||
XULDescriptionIterator(DocAccessible* aDocument, nsIContent* aElement) :
|
||||
mRelIter(aDocument, aElement, nsGkAtoms::control)
|
||||
{
|
||||
}
|
||||
|
||||
nsAccessible*
|
||||
Accessible*
|
||||
XULDescriptionIterator::Next()
|
||||
{
|
||||
nsAccessible* descr = nsnull;
|
||||
Accessible* descr = nsnull;
|
||||
while ((descr = mRelIter.Next())) {
|
||||
if (descr->GetContent()->Tag() == nsGkAtoms::description)
|
||||
return descr;
|
||||
|
@ -245,7 +245,7 @@ XULDescriptionIterator::Next()
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
IDRefsIterator::
|
||||
IDRefsIterator(nsDocAccessible* aDoc, nsIContent* aContent,
|
||||
IDRefsIterator(DocAccessible* aDoc, nsIContent* aContent,
|
||||
nsIAtom* aIDRefsAttr) :
|
||||
mContent(aContent), mDoc(aDoc), mCurrIdx(0)
|
||||
{
|
||||
|
@ -302,48 +302,37 @@ IDRefsIterator::GetElem(const nsDependentSubstring& aID)
|
|||
|
||||
// If content is in anonymous subtree or an element having anonymous subtree
|
||||
// then use "anonid" attribute to get elements in anonymous subtree.
|
||||
nsCOMPtr<nsIDOMElement> refDOMElm;
|
||||
nsCOMPtr<nsIDOMDocumentXBL> xblDocument =
|
||||
do_QueryInterface(mContent->OwnerDoc());
|
||||
|
||||
// Check inside the binding the element is contained in.
|
||||
nsIContent* bindingParent = mContent->GetBindingParent();
|
||||
if (bindingParent) {
|
||||
nsCOMPtr<nsIDOMElement> bindingParentElm = do_QueryInterface(bindingParent);
|
||||
xblDocument->GetAnonymousElementByAttribute(bindingParentElm,
|
||||
NS_LITERAL_STRING("anonid"),
|
||||
aID,
|
||||
getter_AddRefs(refDOMElm));
|
||||
nsCOMPtr<dom::Element> refElm = do_QueryInterface(refDOMElm);
|
||||
nsIContent* refElm = bindingParent->OwnerDoc()->
|
||||
GetAnonymousElementByAttribute(bindingParent, nsGkAtoms::anonid, aID);
|
||||
|
||||
if (refElm)
|
||||
return refElm;
|
||||
}
|
||||
|
||||
// Check inside the binding of the element.
|
||||
if (mContent->OwnerDoc()->BindingManager()->GetBinding(mContent)) {
|
||||
nsCOMPtr<nsIDOMElement> elm = do_QueryInterface(mContent);
|
||||
xblDocument->GetAnonymousElementByAttribute(elm,
|
||||
NS_LITERAL_STRING("anonid"),
|
||||
aID,
|
||||
getter_AddRefs(refDOMElm));
|
||||
nsCOMPtr<dom::Element> refElm = do_QueryInterface(refDOMElm);
|
||||
return refElm;
|
||||
return mContent->OwnerDoc()->
|
||||
GetAnonymousElementByAttribute(mContent, nsGkAtoms::anonid, aID);
|
||||
}
|
||||
|
||||
return nsnull;
|
||||
}
|
||||
|
||||
nsAccessible*
|
||||
Accessible*
|
||||
IDRefsIterator::Next()
|
||||
{
|
||||
nsIContent* nextElm = NextElem();
|
||||
return nextElm ? mDoc->GetAccessible(nextElm) : nsnull;
|
||||
}
|
||||
|
||||
nsAccessible*
|
||||
Accessible*
|
||||
SingleAccIterator::Next()
|
||||
{
|
||||
nsRefPtr<nsAccessible> nextAcc;
|
||||
nsRefPtr<Accessible> nextAcc;
|
||||
mAcc.swap(nextAcc);
|
||||
return (nextAcc && !nextAcc->IsDefunct()) ? nextAcc : nsnull;
|
||||
}
|
||||
|
|
|
@ -10,9 +10,7 @@
|
|||
#include "nsAccessibilityService.h"
|
||||
#include "filters.h"
|
||||
#include "nscore.h"
|
||||
#include "nsDocAccessible.h"
|
||||
|
||||
#include "nsIDOMDocumentXBL.h"
|
||||
#include "DocAccessible.h"
|
||||
|
||||
/**
|
||||
* AccIterable is a basic interface for iterators over accessibles.
|
||||
|
@ -21,7 +19,7 @@ class AccIterable
|
|||
{
|
||||
public:
|
||||
virtual ~AccIterable() { }
|
||||
virtual nsAccessible* Next() = 0;
|
||||
virtual Accessible* Next() = 0;
|
||||
|
||||
private:
|
||||
friend class Relation;
|
||||
|
@ -51,7 +49,7 @@ public:
|
|||
eTreeNav
|
||||
};
|
||||
|
||||
AccIterator(nsAccessible* aRoot, filters::FilterFuncPtr aFilterFunc,
|
||||
AccIterator(Accessible* aRoot, filters::FilterFuncPtr aFilterFunc,
|
||||
IterationType aIterationType = eFlatNav);
|
||||
virtual ~AccIterator();
|
||||
|
||||
|
@ -59,7 +57,7 @@ public:
|
|||
* Return next accessible complying with filter function. Return the first
|
||||
* accessible for the first time.
|
||||
*/
|
||||
virtual nsAccessible *Next();
|
||||
virtual Accessible* Next();
|
||||
|
||||
private:
|
||||
AccIterator();
|
||||
|
@ -68,9 +66,9 @@ private:
|
|||
|
||||
struct IteratorState
|
||||
{
|
||||
IteratorState(nsAccessible *aParent, IteratorState *mParentState = nsnull);
|
||||
IteratorState(Accessible* aParent, IteratorState* mParentState = nsnull);
|
||||
|
||||
nsAccessible *mParent;
|
||||
Accessible* mParent;
|
||||
PRInt32 mIndex;
|
||||
IteratorState *mParentState;
|
||||
};
|
||||
|
@ -98,7 +96,7 @@ public:
|
|||
* @param aRelAttr [in] relation attribute that relations are
|
||||
* pointed by
|
||||
*/
|
||||
RelatedAccIterator(nsDocAccessible* aDocument, nsIContent* aDependentContent,
|
||||
RelatedAccIterator(DocAccessible* aDocument, nsIContent* aDependentContent,
|
||||
nsIAtom* aRelAttr);
|
||||
|
||||
virtual ~RelatedAccIterator() { }
|
||||
|
@ -106,16 +104,16 @@ public:
|
|||
/**
|
||||
* Return next related accessible for the given dependent accessible.
|
||||
*/
|
||||
virtual nsAccessible* Next();
|
||||
virtual Accessible* Next();
|
||||
|
||||
private:
|
||||
RelatedAccIterator();
|
||||
RelatedAccIterator(const RelatedAccIterator&);
|
||||
RelatedAccIterator& operator = (const RelatedAccIterator&);
|
||||
|
||||
nsDocAccessible* mDocument;
|
||||
DocAccessible* mDocument;
|
||||
nsIAtom* mRelAttr;
|
||||
nsDocAccessible::AttrRelProviderArray* mProviders;
|
||||
DocAccessible::AttrRelProviderArray* mProviders;
|
||||
nsIContent* mBindingParent;
|
||||
PRUint32 mIndex;
|
||||
};
|
||||
|
@ -132,7 +130,7 @@ public:
|
|||
eSkipAncestorLabel
|
||||
};
|
||||
|
||||
HTMLLabelIterator(nsDocAccessible* aDocument, const nsAccessible* aAccessible,
|
||||
HTMLLabelIterator(DocAccessible* aDocument, const Accessible* aAccessible,
|
||||
LabelFilter aFilter = eAllLabels);
|
||||
|
||||
virtual ~HTMLLabelIterator() { }
|
||||
|
@ -140,7 +138,7 @@ public:
|
|||
/**
|
||||
* Return next label accessible associated with the given element.
|
||||
*/
|
||||
virtual nsAccessible* Next();
|
||||
virtual Accessible* Next();
|
||||
|
||||
private:
|
||||
HTMLLabelIterator();
|
||||
|
@ -150,7 +148,7 @@ private:
|
|||
RelatedAccIterator mRelIter;
|
||||
// XXX: replace it on weak reference (bug 678429), it's safe to use raw
|
||||
// pointer now because iterators life cycle is short.
|
||||
const nsAccessible* mAcc;
|
||||
const Accessible* mAcc;
|
||||
LabelFilter mLabelFilter;
|
||||
};
|
||||
|
||||
|
@ -161,13 +159,13 @@ private:
|
|||
class HTMLOutputIterator : public AccIterable
|
||||
{
|
||||
public:
|
||||
HTMLOutputIterator(nsDocAccessible* aDocument, nsIContent* aElement);
|
||||
HTMLOutputIterator(DocAccessible* aDocument, nsIContent* aElement);
|
||||
virtual ~HTMLOutputIterator() { }
|
||||
|
||||
/**
|
||||
* Return next output accessible associated with the given element.
|
||||
*/
|
||||
virtual nsAccessible* Next();
|
||||
virtual Accessible* Next();
|
||||
|
||||
private:
|
||||
HTMLOutputIterator();
|
||||
|
@ -184,13 +182,13 @@ private:
|
|||
class XULLabelIterator : public AccIterable
|
||||
{
|
||||
public:
|
||||
XULLabelIterator(nsDocAccessible* aDocument, nsIContent* aElement);
|
||||
XULLabelIterator(DocAccessible* aDocument, nsIContent* aElement);
|
||||
virtual ~XULLabelIterator() { }
|
||||
|
||||
/**
|
||||
* Return next label accessible associated with the given element.
|
||||
*/
|
||||
virtual nsAccessible* Next();
|
||||
virtual Accessible* Next();
|
||||
|
||||
private:
|
||||
XULLabelIterator();
|
||||
|
@ -207,13 +205,13 @@ private:
|
|||
class XULDescriptionIterator : public AccIterable
|
||||
{
|
||||
public:
|
||||
XULDescriptionIterator(nsDocAccessible* aDocument, nsIContent* aElement);
|
||||
XULDescriptionIterator(DocAccessible* aDocument, nsIContent* aElement);
|
||||
virtual ~XULDescriptionIterator() { }
|
||||
|
||||
/**
|
||||
* Return next description accessible associated with the given element.
|
||||
*/
|
||||
virtual nsAccessible* Next();
|
||||
virtual Accessible* Next();
|
||||
|
||||
private:
|
||||
XULDescriptionIterator();
|
||||
|
@ -231,7 +229,7 @@ private:
|
|||
class IDRefsIterator : public AccIterable
|
||||
{
|
||||
public:
|
||||
IDRefsIterator(nsDocAccessible* aDoc, nsIContent* aContent,
|
||||
IDRefsIterator(DocAccessible* aDoc, nsIContent* aContent,
|
||||
nsIAtom* aIDRefsAttr);
|
||||
virtual ~IDRefsIterator() { }
|
||||
|
||||
|
@ -251,7 +249,7 @@ public:
|
|||
nsIContent* GetElem(const nsDependentSubstring& aID);
|
||||
|
||||
// AccIterable
|
||||
virtual nsAccessible* Next();
|
||||
virtual Accessible* Next();
|
||||
|
||||
private:
|
||||
IDRefsIterator();
|
||||
|
@ -260,7 +258,7 @@ private:
|
|||
|
||||
nsString mIDs;
|
||||
nsIContent* mContent;
|
||||
nsDocAccessible* mDoc;
|
||||
DocAccessible* mDoc;
|
||||
nsAString::index_type mCurrIdx;
|
||||
};
|
||||
|
||||
|
@ -271,17 +269,17 @@ private:
|
|||
class SingleAccIterator : public AccIterable
|
||||
{
|
||||
public:
|
||||
SingleAccIterator(nsAccessible* aTarget): mAcc(aTarget) { }
|
||||
SingleAccIterator(Accessible* aTarget): mAcc(aTarget) { }
|
||||
virtual ~SingleAccIterator() { }
|
||||
|
||||
virtual nsAccessible* Next();
|
||||
virtual Accessible* Next();
|
||||
|
||||
private:
|
||||
SingleAccIterator();
|
||||
SingleAccIterator(const SingleAccIterator&);
|
||||
SingleAccIterator& operator = (const SingleAccIterator&);
|
||||
|
||||
nsRefPtr<nsAccessible> mAcc;
|
||||
nsRefPtr<Accessible> mAcc;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
@ -24,7 +24,7 @@ FocusManager::~FocusManager()
|
|||
{
|
||||
}
|
||||
|
||||
nsAccessible*
|
||||
Accessible*
|
||||
FocusManager::FocusedAccessible() const
|
||||
{
|
||||
if (mActiveItem)
|
||||
|
@ -32,7 +32,7 @@ FocusManager::FocusedAccessible() const
|
|||
|
||||
nsINode* focusedNode = FocusedDOMNode();
|
||||
if (focusedNode) {
|
||||
nsDocAccessible* doc =
|
||||
DocAccessible* doc =
|
||||
GetAccService()->GetDocAccessible(focusedNode->OwnerDoc());
|
||||
return doc ? doc->GetAccessibleOrContainer(focusedNode) : nsnull;
|
||||
}
|
||||
|
@ -41,7 +41,7 @@ FocusManager::FocusedAccessible() const
|
|||
}
|
||||
|
||||
bool
|
||||
FocusManager::IsFocused(const nsAccessible* aAccessible) const
|
||||
FocusManager::IsFocused(const Accessible* aAccessible) const
|
||||
{
|
||||
if (mActiveItem)
|
||||
return mActiveItem == aAccessible;
|
||||
|
@ -55,7 +55,7 @@ FocusManager::IsFocused(const nsAccessible* aAccessible) const
|
|||
// FocusedAccessible() method call. Make sure this issue is fixed in
|
||||
// bug 638465.
|
||||
if (focusedNode->OwnerDoc() == aAccessible->GetNode()->OwnerDoc()) {
|
||||
nsDocAccessible* doc =
|
||||
DocAccessible* doc =
|
||||
GetAccService()->GetDocAccessible(focusedNode->OwnerDoc());
|
||||
return aAccessible ==
|
||||
(doc ? doc->GetAccessibleOrContainer(focusedNode) : nsnull);
|
||||
|
@ -65,9 +65,9 @@ FocusManager::IsFocused(const nsAccessible* aAccessible) const
|
|||
}
|
||||
|
||||
bool
|
||||
FocusManager::IsFocusWithin(const nsAccessible* aContainer) const
|
||||
FocusManager::IsFocusWithin(const Accessible* aContainer) const
|
||||
{
|
||||
nsAccessible* child = FocusedAccessible();
|
||||
Accessible* child = FocusedAccessible();
|
||||
while (child) {
|
||||
if (child == aContainer)
|
||||
return true;
|
||||
|
@ -78,9 +78,9 @@ FocusManager::IsFocusWithin(const nsAccessible* aContainer) const
|
|||
}
|
||||
|
||||
FocusManager::FocusDisposition
|
||||
FocusManager::IsInOrContainsFocus(const nsAccessible* aAccessible) const
|
||||
FocusManager::IsInOrContainsFocus(const Accessible* aAccessible) const
|
||||
{
|
||||
nsAccessible* focus = FocusedAccessible();
|
||||
Accessible* focus = FocusedAccessible();
|
||||
if (!focus)
|
||||
return eNone;
|
||||
|
||||
|
@ -89,7 +89,7 @@ FocusManager::IsInOrContainsFocus(const nsAccessible* aAccessible) const
|
|||
return eFocused;
|
||||
|
||||
// If contains the focus.
|
||||
nsAccessible* child = focus->Parent();
|
||||
Accessible* child = focus->Parent();
|
||||
while (child) {
|
||||
if (child == aAccessible)
|
||||
return eContainsFocus;
|
||||
|
@ -119,7 +119,7 @@ FocusManager::NotifyOfDOMFocus(nsISupports* aTarget)
|
|||
|
||||
nsCOMPtr<nsINode> targetNode(do_QueryInterface(aTarget));
|
||||
if (targetNode) {
|
||||
nsDocAccessible* document =
|
||||
DocAccessible* document =
|
||||
GetAccService()->GetDocAccessible(targetNode->OwnerDoc());
|
||||
if (document) {
|
||||
// Set selection listener for focused element.
|
||||
|
@ -148,7 +148,7 @@ FocusManager::NotifyOfDOMBlur(nsISupports* aTarget)
|
|||
nsCOMPtr<nsINode> targetNode(do_QueryInterface(aTarget));
|
||||
if (targetNode && targetNode->OwnerDoc() == FocusedDOMDocument()) {
|
||||
nsIDocument* DOMDoc = targetNode->OwnerDoc();
|
||||
nsDocAccessible* document =
|
||||
DocAccessible* document =
|
||||
GetAccService()->GetDocAccessible(DOMDoc);
|
||||
if (document) {
|
||||
document->HandleNotification<FocusManager, nsINode>
|
||||
|
@ -158,7 +158,7 @@ FocusManager::NotifyOfDOMBlur(nsISupports* aTarget)
|
|||
}
|
||||
|
||||
void
|
||||
FocusManager::ActiveItemChanged(nsAccessible* aItem, bool aCheckIfActive)
|
||||
FocusManager::ActiveItemChanged(Accessible* aItem, bool aCheckIfActive)
|
||||
{
|
||||
A11YDEBUG_FOCUS_NOTIFICATION_ACCTARGET("active item changed",
|
||||
"Active item", aItem)
|
||||
|
@ -170,7 +170,7 @@ FocusManager::ActiveItemChanged(nsAccessible* aItem, bool aCheckIfActive)
|
|||
mActiveItem = nsnull;
|
||||
|
||||
if (aItem && aCheckIfActive) {
|
||||
nsAccessible* widget = aItem->ContainerWidget();
|
||||
Accessible* widget = aItem->ContainerWidget();
|
||||
A11YDEBUG_FOCUS_LOG_WIDGET("Active item widget", widget)
|
||||
if (!widget || !widget->IsActiveWidget() || !widget->AreItemsOperable())
|
||||
return;
|
||||
|
@ -180,7 +180,7 @@ FocusManager::ActiveItemChanged(nsAccessible* aItem, bool aCheckIfActive)
|
|||
// If active item is changed then fire accessible focus event on it, otherwise
|
||||
// if there's no an active item then fire focus event to accessible having
|
||||
// DOM focus.
|
||||
nsAccessible* target = FocusedAccessible();
|
||||
Accessible* target = FocusedAccessible();
|
||||
if (target)
|
||||
DispatchFocusEvent(target->Document(), target);
|
||||
}
|
||||
|
@ -190,7 +190,7 @@ FocusManager::ForceFocusEvent()
|
|||
{
|
||||
nsINode* focusedNode = FocusedDOMNode();
|
||||
if (focusedNode) {
|
||||
nsDocAccessible* document =
|
||||
DocAccessible* document =
|
||||
GetAccService()->GetDocAccessible(focusedNode->OwnerDoc());
|
||||
if (document) {
|
||||
document->HandleNotification<FocusManager, nsINode>
|
||||
|
@ -200,8 +200,8 @@ FocusManager::ForceFocusEvent()
|
|||
}
|
||||
|
||||
void
|
||||
FocusManager::DispatchFocusEvent(nsDocAccessible* aDocument,
|
||||
nsAccessible* aTarget)
|
||||
FocusManager::DispatchFocusEvent(DocAccessible* aDocument,
|
||||
Accessible* aTarget)
|
||||
{
|
||||
NS_PRECONDITION(aDocument, "No document for focused accessible!");
|
||||
if (aDocument) {
|
||||
|
@ -220,19 +220,19 @@ FocusManager::ProcessDOMFocus(nsINode* aTarget)
|
|||
A11YDEBUG_FOCUS_NOTIFICATION_DOMTARGET("Process DOM focus",
|
||||
"Notification target", aTarget)
|
||||
|
||||
nsDocAccessible* document =
|
||||
DocAccessible* document =
|
||||
GetAccService()->GetDocAccessible(aTarget->OwnerDoc());
|
||||
|
||||
nsAccessible* target = document->GetAccessibleOrContainer(aTarget);
|
||||
Accessible* target = document->GetAccessibleOrContainer(aTarget);
|
||||
if (target && document) {
|
||||
// Check if still focused. Otherwise we can end up with storing the active
|
||||
// item for control that isn't focused anymore.
|
||||
nsAccessible* DOMFocus =
|
||||
Accessible* DOMFocus =
|
||||
document->GetAccessibleOrContainer(FocusedDOMNode());
|
||||
if (target != DOMFocus)
|
||||
return;
|
||||
|
||||
nsAccessible* activeItem = target->CurrentItem();
|
||||
Accessible* activeItem = target->CurrentItem();
|
||||
if (activeItem) {
|
||||
mActiveItem = activeItem;
|
||||
target = activeItem;
|
||||
|
@ -253,18 +253,18 @@ FocusManager::ProcessFocusEvent(AccEvent* aEvent)
|
|||
|
||||
// Emit focus event if event target is the active item. Otherwise then check
|
||||
// if it's still focused and then update active item and emit focus event.
|
||||
nsAccessible* target = aEvent->GetAccessible();
|
||||
Accessible* target = aEvent->GetAccessible();
|
||||
if (target != mActiveItem) {
|
||||
|
||||
// Check if still focused. Otherwise we can end up with storing the active
|
||||
// item for control that isn't focused anymore.
|
||||
nsDocAccessible* document = aEvent->GetDocAccessible();
|
||||
nsAccessible* DOMFocus = document->GetAccessibleOrContainer(FocusedDOMNode());
|
||||
DocAccessible* document = aEvent->GetDocAccessible();
|
||||
Accessible* DOMFocus = document->GetAccessibleOrContainer(FocusedDOMNode());
|
||||
|
||||
if (target != DOMFocus)
|
||||
return;
|
||||
|
||||
nsAccessible* activeItem = target->CurrentItem();
|
||||
Accessible* activeItem = target->CurrentItem();
|
||||
if (activeItem) {
|
||||
mActiveItem = activeItem;
|
||||
target = activeItem;
|
||||
|
@ -274,7 +274,7 @@ FocusManager::ProcessFocusEvent(AccEvent* aEvent)
|
|||
// Fire menu start/end events for ARIA menus.
|
||||
if (target->ARIARole() == roles::MENUITEM) {
|
||||
// The focus was moved into menu.
|
||||
nsAccessible* ARIAMenubar =
|
||||
Accessible* ARIAMenubar =
|
||||
nsAccUtils::GetAncestorWithRole(target, roles::MENUBAR);
|
||||
|
||||
if (ARIAMenubar != mActiveARIAMenubar) {
|
||||
|
@ -316,8 +316,8 @@ FocusManager::ProcessFocusEvent(AccEvent* aEvent)
|
|||
// Fire scrolling_start event when the document receives the focus if it has
|
||||
// an anchor jump. If an accessible within the document receive the focus
|
||||
// then null out the anchor jump because it no longer applies.
|
||||
nsDocAccessible* targetDocument = target->Document();
|
||||
nsAccessible* anchorJump = targetDocument->AnchorJump();
|
||||
DocAccessible* targetDocument = target->Document();
|
||||
Accessible* anchorJump = targetDocument->AnchorJump();
|
||||
if (anchorJump) {
|
||||
if (target == targetDocument) {
|
||||
// XXX: bug 625699, note in some cases the node could go away before we
|
||||
|
|
|
@ -9,8 +9,8 @@
|
|||
#include "mozilla/dom/Element.h"
|
||||
|
||||
class AccEvent;
|
||||
class nsAccessible;
|
||||
class nsDocAccessible;
|
||||
class Accessible;
|
||||
class DocAccessible;
|
||||
|
||||
namespace mozilla {
|
||||
namespace a11y {
|
||||
|
@ -26,18 +26,18 @@ public:
|
|||
/**
|
||||
* Return a focused accessible.
|
||||
*/
|
||||
nsAccessible* FocusedAccessible() const;
|
||||
Accessible* FocusedAccessible() const;
|
||||
|
||||
/**
|
||||
* Return true if given accessible is focused.
|
||||
*/
|
||||
bool IsFocused(const nsAccessible* aAccessible) const;
|
||||
bool IsFocused(const Accessible* aAccessible) const;
|
||||
|
||||
/**
|
||||
* Return true if the given accessible is an active item, i.e. an item that
|
||||
* is current within the active widget.
|
||||
*/
|
||||
inline bool IsActiveItem(const nsAccessible* aAccessible)
|
||||
inline bool IsActiveItem(const Accessible* aAccessible)
|
||||
{ return aAccessible == mActiveItem; }
|
||||
|
||||
/**
|
||||
|
@ -49,7 +49,7 @@ public:
|
|||
/**
|
||||
* Return true if focused accessible is within the given container.
|
||||
*/
|
||||
bool IsFocusWithin(const nsAccessible* aContainer) const;
|
||||
bool IsFocusWithin(const Accessible* aContainer) const;
|
||||
|
||||
/**
|
||||
* Return whether the given accessible is focused or contains the focus or
|
||||
|
@ -61,7 +61,7 @@ public:
|
|||
eContainsFocus,
|
||||
eContainedByFocus
|
||||
};
|
||||
FocusDisposition IsInOrContainsFocus(const nsAccessible* aAccessible) const;
|
||||
FocusDisposition IsInOrContainsFocus(const Accessible* aAccessible) const;
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
// Focus notifications and processing (don't use until you know what you do).
|
||||
|
@ -80,7 +80,7 @@ public:
|
|||
* Called when active item is changed. Note: must be called when accessible
|
||||
* tree is up to date.
|
||||
*/
|
||||
void ActiveItemChanged(nsAccessible* aItem, bool aCheckIfActive = true);
|
||||
void ActiveItemChanged(Accessible* aItem, bool aCheckIfActive = true);
|
||||
|
||||
/**
|
||||
* Dispatch delayed focus event for the current focus accessible.
|
||||
|
@ -90,7 +90,7 @@ public:
|
|||
/**
|
||||
* Dispatch delayed focus event for the given target.
|
||||
*/
|
||||
void DispatchFocusEvent(nsDocAccessible* aDocument, nsAccessible* aTarget);
|
||||
void DispatchFocusEvent(DocAccessible* aDocument, Accessible* aTarget);
|
||||
|
||||
/**
|
||||
* Process DOM focus notification.
|
||||
|
@ -121,8 +121,8 @@ private:
|
|||
nsIDocument* FocusedDOMDocument() const;
|
||||
|
||||
private:
|
||||
nsRefPtr<nsAccessible> mActiveItem;
|
||||
nsRefPtr<nsAccessible> mActiveARIAMenubar;
|
||||
nsRefPtr<Accessible> mActiveItem;
|
||||
nsRefPtr<Accessible> mActiveARIAMenubar;
|
||||
};
|
||||
|
||||
} // namespace a11y
|
||||
|
|
|
@ -0,0 +1,488 @@
|
|||
/* -*- 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 "Logging.h"
|
||||
|
||||
#include "AccEvent.h"
|
||||
#include "nsAccessibilityService.h"
|
||||
#include "nsCoreUtils.h"
|
||||
#include "DocAccessible.h"
|
||||
|
||||
#include "nsDocShellLoadTypes.h"
|
||||
#include "nsIChannel.h"
|
||||
#include "nsIInterfaceRequestorUtils.h"
|
||||
#include "nsTraceRefcntImpl.h"
|
||||
#include "nsIWebProgress.h"
|
||||
#include "prenv.h"
|
||||
|
||||
using namespace mozilla;
|
||||
using namespace mozilla::a11y;
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// Logging helpers
|
||||
|
||||
static PRUint32 sModules = 0;
|
||||
|
||||
struct ModuleRep {
|
||||
const char* mStr;
|
||||
logging::EModules mModule;
|
||||
};
|
||||
|
||||
static void
|
||||
EnableLogging(const char* aModulesStr)
|
||||
{
|
||||
sModules = 0;
|
||||
if (!aModulesStr)
|
||||
return;
|
||||
|
||||
static ModuleRep modules[] = {
|
||||
{ "docload", logging::eDocLoad },
|
||||
{ "doccreate", logging::eDocCreate },
|
||||
{ "docdestroy", logging::eDocDestroy },
|
||||
{ "doclifecycle", logging::eDocLifeCycle },
|
||||
{ "platforms", logging::ePlatforms }
|
||||
};
|
||||
|
||||
const char* token = aModulesStr;
|
||||
while (*token != '\0') {
|
||||
size_t tokenLen = strcspn(token, ",");
|
||||
for (unsigned int idx = 0; idx < ArrayLength(modules); idx++) {
|
||||
if (strncmp(token, modules[idx].mStr, tokenLen) == 0) {
|
||||
sModules |= modules[idx].mModule;
|
||||
printf("\n\nmodule enabled: %s\n", modules[idx].mStr);
|
||||
break;
|
||||
}
|
||||
}
|
||||
token += tokenLen;
|
||||
|
||||
if (*token == ',')
|
||||
token++; // skip ',' char
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
LogDocURI(nsIDocument* aDocumentNode)
|
||||
{
|
||||
nsIURI* uri = aDocumentNode->GetDocumentURI();
|
||||
nsCAutoString spec;
|
||||
uri->GetSpec(spec);
|
||||
printf("uri: %s", spec.get());
|
||||
}
|
||||
|
||||
static void
|
||||
LogDocShellState(nsIDocument* aDocumentNode)
|
||||
{
|
||||
printf("docshell busy: ");
|
||||
|
||||
nsCAutoString docShellBusy;
|
||||
nsCOMPtr<nsISupports> container = aDocumentNode->GetContainer();
|
||||
if (container) {
|
||||
nsCOMPtr<nsIDocShell> docShell = do_QueryInterface(container);
|
||||
PRUint32 busyFlags = nsIDocShell::BUSY_FLAGS_NONE;
|
||||
docShell->GetBusyFlags(&busyFlags);
|
||||
if (busyFlags == nsIDocShell::BUSY_FLAGS_NONE)
|
||||
printf("'none'");
|
||||
if (busyFlags & nsIDocShell::BUSY_FLAGS_BUSY)
|
||||
printf("'busy'");
|
||||
if (busyFlags & nsIDocShell::BUSY_FLAGS_BEFORE_PAGE_LOAD)
|
||||
printf(", 'before page load'");
|
||||
if (busyFlags & nsIDocShell::BUSY_FLAGS_PAGE_LOADING)
|
||||
printf(", 'page loading'");
|
||||
} else {
|
||||
printf("[failed]");
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
LogDocType(nsIDocument* aDocumentNode)
|
||||
{
|
||||
if (aDocumentNode->IsActive()) {
|
||||
bool isContent = nsCoreUtils::IsContentDocument(aDocumentNode);
|
||||
printf("%s document", (isContent ? "content" : "chrome"));
|
||||
} else {
|
||||
printf("document type: [failed]");\
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
LogDocShellTree(nsIDocument* aDocumentNode)
|
||||
{
|
||||
if (aDocumentNode->IsActive()) {
|
||||
nsCOMPtr<nsISupports> container = aDocumentNode->GetContainer();
|
||||
nsCOMPtr<nsIDocShellTreeItem> treeItem(do_QueryInterface(container));
|
||||
nsCOMPtr<nsIDocShellTreeItem> parentTreeItem;
|
||||
treeItem->GetParent(getter_AddRefs(parentTreeItem));
|
||||
nsCOMPtr<nsIDocShellTreeItem> rootTreeItem;
|
||||
treeItem->GetRootTreeItem(getter_AddRefs(rootTreeItem));
|
||||
printf("docshell hierarchy, parent: %p, root: %p, is tab document: %s;",
|
||||
static_cast<void*>(parentTreeItem), static_cast<void*>(rootTreeItem),
|
||||
(nsCoreUtils::IsTabDocument(aDocumentNode) ? "yes" : "no"));
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
LogDocState(nsIDocument* aDocumentNode)
|
||||
{
|
||||
const char* docState = nsnull;
|
||||
nsIDocument::ReadyState docStateFlag = aDocumentNode->GetReadyStateEnum();
|
||||
switch (docStateFlag) {
|
||||
case nsIDocument::READYSTATE_UNINITIALIZED:
|
||||
docState = "uninitialized";
|
||||
break;
|
||||
case nsIDocument::READYSTATE_LOADING:
|
||||
docState = "loading";
|
||||
break;
|
||||
case nsIDocument::READYSTATE_INTERACTIVE:
|
||||
docState = "interactive";
|
||||
break;
|
||||
case nsIDocument::READYSTATE_COMPLETE:
|
||||
docState = "complete";
|
||||
break;
|
||||
}
|
||||
|
||||
printf("doc state: %s", docState);
|
||||
printf(", %sinitial", aDocumentNode->IsInitialDocument() ? "" : "not ");
|
||||
printf(", %sshowing", aDocumentNode->IsShowing() ? "" : "not ");
|
||||
printf(", %svisible", aDocumentNode->IsVisible() ? "" : "not ");
|
||||
printf(", %sactive", aDocumentNode->IsActive() ? "" : "not ");
|
||||
}
|
||||
|
||||
static void
|
||||
LogPresShell(nsIDocument* aDocumentNode)
|
||||
{
|
||||
nsIPresShell* ps = aDocumentNode->GetShell();
|
||||
printf("presshell: %p", static_cast<void*>(ps));
|
||||
nsIScrollableFrame *sf = ps ?
|
||||
ps->GetRootScrollFrameAsScrollableExternal() : nsnull;
|
||||
printf(", root scroll frame: %p", static_cast<void*>(sf));
|
||||
}
|
||||
|
||||
static void
|
||||
LogDocLoadGroup(nsIDocument* aDocumentNode)
|
||||
{
|
||||
nsCOMPtr<nsILoadGroup> loadGroup = aDocumentNode->GetDocumentLoadGroup();
|
||||
printf("load group: %p", static_cast<void*>(loadGroup));
|
||||
}
|
||||
|
||||
static void
|
||||
LogDocParent(nsIDocument* aDocumentNode)
|
||||
{
|
||||
nsIDocument* parentDoc = aDocumentNode->GetParentDocument();
|
||||
printf("parent id: %p", static_cast<void*>(parentDoc));
|
||||
if (parentDoc) {
|
||||
printf("\n parent ");
|
||||
LogDocURI(parentDoc);
|
||||
printf("\n");
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
LogDocInfo(nsIDocument* aDocumentNode, DocAccessible* aDocument)
|
||||
{
|
||||
printf(" {\n");
|
||||
|
||||
printf(" DOM id: %p, acc id: %p\n ",
|
||||
static_cast<void*>(aDocumentNode), static_cast<void*>(aDocument));
|
||||
|
||||
// log document info
|
||||
if (aDocumentNode) {
|
||||
LogDocURI(aDocumentNode);
|
||||
printf("\n ");
|
||||
LogDocShellState(aDocumentNode);
|
||||
printf("; ");
|
||||
LogDocType(aDocumentNode);
|
||||
printf("\n ");
|
||||
LogDocShellTree(aDocumentNode);
|
||||
printf("\n ");
|
||||
LogDocState(aDocumentNode);
|
||||
printf("\n ");
|
||||
LogPresShell(aDocumentNode);
|
||||
printf("\n ");
|
||||
LogDocLoadGroup(aDocumentNode);
|
||||
printf(", ");
|
||||
LogDocParent(aDocumentNode);
|
||||
printf("\n");
|
||||
}
|
||||
|
||||
printf(" }\n");
|
||||
}
|
||||
|
||||
static void
|
||||
LogShellLoadType(nsIDocShell* aDocShell)
|
||||
{
|
||||
printf("load type: ");
|
||||
|
||||
PRUint32 loadType = 0;
|
||||
aDocShell->GetLoadType(&loadType);
|
||||
switch (loadType) {
|
||||
case LOAD_NORMAL:
|
||||
printf("normal; ");
|
||||
break;
|
||||
case LOAD_NORMAL_REPLACE:
|
||||
printf("normal replace; ");
|
||||
break;
|
||||
case LOAD_NORMAL_EXTERNAL:
|
||||
printf("normal external; ");
|
||||
break;
|
||||
case LOAD_HISTORY:
|
||||
printf("history; ");
|
||||
break;
|
||||
case LOAD_NORMAL_BYPASS_CACHE:
|
||||
printf("normal bypass cache; ");
|
||||
break;
|
||||
case LOAD_NORMAL_BYPASS_PROXY:
|
||||
printf("normal bypass proxy; ");
|
||||
break;
|
||||
case LOAD_NORMAL_BYPASS_PROXY_AND_CACHE:
|
||||
printf("normal bypass proxy and cache; ");
|
||||
break;
|
||||
case LOAD_RELOAD_NORMAL:
|
||||
printf("reload normal; ");
|
||||
break;
|
||||
case LOAD_RELOAD_BYPASS_CACHE:
|
||||
printf("reload bypass cache; ");
|
||||
break;
|
||||
case LOAD_RELOAD_BYPASS_PROXY:
|
||||
printf("reload bypass proxy; ");
|
||||
break;
|
||||
case LOAD_RELOAD_BYPASS_PROXY_AND_CACHE:
|
||||
printf("reload bypass proxy and cache; ");
|
||||
break;
|
||||
case LOAD_LINK:
|
||||
printf("link; ");
|
||||
break;
|
||||
case LOAD_REFRESH:
|
||||
printf("refresh; ");
|
||||
break;
|
||||
case LOAD_RELOAD_CHARSET_CHANGE:
|
||||
printf("reload charset change; ");
|
||||
break;
|
||||
case LOAD_BYPASS_HISTORY:
|
||||
printf("bypass history; ");
|
||||
break;
|
||||
case LOAD_STOP_CONTENT:
|
||||
printf("stop content; ");
|
||||
break;
|
||||
case LOAD_STOP_CONTENT_AND_REPLACE:
|
||||
printf("stop content and replace; ");
|
||||
break;
|
||||
case LOAD_PUSHSTATE:
|
||||
printf("load pushstate; ");
|
||||
break;
|
||||
case LOAD_ERROR_PAGE:
|
||||
printf("error page;");
|
||||
break;
|
||||
default:
|
||||
printf("unknown");
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
LogRequest(nsIRequest* aRequest)
|
||||
{
|
||||
if (aRequest) {
|
||||
nsCAutoString name;
|
||||
aRequest->GetName(name);
|
||||
printf(" request spec: %s\n", name.get());
|
||||
PRUint32 loadFlags = 0;
|
||||
aRequest->GetLoadFlags(&loadFlags);
|
||||
printf(" request load flags: %x; ", loadFlags);
|
||||
if (loadFlags & nsIChannel::LOAD_DOCUMENT_URI)
|
||||
printf("document uri; ");
|
||||
if (loadFlags & nsIChannel::LOAD_RETARGETED_DOCUMENT_URI)
|
||||
printf("retargeted document uri; ");
|
||||
if (loadFlags & nsIChannel::LOAD_REPLACE)
|
||||
printf("replace; ");
|
||||
if (loadFlags & nsIChannel::LOAD_INITIAL_DOCUMENT_URI)
|
||||
printf("initial document uri; ");
|
||||
if (loadFlags & nsIChannel::LOAD_TARGETED)
|
||||
printf("targeted; ");
|
||||
if (loadFlags & nsIChannel::LOAD_CALL_CONTENT_SNIFFERS)
|
||||
printf("call content sniffers; ");
|
||||
if (loadFlags & nsIChannel::LOAD_CLASSIFY_URI)
|
||||
printf("classify uri; ");
|
||||
} else {
|
||||
printf(" no request");
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
GetDocLoadEventType(AccEvent* aEvent, nsACString& aEventType)
|
||||
{
|
||||
PRUint32 type = aEvent->GetEventType();
|
||||
if (type == nsIAccessibleEvent::EVENT_DOCUMENT_LOAD_STOPPED) {
|
||||
aEventType.AssignLiteral("load stopped");
|
||||
} else if (type == nsIAccessibleEvent::EVENT_DOCUMENT_LOAD_COMPLETE) {
|
||||
aEventType.AssignLiteral("load complete");
|
||||
} else if (type == nsIAccessibleEvent::EVENT_DOCUMENT_RELOAD) {
|
||||
aEventType.AssignLiteral("reload");
|
||||
} else if (type == nsIAccessibleEvent::EVENT_STATE_CHANGE) {
|
||||
AccStateChangeEvent* event = downcast_accEvent(aEvent);
|
||||
if (event->GetState() == states::BUSY) {
|
||||
aEventType.AssignLiteral("busy ");
|
||||
if (event->IsStateEnabled())
|
||||
aEventType.AppendLiteral("true");
|
||||
else
|
||||
aEventType.AppendLiteral("false");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// namespace logging:: document life cycle logging methods
|
||||
|
||||
void
|
||||
logging::DocLoad(const char* aMsg, nsIWebProgress* aWebProgress,
|
||||
nsIRequest* aRequest, PRUint32 aStateFlags)
|
||||
{
|
||||
printf("\nA11Y DOCLOAD: %s\n", aMsg);
|
||||
|
||||
nsCOMPtr<nsIDOMWindow> DOMWindow;
|
||||
aWebProgress->GetDOMWindow(getter_AddRefs(DOMWindow));
|
||||
if (!DOMWindow)
|
||||
return;
|
||||
|
||||
nsCOMPtr<nsIDOMDocument> DOMDocument;
|
||||
DOMWindow->GetDocument(getter_AddRefs(DOMDocument));
|
||||
if (!DOMDocument)
|
||||
return;
|
||||
|
||||
nsCOMPtr<nsIDocument> documentNode(do_QueryInterface(DOMDocument));
|
||||
DocAccessible* document =
|
||||
GetAccService()->GetDocAccessibleFromCache(documentNode);
|
||||
|
||||
LogDocInfo(documentNode, document);
|
||||
|
||||
printf(" {\n");
|
||||
nsCOMPtr<nsIWebNavigation> webNav(do_GetInterface(DOMWindow));
|
||||
nsCOMPtr<nsIDocShell> docShell(do_QueryInterface(webNav));
|
||||
printf(" ");
|
||||
LogShellLoadType(docShell);
|
||||
printf("\n");
|
||||
LogRequest(aRequest);
|
||||
printf("\n");
|
||||
printf(" state flags: %x", aStateFlags);
|
||||
bool isDocLoading;
|
||||
aWebProgress->GetIsLoadingDocument(&isDocLoading);
|
||||
printf(", document is %sloading\n", (isDocLoading ? "" : "not "));
|
||||
printf(" }\n");
|
||||
}
|
||||
|
||||
void
|
||||
logging::DocLoad(const char* aMsg, nsIDocument* aDocumentNode)
|
||||
{
|
||||
printf("\nA11Y DOCLOAD: %s\n", aMsg);
|
||||
|
||||
DocAccessible* document =
|
||||
GetAccService()->GetDocAccessibleFromCache(aDocumentNode);
|
||||
LogDocInfo(aDocumentNode, document);
|
||||
}
|
||||
|
||||
void
|
||||
logging::DocLoadEventFired(AccEvent* aEvent)
|
||||
{
|
||||
nsCAutoString strEventType;
|
||||
GetDocLoadEventType(aEvent, strEventType);
|
||||
if (!strEventType.IsEmpty())
|
||||
printf(" fire: %s\n", strEventType.get());
|
||||
}
|
||||
|
||||
void
|
||||
logging::DocLoadEventHandled(AccEvent* aEvent)
|
||||
{
|
||||
nsCAutoString strEventType;
|
||||
GetDocLoadEventType(aEvent, strEventType);
|
||||
if (!strEventType.IsEmpty()) {
|
||||
printf("\nA11Y DOCEVENT: handled '%s' event ", strEventType.get());
|
||||
|
||||
nsINode* node = aEvent->GetNode();
|
||||
if (node->IsNodeOfType(nsINode::eDOCUMENT)) {
|
||||
nsIDocument* documentNode = static_cast<nsIDocument*>(node);
|
||||
DocAccessible* document = aEvent->GetDocAccessible();
|
||||
LogDocInfo(documentNode, document);
|
||||
}
|
||||
|
||||
printf("\n");
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
logging::DocCreate(const char* aMsg, nsIDocument* aDocumentNode,
|
||||
DocAccessible* aDocument)
|
||||
{
|
||||
DocAccessible* document = aDocument ?
|
||||
aDocument : GetAccService()->GetDocAccessibleFromCache(aDocumentNode);
|
||||
|
||||
printf("\nA11Y DOCCREATE: %s\n", aMsg);
|
||||
LogDocInfo(aDocumentNode, document);
|
||||
}
|
||||
|
||||
void
|
||||
logging::DocDestroy(const char* aMsg, nsIDocument* aDocumentNode,
|
||||
DocAccessible* aDocument)
|
||||
{
|
||||
DocAccessible* document = aDocument ?
|
||||
aDocument : GetAccService()->GetDocAccessibleFromCache(aDocumentNode);
|
||||
|
||||
printf("\nA11Y DOCDESTROY: %s\n", aMsg);
|
||||
LogDocInfo(aDocumentNode, document);
|
||||
}
|
||||
|
||||
void
|
||||
logging::Address(const char* aDescr, Accessible* aAcc)
|
||||
{
|
||||
nsINode* node = aAcc->GetNode();
|
||||
nsIDocument* docNode = aAcc->GetDocumentNode();
|
||||
DocAccessible* doc = GetAccService()->GetDocAccessibleFromCache(docNode);
|
||||
printf(" %s accessible: %p, node: %p\n", aDescr,
|
||||
static_cast<void*>(aAcc), static_cast<void*>(node));
|
||||
printf(" docacc for %s accessible: %p, node: %p\n", aDescr,
|
||||
static_cast<void*>(doc), static_cast<void*>(docNode));
|
||||
printf(" ");
|
||||
LogDocURI(docNode);
|
||||
printf("\n");
|
||||
}
|
||||
|
||||
void
|
||||
logging::Msg(const char* aMsg)
|
||||
{
|
||||
printf("\n%s\n", aMsg);
|
||||
}
|
||||
|
||||
void
|
||||
logging::Text(const char* aText)
|
||||
{
|
||||
printf(" %s\n", aText);
|
||||
}
|
||||
|
||||
void
|
||||
logging::Stack()
|
||||
{
|
||||
printf(" stack: \n");
|
||||
nsTraceRefcntImpl::WalkTheStack(stdout);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// namespace logging:: initialization
|
||||
|
||||
bool
|
||||
logging::IsEnabled(PRUint32 aModules)
|
||||
{
|
||||
return sModules & aModules;
|
||||
}
|
||||
|
||||
void
|
||||
logging::Enable(const nsAFlatCString& aModules)
|
||||
{
|
||||
EnableLogging(aModules.get());
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
logging::CheckEnv()
|
||||
{
|
||||
EnableLogging(PR_GetEnv("A11YLOG"));
|
||||
}
|
|
@ -0,0 +1,102 @@
|
|||
/* -*- 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_logs_h__
|
||||
#define mozilla_a11y_logs_h__
|
||||
|
||||
#include "nscore.h"
|
||||
#include "nsAString.h"
|
||||
|
||||
class AccEvent;
|
||||
class Accessible;
|
||||
class DocAccessible;
|
||||
class nsIDocument;
|
||||
class nsIRequest;
|
||||
class nsIWebProgress;
|
||||
|
||||
namespace mozilla {
|
||||
namespace a11y {
|
||||
namespace logging {
|
||||
|
||||
enum EModules {
|
||||
eDocLoad = 1 << 0,
|
||||
eDocCreate = 1 << 1,
|
||||
eDocDestroy = 1 << 2,
|
||||
eDocLifeCycle = eDocLoad | eDocCreate | eDocDestroy,
|
||||
ePlatforms = 1 << 3
|
||||
};
|
||||
|
||||
/**
|
||||
* Return true if the given module is logged.
|
||||
*/
|
||||
bool IsEnabled(PRUint32 aModule);
|
||||
|
||||
/**
|
||||
* Log the document loading progress.
|
||||
*/
|
||||
void DocLoad(const char* aMsg, nsIWebProgress* aWebProgress,
|
||||
nsIRequest* aRequest, PRUint32 aStateFlags);
|
||||
void DocLoad(const char* aMsg, nsIDocument* aDocumentNode);
|
||||
|
||||
/**
|
||||
* Log that document load event was fired.
|
||||
*/
|
||||
void DocLoadEventFired(AccEvent* aEvent);
|
||||
|
||||
/**
|
||||
* Log that document laod event was handled.
|
||||
*/
|
||||
void DocLoadEventHandled(AccEvent* aEvent);
|
||||
|
||||
/**
|
||||
* Log the document was created.
|
||||
*/
|
||||
void DocCreate(const char* aMsg, nsIDocument* aDocumentNode,
|
||||
DocAccessible* aDocument = nsnull);
|
||||
|
||||
/**
|
||||
* Log the document was destroyed.
|
||||
*/
|
||||
void DocDestroy(const char* aMsg, nsIDocument* aDocumentNode,
|
||||
DocAccessible* aDocument = nsnull);
|
||||
|
||||
/**
|
||||
* Log the message, a piece of text on own line, no offset.
|
||||
*/
|
||||
void Msg(const char* aMsg);
|
||||
|
||||
/**
|
||||
* Log the text, two spaces offset is used.
|
||||
*/
|
||||
void Text(const char* aText);
|
||||
|
||||
/**
|
||||
* Log the accesisble object address, two spaces offset is used.
|
||||
*/
|
||||
void Address(const char* aDescr, Accessible* aAcc);
|
||||
|
||||
/**
|
||||
* Log the call stack, two spaces offset is used.
|
||||
*/
|
||||
void Stack();
|
||||
|
||||
/**
|
||||
* Enable logging of the specified modules, all other modules aren't logged.
|
||||
*/
|
||||
void Enable(const nsAFlatCString& aModules);
|
||||
|
||||
/**
|
||||
* Enable logging of modules specified by A11YLOG environment variable,
|
||||
* all other modules aren't logged.
|
||||
*/
|
||||
void CheckEnv();
|
||||
|
||||
} // namespace logs
|
||||
} // namespace a11y
|
||||
} // namespace mozilla
|
||||
|
||||
#endif
|
||||
|
|
@ -26,17 +26,14 @@ CPPSRCS = \
|
|||
nsAccDocManager.cpp \
|
||||
nsAccessNode.cpp \
|
||||
nsARIAMap.cpp \
|
||||
nsDocAccessible.cpp \
|
||||
nsCoreUtils.cpp \
|
||||
nsAccUtils.cpp \
|
||||
nsAccessibilityService.cpp \
|
||||
nsAccessible.cpp \
|
||||
nsAccessiblePivot.cpp \
|
||||
nsAccTreeWalker.cpp \
|
||||
nsBaseWidgetAccessible.cpp \
|
||||
nsEventShell.cpp \
|
||||
nsCaretAccessible.cpp \
|
||||
nsTextAccessible.cpp \
|
||||
nsTextEquivUtils.cpp \
|
||||
RoleAsserts.cpp \
|
||||
StyleInfo.cpp \
|
||||
|
@ -44,11 +41,16 @@ CPPSRCS = \
|
|||
TextUpdater.cpp \
|
||||
$(NULL)
|
||||
|
||||
ifdef MOZ_DEBUG
|
||||
CPPSRCS += \
|
||||
Logging.cpp \
|
||||
$(NULL)
|
||||
endif
|
||||
|
||||
EXPORTS = \
|
||||
a11yGeneric.h \
|
||||
nsAccDocManager.h \
|
||||
nsAccessibilityService.h \
|
||||
nsAccessible.h \
|
||||
nsAccessNode.h \
|
||||
$(NULL)
|
||||
|
||||
|
|
|
@ -9,11 +9,11 @@
|
|||
#include "nsAccessibilityService.h"
|
||||
#include "nsAccUtils.h"
|
||||
#include "nsCoreUtils.h"
|
||||
#include "nsDocAccessible.h"
|
||||
#include "DocAccessible.h"
|
||||
#include "nsEventShell.h"
|
||||
#include "nsTextAccessible.h"
|
||||
#include "FocusManager.h"
|
||||
#include "Role.h"
|
||||
#include "TextLeafAccessible.h"
|
||||
#include "TextUpdater.h"
|
||||
|
||||
#include "mozilla/dom/Element.h"
|
||||
|
@ -28,7 +28,7 @@ const unsigned int kSelChangeCountToPack = 5;
|
|||
// NotificationCollector
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
NotificationController::NotificationController(nsDocAccessible* aDocument,
|
||||
NotificationController::NotificationController(DocAccessible* aDocument,
|
||||
nsIPresShell* aPresShell) :
|
||||
mObservingState(eNotObservingRefresh), mDocument(aDocument),
|
||||
mPresShell(aPresShell)
|
||||
|
@ -63,7 +63,7 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NATIVE_BEGIN(NotificationController)
|
|||
NS_CYCLE_COLLECTION_NOTE_EDGE_NAME(cb, "mDocument");
|
||||
cb.NoteXPCOMChild(static_cast<nsIAccessible*>(tmp->mDocument.get()));
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSTARRAY_MEMBER(mHangingChildDocuments,
|
||||
nsDocAccessible)
|
||||
DocAccessible)
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSTARRAY_MEMBER(mContentInsertions,
|
||||
ContentInsertion)
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSTARRAY_MEMBER(mEvents, AccEvent)
|
||||
|
@ -120,7 +120,7 @@ NotificationController::QueueEvent(AccEvent* aEvent)
|
|||
}
|
||||
|
||||
void
|
||||
NotificationController::ScheduleChildDocBinding(nsDocAccessible* aDocument)
|
||||
NotificationController::ScheduleChildDocBinding(DocAccessible* aDocument)
|
||||
{
|
||||
// Schedule child document binding to the tree.
|
||||
mHangingChildDocuments.AppendElement(aDocument);
|
||||
|
@ -128,7 +128,7 @@ NotificationController::ScheduleChildDocBinding(nsDocAccessible* aDocument)
|
|||
}
|
||||
|
||||
void
|
||||
NotificationController::ScheduleContentInsertion(nsAccessible* aContainer,
|
||||
NotificationController::ScheduleContentInsertion(Accessible* aContainer,
|
||||
nsIContent* aStartChildNode,
|
||||
nsIContent* aEndChildNode)
|
||||
{
|
||||
|
@ -161,7 +161,7 @@ NotificationController::IsUpdatePending()
|
|||
mObservingState == eRefreshProcessingForUpdate ||
|
||||
mContentInsertions.Length() != 0 || mNotifications.Length() != 0 ||
|
||||
mTextHash.Count() != 0 ||
|
||||
!mDocument->HasLoadState(nsDocAccessible::eTreeConstructed);
|
||||
!mDocument->HasLoadState(DocAccessible::eTreeConstructed);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -182,7 +182,7 @@ NotificationController::WillRefresh(mozilla::TimeStamp aTime)
|
|||
mObservingState = eRefreshProcessingForUpdate;
|
||||
|
||||
// Initial accessible tree construction.
|
||||
if (!mDocument->HasLoadState(nsDocAccessible::eTreeConstructed)) {
|
||||
if (!mDocument->HasLoadState(DocAccessible::eTreeConstructed)) {
|
||||
// If document is not bound to parent at this point then the document is not
|
||||
// ready yet (process notifications later).
|
||||
if (!mDocument->IsBoundToParent()) {
|
||||
|
@ -228,14 +228,14 @@ NotificationController::WillRefresh(mozilla::TimeStamp aTime)
|
|||
// Bind hanging child documents.
|
||||
PRUint32 hangingDocCnt = mHangingChildDocuments.Length();
|
||||
for (PRUint32 idx = 0; idx < hangingDocCnt; idx++) {
|
||||
nsDocAccessible* childDoc = mHangingChildDocuments[idx];
|
||||
DocAccessible* childDoc = mHangingChildDocuments[idx];
|
||||
if (childDoc->IsDefunct())
|
||||
continue;
|
||||
|
||||
nsIContent* ownerContent = mDocument->GetDocumentNode()->
|
||||
FindContentForSubDocument(childDoc->GetDocumentNode());
|
||||
if (ownerContent) {
|
||||
nsAccessible* outerDocAcc = mDocument->GetAccessible(ownerContent);
|
||||
Accessible* outerDocAcc = mDocument->GetAccessible(ownerContent);
|
||||
if (outerDocAcc && outerDocAcc->AppendChild(childDoc)) {
|
||||
if (mDocument->AppendChildDocument(childDoc))
|
||||
continue;
|
||||
|
@ -251,13 +251,13 @@ NotificationController::WillRefresh(mozilla::TimeStamp aTime)
|
|||
|
||||
// If the document is ready and all its subdocuments are completely loaded
|
||||
// then process the document load.
|
||||
if (mDocument->HasLoadState(nsDocAccessible::eReady) &&
|
||||
!mDocument->HasLoadState(nsDocAccessible::eCompletelyLoaded) &&
|
||||
if (mDocument->HasLoadState(DocAccessible::eReady) &&
|
||||
!mDocument->HasLoadState(DocAccessible::eCompletelyLoaded) &&
|
||||
hangingDocCnt == 0) {
|
||||
PRUint32 childDocCnt = mDocument->ChildDocumentCount(), childDocIdx = 0;
|
||||
for (; childDocIdx < childDocCnt; childDocIdx++) {
|
||||
nsDocAccessible* childDoc = mDocument->GetChildDocumentAt(childDocIdx);
|
||||
if (!childDoc->HasLoadState(nsDocAccessible::eCompletelyLoaded))
|
||||
DocAccessible* childDoc = mDocument->GetChildDocumentAt(childDocIdx);
|
||||
if (!childDoc->HasLoadState(DocAccessible::eCompletelyLoaded))
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -295,7 +295,7 @@ NotificationController::WillRefresh(mozilla::TimeStamp aTime)
|
|||
for (PRUint32 idx = 0; idx < eventCount; idx++) {
|
||||
AccEvent* accEvent = events[idx];
|
||||
if (accEvent->mEventRule != AccEvent::eDoNotEmit) {
|
||||
nsAccessible* target = accEvent->GetAccessible();
|
||||
Accessible* target = accEvent->GetAccessible();
|
||||
if (!target || target->IsDefunct())
|
||||
continue;
|
||||
|
||||
|
@ -323,7 +323,7 @@ NotificationController::WillRefresh(mozilla::TimeStamp aTime)
|
|||
if (mContentInsertions.Length() == 0 && mNotifications.Length() == 0 &&
|
||||
mEvents.Length() == 0 && mTextHash.Count() == 0 &&
|
||||
mHangingChildDocuments.Length() == 0 &&
|
||||
mDocument->HasLoadState(nsDocAccessible::eCompletelyLoaded) &&
|
||||
mDocument->HasLoadState(DocAccessible::eCompletelyLoaded) &&
|
||||
mPresShell->RemoveRefreshObserver(this, Flush_Display)) {
|
||||
mObservingState = eNotObservingRefresh;
|
||||
}
|
||||
|
@ -641,8 +641,8 @@ NotificationController::CoalesceTextChangeEventsFor(AccShowEvent* aTailEvent,
|
|||
void
|
||||
NotificationController::CreateTextChangeEventFor(AccMutationEvent* aEvent)
|
||||
{
|
||||
nsDocAccessible* document = aEvent->GetDocAccessible();
|
||||
nsAccessible* container = document->GetContainerAccessible(aEvent->mNode);
|
||||
DocAccessible* document = aEvent->GetDocAccessible();
|
||||
Accessible* container = document->GetContainerAccessible(aEvent->mNode);
|
||||
if (!container)
|
||||
return;
|
||||
|
||||
|
@ -680,9 +680,9 @@ PLDHashOperator
|
|||
NotificationController::TextEnumerator(nsCOMPtrHashKey<nsIContent>* aEntry,
|
||||
void* aUserArg)
|
||||
{
|
||||
nsDocAccessible* document = static_cast<nsDocAccessible*>(aUserArg);
|
||||
DocAccessible* document = static_cast<DocAccessible*>(aUserArg);
|
||||
nsIContent* textNode = aEntry->GetKey();
|
||||
nsAccessible* textAcc = document->GetAccessible(textNode);
|
||||
Accessible* textAcc = document->GetAccessible(textNode);
|
||||
|
||||
// If the text node is not in tree or doesn't have frame then this case should
|
||||
// have been handled already by content removal notifications.
|
||||
|
@ -771,7 +771,7 @@ NotificationController::TextEnumerator(nsCOMPtrHashKey<nsIContent>* aEntry,
|
|||
#endif
|
||||
|
||||
// Make sure the text node is in accessible document still.
|
||||
nsAccessible* container = document->GetAccessibleOrContainer(containerNode);
|
||||
Accessible* container = document->GetAccessibleOrContainer(containerNode);
|
||||
NS_ASSERTION(container,
|
||||
"Text node having rendered text hasn't accessible document!");
|
||||
if (container) {
|
||||
|
@ -789,7 +789,7 @@ NotificationController::TextEnumerator(nsCOMPtrHashKey<nsIContent>* aEntry,
|
|||
// NotificationController: content inserted notification
|
||||
|
||||
NotificationController::ContentInsertion::
|
||||
ContentInsertion(nsDocAccessible* aDocument, nsAccessible* aContainer) :
|
||||
ContentInsertion(DocAccessible* aDocument, Accessible* aContainer) :
|
||||
mDocument(aDocument), mContainer(aContainer)
|
||||
{
|
||||
}
|
||||
|
|
|
@ -10,8 +10,8 @@
|
|||
#include "nsCycleCollectionParticipant.h"
|
||||
#include "nsRefreshDriver.h"
|
||||
|
||||
class nsAccessible;
|
||||
class nsDocAccessible;
|
||||
class Accessible;
|
||||
class DocAccessible;
|
||||
class nsIContent;
|
||||
|
||||
// Uncomment to log notifications processing.
|
||||
|
@ -87,7 +87,7 @@ private:
|
|||
class NotificationController : public nsARefreshObserver
|
||||
{
|
||||
public:
|
||||
NotificationController(nsDocAccessible* aDocument, nsIPresShell* aPresShell);
|
||||
NotificationController(DocAccessible* aDocument, nsIPresShell* aPresShell);
|
||||
virtual ~NotificationController();
|
||||
|
||||
NS_IMETHOD_(nsrefcnt) AddRef(void);
|
||||
|
@ -108,7 +108,7 @@ public:
|
|||
/**
|
||||
* Schedule binding the child document to the tree of this document.
|
||||
*/
|
||||
void ScheduleChildDocBinding(nsDocAccessible* aDocument);
|
||||
void ScheduleChildDocBinding(DocAccessible* aDocument);
|
||||
|
||||
/**
|
||||
* Schedule the accessible tree update because of rendered text changes.
|
||||
|
@ -122,7 +122,7 @@ public:
|
|||
/**
|
||||
* Pend accessible tree update for content insertion.
|
||||
*/
|
||||
void ScheduleContentInsertion(nsAccessible* aContainer,
|
||||
void ScheduleContentInsertion(Accessible* aContainer,
|
||||
nsIContent* aStartChildNode,
|
||||
nsIContent* aEndChildNode);
|
||||
|
||||
|
@ -254,7 +254,7 @@ private:
|
|||
/**
|
||||
* The document accessible reference owning this queue.
|
||||
*/
|
||||
nsRefPtr<nsDocAccessible> mDocument;
|
||||
nsRefPtr<DocAccessible> mDocument;
|
||||
|
||||
/**
|
||||
* The presshell of the document accessible.
|
||||
|
@ -264,7 +264,7 @@ private:
|
|||
/**
|
||||
* Child documents that needs to be bound to the tree.
|
||||
*/
|
||||
nsTArray<nsRefPtr<nsDocAccessible> > mHangingChildDocuments;
|
||||
nsTArray<nsRefPtr<DocAccessible> > mHangingChildDocuments;
|
||||
|
||||
/**
|
||||
* Storage for content inserted notification information.
|
||||
|
@ -272,7 +272,7 @@ private:
|
|||
class ContentInsertion
|
||||
{
|
||||
public:
|
||||
ContentInsertion(nsDocAccessible* aDocument, nsAccessible* aContainer);
|
||||
ContentInsertion(DocAccessible* aDocument, Accessible* aContainer);
|
||||
virtual ~ContentInsertion() { mDocument = nsnull; }
|
||||
|
||||
NS_INLINE_DECL_REFCOUNTING(ContentInsertion)
|
||||
|
@ -289,10 +289,10 @@ private:
|
|||
// The document used to process content insertion, matched to document of
|
||||
// the notification controller that this notification belongs to, therefore
|
||||
// it's ok to keep it as weak ref.
|
||||
nsDocAccessible* mDocument;
|
||||
DocAccessible* mDocument;
|
||||
|
||||
// The container accessible that content insertion occurs within.
|
||||
nsRefPtr<nsAccessible> mContainer;
|
||||
nsRefPtr<Accessible> mContainer;
|
||||
|
||||
// Array of inserted contents.
|
||||
nsTArray<nsCOMPtr<nsIContent> > mInsertedContent;
|
||||
|
|
|
@ -37,11 +37,11 @@ public:
|
|||
|
||||
Relation(AccIterable* aIter) : mFirstIter(aIter), mLastIter(aIter) { }
|
||||
|
||||
Relation(nsAccessible* aAcc) :
|
||||
Relation(Accessible* aAcc) :
|
||||
mFirstIter(nsnull), mLastIter(nsnull)
|
||||
{ AppendTarget(aAcc); }
|
||||
|
||||
Relation(nsDocAccessible* aDocument, nsIContent* aContent) :
|
||||
Relation(DocAccessible* aDocument, nsIContent* aContent) :
|
||||
mFirstIter(nsnull), mLastIter(nsnull)
|
||||
{ AppendTarget(aDocument, aContent); }
|
||||
|
||||
|
@ -77,7 +77,7 @@ public:
|
|||
/**
|
||||
* Append the given accessible to the set of related accessibles.
|
||||
*/
|
||||
inline void AppendTarget(nsAccessible* aAcc)
|
||||
inline void AppendTarget(Accessible* aAcc)
|
||||
{
|
||||
if (aAcc)
|
||||
AppendIter(new SingleAccIterator(aAcc));
|
||||
|
@ -87,7 +87,7 @@ public:
|
|||
* Append the one accessible for this content node to the set of related
|
||||
* accessibles.
|
||||
*/
|
||||
void AppendTarget(nsDocAccessible* aDocument, nsIContent* aContent)
|
||||
void AppendTarget(DocAccessible* aDocument, nsIContent* aContent)
|
||||
{
|
||||
if (aContent)
|
||||
AppendTarget(aDocument->GetAccessible(aContent));
|
||||
|
@ -96,9 +96,9 @@ public:
|
|||
/**
|
||||
* compute and return the next related accessible.
|
||||
*/
|
||||
inline nsAccessible* Next()
|
||||
inline Accessible* Next()
|
||||
{
|
||||
nsAccessible* target = nsnull;
|
||||
Accessible* target = nsnull;
|
||||
|
||||
// a trick nsAutoPtr deletes what it used to point to when assigned to
|
||||
while (mFirstIter && !(target = mFirstIter->Next()))
|
||||
|
|
|
@ -44,17 +44,17 @@ TextAttrsMgr::GetAttributes(nsIPersistentProperties* aAttributes,
|
|||
// Embedded objects are combined into own range with empty attributes set.
|
||||
if (mOffsetAcc && nsAccUtils::IsEmbeddedObject(mOffsetAcc)) {
|
||||
for (PRInt32 childIdx = mOffsetAccIdx - 1; childIdx >= 0; childIdx--) {
|
||||
nsAccessible *currAcc = mHyperTextAcc->GetChildAt(childIdx);
|
||||
Accessible* currAcc = mHyperTextAcc->GetChildAt(childIdx);
|
||||
if (!nsAccUtils::IsEmbeddedObject(currAcc))
|
||||
break;
|
||||
|
||||
(*aStartHTOffset)--;
|
||||
}
|
||||
|
||||
PRInt32 childCount = mHyperTextAcc->GetChildCount();
|
||||
for (PRInt32 childIdx = mOffsetAccIdx + 1; childIdx < childCount;
|
||||
PRUint32 childCount = mHyperTextAcc->ChildCount();
|
||||
for (PRUint32 childIdx = mOffsetAccIdx + 1; childIdx < childCount;
|
||||
childIdx++) {
|
||||
nsAccessible *currAcc = mHyperTextAcc->GetChildAt(childIdx);
|
||||
Accessible* currAcc = mHyperTextAcc->GetChildAt(childIdx);
|
||||
if (!nsAccUtils::IsEmbeddedObject(currAcc))
|
||||
break;
|
||||
|
||||
|
@ -137,7 +137,7 @@ TextAttrsMgr::GetRange(TextAttr* aAttrArray[], PRUint32 aAttrArrayLen,
|
|||
{
|
||||
// Navigate backward from anchor accessible to find start offset.
|
||||
for (PRInt32 childIdx = mOffsetAccIdx - 1; childIdx >= 0; childIdx--) {
|
||||
nsAccessible *currAcc = mHyperTextAcc->GetChildAt(childIdx);
|
||||
Accessible* currAcc = mHyperTextAcc->GetChildAt(childIdx);
|
||||
|
||||
// Stop on embedded accessible since embedded accessibles are combined into
|
||||
// own range.
|
||||
|
@ -164,9 +164,9 @@ TextAttrsMgr::GetRange(TextAttr* aAttrArray[], PRUint32 aAttrArrayLen,
|
|||
}
|
||||
|
||||
// Navigate forward from anchor accessible to find end offset.
|
||||
PRInt32 childLen = mHyperTextAcc->GetChildCount();
|
||||
for (PRInt32 childIdx = mOffsetAccIdx + 1; childIdx < childLen; childIdx++) {
|
||||
nsAccessible *currAcc = mHyperTextAcc->GetChildAt(childIdx);
|
||||
PRUint32 childLen = mHyperTextAcc->ChildCount();
|
||||
for (PRUint32 childIdx = mOffsetAccIdx + 1; childIdx < childLen; childIdx++) {
|
||||
Accessible* currAcc = mHyperTextAcc->GetChildAt(childIdx);
|
||||
if (nsAccUtils::IsEmbeddedObject(currAcc))
|
||||
break;
|
||||
|
||||
|
|
|
@ -47,7 +47,7 @@ public:
|
|||
*/
|
||||
TextAttrsMgr(nsHyperTextAccessible* aHyperTextAcc,
|
||||
bool aIncludeDefAttrs,
|
||||
nsAccessible* aOffsetAcc,
|
||||
Accessible* aOffsetAcc,
|
||||
PRInt32 aOffsetAccIdx) :
|
||||
mOffsetAcc(aOffsetAcc), mHyperTextAcc(aHyperTextAcc),
|
||||
mOffsetAccIdx(aOffsetAccIdx), mIncludeDefAttrs(aIncludeDefAttrs) { }
|
||||
|
@ -83,7 +83,7 @@ protected:
|
|||
PRInt32* aStartHTOffset, PRInt32* aEndHTOffset);
|
||||
|
||||
private:
|
||||
nsAccessible* mOffsetAcc;
|
||||
Accessible* mOffsetAcc;
|
||||
nsHyperTextAccessible* mHyperTextAcc;
|
||||
PRInt32 mOffsetAccIdx;
|
||||
bool mIncludeDefAttrs;
|
||||
|
|
|
@ -6,11 +6,13 @@
|
|||
#include "TextUpdater.h"
|
||||
|
||||
#include "Accessible-inl.h"
|
||||
#include "nsDocAccessible.h"
|
||||
#include "nsTextAccessible.h"
|
||||
#include "DocAccessible.h"
|
||||
#include "TextLeafAccessible.h"
|
||||
|
||||
using namespace mozilla::a11y;
|
||||
|
||||
void
|
||||
TextUpdater::Run(nsDocAccessible* aDocument, nsTextAccessible* aTextLeaf,
|
||||
TextUpdater::Run(DocAccessible* aDocument, TextLeafAccessible* aTextLeaf,
|
||||
const nsAString& aNewText)
|
||||
{
|
||||
NS_ASSERTION(aTextLeaf, "No text leaf accessible?");
|
||||
|
@ -37,7 +39,7 @@ void
|
|||
TextUpdater::DoUpdate(const nsAString& aNewText, const nsAString& aOldText,
|
||||
PRUint32 aSkipStart)
|
||||
{
|
||||
nsAccessible* parent = mTextLeaf->Parent();
|
||||
Accessible* parent = mTextLeaf->Parent();
|
||||
if (!parent)
|
||||
return;
|
||||
|
||||
|
|
|
@ -19,11 +19,13 @@ public:
|
|||
/**
|
||||
* Start text of the text leaf update.
|
||||
*/
|
||||
static void Run(nsDocAccessible* aDocument, nsTextAccessible* aTextLeaf,
|
||||
static void Run(DocAccessible* aDocument,
|
||||
mozilla::a11y::TextLeafAccessible* aTextLeaf,
|
||||
const nsAString& aNewText);
|
||||
|
||||
private:
|
||||
TextUpdater(nsDocAccessible* aDocument, nsTextAccessible* aTextLeaf) :
|
||||
TextUpdater(DocAccessible* aDocument,
|
||||
mozilla::a11y::TextLeafAccessible* aTextLeaf) :
|
||||
mDocument(aDocument), mTextLeaf(aTextLeaf), mHyperText(nsnull),
|
||||
mTextOffset(-1) { }
|
||||
|
||||
|
@ -81,8 +83,8 @@ private:
|
|||
const static PRUint32 kMaxStrLen = 1 << 6;
|
||||
|
||||
private:
|
||||
nsDocAccessible* mDocument;
|
||||
nsTextAccessible* mTextLeaf;
|
||||
DocAccessible* mDocument;
|
||||
mozilla::a11y::TextLeafAccessible* mTextLeaf;
|
||||
nsHyperTextAccessible* mHyperText;
|
||||
PRInt32 mTextOffset;
|
||||
};
|
||||
|
|
|
@ -12,25 +12,25 @@
|
|||
using namespace mozilla::a11y;
|
||||
|
||||
bool
|
||||
filters::GetSelected(nsAccessible* aAccessible)
|
||||
filters::GetSelected(Accessible* aAccessible)
|
||||
{
|
||||
return aAccessible->State() & states::SELECTED;
|
||||
}
|
||||
|
||||
bool
|
||||
filters::GetSelectable(nsAccessible* aAccessible)
|
||||
filters::GetSelectable(Accessible* aAccessible)
|
||||
{
|
||||
return aAccessible->State() & states::SELECTABLE;
|
||||
}
|
||||
|
||||
bool
|
||||
filters::GetRow(nsAccessible* aAccessible)
|
||||
filters::GetRow(Accessible* aAccessible)
|
||||
{
|
||||
return aAccessible->Role() == roles::ROW;
|
||||
}
|
||||
|
||||
bool
|
||||
filters::GetCell(nsAccessible* aAccessible)
|
||||
filters::GetCell(Accessible* aAccessible)
|
||||
{
|
||||
roles::Role role = aAccessible->Role();
|
||||
return role == roles::GRID_CELL || role == roles::ROWHEADER ||
|
||||
|
@ -38,7 +38,7 @@ filters::GetCell(nsAccessible* aAccessible)
|
|||
}
|
||||
|
||||
bool
|
||||
filters::GetEmbeddedObject(nsAccessible* aAccessible)
|
||||
filters::GetEmbeddedObject(Accessible* aAccessible)
|
||||
{
|
||||
return nsAccUtils::IsEmbeddedObject(aAccessible);
|
||||
}
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
#ifndef a11yFilters_h_
|
||||
#define a11yFilters_h_
|
||||
|
||||
class nsAccessible;
|
||||
class Accessible;
|
||||
|
||||
/**
|
||||
* Predefined filters used for nsAccIterator and nsAccCollector.
|
||||
|
@ -15,13 +15,13 @@ namespace filters {
|
|||
/**
|
||||
* Return true if the traversed accessible complies with filter.
|
||||
*/
|
||||
typedef bool (*FilterFuncPtr) (nsAccessible*);
|
||||
typedef bool (*FilterFuncPtr) (Accessible*);
|
||||
|
||||
bool GetSelected(nsAccessible* aAccessible);
|
||||
bool GetSelectable(nsAccessible* aAccessible);
|
||||
bool GetRow(nsAccessible* aAccessible);
|
||||
bool GetCell(nsAccessible* aAccessible);
|
||||
bool GetEmbeddedObject(nsAccessible* aAccessible);
|
||||
bool GetSelected(Accessible* aAccessible);
|
||||
bool GetSelectable(Accessible* aAccessible);
|
||||
bool GetRow(Accessible* aAccessible);
|
||||
bool GetCell(Accessible* aAccessible);
|
||||
bool GetEmbeddedObject(Accessible* aAccessible);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
|
@ -91,7 +91,7 @@ const bool kUseNativeRole = false;
|
|||
|
||||
/**
|
||||
* This mask indicates the attribute should not be exposed as an object
|
||||
* attribute via the catch-all logic in nsAccessible::GetAttributes.
|
||||
* attribute via the catch-all logic in Accessible::GetAttributes.
|
||||
* This means it either isn't mean't to be exposed as an object attribute, or
|
||||
* that it should, but is already handled in other code.
|
||||
*/
|
||||
|
@ -99,7 +99,7 @@ const PRUint8 ATTR_BYPASSOBJ = 0x0001;
|
|||
|
||||
/**
|
||||
* This mask indicates the attribute is expected to have an NMTOKEN or bool value.
|
||||
* (See for example usage in nsAccessible::GetAttributes)
|
||||
* (See for example usage in Accessible::GetAttributes)
|
||||
*/
|
||||
const PRUint8 ATTR_VALTOKEN = 0x0010;
|
||||
|
||||
|
|
|
@ -33,9 +33,9 @@ ClearCacheEntry(const void* aKey, nsRefPtr<T>& aAccessible, void* aUserArg)
|
|||
*/
|
||||
|
||||
static void
|
||||
ClearCache(nsAccessibleHashtable & aCache)
|
||||
ClearCache(AccessibleHashtable& aCache)
|
||||
{
|
||||
aCache.Enumerate(ClearCacheEntry<nsAccessible>, nsnull);
|
||||
aCache.Enumerate(ClearCacheEntry<Accessible>, nsnull);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -61,10 +61,10 @@ CycleCollectorTraverseCacheEntry(const void *aKey, T *aAccessible,
|
|||
*/
|
||||
|
||||
static void
|
||||
CycleCollectorTraverseCache(nsAccessibleHashtable & aCache,
|
||||
CycleCollectorTraverseCache(AccessibleHashtable& aCache,
|
||||
nsCycleCollectionTraversalCallback *aCallback)
|
||||
{
|
||||
aCache.EnumerateRead(CycleCollectorTraverseCacheEntry<nsAccessible>, aCallback);
|
||||
aCache.EnumerateRead(CycleCollectorTraverseCacheEntry<Accessible>, aCallback);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
|
@ -12,6 +12,10 @@
|
|||
#include "RootAccessibleWrap.h"
|
||||
#include "States.h"
|
||||
|
||||
#ifdef DEBUG
|
||||
#include "Logging.h"
|
||||
#endif
|
||||
|
||||
#include "nsCURILoader.h"
|
||||
#include "nsDocShellLoadTypes.h"
|
||||
#include "nsIChannel.h"
|
||||
|
@ -33,7 +37,7 @@ using namespace mozilla::a11y;
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
// nsAccDocManager public
|
||||
|
||||
nsDocAccessible*
|
||||
DocAccessible*
|
||||
nsAccDocManager::GetDocAccessible(nsIDocument *aDocument)
|
||||
{
|
||||
if (!aDocument)
|
||||
|
@ -42,14 +46,14 @@ nsAccDocManager::GetDocAccessible(nsIDocument *aDocument)
|
|||
// Ensure CacheChildren is called before we query cache.
|
||||
nsAccessNode::GetApplicationAccessible()->EnsureChildren();
|
||||
|
||||
nsDocAccessible* docAcc = mDocAccessibleCache.GetWeak(aDocument);
|
||||
DocAccessible* docAcc = mDocAccessibleCache.GetWeak(aDocument);
|
||||
if (docAcc)
|
||||
return docAcc;
|
||||
|
||||
return CreateDocOrRootAccessible(aDocument);
|
||||
}
|
||||
|
||||
nsAccessible*
|
||||
Accessible*
|
||||
nsAccDocManager::FindAccessibleInCache(nsINode* aNode) const
|
||||
{
|
||||
nsSearchAccessibleInCacheArg arg;
|
||||
|
@ -140,7 +144,10 @@ nsAccDocManager::OnStateChange(nsIWebProgress *aWebProgress,
|
|||
|
||||
// Document was loaded.
|
||||
if (aStateFlags & STATE_STOP) {
|
||||
NS_LOG_ACCDOCLOAD("document loaded", aWebProgress, aRequest, aStateFlags)
|
||||
#ifdef DEBUG
|
||||
if (logging::IsEnabled(logging::eDocLoad))
|
||||
logging::DocLoad("document loaded", aWebProgress, aRequest, aStateFlags);
|
||||
#endif
|
||||
|
||||
// Figure out an event type to notify the document has been loaded.
|
||||
PRUint32 eventType = nsIAccessibleEvent::EVENT_DOCUMENT_LOAD_STOPPED;
|
||||
|
@ -166,10 +173,12 @@ nsAccDocManager::OnStateChange(nsIWebProgress *aWebProgress,
|
|||
}
|
||||
|
||||
// Document loading was started.
|
||||
NS_LOG_ACCDOCLOAD("start document loading", aWebProgress, aRequest,
|
||||
aStateFlags)
|
||||
#ifdef DEBUG
|
||||
if (logging::IsEnabled(logging::eDocLoad))
|
||||
logging::DocLoad("start document loading", aWebProgress, aRequest, aStateFlags);
|
||||
#endif
|
||||
|
||||
nsDocAccessible* docAcc = mDocAccessibleCache.GetWeak(document);
|
||||
DocAccessible* docAcc = mDocAccessibleCache.GetWeak(document);
|
||||
if (!docAcc)
|
||||
return NS_OK;
|
||||
|
||||
|
@ -253,7 +262,10 @@ nsAccDocManager::HandleEvent(nsIDOMEvent *aEvent)
|
|||
// accessible and all its sub document accessible are shutdown as result of
|
||||
// processing.
|
||||
|
||||
NS_LOG_ACCDOCDESTROY("received 'pagehide' event", document)
|
||||
#ifdef DEBUG
|
||||
if (logging::IsEnabled(logging::eDocDestroy))
|
||||
logging::DocDestroy("received 'pagehide' event", document);
|
||||
#endif
|
||||
|
||||
// Ignore 'pagehide' on temporary documents since we ignore them entirely in
|
||||
// accessibility.
|
||||
|
@ -265,7 +277,7 @@ nsAccDocManager::HandleEvent(nsIDOMEvent *aEvent)
|
|||
// We're allowed to not remove listeners when accessible document is
|
||||
// shutdown since we don't keep strong reference on chrome event target and
|
||||
// listeners are removed automatically when chrome event target goes away.
|
||||
nsDocAccessible* docAccessible = mDocAccessibleCache.GetWeak(document);
|
||||
DocAccessible* docAccessible = mDocAccessibleCache.GetWeak(document);
|
||||
if (docAccessible)
|
||||
docAccessible->Shutdown();
|
||||
|
||||
|
@ -276,7 +288,11 @@ nsAccDocManager::HandleEvent(nsIDOMEvent *aEvent)
|
|||
// webprogress notifications nor 'pageshow' event.
|
||||
if (type.EqualsLiteral("DOMContentLoaded") &&
|
||||
nsCoreUtils::IsErrorPage(document)) {
|
||||
NS_LOG_ACCDOCLOAD2("handled 'DOMContentLoaded' event", document)
|
||||
#ifdef DEBUG
|
||||
if (logging::IsEnabled(logging::eDocLoad))
|
||||
logging::DocLoad("handled 'DOMContentLoaded' event", document);
|
||||
#endif
|
||||
|
||||
HandleDOMDocumentLoad(document,
|
||||
nsIAccessibleEvent::EVENT_DOCUMENT_LOAD_COMPLETE);
|
||||
}
|
||||
|
@ -293,7 +309,7 @@ nsAccDocManager::HandleDOMDocumentLoad(nsIDocument *aDocument,
|
|||
{
|
||||
// Document accessible can be created before we were notified the DOM document
|
||||
// was loaded completely. However if it's not created yet then create it.
|
||||
nsDocAccessible* docAcc = mDocAccessibleCache.GetWeak(aDocument);
|
||||
DocAccessible* docAcc = mDocAccessibleCache.GetWeak(aDocument);
|
||||
if (!docAcc) {
|
||||
docAcc = CreateDocOrRootAccessible(aDocument);
|
||||
if (!docAcc)
|
||||
|
@ -313,16 +329,22 @@ nsAccDocManager::AddListeners(nsIDocument *aDocument,
|
|||
elm->AddEventListenerByType(this, NS_LITERAL_STRING("pagehide"),
|
||||
NS_EVENT_FLAG_CAPTURE);
|
||||
|
||||
NS_LOG_ACCDOCCREATE_TEXT(" added 'pagehide' listener")
|
||||
#ifdef DEBUG
|
||||
if (logging::IsEnabled(logging::eDocCreate))
|
||||
logging::Text("added 'pagehide' listener");
|
||||
#endif
|
||||
|
||||
if (aAddDOMContentLoadedListener) {
|
||||
elm->AddEventListenerByType(this, NS_LITERAL_STRING("DOMContentLoaded"),
|
||||
NS_EVENT_FLAG_CAPTURE);
|
||||
NS_LOG_ACCDOCCREATE_TEXT(" added 'DOMContentLoaded' listener")
|
||||
#ifdef DEBUG
|
||||
if (logging::IsEnabled(logging::eDocCreate))
|
||||
logging::Text("added 'DOMContentLoaded' listener");
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
nsDocAccessible*
|
||||
DocAccessible*
|
||||
nsAccDocManager::CreateDocOrRootAccessible(nsIDocument* aDocument)
|
||||
{
|
||||
// Ignore temporary, hiding, resource documents and documents without
|
||||
|
@ -344,7 +366,7 @@ nsAccDocManager::CreateDocOrRootAccessible(nsIDocument* aDocument)
|
|||
|
||||
bool isRootDoc = nsCoreUtils::IsRootDocument(aDocument);
|
||||
|
||||
nsDocAccessible* parentDocAcc = nsnull;
|
||||
DocAccessible* parentDocAcc = nsnull;
|
||||
if (!isRootDoc) {
|
||||
// XXXaaronl: ideally we would traverse the presshell chain. Since there's
|
||||
// no easy way to do that, we cheat and use the document hierarchy.
|
||||
|
@ -357,9 +379,9 @@ nsAccDocManager::CreateDocOrRootAccessible(nsIDocument* aDocument)
|
|||
|
||||
// We only create root accessibles for the true root, otherwise create a
|
||||
// doc accessible.
|
||||
nsRefPtr<nsDocAccessible> docAcc = isRootDoc ?
|
||||
nsRefPtr<DocAccessible> docAcc = isRootDoc ?
|
||||
new RootAccessibleWrap(aDocument, rootElm, presShell) :
|
||||
new nsDocAccessibleWrap(aDocument, rootElm, presShell);
|
||||
new DocAccessibleWrap(aDocument, rootElm, presShell);
|
||||
|
||||
// Cache the document accessible into document cache.
|
||||
mDocAccessibleCache.Put(aDocument, docAcc);
|
||||
|
@ -373,7 +395,7 @@ nsAccDocManager::CreateDocOrRootAccessible(nsIDocument* aDocument)
|
|||
|
||||
// Bind the document to the tree.
|
||||
if (isRootDoc) {
|
||||
nsAccessible* appAcc = nsAccessNode::GetApplicationAccessible();
|
||||
Accessible* appAcc = nsAccessNode::GetApplicationAccessible();
|
||||
if (!appAcc->AppendChild(docAcc)) {
|
||||
docAcc->Shutdown();
|
||||
return nsnull;
|
||||
|
@ -392,8 +414,12 @@ nsAccDocManager::CreateDocOrRootAccessible(nsIDocument* aDocument)
|
|||
parentDocAcc->BindChildDocument(docAcc);
|
||||
}
|
||||
|
||||
NS_LOG_ACCDOCCREATE("document creation finished", aDocument)
|
||||
NS_LOG_ACCDOCCREATE_STACK
|
||||
#ifdef DEBUG
|
||||
if (logging::IsEnabled(logging::eDocCreate)) {
|
||||
logging::DocCreate("document creation finished", aDocument);
|
||||
logging::Stack();
|
||||
}
|
||||
#endif
|
||||
|
||||
AddListeners(aDocument, isRootDoc);
|
||||
return docAcc;
|
||||
|
@ -404,12 +430,12 @@ nsAccDocManager::CreateDocOrRootAccessible(nsIDocument* aDocument)
|
|||
|
||||
PLDHashOperator
|
||||
nsAccDocManager::GetFirstEntryInDocCache(const nsIDocument* aKey,
|
||||
nsDocAccessible* aDocAccessible,
|
||||
DocAccessible* aDocAccessible,
|
||||
void* aUserArg)
|
||||
{
|
||||
NS_ASSERTION(aDocAccessible,
|
||||
"No doc accessible for the object in doc accessible cache!");
|
||||
*reinterpret_cast<nsDocAccessible**>(aUserArg) = aDocAccessible;
|
||||
*reinterpret_cast<DocAccessible**>(aUserArg) = aDocAccessible;
|
||||
|
||||
return PL_DHASH_STOP;
|
||||
}
|
||||
|
@ -417,7 +443,7 @@ nsAccDocManager::GetFirstEntryInDocCache(const nsIDocument* aKey,
|
|||
void
|
||||
nsAccDocManager::ClearDocCache()
|
||||
{
|
||||
nsDocAccessible* docAcc = nsnull;
|
||||
DocAccessible* docAcc = nsnull;
|
||||
while (mDocAccessibleCache.EnumerateRead(GetFirstEntryInDocCache, static_cast<void*>(&docAcc))) {
|
||||
if (docAcc)
|
||||
docAcc->Shutdown();
|
||||
|
@ -426,7 +452,7 @@ nsAccDocManager::ClearDocCache()
|
|||
|
||||
PLDHashOperator
|
||||
nsAccDocManager::SearchAccessibleInDocCache(const nsIDocument* aKey,
|
||||
nsDocAccessible* aDocAccessible,
|
||||
DocAccessible* aDocAccessible,
|
||||
void* aUserArg)
|
||||
{
|
||||
NS_ASSERTION(aDocAccessible,
|
||||
|
@ -446,7 +472,7 @@ nsAccDocManager::SearchAccessibleInDocCache(const nsIDocument* aKey,
|
|||
#ifdef DEBUG
|
||||
PLDHashOperator
|
||||
nsAccDocManager::SearchIfDocIsRefreshing(const nsIDocument* aKey,
|
||||
nsDocAccessible* aDocAccessible,
|
||||
DocAccessible* aDocAccessible,
|
||||
void* aUserArg)
|
||||
{
|
||||
NS_ASSERTION(aDocAccessible,
|
||||
|
|
|
@ -13,10 +13,8 @@
|
|||
#include "nsWeakReference.h"
|
||||
#include "nsIPresShell.h"
|
||||
|
||||
class nsAccessible;
|
||||
class nsDocAccessible;
|
||||
|
||||
//#define DEBUG_ACCDOCMGR
|
||||
class Accessible;
|
||||
class DocAccessible;
|
||||
|
||||
/**
|
||||
* Manage the document accessible life cycle.
|
||||
|
@ -35,12 +33,12 @@ public:
|
|||
/**
|
||||
* Return document accessible for the given DOM node.
|
||||
*/
|
||||
nsDocAccessible *GetDocAccessible(nsIDocument *aDocument);
|
||||
DocAccessible* GetDocAccessible(nsIDocument* aDocument);
|
||||
|
||||
/**
|
||||
* Return document accessible for the given presshell.
|
||||
*/
|
||||
nsDocAccessible* GetDocAccessible(const nsIPresShell* aPresShell)
|
||||
DocAccessible* GetDocAccessible(const nsIPresShell* aPresShell)
|
||||
{
|
||||
return aPresShell ? GetDocAccessible(aPresShell->GetDocument()) : nsnull;
|
||||
}
|
||||
|
@ -49,12 +47,12 @@ public:
|
|||
* Search through all document accessibles for an accessible with the given
|
||||
* unique id.
|
||||
*/
|
||||
nsAccessible* FindAccessibleInCache(nsINode* aNode) const;
|
||||
Accessible* FindAccessibleInCache(nsINode* aNode) const;
|
||||
|
||||
/**
|
||||
* Return document accessible from the cache. Convenient method for testing.
|
||||
*/
|
||||
inline nsDocAccessible* GetDocAccessibleFromCache(nsIDocument* aDocument) const
|
||||
inline DocAccessible* GetDocAccessibleFromCache(nsIDocument* aDocument) const
|
||||
{
|
||||
return mDocAccessibleCache.GetWeak(aDocument);
|
||||
}
|
||||
|
@ -97,7 +95,7 @@ private:
|
|||
* @param aLoadEventType [in] specifies the event type to fire load event,
|
||||
* if 0 then no event is fired
|
||||
*/
|
||||
void HandleDOMDocumentLoad(nsIDocument *aDocument,
|
||||
void HandleDOMDocumentLoad(nsIDocument* aDocument,
|
||||
PRUint32 aLoadEventType);
|
||||
|
||||
/**
|
||||
|
@ -108,17 +106,17 @@ private:
|
|||
/**
|
||||
* Create document or root accessible.
|
||||
*/
|
||||
nsDocAccessible *CreateDocOrRootAccessible(nsIDocument *aDocument);
|
||||
DocAccessible* CreateDocOrRootAccessible(nsIDocument* aDocument);
|
||||
|
||||
typedef nsRefPtrHashtable<nsPtrHashKey<const nsIDocument>, nsDocAccessible>
|
||||
nsDocAccessibleHashtable;
|
||||
typedef nsRefPtrHashtable<nsPtrHashKey<const nsIDocument>, DocAccessible>
|
||||
DocAccessibleHashtable;
|
||||
|
||||
/**
|
||||
* Get first entry of the document accessible from cache.
|
||||
*/
|
||||
static PLDHashOperator
|
||||
GetFirstEntryInDocCache(const nsIDocument* aKey,
|
||||
nsDocAccessible* aDocAccessible,
|
||||
DocAccessible* aDocAccessible,
|
||||
void* aUserArg);
|
||||
|
||||
/**
|
||||
|
@ -128,441 +126,22 @@ private:
|
|||
|
||||
struct nsSearchAccessibleInCacheArg
|
||||
{
|
||||
nsAccessible *mAccessible;
|
||||
Accessible* mAccessible;
|
||||
nsINode* mNode;
|
||||
};
|
||||
|
||||
static PLDHashOperator
|
||||
SearchAccessibleInDocCache(const nsIDocument* aKey,
|
||||
nsDocAccessible* aDocAccessible,
|
||||
DocAccessible* aDocAccessible,
|
||||
void* aUserArg);
|
||||
|
||||
#ifdef DEBUG
|
||||
static PLDHashOperator
|
||||
SearchIfDocIsRefreshing(const nsIDocument* aKey,
|
||||
nsDocAccessible* aDocAccessible, void* aUserArg);
|
||||
DocAccessible* aDocAccessible, void* aUserArg);
|
||||
#endif
|
||||
|
||||
nsDocAccessibleHashtable mDocAccessibleCache;
|
||||
DocAccessibleHashtable mDocAccessibleCache;
|
||||
};
|
||||
|
||||
/**
|
||||
* nsAccDocManager debugging macros.
|
||||
*/
|
||||
#ifdef DEBUG_ACCDOCMGR
|
||||
|
||||
#include "nsTraceRefcntImpl.h"
|
||||
|
||||
// Enable these to log accessible document loading, creation or destruction.
|
||||
#define DEBUG_ACCDOCMGR_DOCLOAD
|
||||
#define DEBUG_ACCDOCMGR_DOCCREATE
|
||||
#define DEBUG_ACCDOCMGR_DOCDESTROY
|
||||
|
||||
// Common macros, do not use directly.
|
||||
#define NS_LOG_ACCDOC_ADDRESS(aDocument, aDocAcc) \
|
||||
printf("DOM id: %p, acc id: %p", aDocument, aDocAcc);
|
||||
|
||||
#define NS_LOG_ACCDOC_URI(aDocument) \
|
||||
nsIURI *uri = aDocument->GetDocumentURI(); \
|
||||
nsCAutoString spec; \
|
||||
uri->GetSpec(spec); \
|
||||
printf("uri: %s", spec);
|
||||
|
||||
#define NS_LOG_ACCDOC_TYPE(aDocument) \
|
||||
if (aDocument->IsActive()) { \
|
||||
bool isContent = nsCoreUtils::IsContentDocument(aDocument); \
|
||||
printf("%s document", (isContent ? "content" : "chrome")); \
|
||||
} else { \
|
||||
printf("document type: [failed]"); \
|
||||
}
|
||||
|
||||
#define NS_LOG_ACCDOC_DOCSHELLTREE(aDocument) \
|
||||
if (aDocument->IsActive()) { \
|
||||
nsCOMPtr<nsISupports> container = aDocument->GetContainer(); \
|
||||
nsCOMPtr<nsIDocShellTreeItem> treeItem(do_QueryInterface(container)); \
|
||||
nsCOMPtr<nsIDocShellTreeItem> parentTreeItem; \
|
||||
treeItem->GetParent(getter_AddRefs(parentTreeItem)); \
|
||||
nsCOMPtr<nsIDocShellTreeItem> rootTreeItem; \
|
||||
treeItem->GetRootTreeItem(getter_AddRefs(rootTreeItem)); \
|
||||
printf("docshell hierarchy, parent: %p, root: %p, is tab document: %s;", \
|
||||
parentTreeItem, rootTreeItem, \
|
||||
(nsCoreUtils::IsTabDocument(aDocument) ? "yes" : "no")); \
|
||||
}
|
||||
|
||||
#define NS_LOG_ACCDOC_SHELLSTATE(aDocument) \
|
||||
nsCAutoString docShellBusy; \
|
||||
nsCOMPtr<nsISupports> container = aDocument->GetContainer(); \
|
||||
if (container) { \
|
||||
nsCOMPtr<nsIDocShell> docShell = do_QueryInterface(container); \
|
||||
PRUint32 busyFlags = nsIDocShell::BUSY_FLAGS_NONE; \
|
||||
docShell->GetBusyFlags(&busyFlags); \
|
||||
if (busyFlags == nsIDocShell::BUSY_FLAGS_NONE) \
|
||||
docShellBusy.AppendLiteral("'none'"); \
|
||||
if (busyFlags & nsIDocShell::BUSY_FLAGS_BUSY) \
|
||||
docShellBusy.AppendLiteral("'busy'"); \
|
||||
if (busyFlags & nsIDocShell::BUSY_FLAGS_BEFORE_PAGE_LOAD) \
|
||||
docShellBusy.AppendLiteral(", 'before page load'"); \
|
||||
if (busyFlags & nsIDocShell::BUSY_FLAGS_PAGE_LOADING) \
|
||||
docShellBusy.AppendLiteral(", 'page loading'"); \
|
||||
} \
|
||||
else { \
|
||||
docShellBusy.AppendLiteral("[failed]"); \
|
||||
} \
|
||||
printf("docshell busy: %s", docShellBusy.get());
|
||||
|
||||
#define NS_LOG_ACCDOC_DOCSTATES(aDocument) \
|
||||
const char *docState = 0; \
|
||||
nsIDocument::ReadyState docStateFlag = aDocument->GetReadyStateEnum(); \
|
||||
switch (docStateFlag) { \
|
||||
case nsIDocument::READYSTATE_UNINITIALIZED: \
|
||||
docState = "uninitialized"; \
|
||||
break; \
|
||||
case nsIDocument::READYSTATE_LOADING: \
|
||||
docState = "loading"; \
|
||||
break; \
|
||||
case nsIDocument::READYSTATE_INTERACTIVE: \
|
||||
docState = "interactive"; \
|
||||
break; \
|
||||
case nsIDocument::READYSTATE_COMPLETE: \
|
||||
docState = "complete"; \
|
||||
break; \
|
||||
} \
|
||||
printf("doc state: %s", docState); \
|
||||
printf(", %sinitial", aDocument->IsInitialDocument() ? "" : "not "); \
|
||||
printf(", %sshowing", aDocument->IsShowing() ? "" : "not "); \
|
||||
printf(", %svisible", aDocument->IsVisible() ? "" : "not "); \
|
||||
printf(", %sactive", aDocument->IsActive() ? "" : "not ");
|
||||
|
||||
#define NS_LOG_ACCDOC_DOCPRESSHELL(aDocument) \
|
||||
nsIPresShell *ps = aDocument->GetShell(); \
|
||||
printf("presshell: %p", ps); \
|
||||
nsIScrollableFrame *sf = ps ? \
|
||||
ps->GetRootScrollFrameAsScrollableExternal() : nsnull; \
|
||||
printf(", root scroll frame: %p", sf);
|
||||
|
||||
#define NS_LOG_ACCDOC_DOCLOADGROUP(aDocument) \
|
||||
nsCOMPtr<nsILoadGroup> loadGroup = aDocument->GetDocumentLoadGroup(); \
|
||||
printf("load group: %p", loadGroup);
|
||||
|
||||
#define NS_LOG_ACCDOC_DOCPARENT(aDocument) \
|
||||
nsIDocument *parentDoc = aDocument->GetParentDocument(); \
|
||||
printf("parent id: %p", parentDoc); \
|
||||
if (parentDoc) { \
|
||||
printf("\n parent "); \
|
||||
NS_LOG_ACCDOC_URI(parentDoc) \
|
||||
printf("\n"); \
|
||||
}
|
||||
|
||||
#define NS_LOG_ACCDOC_SHELLLOADTYPE(aDocShell) \
|
||||
{ \
|
||||
printf("load type: "); \
|
||||
PRUint32 loadType; \
|
||||
docShell->GetLoadType(&loadType); \
|
||||
switch (loadType) { \
|
||||
case LOAD_NORMAL: \
|
||||
printf("normal; "); \
|
||||
break; \
|
||||
case LOAD_NORMAL_REPLACE: \
|
||||
printf("normal replace; "); \
|
||||
break; \
|
||||
case LOAD_NORMAL_EXTERNAL: \
|
||||
printf("normal external; "); \
|
||||
break; \
|
||||
case LOAD_HISTORY: \
|
||||
printf("history; "); \
|
||||
break; \
|
||||
case LOAD_NORMAL_BYPASS_CACHE: \
|
||||
printf("normal bypass cache; "); \
|
||||
break; \
|
||||
case LOAD_NORMAL_BYPASS_PROXY: \
|
||||
printf("normal bypass proxy; "); \
|
||||
break; \
|
||||
case LOAD_NORMAL_BYPASS_PROXY_AND_CACHE: \
|
||||
printf("normal bypass proxy and cache; "); \
|
||||
break; \
|
||||
case LOAD_RELOAD_NORMAL: \
|
||||
printf("reload normal; "); \
|
||||
break; \
|
||||
case LOAD_RELOAD_BYPASS_CACHE: \
|
||||
printf("reload bypass cache; "); \
|
||||
break; \
|
||||
case LOAD_RELOAD_BYPASS_PROXY: \
|
||||
printf("reload bypass proxy; "); \
|
||||
break; \
|
||||
case LOAD_RELOAD_BYPASS_PROXY_AND_CACHE: \
|
||||
printf("reload bypass proxy and cache; "); \
|
||||
break; \
|
||||
case LOAD_LINK: \
|
||||
printf("link; "); \
|
||||
break; \
|
||||
case LOAD_REFRESH: \
|
||||
printf("refresh; "); \
|
||||
break; \
|
||||
case LOAD_RELOAD_CHARSET_CHANGE: \
|
||||
printf("reload charset change; "); \
|
||||
break; \
|
||||
case LOAD_BYPASS_HISTORY: \
|
||||
printf("bypass history; "); \
|
||||
break; \
|
||||
case LOAD_STOP_CONTENT: \
|
||||
printf("stop content; "); \
|
||||
break; \
|
||||
case LOAD_STOP_CONTENT_AND_REPLACE: \
|
||||
printf("stop content and replace; "); \
|
||||
break; \
|
||||
case LOAD_PUSHSTATE: \
|
||||
printf("load pushstate; "); \
|
||||
break; \
|
||||
case LOAD_ERROR_PAGE: \
|
||||
printf("error page;"); \
|
||||
break; \
|
||||
default: \
|
||||
printf("unknown"); \
|
||||
} \
|
||||
}
|
||||
|
||||
#define NS_LOG_ACCDOC_DOCINFO_BEGIN \
|
||||
printf(" {\n");
|
||||
#define NS_LOG_ACCDOC_DOCINFO_BODY(aDocument, aDocAcc) \
|
||||
{ \
|
||||
printf(" "); \
|
||||
NS_LOG_ACCDOC_ADDRESS(aDocument, aDocAcc) \
|
||||
printf("\n "); \
|
||||
if (aDocument) { \
|
||||
NS_LOG_ACCDOC_URI(aDocument) \
|
||||
printf("\n "); \
|
||||
NS_LOG_ACCDOC_SHELLSTATE(aDocument) \
|
||||
printf("; "); \
|
||||
NS_LOG_ACCDOC_TYPE(aDocument) \
|
||||
printf("\n "); \
|
||||
NS_LOG_ACCDOC_DOCSHELLTREE(aDocument) \
|
||||
printf("\n "); \
|
||||
NS_LOG_ACCDOC_DOCSTATES(aDocument) \
|
||||
printf("\n "); \
|
||||
NS_LOG_ACCDOC_DOCPRESSHELL(aDocument) \
|
||||
printf("\n "); \
|
||||
NS_LOG_ACCDOC_DOCLOADGROUP(aDocument) \
|
||||
printf(", "); \
|
||||
NS_LOG_ACCDOC_DOCPARENT(aDocument) \
|
||||
printf("\n"); \
|
||||
} \
|
||||
}
|
||||
#define NS_LOG_ACCDOC_DOCINFO_END \
|
||||
printf(" }\n");
|
||||
|
||||
#define NS_LOG_ACCDOC_DOCINFO(aDocument, aDocAcc) \
|
||||
NS_LOG_ACCDOC_DOCINFO_BEGIN \
|
||||
NS_LOG_ACCDOC_DOCINFO_BODY(aDocument, aDocAcc) \
|
||||
NS_LOG_ACCDOC_DOCINFO_END
|
||||
|
||||
#define NS_GET_ACCDOC_EVENTTYPE(aEvent) \
|
||||
nsCAutoString strEventType; \
|
||||
PRUint32 type = aEvent->GetEventType(); \
|
||||
if (type == nsIAccessibleEvent::EVENT_DOCUMENT_LOAD_STOPPED) { \
|
||||
strEventType.AssignLiteral("load stopped"); \
|
||||
} else if (type == nsIAccessibleEvent::EVENT_DOCUMENT_LOAD_COMPLETE) { \
|
||||
strEventType.AssignLiteral("load complete"); \
|
||||
} else if (type == nsIAccessibleEvent::EVENT_DOCUMENT_RELOAD) { \
|
||||
strEventType.AssignLiteral("reload"); \
|
||||
} else if (type == nsIAccessibleEvent::EVENT_STATE_CHANGE) { \
|
||||
AccStateChangeEvent* event = downcast_accEvent(aEvent); \
|
||||
if (event->GetState() == states::BUSY) { \
|
||||
strEventType.AssignLiteral("busy "); \
|
||||
if (event->IsStateEnabled()) \
|
||||
strEventType.AppendLiteral("true"); \
|
||||
else \
|
||||
strEventType.AppendLiteral("false"); \
|
||||
} \
|
||||
}
|
||||
|
||||
#define NS_LOG_ACCDOC_ACCADDRESS(aName, aAcc) \
|
||||
{ \
|
||||
nsINode* node = aAcc->GetNode(); \
|
||||
nsIDocument* doc = aAcc->GetDocumentNode(); \
|
||||
nsDocAccessible *docacc = GetAccService()->GetDocAccessibleFromCache(doc); \
|
||||
printf(" " aName " accessible: %p, node: %p\n", aAcc, node); \
|
||||
printf(" docacc for " aName " accessible: %p, node: %p\n", docacc, doc); \
|
||||
printf(" "); \
|
||||
NS_LOG_ACCDOC_URI(doc) \
|
||||
printf("\n"); \
|
||||
}
|
||||
|
||||
#define NS_LOG_ACCDOC_MSG(aMsg) \
|
||||
printf("\n" aMsg "\n"); \
|
||||
|
||||
#define NS_LOG_ACCDOC_TEXT(aMsg) \
|
||||
printf(" " aMsg "\n");
|
||||
|
||||
#define NS_LOG_ACCDOC_STACK \
|
||||
printf(" stack: \n"); \
|
||||
nsTraceRefcntImpl::WalkTheStack(stdout);
|
||||
|
||||
// Accessible document loading macros.
|
||||
#ifdef DEBUG_ACCDOCMGR_DOCLOAD
|
||||
|
||||
#define NS_LOG_ACCDOCLOAD_REQUEST(aRequest) \
|
||||
if (aRequest) { \
|
||||
nsCAutoString name; \
|
||||
aRequest->GetName(name); \
|
||||
printf(" request spec: %s\n", name.get()); \
|
||||
PRUint32 loadFlags = 0; \
|
||||
aRequest->GetLoadFlags(&loadFlags); \
|
||||
printf(" request load flags: %x; ", loadFlags); \
|
||||
if (loadFlags & nsIChannel::LOAD_DOCUMENT_URI) \
|
||||
printf("document uri; "); \
|
||||
if (loadFlags & nsIChannel::LOAD_RETARGETED_DOCUMENT_URI) \
|
||||
printf("retargeted document uri; "); \
|
||||
if (loadFlags & nsIChannel::LOAD_REPLACE) \
|
||||
printf("replace; "); \
|
||||
if (loadFlags & nsIChannel::LOAD_INITIAL_DOCUMENT_URI) \
|
||||
printf("initial document uri; "); \
|
||||
if (loadFlags & nsIChannel::LOAD_TARGETED) \
|
||||
printf("targeted; "); \
|
||||
if (loadFlags & nsIChannel::LOAD_CALL_CONTENT_SNIFFERS) \
|
||||
printf("call content sniffers; "); \
|
||||
if (loadFlags & nsIChannel::LOAD_CLASSIFY_URI) \
|
||||
printf("classify uri; "); \
|
||||
} else { \
|
||||
printf(" no request"); \
|
||||
}
|
||||
|
||||
#define NS_LOG_ACCDOCLOAD(aMsg, aWebProgress, aRequest, aStateFlags) \
|
||||
{ \
|
||||
NS_LOG_ACCDOC_MSG("A11Y DOCLOAD: " aMsg); \
|
||||
\
|
||||
nsCOMPtr<nsIDOMWindow> DOMWindow; \
|
||||
aWebProgress->GetDOMWindow(getter_AddRefs(DOMWindow)); \
|
||||
if (DOMWindow) { \
|
||||
nsCOMPtr<nsIDOMDocument> DOMDocument; \
|
||||
DOMWindow->GetDocument(getter_AddRefs(DOMDocument)); \
|
||||
if (DOMDocument) { \
|
||||
nsCOMPtr<nsIDocument> document(do_QueryInterface(DOMDocument)); \
|
||||
nsDocAccessible *docAcc = \
|
||||
GetAccService()->GetDocAccessibleFromCache(document); \
|
||||
NS_LOG_ACCDOC_DOCINFO(document, docAcc) \
|
||||
\
|
||||
printf(" {\n"); \
|
||||
nsCOMPtr<nsIWebNavigation> webNav(do_GetInterface(DOMWindow)); \
|
||||
nsCOMPtr<nsIDocShell> docShell(do_QueryInterface(webNav)); \
|
||||
printf(" "); \
|
||||
NS_LOG_ACCDOC_SHELLLOADTYPE(docShell) \
|
||||
printf("\n"); \
|
||||
NS_LOG_ACCDOCLOAD_REQUEST(aRequest) \
|
||||
printf("\n"); \
|
||||
printf(" state flags: %x", aStateFlags); \
|
||||
bool isDocLoading; \
|
||||
aWebProgress->GetIsLoadingDocument(&isDocLoading); \
|
||||
printf(", document is %sloading\n", (isDocLoading ? "" : "not ")); \
|
||||
printf(" }\n"); \
|
||||
} \
|
||||
} \
|
||||
}
|
||||
|
||||
#define NS_LOG_ACCDOCLOAD2(aMsg, aDocument) \
|
||||
{ \
|
||||
NS_LOG_ACCDOC_MSG("A11Y DOCLOAD: " aMsg); \
|
||||
nsDocAccessible *docAcc = \
|
||||
GetAccService()->GetDocAccessibleFromCache(aDocument); \
|
||||
NS_LOG_ACCDOC_DOCINFO(aDocument, docAcc) \
|
||||
}
|
||||
|
||||
#define NS_LOG_ACCDOCLOAD_FIREEVENT(aEvent) \
|
||||
{ \
|
||||
NS_GET_ACCDOC_EVENTTYPE(aEvent) \
|
||||
if (!strEventType.IsEmpty()) \
|
||||
printf(" fire: %s\n", strEventType.get()); \
|
||||
}
|
||||
|
||||
#define NS_LOG_ACCDOCLOAD_HANDLEEVENT(aEvent) \
|
||||
{ \
|
||||
NS_GET_ACCDOC_EVENTTYPE(aEvent) \
|
||||
nsCOMPtr<nsIDocument> doc(do_QueryInterface(aEvent->GetNode())); \
|
||||
if (doc && !strEventType.IsEmpty()) { \
|
||||
printf("\nA11Y DOCEVENT: handled '%s' event ", strEventType.get()); \
|
||||
nsDocAccessible *docAcc = aEvent->GetDocAccessible(); \
|
||||
NS_LOG_ACCDOC_DOCINFO(doc, docAcc) \
|
||||
printf("\n"); \
|
||||
} \
|
||||
}
|
||||
|
||||
#define NS_LOG_ACCDOCLOAD_TEXT(aMsg) \
|
||||
NS_LOG_ACCDOC_TEXT(aMsg)
|
||||
|
||||
#endif // DEBUG_ACCDOCMGR_DOCLOAD
|
||||
|
||||
// Accessible document creation macros.
|
||||
#ifdef DEBUG_ACCDOCMGR_DOCCREATE
|
||||
#define NS_LOG_ACCDOCCREATE_FOR(aMsg, aDocument, aDocAcc) \
|
||||
NS_LOG_ACCDOC_MSG("A11Y DOCCREATE: " aMsg); \
|
||||
NS_LOG_ACCDOC_DOCINFO(aDocument, aDocAcc)
|
||||
|
||||
#define NS_LOG_ACCDOCCREATE(aMsg, aDocument) \
|
||||
{ \
|
||||
nsDocAccessible *docAcc = \
|
||||
GetAccService()->GetDocAccessibleFromCache(aDocument); \
|
||||
NS_LOG_ACCDOCCREATE_FOR(aMsg, aDocument, docAcc) \
|
||||
}
|
||||
|
||||
#define NS_LOG_ACCDOCCREATE_ACCADDRESS(aName, aAcc) \
|
||||
NS_LOG_ACCDOC_ACCADDRESS(aName, aAcc)
|
||||
|
||||
#define NS_LOG_ACCDOCCREATE_TEXT(aMsg) \
|
||||
NS_LOG_ACCDOC_TEXT(aMsg)
|
||||
|
||||
#define NS_LOG_ACCDOCCREATE_STACK \
|
||||
NS_LOG_ACCDOC_STACK
|
||||
|
||||
#endif // DEBUG_ACCDOCMGR_DOCCREATE
|
||||
|
||||
// Accessible document destruction macros.
|
||||
#ifdef DEBUG_ACCDOCMGR_DOCDESTROY
|
||||
#define NS_LOG_ACCDOCDESTROY_FOR(aMsg, aDocument, aDocAcc) \
|
||||
NS_LOG_ACCDOC_MSG("A11Y DOCDESTROY: " aMsg); \
|
||||
NS_LOG_ACCDOC_DOCINFO(aDocument, aDocAcc)
|
||||
|
||||
#define NS_LOG_ACCDOCDESTROY(aMsg, aDocument) \
|
||||
{ \
|
||||
nsDocAccessible* docAcc = \
|
||||
GetAccService()->GetDocAccessibleFromCache(aDocument); \
|
||||
NS_LOG_ACCDOCDESTROY_FOR(aMsg, aDocument, docAcc) \
|
||||
}
|
||||
|
||||
#define NS_LOG_ACCDOCDESTROY_ACCADDRESS(aName, aAcc) \
|
||||
NS_LOG_ACCDOC_ACCADDRESS(aName, aAcc)
|
||||
|
||||
#define NS_LOG_ACCDOCDESTROY_MSG(aMsg) \
|
||||
NS_LOG_ACCDOC_MSG(aMsg)
|
||||
|
||||
#define NS_LOG_ACCDOCDESTROY_TEXT(aMsg) \
|
||||
NS_LOG_ACCDOC_TEXT(aMsg)
|
||||
|
||||
#endif // DEBUG_ACCDOCMGR_DOCDESTROY
|
||||
|
||||
#endif // DEBUG_ACCDOCMGR
|
||||
|
||||
#ifndef DEBUG_ACCDOCMGR_DOCLOAD
|
||||
#define NS_LOG_ACCDOCLOAD(aMsg, aWebProgress, aRequest, aStateFlags)
|
||||
#define NS_LOG_ACCDOCLOAD2(aMsg, aDocument)
|
||||
#define NS_LOG_ACCDOCLOAD_EVENT(aMsg, aEvent)
|
||||
#define NS_LOG_ACCDOCLOAD_FIREEVENT(aEvent)
|
||||
#define NS_LOG_ACCDOCLOAD_HANDLEEVENT(aEvent)
|
||||
#define NS_LOG_ACCDOCLOAD_TEXT(aMsg)
|
||||
#endif
|
||||
|
||||
#ifndef DEBUG_ACCDOCMGR_DOCCREATE
|
||||
#define NS_LOG_ACCDOCCREATE_FOR(aMsg, aDocument, aDocAcc)
|
||||
#define NS_LOG_ACCDOCCREATE(aMsg, aDocument)
|
||||
#define NS_LOG_ACCDOCCREATE_ACCADDRESS(aName, aAcc)
|
||||
#define NS_LOG_ACCDOCCREATE_TEXT(aMsg)
|
||||
#define NS_LOG_ACCDOCCREATE_STACK
|
||||
#endif
|
||||
|
||||
#ifndef DEBUG_ACCDOCMGR_DOCDESTROY
|
||||
#define NS_LOG_ACCDOCDESTROY_FOR(aMsg, aDocument, aDocAcc)
|
||||
#define NS_LOG_ACCDOCDESTROY(aMsg, aDocument)
|
||||
#define NS_LOG_ACCDOCDESTROY_MSG(aMsg)
|
||||
#define NS_LOG_ACCDOCDESTROY_ACCADDRESS(aName, aAcc)
|
||||
#define NS_LOG_ACCDOCDESTROY_TEXT(aMsg)
|
||||
#endif
|
||||
|
||||
#endif // nsAccDocManager_h_
|
||||
|
|
|
@ -5,9 +5,9 @@
|
|||
|
||||
#include "nsAccTreeWalker.h"
|
||||
|
||||
#include "nsAccessible.h"
|
||||
#include "Accessible.h"
|
||||
#include "nsAccessibilityService.h"
|
||||
#include "nsDocAccessible.h"
|
||||
#include "DocAccessible.h"
|
||||
|
||||
#include "nsINodeList.h"
|
||||
|
||||
|
@ -31,7 +31,7 @@ struct WalkState
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
nsAccTreeWalker::
|
||||
nsAccTreeWalker(nsDocAccessible* aDoc, nsIContent* aContent,
|
||||
nsAccTreeWalker(DocAccessible* aDoc, nsIContent* aContent,
|
||||
bool aWalkAnonContent, bool aWalkCache) :
|
||||
mDoc(aDoc), mWalkCache(aWalkCache), mState(nsnull)
|
||||
{
|
||||
|
@ -60,7 +60,7 @@ nsAccTreeWalker::~nsAccTreeWalker()
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
// nsAccTreeWalker: private
|
||||
|
||||
nsAccessible*
|
||||
Accessible*
|
||||
nsAccTreeWalker::NextChildInternal(bool aNoWalkUp)
|
||||
{
|
||||
if (!mState || !mState->content)
|
||||
|
@ -78,7 +78,7 @@ nsAccTreeWalker::NextChildInternal(bool aNoWalkUp)
|
|||
mState->childIdx++;
|
||||
|
||||
bool isSubtreeHidden = false;
|
||||
nsAccessible* accessible = mWalkCache ? mDoc->GetAccessible(childNode) :
|
||||
Accessible* accessible = mWalkCache ? mDoc->GetAccessible(childNode) :
|
||||
GetAccService()->GetOrCreateAccessible(childNode, mDoc, &isSubtreeHidden);
|
||||
|
||||
if (accessible)
|
||||
|
|
|
@ -9,8 +9,8 @@
|
|||
#include "nsAutoPtr.h"
|
||||
#include "nsIContent.h"
|
||||
|
||||
class nsAccessible;
|
||||
class nsDocAccessible;
|
||||
class Accessible;
|
||||
class DocAccessible;
|
||||
struct WalkState;
|
||||
|
||||
/**
|
||||
|
@ -19,7 +19,7 @@ struct WalkState;
|
|||
class nsAccTreeWalker
|
||||
{
|
||||
public:
|
||||
nsAccTreeWalker(nsDocAccessible* aDoc, nsIContent* aNode,
|
||||
nsAccTreeWalker(DocAccessible* aDoc, nsIContent* aNode,
|
||||
bool aWalkAnonymousContent, bool aWalkCache = false);
|
||||
virtual ~nsAccTreeWalker();
|
||||
|
||||
|
@ -30,7 +30,7 @@ public:
|
|||
* rejected during tree creation then the caller should be unbind it
|
||||
* from the document.
|
||||
*/
|
||||
inline nsAccessible* NextChild()
|
||||
Accessible* NextChild()
|
||||
{
|
||||
return NextChildInternal(false);
|
||||
}
|
||||
|
@ -44,7 +44,7 @@ private:
|
|||
* shouldn't go up through the tree if we failed find
|
||||
* accessible children.
|
||||
*/
|
||||
nsAccessible* NextChildInternal(bool aNoWalkUp);
|
||||
Accessible* NextChildInternal(bool aNoWalkUp);
|
||||
|
||||
/**
|
||||
* Create new state for the given node and push it on top of stack.
|
||||
|
@ -59,7 +59,7 @@ private:
|
|||
*/
|
||||
void PopState();
|
||||
|
||||
nsDocAccessible* mDoc;
|
||||
DocAccessible* mDoc;
|
||||
PRInt32 mChildFilter;
|
||||
bool mWalkCache;
|
||||
WalkState* mState;
|
||||
|
|
|
@ -9,12 +9,12 @@
|
|||
#include "nsAccessibilityService.h"
|
||||
#include "nsARIAMap.h"
|
||||
#include "nsCoreUtils.h"
|
||||
#include "nsDocAccessible.h"
|
||||
#include "DocAccessible.h"
|
||||
#include "nsHyperTextAccessible.h"
|
||||
#include "nsIAccessibleTypes.h"
|
||||
#include "nsTextAccessible.h"
|
||||
#include "Role.h"
|
||||
#include "States.h"
|
||||
#include "TextLeafAccessible.h"
|
||||
|
||||
#include "nsIDOMXULContainerElement.h"
|
||||
#include "nsIDOMXULSelectCntrlEl.h"
|
||||
|
@ -68,7 +68,7 @@ nsAccUtils::SetAccGroupAttrs(nsIPersistentProperties *aAttributes,
|
|||
}
|
||||
|
||||
PRInt32
|
||||
nsAccUtils::GetDefaultLevel(nsAccessible *aAccessible)
|
||||
nsAccUtils::GetDefaultLevel(Accessible* aAccessible)
|
||||
{
|
||||
roles::Role role = aAccessible->Role();
|
||||
|
||||
|
@ -76,7 +76,7 @@ nsAccUtils::GetDefaultLevel(nsAccessible *aAccessible)
|
|||
return 1;
|
||||
|
||||
if (role == roles::ROW) {
|
||||
nsAccessible* parent = aAccessible->Parent();
|
||||
Accessible* parent = aAccessible->Parent();
|
||||
// It is a row inside flatten treegrid. Group level is always 1 until it
|
||||
// is overriden by aria-level attribute.
|
||||
if (parent && parent->Role() == roles::TREE_TABLE)
|
||||
|
@ -87,7 +87,7 @@ nsAccUtils::GetDefaultLevel(nsAccessible *aAccessible)
|
|||
}
|
||||
|
||||
PRInt32
|
||||
nsAccUtils::GetARIAOrDefaultLevel(nsAccessible *aAccessible)
|
||||
nsAccUtils::GetARIAOrDefaultLevel(Accessible* aAccessible)
|
||||
{
|
||||
PRInt32 level = 0;
|
||||
nsCoreUtils::GetUIntAttr(aAccessible->GetContent(),
|
||||
|
@ -213,11 +213,11 @@ nsAccUtils::GetARIAToken(dom::Element* aElement, nsIAtom* aAttr)
|
|||
return nsnull;
|
||||
}
|
||||
|
||||
nsAccessible*
|
||||
nsAccUtils::GetAncestorWithRole(nsAccessible *aDescendant, PRUint32 aRole)
|
||||
Accessible*
|
||||
nsAccUtils::GetAncestorWithRole(Accessible* aDescendant, PRUint32 aRole)
|
||||
{
|
||||
nsAccessible* document = aDescendant->Document();
|
||||
nsAccessible* parent = aDescendant;
|
||||
Accessible* document = aDescendant->Document();
|
||||
Accessible* parent = aDescendant;
|
||||
while ((parent = parent->Parent())) {
|
||||
PRUint32 testRole = parent->Role();
|
||||
if (testRole == aRole)
|
||||
|
@ -229,8 +229,8 @@ nsAccUtils::GetAncestorWithRole(nsAccessible *aDescendant, PRUint32 aRole)
|
|||
return nsnull;
|
||||
}
|
||||
|
||||
nsAccessible*
|
||||
nsAccUtils::GetSelectableContainer(nsAccessible* aAccessible, PRUint64 aState)
|
||||
Accessible*
|
||||
nsAccUtils::GetSelectableContainer(Accessible* aAccessible, PRUint64 aState)
|
||||
{
|
||||
if (!aAccessible)
|
||||
return nsnull;
|
||||
|
@ -238,7 +238,7 @@ nsAccUtils::GetSelectableContainer(nsAccessible* aAccessible, PRUint64 aState)
|
|||
if (!(aState & states::SELECTABLE))
|
||||
return nsnull;
|
||||
|
||||
nsAccessible* parent = aAccessible;
|
||||
Accessible* parent = aAccessible;
|
||||
while ((parent = parent->Parent()) && !parent->IsSelect()) {
|
||||
if (Role(parent) == nsIAccessibleRole::ROLE_PANE)
|
||||
return nsnull;
|
||||
|
@ -247,7 +247,7 @@ nsAccUtils::GetSelectableContainer(nsAccessible* aAccessible, PRUint64 aState)
|
|||
}
|
||||
|
||||
bool
|
||||
nsAccUtils::IsARIASelected(nsAccessible *aAccessible)
|
||||
nsAccUtils::IsARIASelected(Accessible* aAccessible)
|
||||
{
|
||||
return aAccessible->GetContent()->
|
||||
AttrValueIs(kNameSpaceID_None, nsGkAtoms::aria_selected,
|
||||
|
@ -273,9 +273,9 @@ nsAccUtils::GetTextAccessibleFromSelection(nsISelection* aSelection)
|
|||
nsCoreUtils::GetDOMNodeFromDOMPoint(focusNode, focusOffset);
|
||||
|
||||
// Get text accessible containing the result node.
|
||||
nsDocAccessible* doc =
|
||||
DocAccessible* doc =
|
||||
GetAccService()->GetDocAccessible(resultNode->OwnerDoc());
|
||||
nsAccessible* accessible = doc ?
|
||||
Accessible* accessible = doc ?
|
||||
doc->GetAccessibleOrContainer(resultNode) : nsnull;
|
||||
if (!accessible) {
|
||||
NS_NOTREACHED("No nsIAccessibleText for selection change event!");
|
||||
|
@ -372,8 +372,8 @@ nsAccUtils::GetScreenCoordsForWindow(nsAccessNode *aAccessNode)
|
|||
nsIntPoint
|
||||
nsAccUtils::GetScreenCoordsForParent(nsAccessNode *aAccessNode)
|
||||
{
|
||||
nsDocAccessible* document = aAccessNode->Document();
|
||||
nsAccessible* parent = document->GetContainerAccessible(aAccessNode->GetNode());
|
||||
DocAccessible* document = aAccessNode->Document();
|
||||
Accessible* parent = document->GetContainerAccessible(aAccessNode->GetNode());
|
||||
if (!parent)
|
||||
return nsIntPoint(0, 0);
|
||||
|
||||
|
@ -413,7 +413,7 @@ nsAccUtils::GetLiveAttrValue(PRUint32 aRule, nsAString& aValue)
|
|||
#ifdef DEBUG
|
||||
|
||||
bool
|
||||
nsAccUtils::IsTextInterfaceSupportCorrect(nsAccessible* aAccessible)
|
||||
nsAccUtils::IsTextInterfaceSupportCorrect(Accessible* aAccessible)
|
||||
{
|
||||
// Don't test for accessible docs, it makes us create accessibles too
|
||||
// early and fire mutation events before we need to
|
||||
|
@ -421,9 +421,9 @@ nsAccUtils::IsTextInterfaceSupportCorrect(nsAccessible* aAccessible)
|
|||
return true;
|
||||
|
||||
bool foundText = false;
|
||||
PRInt32 childCount = aAccessible->GetChildCount();
|
||||
for (PRInt32 childIdx = 0; childIdx < childCount; childIdx++) {
|
||||
nsAccessible* child = aAccessible->GetChildAt(childIdx);
|
||||
PRUint32 childCount = aAccessible->ChildCount();
|
||||
for (PRUint32 childIdx = 0; childIdx < childCount; childIdx++) {
|
||||
Accessible* child = aAccessible->GetChildAt(childIdx);
|
||||
if (IsText(child)) {
|
||||
foundText = true;
|
||||
break;
|
||||
|
@ -442,12 +442,12 @@ nsAccUtils::IsTextInterfaceSupportCorrect(nsAccessible* aAccessible)
|
|||
#endif
|
||||
|
||||
PRUint32
|
||||
nsAccUtils::TextLength(nsAccessible *aAccessible)
|
||||
nsAccUtils::TextLength(Accessible* aAccessible)
|
||||
{
|
||||
if (!IsText(aAccessible))
|
||||
return 1;
|
||||
|
||||
nsTextAccessible* textLeaf = aAccessible->AsTextLeaf();
|
||||
TextLeafAccessible* textLeaf = aAccessible->AsTextLeaf();
|
||||
if (textLeaf)
|
||||
return textLeaf->Text().Length();
|
||||
|
||||
|
@ -461,7 +461,7 @@ nsAccUtils::TextLength(nsAccessible *aAccessible)
|
|||
}
|
||||
|
||||
bool
|
||||
nsAccUtils::MustPrune(nsAccessible* aAccessible)
|
||||
nsAccUtils::MustPrune(Accessible* aAccessible)
|
||||
{
|
||||
roles::Role role = aAccessible->Role();
|
||||
|
||||
|
|
|
@ -22,10 +22,10 @@
|
|||
#include "nsPoint.h"
|
||||
|
||||
class nsAccessNode;
|
||||
class nsAccessible;
|
||||
class Accessible;
|
||||
class nsHyperTextAccessible;
|
||||
class nsHTMLTableAccessible;
|
||||
class nsDocAccessible;
|
||||
class DocAccessible;
|
||||
struct nsRoleMapEntry;
|
||||
#ifdef MOZ_XUL
|
||||
class nsXULTreeAccessible;
|
||||
|
@ -66,13 +66,13 @@ public:
|
|||
/**
|
||||
* Get default value of the level for the given accessible.
|
||||
*/
|
||||
static PRInt32 GetDefaultLevel(nsAccessible *aAcc);
|
||||
static PRInt32 GetDefaultLevel(Accessible* aAcc);
|
||||
|
||||
/**
|
||||
* Return ARIA level value or the default one if ARIA is missed for the
|
||||
* given accessible.
|
||||
*/
|
||||
static PRInt32 GetARIAOrDefaultLevel(nsAccessible *aAccessible);
|
||||
static PRInt32 GetARIAOrDefaultLevel(Accessible* aAccessible);
|
||||
|
||||
/**
|
||||
* Compute group level for nsIDOMXULContainerItemElement node.
|
||||
|
@ -107,7 +107,7 @@ public:
|
|||
/**
|
||||
* Return document accessible for the given DOM node.
|
||||
*/
|
||||
static nsDocAccessible *GetDocAccessibleFor(nsINode *aNode)
|
||||
static DocAccessible* GetDocAccessibleFor(nsINode* aNode)
|
||||
{
|
||||
nsIPresShell *presShell = nsCoreUtils::GetPresShellFor(aNode);
|
||||
return GetAccService()->GetDocAccessible(presShell);
|
||||
|
@ -116,7 +116,7 @@ public:
|
|||
/**
|
||||
* Return document accessible for the given docshell.
|
||||
*/
|
||||
static nsDocAccessible *GetDocAccessibleFor(nsIDocShellTreeItem *aContainer)
|
||||
static DocAccessible* GetDocAccessibleFor(nsIDocShellTreeItem* aContainer)
|
||||
{
|
||||
nsCOMPtr<nsIDocShell> docShell(do_QueryInterface(aContainer));
|
||||
nsCOMPtr<nsIPresShell> presShell;
|
||||
|
@ -132,8 +132,8 @@ public:
|
|||
* @return the ancestor accessible with the given role, or
|
||||
* nsnull if no match is found
|
||||
*/
|
||||
static nsAccessible * GetAncestorWithRole(nsAccessible *aDescendant,
|
||||
PRUint32 aRole);
|
||||
static Accessible* GetAncestorWithRole(Accessible* aDescendant,
|
||||
PRUint32 aRole);
|
||||
|
||||
/**
|
||||
* Return single or multi selectable container for the given item.
|
||||
|
@ -141,14 +141,14 @@ public:
|
|||
* @param aAccessible [in] the item accessible
|
||||
* @param aState [in] the state of the item accessible
|
||||
*/
|
||||
static nsAccessible* GetSelectableContainer(nsAccessible* aAccessible,
|
||||
PRUint64 aState);
|
||||
static Accessible* GetSelectableContainer(Accessible* aAccessible,
|
||||
PRUint64 aState);
|
||||
|
||||
/**
|
||||
* Return true if the DOM node of given accessible has aria-selected="true"
|
||||
* attribute.
|
||||
*/
|
||||
static bool IsARIASelected(nsAccessible *aAccessible);
|
||||
static bool IsARIASelected(Accessible* aAccessible);
|
||||
|
||||
/**
|
||||
* Return text accessible containing focus point of the given selection.
|
||||
|
@ -242,7 +242,7 @@ public:
|
|||
* Detect whether the given accessible object implements nsIAccessibleText,
|
||||
* when it is text or has text child node.
|
||||
*/
|
||||
static bool IsTextInterfaceSupportCorrect(nsAccessible *aAccessible);
|
||||
static bool IsTextInterfaceSupportCorrect(Accessible* aAccessible);
|
||||
#endif
|
||||
|
||||
/**
|
||||
|
@ -258,7 +258,7 @@ public:
|
|||
/**
|
||||
* Return text length of the given accessible, return 0 on failure.
|
||||
*/
|
||||
static PRUint32 TextLength(nsAccessible *aAccessible);
|
||||
static PRUint32 TextLength(Accessible* aAccessible);
|
||||
|
||||
/**
|
||||
* Return true if the given accessible is embedded object.
|
||||
|
@ -295,7 +295,7 @@ public:
|
|||
* Return true if the given accessible can't have children. Used when exposing
|
||||
* to platform accessibility APIs, should the children be pruned off?
|
||||
*/
|
||||
static bool MustPrune(nsAccessible* aAccessible);
|
||||
static bool MustPrune(Accessible* aAccessible);
|
||||
|
||||
/**
|
||||
* Search hint enum constants. Used by GetHeaderCellsFor() method.
|
||||
|
|
|
@ -35,7 +35,7 @@ ApplicationAccessible* nsAccessNode::gApplicationAccessible = nsnull;
|
|||
*/
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// nsAccessible. nsISupports
|
||||
// AccessNode. nsISupports
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_1(nsAccessNode, mContent)
|
||||
|
||||
|
@ -50,7 +50,7 @@ NS_IMPL_CYCLE_COLLECTING_RELEASE_WITH_DESTROY(nsAccessNode, LastRelease())
|
|||
// nsAccessNode construction/desctruction
|
||||
|
||||
nsAccessNode::
|
||||
nsAccessNode(nsIContent* aContent, nsDocAccessible* aDoc) :
|
||||
nsAccessNode(nsIContent* aContent, DocAccessible* aDoc) :
|
||||
mContent(aContent), mDoc(aDoc)
|
||||
{
|
||||
}
|
||||
|
@ -144,7 +144,7 @@ nsAccessNode::RootAccessible() const
|
|||
return nsnull;
|
||||
}
|
||||
|
||||
nsDocAccessible* docAcc = nsAccUtils::GetDocAccessibleFor(root);
|
||||
DocAccessible* docAcc = nsAccUtils::GetDocAccessibleFor(root);
|
||||
return docAcc ? docAcc->AsRoot() : nsnull;
|
||||
}
|
||||
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
#include "nsWeakReference.h"
|
||||
|
||||
class nsAccessNode;
|
||||
class nsDocAccessible;
|
||||
class DocAccessible;
|
||||
class nsIAccessibleDocument;
|
||||
|
||||
namespace mozilla {
|
||||
|
@ -40,7 +40,7 @@ class nsAccessNode: public nsISupports
|
|||
{
|
||||
public:
|
||||
|
||||
nsAccessNode(nsIContent* aContent, nsDocAccessible* aDoc);
|
||||
nsAccessNode(nsIContent* aContent, DocAccessible* aDoc);
|
||||
virtual ~nsAccessNode();
|
||||
|
||||
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
|
||||
|
@ -56,7 +56,7 @@ public:
|
|||
/**
|
||||
* Return the document accessible for this access node.
|
||||
*/
|
||||
nsDocAccessible* Document() const { return mDoc; }
|
||||
DocAccessible* Document() const { return mDoc; }
|
||||
|
||||
/**
|
||||
* Return the root document accessible for this accessnode.
|
||||
|
@ -125,7 +125,7 @@ protected:
|
|||
void LastRelease();
|
||||
|
||||
nsCOMPtr<nsIContent> mContent;
|
||||
nsDocAccessible* mDoc;
|
||||
DocAccessible* mDoc;
|
||||
|
||||
private:
|
||||
nsAccessNode() MOZ_DELETE;
|
||||
|
|
|
@ -35,6 +35,11 @@
|
|||
#ifdef XP_WIN
|
||||
#include "nsHTMLWin32ObjectAccessible.h"
|
||||
#endif
|
||||
#include "TextLeafAccessible.h"
|
||||
|
||||
#ifdef DEBUG
|
||||
#include "Logging.h"
|
||||
#endif
|
||||
|
||||
#include "nsCURILoader.h"
|
||||
#include "nsEventStates.h"
|
||||
|
@ -123,7 +128,7 @@ nsAccessibilityService::NotifyOfAnchorJumpTo(nsIContent* aTargetNode)
|
|||
{
|
||||
nsIDocument* documentNode = aTargetNode->GetCurrentDoc();
|
||||
if (documentNode) {
|
||||
nsDocAccessible* document = GetDocAccessible(documentNode);
|
||||
DocAccessible* document = GetDocAccessible(documentNode);
|
||||
if (document)
|
||||
document->SetAnchorJump(aTargetNode);
|
||||
}
|
||||
|
@ -132,7 +137,7 @@ nsAccessibilityService::NotifyOfAnchorJumpTo(nsIContent* aTargetNode)
|
|||
// nsIAccessibilityService
|
||||
void
|
||||
nsAccessibilityService::FireAccessibleEvent(PRUint32 aEvent,
|
||||
nsAccessible* aTarget)
|
||||
Accessible* aTarget)
|
||||
{
|
||||
nsEventShell::FireEvent(aEvent, aTarget);
|
||||
}
|
||||
|
@ -140,7 +145,7 @@ nsAccessibilityService::FireAccessibleEvent(PRUint32 aEvent,
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
// nsIAccessibilityService
|
||||
|
||||
nsAccessible*
|
||||
Accessible*
|
||||
nsAccessibilityService::GetRootDocumentAccessible(nsIPresShell* aPresShell,
|
||||
bool aCanCreate)
|
||||
{
|
||||
|
@ -165,138 +170,138 @@ nsAccessibilityService::GetRootDocumentAccessible(nsIPresShell* aPresShell,
|
|||
return nsnull;
|
||||
}
|
||||
|
||||
already_AddRefed<nsAccessible>
|
||||
already_AddRefed<Accessible>
|
||||
nsAccessibilityService::CreateOuterDocAccessible(nsIContent* aContent,
|
||||
nsIPresShell* aPresShell)
|
||||
{
|
||||
nsAccessible* accessible =
|
||||
Accessible* accessible =
|
||||
new OuterDocAccessible(aContent, GetDocAccessible(aPresShell));
|
||||
NS_ADDREF(accessible);
|
||||
return accessible;
|
||||
}
|
||||
|
||||
already_AddRefed<nsAccessible>
|
||||
already_AddRefed<Accessible>
|
||||
nsAccessibilityService::CreateHTMLButtonAccessible(nsIContent* aContent,
|
||||
nsIPresShell* aPresShell)
|
||||
{
|
||||
nsAccessible* accessible =
|
||||
Accessible* accessible =
|
||||
new HTMLButtonAccessible(aContent, GetDocAccessible(aPresShell));
|
||||
NS_ADDREF(accessible);
|
||||
return accessible;
|
||||
}
|
||||
|
||||
already_AddRefed<nsAccessible>
|
||||
already_AddRefed<Accessible>
|
||||
nsAccessibilityService::CreateHTMLLIAccessible(nsIContent* aContent,
|
||||
nsIPresShell* aPresShell)
|
||||
{
|
||||
nsAccessible* accessible =
|
||||
Accessible* accessible =
|
||||
new HTMLLIAccessible(aContent, GetDocAccessible(aPresShell));
|
||||
NS_ADDREF(accessible);
|
||||
return accessible;
|
||||
}
|
||||
|
||||
already_AddRefed<nsAccessible>
|
||||
already_AddRefed<Accessible>
|
||||
nsAccessibilityService::CreateHyperTextAccessible(nsIContent* aContent,
|
||||
nsIPresShell* aPresShell)
|
||||
{
|
||||
nsAccessible* accessible =
|
||||
Accessible* accessible =
|
||||
new nsHyperTextAccessibleWrap(aContent, GetDocAccessible(aPresShell));
|
||||
NS_ADDREF(accessible);
|
||||
return accessible;
|
||||
}
|
||||
|
||||
already_AddRefed<nsAccessible>
|
||||
already_AddRefed<Accessible>
|
||||
nsAccessibilityService::CreateHTMLCheckboxAccessible(nsIContent* aContent,
|
||||
nsIPresShell* aPresShell)
|
||||
{
|
||||
nsAccessible* accessible =
|
||||
Accessible* accessible =
|
||||
new HTMLCheckboxAccessible(aContent, GetDocAccessible(aPresShell));
|
||||
NS_ADDREF(accessible);
|
||||
return accessible;
|
||||
}
|
||||
|
||||
already_AddRefed<nsAccessible>
|
||||
already_AddRefed<Accessible>
|
||||
nsAccessibilityService::CreateHTMLComboboxAccessible(nsIContent* aContent,
|
||||
nsIPresShell* aPresShell)
|
||||
{
|
||||
nsAccessible* accessible =
|
||||
Accessible* accessible =
|
||||
new nsHTMLComboboxAccessible(aContent, GetDocAccessible(aPresShell));
|
||||
NS_ADDREF(accessible);
|
||||
return accessible;
|
||||
}
|
||||
|
||||
already_AddRefed<nsAccessible>
|
||||
already_AddRefed<Accessible>
|
||||
nsAccessibilityService::CreateHTMLCanvasAccessible(nsIContent* aContent,
|
||||
nsIPresShell* aPresShell)
|
||||
{
|
||||
nsAccessible* accessible =
|
||||
Accessible* accessible =
|
||||
new nsHTMLCanvasAccessible(aContent, GetDocAccessible(aPresShell));
|
||||
NS_ADDREF(accessible);
|
||||
return accessible;
|
||||
}
|
||||
|
||||
already_AddRefed<nsAccessible>
|
||||
already_AddRefed<Accessible>
|
||||
nsAccessibilityService::CreateHTMLFileInputAccessible(nsIContent* aContent,
|
||||
nsIPresShell* aPresShell)
|
||||
{
|
||||
nsAccessible* accessible =
|
||||
Accessible* accessible =
|
||||
new HTMLFileInputAccessible(aContent, GetDocAccessible(aPresShell));
|
||||
NS_ADDREF(accessible);
|
||||
return accessible;
|
||||
}
|
||||
|
||||
already_AddRefed<nsAccessible>
|
||||
already_AddRefed<Accessible>
|
||||
nsAccessibilityService::CreateHTMLImageAccessible(nsIContent* aContent,
|
||||
nsIPresShell* aPresShell)
|
||||
{
|
||||
nsAccessible* accessible =
|
||||
Accessible* accessible =
|
||||
new nsHTMLImageAccessibleWrap(aContent, GetDocAccessible(aPresShell));
|
||||
NS_ADDREF(accessible);
|
||||
return accessible;
|
||||
}
|
||||
|
||||
already_AddRefed<nsAccessible>
|
||||
already_AddRefed<Accessible>
|
||||
nsAccessibilityService::CreateHTMLImageMapAccessible(nsIContent* aContent,
|
||||
nsIPresShell* aPresShell)
|
||||
{
|
||||
nsAccessible* accessible =
|
||||
Accessible* accessible =
|
||||
new nsHTMLImageMapAccessible(aContent, GetDocAccessible(aPresShell));
|
||||
NS_ADDREF(accessible);
|
||||
return accessible;
|
||||
}
|
||||
|
||||
already_AddRefed<nsAccessible>
|
||||
already_AddRefed<Accessible>
|
||||
nsAccessibilityService::CreateHTMLGroupboxAccessible(nsIContent* aContent,
|
||||
nsIPresShell* aPresShell)
|
||||
{
|
||||
nsAccessible* accessible =
|
||||
Accessible* accessible =
|
||||
new HTMLGroupboxAccessible(aContent, GetDocAccessible(aPresShell));
|
||||
NS_ADDREF(accessible);
|
||||
return accessible;
|
||||
}
|
||||
|
||||
already_AddRefed<nsAccessible>
|
||||
already_AddRefed<Accessible>
|
||||
nsAccessibilityService::CreateHTMLListboxAccessible(nsIContent* aContent,
|
||||
nsIPresShell* aPresShell)
|
||||
{
|
||||
nsAccessible* accessible =
|
||||
Accessible* accessible =
|
||||
new nsHTMLSelectListAccessible(aContent, GetDocAccessible(aPresShell));
|
||||
NS_ADDREF(accessible);
|
||||
return accessible;
|
||||
}
|
||||
|
||||
already_AddRefed<nsAccessible>
|
||||
already_AddRefed<Accessible>
|
||||
nsAccessibilityService::CreateHTMLMediaAccessible(nsIContent* aContent,
|
||||
nsIPresShell* aPresShell)
|
||||
{
|
||||
nsAccessible* accessible =
|
||||
Accessible* accessible =
|
||||
new nsEnumRoleAccessible(aContent, GetDocAccessible(aPresShell),
|
||||
roles::GROUPING);
|
||||
NS_ADDREF(accessible);
|
||||
return accessible;
|
||||
}
|
||||
|
||||
already_AddRefed<nsAccessible>
|
||||
already_AddRefed<Accessible>
|
||||
nsAccessibilityService::CreateHTMLObjectFrameAccessible(nsObjectFrame* aFrame,
|
||||
nsIContent* aContent,
|
||||
nsIPresShell* aPresShell)
|
||||
|
@ -332,7 +337,7 @@ nsAccessibilityService::CreateHTMLObjectFrameAccessible(nsObjectFrame* aFrame,
|
|||
HWND pluginPort = nsnull;
|
||||
aFrame->GetPluginPort(&pluginPort);
|
||||
|
||||
nsAccessible* accessible =
|
||||
Accessible* accessible =
|
||||
new nsHTMLWin32ObjectOwnerAccessible(aContent,
|
||||
GetDocAccessible(aPresShell),
|
||||
pluginPort);
|
||||
|
@ -364,101 +369,101 @@ nsAccessibilityService::CreateHTMLObjectFrameAccessible(nsObjectFrame* aFrame,
|
|||
return frame ? frame->CreateAccessible() : nsnull;
|
||||
}
|
||||
|
||||
already_AddRefed<nsAccessible>
|
||||
already_AddRefed<Accessible>
|
||||
nsAccessibilityService::CreateHTMLRadioButtonAccessible(nsIContent* aContent,
|
||||
nsIPresShell* aPresShell)
|
||||
{
|
||||
nsAccessible* accessible =
|
||||
Accessible* accessible =
|
||||
new HTMLRadioButtonAccessible(aContent, GetDocAccessible(aPresShell));
|
||||
NS_ADDREF(accessible);
|
||||
return accessible;
|
||||
}
|
||||
|
||||
already_AddRefed<nsAccessible>
|
||||
already_AddRefed<Accessible>
|
||||
nsAccessibilityService::CreateHTMLTableAccessible(nsIContent* aContent,
|
||||
nsIPresShell* aPresShell)
|
||||
{
|
||||
nsAccessible* accessible =
|
||||
Accessible* accessible =
|
||||
new nsHTMLTableAccessibleWrap(aContent, GetDocAccessible(aPresShell));
|
||||
NS_ADDREF(accessible);
|
||||
return accessible;
|
||||
}
|
||||
|
||||
already_AddRefed<nsAccessible>
|
||||
already_AddRefed<Accessible>
|
||||
nsAccessibilityService::CreateHTMLTableCellAccessible(nsIContent* aContent,
|
||||
nsIPresShell* aPresShell)
|
||||
{
|
||||
nsAccessible* accessible =
|
||||
Accessible* accessible =
|
||||
new nsHTMLTableCellAccessibleWrap(aContent, GetDocAccessible(aPresShell));
|
||||
NS_ADDREF(accessible);
|
||||
return accessible;
|
||||
}
|
||||
|
||||
already_AddRefed<nsAccessible>
|
||||
already_AddRefed<Accessible>
|
||||
nsAccessibilityService::CreateHTMLTableRowAccessible(nsIContent* aContent,
|
||||
nsIPresShell* aPresShell)
|
||||
{
|
||||
nsAccessible* accessible =
|
||||
Accessible* accessible =
|
||||
new nsEnumRoleAccessible(aContent, GetDocAccessible(aPresShell), roles::ROW);
|
||||
NS_ADDREF(accessible);
|
||||
return accessible;
|
||||
}
|
||||
|
||||
already_AddRefed<nsAccessible>
|
||||
nsAccessibilityService::CreateHTMLTextAccessible(nsIContent* aContent,
|
||||
already_AddRefed<Accessible>
|
||||
nsAccessibilityService::CreateTextLeafAccessible(nsIContent* aContent,
|
||||
nsIPresShell* aPresShell)
|
||||
{
|
||||
nsAccessible* accessible =
|
||||
new nsHTMLTextAccessible(aContent, GetDocAccessible(aPresShell));
|
||||
Accessible* accessible =
|
||||
new TextLeafAccessible(aContent, GetDocAccessible(aPresShell));
|
||||
NS_ADDREF(accessible);
|
||||
return accessible;
|
||||
}
|
||||
|
||||
already_AddRefed<nsAccessible>
|
||||
already_AddRefed<Accessible>
|
||||
nsAccessibilityService::CreateHTMLTextFieldAccessible(nsIContent* aContent,
|
||||
nsIPresShell* aPresShell)
|
||||
{
|
||||
nsAccessible* accessible =
|
||||
Accessible* accessible =
|
||||
new HTMLTextFieldAccessible(aContent, GetDocAccessible(aPresShell));
|
||||
NS_ADDREF(accessible);
|
||||
return accessible;
|
||||
}
|
||||
|
||||
already_AddRefed<nsAccessible>
|
||||
already_AddRefed<Accessible>
|
||||
nsAccessibilityService::CreateHTMLLabelAccessible(nsIContent* aContent,
|
||||
nsIPresShell* aPresShell)
|
||||
{
|
||||
nsAccessible* accessible =
|
||||
Accessible* accessible =
|
||||
new nsHTMLLabelAccessible(aContent, GetDocAccessible(aPresShell));
|
||||
NS_ADDREF(accessible);
|
||||
return accessible;
|
||||
}
|
||||
|
||||
already_AddRefed<nsAccessible>
|
||||
already_AddRefed<Accessible>
|
||||
nsAccessibilityService::CreateHTMLHRAccessible(nsIContent* aContent,
|
||||
nsIPresShell* aPresShell)
|
||||
{
|
||||
nsAccessible* accessible =
|
||||
Accessible* accessible =
|
||||
new nsHTMLHRAccessible(aContent, GetDocAccessible(aPresShell));
|
||||
NS_ADDREF(accessible);
|
||||
return accessible;
|
||||
}
|
||||
|
||||
already_AddRefed<nsAccessible>
|
||||
already_AddRefed<Accessible>
|
||||
nsAccessibilityService::CreateHTMLBRAccessible(nsIContent* aContent,
|
||||
nsIPresShell* aPresShell)
|
||||
{
|
||||
nsAccessible* accessible =
|
||||
Accessible* accessible =
|
||||
new nsHTMLBRAccessible(aContent, GetDocAccessible(aPresShell));
|
||||
NS_ADDREF(accessible);
|
||||
return accessible;
|
||||
}
|
||||
|
||||
already_AddRefed<nsAccessible>
|
||||
already_AddRefed<Accessible>
|
||||
nsAccessibilityService::CreateHTMLCaptionAccessible(nsIContent* aContent,
|
||||
nsIPresShell* aPresShell)
|
||||
{
|
||||
nsAccessible* accessible =
|
||||
Accessible* accessible =
|
||||
new nsHTMLCaptionAccessible(aContent, GetDocAccessible(aPresShell));
|
||||
NS_ADDREF(accessible);
|
||||
return accessible;
|
||||
|
@ -494,7 +499,7 @@ nsAccessibilityService::ContentRangeInserted(nsIPresShell* aPresShell,
|
|||
NS_ConvertUTF16toUTF8(ctag).get(), cid.get(), aEndChild);
|
||||
#endif
|
||||
|
||||
nsDocAccessible* docAccessible = GetDocAccessible(aPresShell);
|
||||
DocAccessible* docAccessible = GetDocAccessible(aPresShell);
|
||||
if (docAccessible)
|
||||
docAccessible->ContentInserted(aContainer, aStartChild, aEndChild);
|
||||
}
|
||||
|
@ -528,7 +533,7 @@ nsAccessibilityService::ContentRemoved(nsIPresShell* aPresShell,
|
|||
NS_ConvertUTF16toUTF8(ctag).get(), cid.get());
|
||||
#endif
|
||||
|
||||
nsDocAccessible* docAccessible = GetDocAccessible(aPresShell);
|
||||
DocAccessible* docAccessible = GetDocAccessible(aPresShell);
|
||||
if (docAccessible)
|
||||
docAccessible->ContentRemoved(aContainer, aChild);
|
||||
}
|
||||
|
@ -537,7 +542,7 @@ void
|
|||
nsAccessibilityService::UpdateText(nsIPresShell* aPresShell,
|
||||
nsIContent* aContent)
|
||||
{
|
||||
nsDocAccessible* document = GetDocAccessible(aPresShell);
|
||||
DocAccessible* document = GetDocAccessible(aPresShell);
|
||||
if (document)
|
||||
document->UpdateText(aContent);
|
||||
}
|
||||
|
@ -547,9 +552,9 @@ nsAccessibilityService::TreeViewChanged(nsIPresShell* aPresShell,
|
|||
nsIContent* aContent,
|
||||
nsITreeView* aView)
|
||||
{
|
||||
nsDocAccessible* document = GetDocAccessible(aPresShell);
|
||||
DocAccessible* document = GetDocAccessible(aPresShell);
|
||||
if (document) {
|
||||
nsAccessible* accessible = document->GetAccessible(aContent);
|
||||
Accessible* accessible = document->GetAccessible(aContent);
|
||||
if (accessible) {
|
||||
nsXULTreeAccessible* treeAcc = accessible->AsXULTree();
|
||||
if (treeAcc)
|
||||
|
@ -563,9 +568,9 @@ nsAccessibilityService::UpdateListBullet(nsIPresShell* aPresShell,
|
|||
nsIContent* aHTMLListItemContent,
|
||||
bool aHasBullet)
|
||||
{
|
||||
nsDocAccessible* document = GetDocAccessible(aPresShell);
|
||||
DocAccessible* document = GetDocAccessible(aPresShell);
|
||||
if (document) {
|
||||
nsAccessible* accessible = document->GetAccessible(aHTMLListItemContent);
|
||||
Accessible* accessible = document->GetAccessible(aHTMLListItemContent);
|
||||
if (accessible) {
|
||||
HTMLLIAccessible* listItem = accessible->AsHTMLListItem();
|
||||
if (listItem)
|
||||
|
@ -578,9 +583,9 @@ void
|
|||
nsAccessibilityService::UpdateImageMap(nsImageFrame* aImageFrame)
|
||||
{
|
||||
nsIPresShell* presShell = aImageFrame->PresContext()->PresShell();
|
||||
nsDocAccessible* document = GetDocAccessible(presShell);
|
||||
DocAccessible* document = GetDocAccessible(presShell);
|
||||
if (document) {
|
||||
nsAccessible* accessible =
|
||||
Accessible* accessible =
|
||||
document->GetAccessible(aImageFrame->GetContent());
|
||||
if (accessible) {
|
||||
nsHTMLImageMapAccessible* imageMap = accessible->AsImageMap();
|
||||
|
@ -611,9 +616,12 @@ nsAccessibilityService::PresShellDestroyed(nsIPresShell *aPresShell)
|
|||
if (!doc)
|
||||
return;
|
||||
|
||||
NS_LOG_ACCDOCDESTROY("presshell destroyed", doc)
|
||||
#ifdef DEBUG
|
||||
if (logging::IsEnabled(logging::eDocDestroy))
|
||||
logging::DocDestroy("presshell destroyed", doc);
|
||||
#endif
|
||||
|
||||
nsDocAccessible* docAccessible = GetDocAccessibleFromCache(doc);
|
||||
DocAccessible* docAccessible = GetDocAccessibleFromCache(doc);
|
||||
if (docAccessible)
|
||||
docAccessible->Shutdown();
|
||||
}
|
||||
|
@ -623,7 +631,7 @@ nsAccessibilityService::PresShellActivated(nsIPresShell* aPresShell)
|
|||
{
|
||||
nsIDocument* DOMDoc = aPresShell->GetDocument();
|
||||
if (DOMDoc) {
|
||||
nsDocAccessible* document = GetDocAccessibleFromCache(DOMDoc);
|
||||
DocAccessible* document = GetDocAccessibleFromCache(DOMDoc);
|
||||
if (document) {
|
||||
RootAccessible* rootDocument = document->RootAccessible();
|
||||
NS_ASSERTION(rootDocument, "Entirely broken tree: no root document!");
|
||||
|
@ -637,7 +645,7 @@ void
|
|||
nsAccessibilityService::RecreateAccessible(nsIPresShell* aPresShell,
|
||||
nsIContent* aContent)
|
||||
{
|
||||
nsDocAccessible* document = GetDocAccessible(aPresShell);
|
||||
DocAccessible* document = GetDocAccessible(aPresShell);
|
||||
if (document)
|
||||
document->RecreateAccessible(aContent);
|
||||
}
|
||||
|
@ -693,7 +701,7 @@ NS_IMETHODIMP
|
|||
nsAccessibilityService::GetStringStates(PRUint32 aState, PRUint32 aExtraState,
|
||||
nsIDOMDOMStringList **aStringStates)
|
||||
{
|
||||
nsAccessibleDOMStringList *stringStates = new nsAccessibleDOMStringList();
|
||||
nsAccessibleDOMStringList* stringStates = new nsAccessibleDOMStringList();
|
||||
NS_ENSURE_TRUE(stringStates, NS_ERROR_OUT_OF_MEMORY);
|
||||
|
||||
PRUint64 state = nsAccUtils::To64State(aState, aExtraState);
|
||||
|
@ -856,7 +864,7 @@ nsAccessibilityService::GetAccessibleFromCache(nsIDOMNode* aNode,
|
|||
// document accessibles are not stored in the document cache, however an
|
||||
// "unofficially" shutdown document (i.e. not from nsAccDocManager) can still
|
||||
// exist in the document cache.
|
||||
nsAccessible* accessible = FindAccessibleInCache(node);
|
||||
Accessible* accessible = FindAccessibleInCache(node);
|
||||
if (!accessible) {
|
||||
nsCOMPtr<nsIDocument> document(do_QueryInterface(node));
|
||||
if (document)
|
||||
|
@ -875,7 +883,7 @@ nsAccessibilityService::CreateAccessiblePivot(nsIAccessible* aRoot,
|
|||
NS_ENSURE_ARG(aRoot);
|
||||
*aPivot = nsnull;
|
||||
|
||||
nsRefPtr<nsAccessible> accessibleRoot(do_QueryObject(aRoot));
|
||||
nsRefPtr<Accessible> accessibleRoot(do_QueryObject(aRoot));
|
||||
NS_ENSURE_TRUE(accessibleRoot, NS_ERROR_INVALID_ARG);
|
||||
|
||||
nsAccessiblePivot* pivot = new nsAccessiblePivot(accessibleRoot);
|
||||
|
@ -884,16 +892,25 @@ nsAccessibilityService::CreateAccessiblePivot(nsIAccessible* aRoot,
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsAccessibilityService::SetLogging(const nsACString& aModules)
|
||||
{
|
||||
#ifdef DEBUG
|
||||
logging::Enable(PromiseFlatCString(aModules));
|
||||
#endif
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// nsAccessibilityService public
|
||||
|
||||
nsAccessible*
|
||||
Accessible*
|
||||
nsAccessibilityService::GetAccessible(nsINode* aNode, nsIPresShell* aPresShell)
|
||||
{
|
||||
NS_PRECONDITION(aNode, "Getting an accessible for null node! Crash.");
|
||||
|
||||
// XXX handle the presshell
|
||||
nsDocAccessible* document = GetDocAccessible(aNode->OwnerDoc());
|
||||
DocAccessible* document = GetDocAccessible(aNode->OwnerDoc());
|
||||
return document ? document->GetAccessible(aNode) : nsnull;
|
||||
}
|
||||
|
||||
|
@ -910,9 +927,9 @@ static bool HasRelatedContent(nsIContent *aContent)
|
|||
nsAccUtils::GetDocAccessibleFor(aContent)->IsDependentID(id);
|
||||
}
|
||||
|
||||
nsAccessible*
|
||||
Accessible*
|
||||
nsAccessibilityService::GetOrCreateAccessible(nsINode* aNode,
|
||||
nsDocAccessible* aDoc,
|
||||
DocAccessible* aDoc,
|
||||
bool* aIsSubtreeHidden)
|
||||
{
|
||||
if (!aDoc || !aNode || gIsShutdown)
|
||||
|
@ -922,7 +939,7 @@ nsAccessibilityService::GetOrCreateAccessible(nsINode* aNode,
|
|||
*aIsSubtreeHidden = false;
|
||||
|
||||
// Check to see if we already have an accessible for this node in the cache.
|
||||
nsAccessible* cachedAccessible = aDoc->GetAccessible(aNode);
|
||||
Accessible* cachedAccessible = aDoc->GetAccessible(aNode);
|
||||
if (cachedAccessible)
|
||||
return cachedAccessible;
|
||||
|
||||
|
@ -987,7 +1004,7 @@ nsAccessibilityService::GetOrCreateAccessible(nsINode* aNode,
|
|||
"Image map manages the area accessible creation!");
|
||||
#endif
|
||||
|
||||
nsDocAccessible* docAcc =
|
||||
DocAccessible* docAcc =
|
||||
GetAccService()->GetDocAccessible(aNode->OwnerDoc());
|
||||
if (!docAcc) {
|
||||
NS_NOTREACHED("Node has no host document accessible!");
|
||||
|
@ -995,7 +1012,7 @@ nsAccessibilityService::GetOrCreateAccessible(nsINode* aNode,
|
|||
}
|
||||
|
||||
// Attempt to create an accessible based on what we know.
|
||||
nsRefPtr<nsAccessible> newAcc;
|
||||
nsRefPtr<Accessible> newAcc;
|
||||
|
||||
// Create accessible for visible text frames.
|
||||
if (content->IsNodeOfType(nsINode::eTEXT)) {
|
||||
|
@ -1073,7 +1090,7 @@ nsAccessibilityService::GetOrCreateAccessible(nsINode* aNode,
|
|||
continue;
|
||||
|
||||
if (tableFrame->GetType() == nsGkAtoms::tableOuterFrame) {
|
||||
nsAccessible* tableAccessible = aDoc->GetAccessible(tableContent);
|
||||
Accessible* tableAccessible = aDoc->GetAccessible(tableContent);
|
||||
|
||||
if (tableAccessible) {
|
||||
if (!roleMapEntry) {
|
||||
|
@ -1214,7 +1231,7 @@ nsAccessibilityService::GetOrCreateAccessible(nsINode* aNode,
|
|||
}
|
||||
else { // XUL, SVG, MathML etc.
|
||||
// Interesting generic non-HTML container
|
||||
newAcc = new nsAccessibleWrap(content, docAcc);
|
||||
newAcc = new AccessibleWrap(content, docAcc);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1242,6 +1259,10 @@ nsAccessibilityService::Init()
|
|||
static const PRUnichar kInitIndicator[] = { '1', 0 };
|
||||
observerService->NotifyObservers(nsnull, "a11y-init-or-shutdown", kInitIndicator);
|
||||
|
||||
#ifdef DEBUG
|
||||
logging::CheckEnv();
|
||||
#endif
|
||||
|
||||
// Initialize accessibility.
|
||||
nsAccessNodeWrap::InitAccessibility();
|
||||
|
||||
|
@ -1300,9 +1321,9 @@ nsAccessibilityService::HasUniversalAriaProperty(nsIContent *aContent)
|
|||
nsAccUtils::HasDefinedARIAToken(aContent, nsGkAtoms::aria_relevant);
|
||||
}
|
||||
|
||||
already_AddRefed<nsAccessible>
|
||||
already_AddRefed<Accessible>
|
||||
nsAccessibilityService::CreateAccessibleByType(nsIContent* aContent,
|
||||
nsDocAccessible* aDoc)
|
||||
DocAccessible* aDoc)
|
||||
{
|
||||
nsCOMPtr<nsIAccessibleProvider> accessibleProvider(do_QueryInterface(aContent));
|
||||
if (!accessibleProvider)
|
||||
|
@ -1314,12 +1335,12 @@ nsAccessibilityService::CreateAccessibleByType(nsIContent* aContent,
|
|||
return nsnull;
|
||||
|
||||
if (type == nsIAccessibleProvider::OuterDoc) {
|
||||
nsAccessible* accessible = new OuterDocAccessible(aContent, aDoc);
|
||||
Accessible* accessible = new OuterDocAccessible(aContent, aDoc);
|
||||
NS_IF_ADDREF(accessible);
|
||||
return accessible;
|
||||
}
|
||||
|
||||
nsAccessible* accessible = nsnull;
|
||||
Accessible* accessible = nsnull;
|
||||
switch (type)
|
||||
{
|
||||
#ifdef MOZ_XUL
|
||||
|
@ -1383,7 +1404,7 @@ nsAccessibilityService::CreateAccessibleByType(nsIContent* aContent,
|
|||
break;
|
||||
|
||||
case nsIAccessibleProvider::XULListHead:
|
||||
accessible = new nsXULColumnsAccessible(aContent, aDoc);
|
||||
accessible = new nsXULColumAccessible(aContent, aDoc);
|
||||
break;
|
||||
|
||||
case nsIAccessibleProvider::XULListHeader:
|
||||
|
@ -1409,7 +1430,7 @@ nsAccessibilityService::CreateAccessibleByType(nsIContent* aContent,
|
|||
// navigation with assistive technologies more difficult
|
||||
// XXX In the future we will should this for consistency across the nsIAccessible
|
||||
// implementations on each platform for a consistent scripting environment, but
|
||||
// then strip out redundant accessibles in the nsAccessibleWrap class for each platform.
|
||||
// then strip out redundant accessibles in the AccessibleWrap class for each platform.
|
||||
nsIContent *parent = aContent->GetParent();
|
||||
if (parent && parent->NodeInfo()->Equals(nsGkAtoms::menu,
|
||||
kNameSpaceID_XUL))
|
||||
|
@ -1476,7 +1497,7 @@ nsAccessibilityService::CreateAccessibleByType(nsIContent* aContent,
|
|||
return CreateAccessibleForXULTree(aContent, aDoc);
|
||||
|
||||
case nsIAccessibleProvider::XULTreeColumns:
|
||||
accessible = new nsXULTreeColumnsAccessible(aContent, aDoc);
|
||||
accessible = new nsXULTreeColumAccessible(aContent, aDoc);
|
||||
break;
|
||||
|
||||
case nsIAccessibleProvider::XULTreeColumnItem:
|
||||
|
@ -1586,47 +1607,46 @@ nsAccessibilityService::CreateAccessibleByType(nsIContent* aContent,
|
|||
return accessible;
|
||||
}
|
||||
|
||||
already_AddRefed<nsAccessible>
|
||||
already_AddRefed<Accessible>
|
||||
nsAccessibilityService::CreateHTMLAccessibleByMarkup(nsIFrame* aFrame,
|
||||
nsIContent* aContent,
|
||||
nsDocAccessible* aDoc)
|
||||
DocAccessible* aDoc)
|
||||
{
|
||||
// This method assumes we're in an HTML namespace.
|
||||
nsIAtom* tag = aContent->Tag();
|
||||
if (tag == nsGkAtoms::figcaption) {
|
||||
nsAccessible* accessible = new HTMLFigcaptionAccessible(aContent, aDoc);
|
||||
Accessible* accessible = new HTMLFigcaptionAccessible(aContent, aDoc);
|
||||
NS_IF_ADDREF(accessible);
|
||||
return accessible;
|
||||
}
|
||||
|
||||
if (tag == nsGkAtoms::figure) {
|
||||
nsAccessible* accessible = new HTMLFigureAccessible(aContent, aDoc);
|
||||
Accessible* accessible = new HTMLFigureAccessible(aContent, aDoc);
|
||||
NS_IF_ADDREF(accessible);
|
||||
return accessible;
|
||||
}
|
||||
|
||||
if (tag == nsGkAtoms::legend) {
|
||||
nsAccessible* accessible = new HTMLLegendAccessible(aContent, aDoc);
|
||||
Accessible* accessible = new HTMLLegendAccessible(aContent, aDoc);
|
||||
NS_IF_ADDREF(accessible);
|
||||
return accessible;
|
||||
}
|
||||
|
||||
if (tag == nsGkAtoms::option) {
|
||||
nsAccessible* accessible = new nsHTMLSelectOptionAccessible(aContent, aDoc);
|
||||
Accessible* accessible = new nsHTMLSelectOptionAccessible(aContent, aDoc);
|
||||
NS_IF_ADDREF(accessible);
|
||||
return accessible;
|
||||
}
|
||||
|
||||
if (tag == nsGkAtoms::optgroup) {
|
||||
nsAccessible* accessible = new nsHTMLSelectOptGroupAccessible(aContent,
|
||||
aDoc);
|
||||
Accessible* accessible = new nsHTMLSelectOptGroupAccessible(aContent, aDoc);
|
||||
NS_IF_ADDREF(accessible);
|
||||
return accessible;
|
||||
}
|
||||
|
||||
if (tag == nsGkAtoms::ul || tag == nsGkAtoms::ol ||
|
||||
tag == nsGkAtoms::dl) {
|
||||
nsAccessible* accessible = new HTMLListAccessible(aContent, aDoc);
|
||||
Accessible* accessible = new HTMLListAccessible(aContent, aDoc);
|
||||
NS_IF_ADDREF(accessible);
|
||||
return accessible;
|
||||
}
|
||||
|
@ -1637,12 +1657,12 @@ nsAccessibilityService::CreateHTMLAccessibleByMarkup(nsIFrame* aFrame,
|
|||
nsRoleMapEntry* roleMapEntry = aria::GetRoleMap(aContent);
|
||||
if (roleMapEntry && roleMapEntry->role != roles::NOTHING &&
|
||||
roleMapEntry->role != roles::LINK) {
|
||||
nsAccessible* accessible = new nsHyperTextAccessibleWrap(aContent, aDoc);
|
||||
Accessible* accessible = new nsHyperTextAccessibleWrap(aContent, aDoc);
|
||||
NS_IF_ADDREF(accessible);
|
||||
return accessible;
|
||||
}
|
||||
|
||||
nsAccessible* accessible = new nsHTMLLinkAccessible(aContent, aDoc);
|
||||
Accessible* accessible = new nsHTMLLinkAccessible(aContent, aDoc);
|
||||
NS_IF_ADDREF(accessible);
|
||||
return accessible;
|
||||
}
|
||||
|
@ -1653,7 +1673,7 @@ nsAccessibilityService::CreateHTMLAccessibleByMarkup(nsIFrame* aFrame,
|
|||
// Normally for li, it is created by the list item frame (in nsBlockFrame)
|
||||
// which knows about the bullet frame; however, in this case the list item
|
||||
// must have been styled using display: foo
|
||||
nsAccessible* accessible = new HTMLLIAccessible(aContent, aDoc);
|
||||
Accessible* accessible = new HTMLLIAccessible(aContent, aDoc);
|
||||
NS_IF_ADDREF(accessible);
|
||||
return accessible;
|
||||
}
|
||||
|
@ -1670,26 +1690,26 @@ nsAccessibilityService::CreateHTMLAccessibleByMarkup(nsIFrame* aFrame,
|
|||
tag == nsGkAtoms::h5 ||
|
||||
tag == nsGkAtoms::h6 ||
|
||||
tag == nsGkAtoms::q) {
|
||||
nsAccessible* accessible = new nsHyperTextAccessibleWrap(aContent, aDoc);
|
||||
Accessible* accessible = new nsHyperTextAccessibleWrap(aContent, aDoc);
|
||||
NS_IF_ADDREF(accessible);
|
||||
return accessible;
|
||||
}
|
||||
|
||||
if (nsCoreUtils::IsHTMLTableHeader(aContent)) {
|
||||
nsAccessible* accessible = new nsHTMLTableHeaderCellAccessibleWrap(aContent,
|
||||
aDoc);
|
||||
Accessible* accessible = new nsHTMLTableHeaderCellAccessibleWrap(aContent,
|
||||
aDoc);
|
||||
NS_IF_ADDREF(accessible);
|
||||
return accessible;
|
||||
}
|
||||
|
||||
if (tag == nsGkAtoms::output) {
|
||||
nsAccessible* accessible = new nsHTMLOutputAccessible(aContent, aDoc);
|
||||
Accessible* accessible = new nsHTMLOutputAccessible(aContent, aDoc);
|
||||
NS_IF_ADDREF(accessible);
|
||||
return accessible;
|
||||
}
|
||||
|
||||
if (tag == nsGkAtoms::progress) {
|
||||
nsAccessible* accessible =
|
||||
Accessible* accessible =
|
||||
new HTMLProgressMeterAccessible(aContent, aDoc);
|
||||
NS_IF_ADDREF(accessible);
|
||||
return accessible;
|
||||
|
@ -1701,7 +1721,7 @@ nsAccessibilityService::CreateHTMLAccessibleByMarkup(nsIFrame* aFrame,
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
// nsIAccessibilityService (DON'T put methods here)
|
||||
|
||||
nsAccessible*
|
||||
Accessible*
|
||||
nsAccessibilityService::AddNativeRootAccessible(void* aAtkAccessible)
|
||||
{
|
||||
#ifdef MOZ_ACCESSIBILITY_ATK
|
||||
|
@ -1723,7 +1743,7 @@ nsAccessibilityService::AddNativeRootAccessible(void* aAtkAccessible)
|
|||
}
|
||||
|
||||
void
|
||||
nsAccessibilityService::RemoveNativeRootAccessible(nsAccessible* aAccessible)
|
||||
nsAccessibilityService::RemoveNativeRootAccessible(Accessible* aAccessible)
|
||||
{
|
||||
#ifdef MOZ_ACCESSIBILITY_ATK
|
||||
ApplicationAccessible* applicationAcc =
|
||||
|
@ -1771,10 +1791,10 @@ NS_GetAccessibilityService(nsIAccessibilityService** aResult)
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
// nsAccessibilityService private (DON'T put methods here)
|
||||
|
||||
already_AddRefed<nsAccessible>
|
||||
already_AddRefed<Accessible>
|
||||
nsAccessibilityService::CreateAccessibleForDeckChild(nsIFrame* aFrame,
|
||||
nsIContent* aContent,
|
||||
nsDocAccessible* aDoc)
|
||||
DocAccessible* aDoc)
|
||||
{
|
||||
if (aFrame->GetType() == nsGkAtoms::boxFrame ||
|
||||
aFrame->GetType() == nsGkAtoms::scrollFrame) {
|
||||
|
@ -1787,13 +1807,13 @@ nsAccessibilityService::CreateAccessibleForDeckChild(nsIFrame* aFrame,
|
|||
#ifdef MOZ_XUL
|
||||
if (parentContent->NodeInfo()->Equals(nsGkAtoms::tabpanels,
|
||||
kNameSpaceID_XUL)) {
|
||||
nsAccessible* accessible = new nsXULTabpanelAccessible(aContent, aDoc);
|
||||
Accessible* accessible = new nsXULTabpanelAccessible(aContent, aDoc);
|
||||
NS_IF_ADDREF(accessible);
|
||||
return accessible;
|
||||
}
|
||||
#endif
|
||||
nsAccessible* accessible = new nsEnumRoleAccessible(aContent, aDoc,
|
||||
roles::PROPERTYPAGE);
|
||||
Accessible* accessible = new nsEnumRoleAccessible(aContent, aDoc,
|
||||
roles::PROPERTYPAGE);
|
||||
NS_IF_ADDREF(accessible);
|
||||
return accessible;
|
||||
}
|
||||
|
@ -1803,9 +1823,9 @@ nsAccessibilityService::CreateAccessibleForDeckChild(nsIFrame* aFrame,
|
|||
}
|
||||
|
||||
#ifdef MOZ_XUL
|
||||
already_AddRefed<nsAccessible>
|
||||
already_AddRefed<Accessible>
|
||||
nsAccessibilityService::CreateAccessibleForXULTree(nsIContent* aContent,
|
||||
nsDocAccessible* aDoc)
|
||||
DocAccessible* aDoc)
|
||||
{
|
||||
nsCOMPtr<nsITreeBoxObject> treeBoxObj = nsCoreUtils::GetTreeBoxObject(aContent);
|
||||
if (!treeBoxObj)
|
||||
|
@ -1821,13 +1841,13 @@ nsAccessibilityService::CreateAccessibleForXULTree(nsIContent* aContent,
|
|||
|
||||
// Outline of list accessible.
|
||||
if (count == 1) {
|
||||
nsAccessible* accessible = new nsXULTreeAccessible(aContent, aDoc);
|
||||
Accessible* accessible = new nsXULTreeAccessible(aContent, aDoc);
|
||||
NS_IF_ADDREF(accessible);
|
||||
return accessible;
|
||||
}
|
||||
|
||||
// Table or tree table accessible.
|
||||
nsAccessible* accessible = new nsXULTreeGridAccessibleWrap(aContent, aDoc);
|
||||
Accessible* accessible = new nsXULTreeGridAccessibleWrap(aContent, aDoc);
|
||||
NS_IF_ADDREF(accessible);
|
||||
return accessible;
|
||||
}
|
||||
|
|
|
@ -57,60 +57,60 @@ public:
|
|||
NS_DECL_NSIOBSERVER
|
||||
|
||||
// nsIAccessibilityService
|
||||
virtual nsAccessible* GetRootDocumentAccessible(nsIPresShell* aPresShell,
|
||||
bool aCanCreate);
|
||||
already_AddRefed<nsAccessible>
|
||||
virtual Accessible* GetRootDocumentAccessible(nsIPresShell* aPresShell,
|
||||
bool aCanCreate);
|
||||
already_AddRefed<Accessible>
|
||||
CreateHTMLButtonAccessible(nsIContent* aContent, nsIPresShell* aPresShell);
|
||||
already_AddRefed<nsAccessible>
|
||||
already_AddRefed<Accessible>
|
||||
CreateHTMLBRAccessible(nsIContent* aContent, nsIPresShell* aPresShell);
|
||||
already_AddRefed<nsAccessible>
|
||||
already_AddRefed<Accessible>
|
||||
CreateHTMLCanvasAccessible(nsIContent* aContent, nsIPresShell* aPresShell);
|
||||
already_AddRefed<nsAccessible>
|
||||
already_AddRefed<Accessible>
|
||||
CreateHTMLCaptionAccessible(nsIContent* aContent, nsIPresShell* aPresShell);
|
||||
already_AddRefed<nsAccessible>
|
||||
already_AddRefed<Accessible>
|
||||
CreateHTMLCheckboxAccessible(nsIContent* aContent, nsIPresShell* aPresShell);
|
||||
already_AddRefed<nsAccessible>
|
||||
already_AddRefed<Accessible>
|
||||
CreateHTMLComboboxAccessible(nsIContent* aContent, nsIPresShell* aPresShell);
|
||||
already_AddRefed<nsAccessible>
|
||||
already_AddRefed<Accessible>
|
||||
CreateHTMLFileInputAccessible(nsIContent* aContent, nsIPresShell* aPresShell);
|
||||
already_AddRefed<nsAccessible>
|
||||
already_AddRefed<Accessible>
|
||||
CreateHTMLGroupboxAccessible(nsIContent* aContent, nsIPresShell* aPresShell);
|
||||
already_AddRefed<nsAccessible>
|
||||
already_AddRefed<Accessible>
|
||||
CreateHTMLHRAccessible(nsIContent* aContent, nsIPresShell* aPresShell);
|
||||
already_AddRefed<nsAccessible>
|
||||
already_AddRefed<Accessible>
|
||||
CreateHTMLImageAccessible(nsIContent* aContent, nsIPresShell* aPresShell);
|
||||
already_AddRefed<nsAccessible>
|
||||
already_AddRefed<Accessible>
|
||||
CreateHTMLImageMapAccessible(nsIContent* aContent, nsIPresShell* aPresShell);
|
||||
already_AddRefed<nsAccessible>
|
||||
already_AddRefed<Accessible>
|
||||
CreateHTMLLabelAccessible(nsIContent* aContent, nsIPresShell* aPresShell);
|
||||
already_AddRefed<nsAccessible>
|
||||
already_AddRefed<Accessible>
|
||||
CreateHTMLLIAccessible(nsIContent* aContent, nsIPresShell* aPresShell);
|
||||
already_AddRefed<nsAccessible>
|
||||
already_AddRefed<Accessible>
|
||||
CreateHTMLListboxAccessible(nsIContent* aContent, nsIPresShell* aPresShell);
|
||||
already_AddRefed<nsAccessible>
|
||||
already_AddRefed<Accessible>
|
||||
CreateHTMLMediaAccessible(nsIContent* aContent, nsIPresShell* aPresShell);
|
||||
already_AddRefed<nsAccessible>
|
||||
already_AddRefed<Accessible>
|
||||
CreateHTMLObjectFrameAccessible(nsObjectFrame* aFrame, nsIContent* aContent,
|
||||
nsIPresShell* aPresShell);
|
||||
already_AddRefed<nsAccessible>
|
||||
already_AddRefed<Accessible>
|
||||
CreateHTMLRadioButtonAccessible(nsIContent* aContent, nsIPresShell* aPresShell);
|
||||
already_AddRefed<nsAccessible>
|
||||
already_AddRefed<Accessible>
|
||||
CreateHTMLTableAccessible(nsIContent* aContent, nsIPresShell* aPresShell);
|
||||
already_AddRefed<nsAccessible>
|
||||
already_AddRefed<Accessible>
|
||||
CreateHTMLTableCellAccessible(nsIContent* aContent, nsIPresShell* aPresShell);
|
||||
already_AddRefed<nsAccessible>
|
||||
already_AddRefed<Accessible>
|
||||
CreateHTMLTableRowAccessible(nsIContent* aContent, nsIPresShell* aPresShell);
|
||||
already_AddRefed<nsAccessible>
|
||||
CreateHTMLTextAccessible(nsIContent* aContent, nsIPresShell* aPresShell);
|
||||
already_AddRefed<nsAccessible>
|
||||
already_AddRefed<Accessible>
|
||||
CreateTextLeafAccessible(nsIContent* aContent, nsIPresShell* aPresShell);
|
||||
already_AddRefed<Accessible>
|
||||
CreateHTMLTextFieldAccessible(nsIContent* aContent, nsIPresShell* aPresShell);
|
||||
already_AddRefed<nsAccessible>
|
||||
already_AddRefed<Accessible>
|
||||
CreateHyperTextAccessible(nsIContent* aContent, nsIPresShell* aPresShell);
|
||||
already_AddRefed<nsAccessible>
|
||||
already_AddRefed<Accessible>
|
||||
CreateOuterDocAccessible(nsIContent* aContent, nsIPresShell* aPresShell);
|
||||
|
||||
virtual nsAccessible* AddNativeRootAccessible(void* aAtkAccessible);
|
||||
virtual void RemoveNativeRootAccessible(nsAccessible* aRootAccessible);
|
||||
virtual Accessible* AddNativeRootAccessible(void* aAtkAccessible);
|
||||
virtual void RemoveNativeRootAccessible(Accessible* aRootAccessible);
|
||||
|
||||
virtual void ContentRangeInserted(nsIPresShell* aPresShell,
|
||||
nsIContent* aContainer,
|
||||
|
@ -154,7 +154,7 @@ public:
|
|||
*/
|
||||
void RecreateAccessible(nsIPresShell* aPresShell, nsIContent* aContent);
|
||||
|
||||
virtual void FireAccessibleEvent(PRUint32 aEvent, nsAccessible* aTarget);
|
||||
virtual void FireAccessibleEvent(PRUint32 aEvent, Accessible* aTarget);
|
||||
|
||||
// nsAccessibiltiyService
|
||||
|
||||
|
@ -172,14 +172,14 @@ public:
|
|||
* @param aIsSubtreeHidden [out, optional] indicates whether the node's
|
||||
* frame and its subtree is hidden
|
||||
*/
|
||||
nsAccessible* GetOrCreateAccessible(nsINode* aNode, nsDocAccessible* aDoc,
|
||||
bool* aIsSubtreeHidden = nsnull);
|
||||
Accessible* GetOrCreateAccessible(nsINode* aNode, DocAccessible* aDoc,
|
||||
bool* aIsSubtreeHidden = nsnull);
|
||||
|
||||
/**
|
||||
* Return an accessible for the given DOM node and eventually a presentation
|
||||
* shell.
|
||||
*/
|
||||
nsAccessible* GetAccessible(nsINode* aNode, nsIPresShell* aPresShell);
|
||||
Accessible* GetAccessible(nsINode* aNode, nsIPresShell* aPresShell);
|
||||
|
||||
private:
|
||||
// nsAccessibilityService creation is controlled by friend
|
||||
|
@ -203,29 +203,29 @@ private:
|
|||
* Create accessible for the element implementing nsIAccessibleProvider
|
||||
* interface.
|
||||
*/
|
||||
already_AddRefed<nsAccessible>
|
||||
CreateAccessibleByType(nsIContent* aContent, nsDocAccessible* aDoc);
|
||||
already_AddRefed<Accessible>
|
||||
CreateAccessibleByType(nsIContent* aContent, DocAccessible* aDoc);
|
||||
|
||||
/**
|
||||
* Create accessible for HTML node by tag name.
|
||||
*/
|
||||
already_AddRefed<nsAccessible>
|
||||
already_AddRefed<Accessible>
|
||||
CreateHTMLAccessibleByMarkup(nsIFrame* aFrame, nsIContent* aContent,
|
||||
nsDocAccessible* aDoc);
|
||||
DocAccessible* aDoc);
|
||||
|
||||
/**
|
||||
* Create accessible if parent is a deck frame.
|
||||
*/
|
||||
already_AddRefed<nsAccessible>
|
||||
already_AddRefed<Accessible>
|
||||
CreateAccessibleForDeckChild(nsIFrame* aFrame, nsIContent* aContent,
|
||||
nsDocAccessible* aDoc);
|
||||
DocAccessible* aDoc);
|
||||
|
||||
#ifdef MOZ_XUL
|
||||
/**
|
||||
* Create accessible for XUL tree element.
|
||||
*/
|
||||
already_AddRefed<nsAccessible>
|
||||
CreateAccessibleForXULTree(nsIContent* aContent, nsDocAccessible* aDoc);
|
||||
already_AddRefed<Accessible>
|
||||
CreateAccessibleForXULTree(nsIContent* aContent, DocAccessible* aDoc);
|
||||
#endif
|
||||
|
||||
/**
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
#include "Accessible-inl.h"
|
||||
#include "nsAccUtils.h"
|
||||
#include "nsHyperTextAccessible.h"
|
||||
#include "nsDocAccessible.h"
|
||||
#include "DocAccessible.h"
|
||||
#include "States.h"
|
||||
|
||||
#include "nsArrayUtils.h"
|
||||
|
@ -32,7 +32,7 @@ public:
|
|||
nsMemory::Free(mAcceptRoles);
|
||||
}
|
||||
|
||||
nsresult ApplyFilter(nsAccessible* aAccessible, PRUint16* aResult);
|
||||
nsresult ApplyFilter(Accessible* aAccessible, PRUint16* aResult);
|
||||
|
||||
private:
|
||||
nsCOMPtr<nsIAccessibleTraversalRule> mRule;
|
||||
|
@ -44,7 +44,7 @@ private:
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
// nsAccessiblePivot
|
||||
|
||||
nsAccessiblePivot::nsAccessiblePivot(nsAccessible* aRoot) :
|
||||
nsAccessiblePivot::nsAccessiblePivot(Accessible* aRoot) :
|
||||
mRoot(aRoot), mPosition(nsnull),
|
||||
mStartOffset(-1), mEndOffset(-1)
|
||||
{
|
||||
|
@ -106,7 +106,7 @@ nsAccessiblePivot::GetPosition(nsIAccessible** aPosition)
|
|||
NS_IMETHODIMP
|
||||
nsAccessiblePivot::SetPosition(nsIAccessible* aPosition)
|
||||
{
|
||||
nsRefPtr<nsAccessible> secondPosition;
|
||||
nsRefPtr<Accessible> secondPosition;
|
||||
|
||||
if (aPosition) {
|
||||
secondPosition = do_QueryObject(aPosition);
|
||||
|
@ -169,7 +169,7 @@ nsAccessiblePivot::SetTextRange(nsIAccessibleText* aTextAccessible,
|
|||
mStartOffset = aStartOffset;
|
||||
mEndOffset = aEndOffset;
|
||||
|
||||
nsRefPtr<nsAccessible> oldPosition = mPosition.forget();
|
||||
nsRefPtr<Accessible> oldPosition = mPosition.forget();
|
||||
mPosition = newPosition.forget();
|
||||
|
||||
NotifyPivotChanged(oldPosition, oldStart, oldEnd);
|
||||
|
@ -180,17 +180,23 @@ nsAccessiblePivot::SetTextRange(nsIAccessibleText* aTextAccessible,
|
|||
// Traversal functions
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsAccessiblePivot::MoveNext(nsIAccessibleTraversalRule* aRule, bool* aResult)
|
||||
nsAccessiblePivot::MoveNext(nsIAccessibleTraversalRule* aRule,
|
||||
nsIAccessible* aAnchor, bool aIncludeStart,
|
||||
PRUint8 aArgc, bool* aResult)
|
||||
{
|
||||
NS_ENSURE_ARG(aResult);
|
||||
NS_ENSURE_ARG(aRule);
|
||||
|
||||
if (mPosition && (mPosition->IsDefunct() ||
|
||||
!mPosition->Document()->IsInDocument(mPosition)))
|
||||
*aResult = false;
|
||||
|
||||
nsRefPtr<Accessible> anchor =
|
||||
(aArgc > 0) ? do_QueryObject(aAnchor) : mPosition;
|
||||
if (anchor && (anchor->IsDefunct() || !IsRootDescendant(anchor)))
|
||||
return NS_ERROR_NOT_IN_TREE;
|
||||
|
||||
nsresult rv = NS_OK;
|
||||
nsAccessible* accessible = SearchForward(mPosition, aRule, false, &rv);
|
||||
Accessible* accessible =
|
||||
SearchForward(anchor, aRule, (aArgc > 1) ? aIncludeStart : false, &rv);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
*aResult = accessible;
|
||||
|
@ -201,17 +207,24 @@ nsAccessiblePivot::MoveNext(nsIAccessibleTraversalRule* aRule, bool* aResult)
|
|||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsAccessiblePivot::MovePrevious(nsIAccessibleTraversalRule* aRule, bool* aResult)
|
||||
nsAccessiblePivot::MovePrevious(nsIAccessibleTraversalRule* aRule,
|
||||
nsIAccessible* aAnchor,
|
||||
bool aIncludeStart,
|
||||
PRUint8 aArgc, bool* aResult)
|
||||
{
|
||||
NS_ENSURE_ARG(aResult);
|
||||
NS_ENSURE_ARG(aRule);
|
||||
|
||||
if (mPosition && (mPosition->IsDefunct() ||
|
||||
!mPosition->Document()->IsInDocument(mPosition)))
|
||||
*aResult = false;
|
||||
|
||||
nsRefPtr<Accessible> anchor =
|
||||
(aArgc > 0) ? do_QueryObject(aAnchor) : mPosition;
|
||||
if (anchor && (anchor->IsDefunct() || !IsRootDescendant(anchor)))
|
||||
return NS_ERROR_NOT_IN_TREE;
|
||||
|
||||
nsresult rv = NS_OK;
|
||||
nsAccessible* accessible = SearchBackward(mPosition, aRule, false, &rv);
|
||||
Accessible* accessible =
|
||||
SearchBackward(anchor, aRule, (aArgc > 1) ? aIncludeStart : false, &rv);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
*aResult = accessible;
|
||||
|
@ -231,7 +244,7 @@ nsAccessiblePivot::MoveFirst(nsIAccessibleTraversalRule* aRule, bool* aResult)
|
|||
return NS_ERROR_NOT_IN_TREE;
|
||||
|
||||
nsresult rv = NS_OK;
|
||||
nsAccessible* accessible = SearchForward(mRoot, aRule, true, &rv);
|
||||
Accessible* accessible = SearchForward(mRoot, aRule, true, &rv);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
*aResult = accessible;
|
||||
|
@ -252,8 +265,8 @@ nsAccessiblePivot::MoveLast(nsIAccessibleTraversalRule* aRule, bool* aResult)
|
|||
|
||||
*aResult = false;
|
||||
nsresult rv = NS_OK;
|
||||
nsAccessible* lastAccessible = mRoot;
|
||||
nsAccessible* accessible = nsnull;
|
||||
Accessible* lastAccessible = mRoot;
|
||||
Accessible* accessible = nsnull;
|
||||
|
||||
// First got to the last accessible in pre-order
|
||||
while (lastAccessible->HasChildren())
|
||||
|
@ -315,12 +328,13 @@ nsAccessiblePivot::RemoveObserver(nsIAccessiblePivotObserver* aObserver)
|
|||
// Private utility methods
|
||||
|
||||
bool
|
||||
nsAccessiblePivot::IsRootDescendant(nsAccessible* aAccessible)
|
||||
nsAccessiblePivot::IsRootDescendant(Accessible* aAccessible)
|
||||
{
|
||||
if (!mRoot || mRoot->IsDefunct())
|
||||
return false;
|
||||
|
||||
nsAccessible* accessible = aAccessible;
|
||||
// XXX Optimize with IsInDocument() when appropriate. Blocked by bug 759875.
|
||||
Accessible* accessible = aAccessible;
|
||||
do {
|
||||
if (accessible == mRoot)
|
||||
return true;
|
||||
|
@ -330,9 +344,9 @@ nsAccessiblePivot::IsRootDescendant(nsAccessible* aAccessible)
|
|||
}
|
||||
|
||||
void
|
||||
nsAccessiblePivot::MovePivotInternal(nsAccessible* aPosition)
|
||||
nsAccessiblePivot::MovePivotInternal(Accessible* aPosition)
|
||||
{
|
||||
nsRefPtr<nsAccessible> oldPosition = mPosition.forget();
|
||||
nsRefPtr<Accessible> oldPosition = mPosition.forget();
|
||||
mPosition = aPosition;
|
||||
PRInt32 oldStart = mStartOffset, oldEnd = mEndOffset;
|
||||
mStartOffset = mEndOffset = -1;
|
||||
|
@ -340,47 +354,48 @@ nsAccessiblePivot::MovePivotInternal(nsAccessible* aPosition)
|
|||
NotifyPivotChanged(oldPosition, oldStart, oldEnd);
|
||||
}
|
||||
|
||||
nsAccessible*
|
||||
nsAccessiblePivot::SearchBackward(nsAccessible* aAccessible,
|
||||
Accessible*
|
||||
nsAccessiblePivot::SearchBackward(Accessible* aAccessible,
|
||||
nsIAccessibleTraversalRule* aRule,
|
||||
bool searchCurrent,
|
||||
nsresult* rv)
|
||||
bool aSearchCurrent,
|
||||
nsresult* aResult)
|
||||
{
|
||||
*rv = NS_OK;
|
||||
*aResult = NS_OK;
|
||||
|
||||
// Initial position could be unset, in that case return null.
|
||||
if (!aAccessible)
|
||||
return nsnull;
|
||||
|
||||
RuleCache cache(aRule);
|
||||
nsAccessible* accessible = aAccessible;
|
||||
Accessible* accessible = aAccessible;
|
||||
|
||||
PRUint16 filtered = nsIAccessibleTraversalRule::FILTER_IGNORE;
|
||||
|
||||
if (searchCurrent) {
|
||||
*rv = cache.ApplyFilter(accessible, &filtered);
|
||||
NS_ENSURE_SUCCESS(*rv, nsnull);
|
||||
if (aSearchCurrent) {
|
||||
*aResult = cache.ApplyFilter(accessible, &filtered);
|
||||
NS_ENSURE_SUCCESS(*aResult, nsnull);
|
||||
if (filtered & nsIAccessibleTraversalRule::FILTER_MATCH)
|
||||
return accessible;
|
||||
}
|
||||
|
||||
while (accessible != mRoot) {
|
||||
nsAccessible* parent = accessible->Parent();
|
||||
Accessible* parent = accessible->Parent();
|
||||
PRInt32 idxInParent = accessible->IndexInParent();
|
||||
while (idxInParent > 0) {
|
||||
if (!(accessible = parent->GetChildAt(--idxInParent)))
|
||||
continue;
|
||||
|
||||
*rv = cache.ApplyFilter(accessible, &filtered);
|
||||
NS_ENSURE_SUCCESS(*rv, nsnull);
|
||||
*aResult = cache.ApplyFilter(accessible, &filtered);
|
||||
NS_ENSURE_SUCCESS(*aResult, nsnull);
|
||||
|
||||
nsAccessible* lastChild;
|
||||
Accessible* lastChild = nsnull;
|
||||
while (!(filtered & nsIAccessibleTraversalRule::FILTER_IGNORE_SUBTREE) &&
|
||||
(lastChild = accessible->LastChild())) {
|
||||
parent = accessible;
|
||||
accessible = lastChild;
|
||||
*rv = cache.ApplyFilter(accessible, &filtered);
|
||||
NS_ENSURE_SUCCESS(*rv, nsnull);
|
||||
idxInParent = accessible->IndexInParent();
|
||||
*aResult = cache.ApplyFilter(accessible, &filtered);
|
||||
NS_ENSURE_SUCCESS(*aResult, nsnull);
|
||||
}
|
||||
|
||||
if (filtered & nsIAccessibleTraversalRule::FILTER_MATCH)
|
||||
|
@ -390,8 +405,8 @@ nsAccessiblePivot::SearchBackward(nsAccessible* aAccessible,
|
|||
if (!(accessible = parent))
|
||||
break;
|
||||
|
||||
*rv = cache.ApplyFilter(accessible, &filtered);
|
||||
NS_ENSURE_SUCCESS(*rv, nsnull);
|
||||
*aResult = cache.ApplyFilter(accessible, &filtered);
|
||||
NS_ENSURE_SUCCESS(*aResult, nsnull);
|
||||
|
||||
if (filtered & nsIAccessibleTraversalRule::FILTER_MATCH)
|
||||
return accessible;
|
||||
|
@ -400,39 +415,39 @@ nsAccessiblePivot::SearchBackward(nsAccessible* aAccessible,
|
|||
return nsnull;
|
||||
}
|
||||
|
||||
nsAccessible*
|
||||
nsAccessiblePivot::SearchForward(nsAccessible* aAccessible,
|
||||
Accessible*
|
||||
nsAccessiblePivot::SearchForward(Accessible* aAccessible,
|
||||
nsIAccessibleTraversalRule* aRule,
|
||||
bool searchCurrent,
|
||||
nsresult* rv)
|
||||
bool aSearchCurrent,
|
||||
nsresult* aResult)
|
||||
{
|
||||
*rv = NS_OK;
|
||||
*aResult = NS_OK;
|
||||
|
||||
// Initial position could be not set, in that case begin search from root.
|
||||
nsAccessible *accessible = (!aAccessible) ? mRoot.get() : aAccessible;
|
||||
Accessible* accessible = (!aAccessible) ? mRoot.get() : aAccessible;
|
||||
|
||||
RuleCache cache(aRule);
|
||||
|
||||
PRUint16 filtered = nsIAccessibleTraversalRule::FILTER_IGNORE;
|
||||
*rv = cache.ApplyFilter(accessible, &filtered);
|
||||
NS_ENSURE_SUCCESS(*rv, nsnull);
|
||||
if (searchCurrent && (filtered & nsIAccessibleTraversalRule::FILTER_MATCH))
|
||||
*aResult = cache.ApplyFilter(accessible, &filtered);
|
||||
NS_ENSURE_SUCCESS(*aResult, nsnull);
|
||||
if (aSearchCurrent && (filtered & nsIAccessibleTraversalRule::FILTER_MATCH))
|
||||
return accessible;
|
||||
|
||||
while (true) {
|
||||
nsAccessible* firstChild = nsnull;
|
||||
Accessible* firstChild = nsnull;
|
||||
while (!(filtered & nsIAccessibleTraversalRule::FILTER_IGNORE_SUBTREE) &&
|
||||
(firstChild = accessible->FirstChild())) {
|
||||
accessible = firstChild;
|
||||
*rv = cache.ApplyFilter(accessible, &filtered);
|
||||
NS_ENSURE_SUCCESS(*rv, nsnull);
|
||||
*aResult = cache.ApplyFilter(accessible, &filtered);
|
||||
NS_ENSURE_SUCCESS(*aResult, nsnull);
|
||||
|
||||
if (filtered & nsIAccessibleTraversalRule::FILTER_MATCH)
|
||||
return accessible;
|
||||
}
|
||||
|
||||
nsAccessible* sibling = nsnull;
|
||||
nsAccessible* temp = accessible;
|
||||
Accessible* sibling = nsnull;
|
||||
Accessible* temp = accessible;
|
||||
do {
|
||||
if (temp == mRoot)
|
||||
break;
|
||||
|
@ -447,8 +462,8 @@ nsAccessiblePivot::SearchForward(nsAccessible* aAccessible,
|
|||
break;
|
||||
|
||||
accessible = sibling;
|
||||
*rv = cache.ApplyFilter(accessible, &filtered);
|
||||
NS_ENSURE_SUCCESS(*rv, nsnull);
|
||||
*aResult = cache.ApplyFilter(accessible, &filtered);
|
||||
NS_ENSURE_SUCCESS(*aResult, nsnull);
|
||||
|
||||
if (filtered & nsIAccessibleTraversalRule::FILTER_MATCH)
|
||||
return accessible;
|
||||
|
@ -458,7 +473,7 @@ nsAccessiblePivot::SearchForward(nsAccessible* aAccessible,
|
|||
}
|
||||
|
||||
void
|
||||
nsAccessiblePivot::NotifyPivotChanged(nsAccessible* aOldPosition,
|
||||
nsAccessiblePivot::NotifyPivotChanged(Accessible* aOldPosition,
|
||||
PRInt32 aOldStart, PRInt32 aOldEnd)
|
||||
{
|
||||
nsTObserverArray<nsCOMPtr<nsIAccessiblePivotObserver> >::ForwardIterator iter(mObservers);
|
||||
|
@ -469,7 +484,7 @@ nsAccessiblePivot::NotifyPivotChanged(nsAccessible* aOldPosition,
|
|||
}
|
||||
|
||||
nsresult
|
||||
RuleCache::ApplyFilter(nsAccessible* aAccessible, PRUint16* aResult)
|
||||
RuleCache::ApplyFilter(Accessible* aAccessible, PRUint16* aResult)
|
||||
{
|
||||
*aResult = nsIAccessibleTraversalRule::FILTER_IGNORE;
|
||||
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
#include "nsTObserverArray.h"
|
||||
#include "nsCycleCollectionParticipant.h"
|
||||
|
||||
class nsAccessible;
|
||||
class Accessible;
|
||||
class nsIAccessibleTraversalRule;
|
||||
|
||||
// raised when current pivot's position is needed but it is not in the tree.
|
||||
|
@ -26,7 +26,7 @@ NS_ERROR_GENERATE_FAILURE(NS_ERROR_MODULE_GENERAL, 0x26)
|
|||
class nsAccessiblePivot: public nsIAccessiblePivot
|
||||
{
|
||||
public:
|
||||
nsAccessiblePivot(nsAccessible* aRoot);
|
||||
nsAccessiblePivot(Accessible* aRoot);
|
||||
|
||||
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
|
||||
NS_DECL_CYCLE_COLLECTION_CLASS_AMBIGUOUS(nsAccessiblePivot, nsIAccessiblePivot)
|
||||
|
@ -36,7 +36,7 @@ public:
|
|||
/*
|
||||
* A simple getter for the pivot's position.
|
||||
*/
|
||||
nsAccessible* Position() { return mPosition; }
|
||||
Accessible* Position() { return mPosition; }
|
||||
|
||||
private:
|
||||
nsAccessiblePivot() MOZ_DELETE;
|
||||
|
@ -46,45 +46,45 @@ private:
|
|||
/*
|
||||
* Notify all observers on a pivot change.
|
||||
*/
|
||||
void NotifyPivotChanged(nsAccessible* aOldAccessible,
|
||||
void NotifyPivotChanged(Accessible* aOldAccessible,
|
||||
PRInt32 aOldStart, PRInt32 aOldEnd);
|
||||
|
||||
/*
|
||||
* Check to see that the given accessible is in the pivot's subtree.
|
||||
*/
|
||||
bool IsRootDescendant(nsAccessible* aAccessible);
|
||||
bool IsRootDescendant(Accessible* aAccessible);
|
||||
|
||||
|
||||
/*
|
||||
* Search in preorder for the first accessible to match the rule.
|
||||
*/
|
||||
nsAccessible* SearchForward(nsAccessible* aAccessible,
|
||||
nsIAccessibleTraversalRule* aRule,
|
||||
bool searchCurrent,
|
||||
nsresult* rv);
|
||||
Accessible* SearchForward(Accessible* aAccessible,
|
||||
nsIAccessibleTraversalRule* aRule,
|
||||
bool aSearchCurrent,
|
||||
nsresult* aResult);
|
||||
|
||||
/*
|
||||
* Reverse search in preorder for the first accessible to match the rule.
|
||||
*/
|
||||
nsAccessible* SearchBackward(nsAccessible* aAccessible,
|
||||
nsIAccessibleTraversalRule* aRule,
|
||||
bool searchCurrent,
|
||||
nsresult* rv);
|
||||
Accessible* SearchBackward(Accessible* aAccessible,
|
||||
nsIAccessibleTraversalRule* aRule,
|
||||
bool aSearchCurrent,
|
||||
nsresult* aResult);
|
||||
|
||||
/*
|
||||
* Update the pivot, and notify observers.
|
||||
*/
|
||||
void MovePivotInternal(nsAccessible* aPosition);
|
||||
void MovePivotInternal(Accessible* aPosition);
|
||||
|
||||
/*
|
||||
* The root accessible.
|
||||
*/
|
||||
nsRefPtr<nsAccessible> mRoot;
|
||||
nsRefPtr<Accessible> mRoot;
|
||||
|
||||
/*
|
||||
* The current pivot position.
|
||||
*/
|
||||
nsRefPtr<nsAccessible> mPosition;
|
||||
nsRefPtr<Accessible> mPosition;
|
||||
|
||||
/*
|
||||
* The text start offset ofthe pivot.
|
||||
|
|
|
@ -26,17 +26,17 @@ using namespace mozilla::a11y;
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
nsLeafAccessible::
|
||||
nsLeafAccessible(nsIContent* aContent, nsDocAccessible* aDoc) :
|
||||
nsAccessibleWrap(aContent, aDoc)
|
||||
nsLeafAccessible(nsIContent* aContent, DocAccessible* aDoc) :
|
||||
AccessibleWrap(aContent, aDoc)
|
||||
{
|
||||
}
|
||||
|
||||
NS_IMPL_ISUPPORTS_INHERITED0(nsLeafAccessible, nsAccessible)
|
||||
NS_IMPL_ISUPPORTS_INHERITED0(nsLeafAccessible, Accessible)
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// nsLeafAccessible: nsAccessible public
|
||||
// nsLeafAccessible: Accessible public
|
||||
|
||||
nsAccessible*
|
||||
Accessible*
|
||||
nsLeafAccessible::ChildAtPoint(PRInt32 aX, PRInt32 aY,
|
||||
EWhichChildAtPoint aWhichChild)
|
||||
{
|
||||
|
@ -45,7 +45,7 @@ nsLeafAccessible::ChildAtPoint(PRInt32 aX, PRInt32 aY,
|
|||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// nsLeafAccessible: nsAccessible private
|
||||
// nsLeafAccessible: Accessible private
|
||||
|
||||
void
|
||||
nsLeafAccessible::CacheChildren()
|
||||
|
@ -59,15 +59,15 @@ nsLeafAccessible::CacheChildren()
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
nsLinkableAccessible::
|
||||
nsLinkableAccessible(nsIContent* aContent, nsDocAccessible* aDoc) :
|
||||
nsAccessibleWrap(aContent, aDoc),
|
||||
nsLinkableAccessible(nsIContent* aContent, DocAccessible* aDoc) :
|
||||
AccessibleWrap(aContent, aDoc),
|
||||
mActionAcc(nsnull),
|
||||
mIsLink(false),
|
||||
mIsOnclick(false)
|
||||
{
|
||||
}
|
||||
|
||||
NS_IMPL_ISUPPORTS_INHERITED0(nsLinkableAccessible, nsAccessibleWrap)
|
||||
NS_IMPL_ISUPPORTS_INHERITED0(nsLinkableAccessible, AccessibleWrap)
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// nsLinkableAccessible. nsIAccessible
|
||||
|
@ -75,7 +75,7 @@ NS_IMPL_ISUPPORTS_INHERITED0(nsLinkableAccessible, nsAccessibleWrap)
|
|||
NS_IMETHODIMP
|
||||
nsLinkableAccessible::TakeFocus()
|
||||
{
|
||||
return mActionAcc ? mActionAcc->TakeFocus() : nsAccessibleWrap::TakeFocus();
|
||||
return mActionAcc ? mActionAcc->TakeFocus() : AccessibleWrap::TakeFocus();
|
||||
}
|
||||
|
||||
PRUint64
|
||||
|
@ -92,7 +92,7 @@ nsLinkableAccessible::Value(nsString& aValue)
|
|||
{
|
||||
aValue.Truncate();
|
||||
|
||||
nsAccessible::Value(aValue);
|
||||
Accessible::Value(aValue);
|
||||
if (!aValue.IsEmpty())
|
||||
return;
|
||||
|
||||
|
@ -134,14 +134,14 @@ nsLinkableAccessible::DoAction(PRUint8 aIndex)
|
|||
return NS_ERROR_INVALID_ARG;
|
||||
|
||||
return mActionAcc ? mActionAcc->DoAction(aIndex) :
|
||||
nsAccessibleWrap::DoAction(aIndex);
|
||||
AccessibleWrap::DoAction(aIndex);
|
||||
}
|
||||
|
||||
KeyBinding
|
||||
nsLinkableAccessible::AccessKey() const
|
||||
{
|
||||
return mActionAcc ?
|
||||
mActionAcc->AccessKey() : nsAccessible::AccessKey();
|
||||
mActionAcc->AccessKey() : Accessible::AccessKey();
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -153,7 +153,7 @@ nsLinkableAccessible::Shutdown()
|
|||
mIsLink = false;
|
||||
mIsOnclick = false;
|
||||
mActionAcc = nsnull;
|
||||
nsAccessibleWrap::Shutdown();
|
||||
AccessibleWrap::Shutdown();
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -174,13 +174,13 @@ nsLinkableAccessible::AnchorURIAt(PRUint32 aAnchorIndex)
|
|||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// nsLinkableAccessible: nsAccessible protected
|
||||
// nsLinkableAccessible: Accessible protected
|
||||
|
||||
void
|
||||
nsLinkableAccessible::BindToParent(nsAccessible* aParent,
|
||||
nsLinkableAccessible::BindToParent(Accessible* aParent,
|
||||
PRUint32 aIndexInParent)
|
||||
{
|
||||
nsAccessibleWrap::BindToParent(aParent, aIndexInParent);
|
||||
AccessibleWrap::BindToParent(aParent, aIndexInParent);
|
||||
|
||||
// Cache action content.
|
||||
mActionAcc = nsnull;
|
||||
|
@ -195,7 +195,7 @@ nsLinkableAccessible::BindToParent(nsAccessible* aParent,
|
|||
// XXX: The logic looks broken since the click listener may be registered
|
||||
// on non accessible node in parent chain but this node is skipped when tree
|
||||
// is traversed.
|
||||
nsAccessible* walkUpAcc = this;
|
||||
Accessible* walkUpAcc = this;
|
||||
while ((walkUpAcc = walkUpAcc->Parent()) && !walkUpAcc->IsDoc()) {
|
||||
if (walkUpAcc->LinkState() & states::LINKED) {
|
||||
mIsLink = true;
|
||||
|
@ -218,7 +218,7 @@ nsLinkableAccessible::UnbindFromParent()
|
|||
mIsLink = false;
|
||||
mIsOnclick = false;
|
||||
|
||||
nsAccessibleWrap::UnbindFromParent();
|
||||
AccessibleWrap::UnbindFromParent();
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -226,13 +226,13 @@ nsLinkableAccessible::UnbindFromParent()
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
nsEnumRoleAccessible::
|
||||
nsEnumRoleAccessible(nsIContent* aNode, nsDocAccessible* aDoc,
|
||||
nsEnumRoleAccessible(nsIContent* aNode, DocAccessible* aDoc,
|
||||
roles::Role aRole) :
|
||||
nsAccessibleWrap(aNode, aDoc), mRole(aRole)
|
||||
AccessibleWrap(aNode, aDoc), mRole(aRole)
|
||||
{
|
||||
}
|
||||
|
||||
NS_IMPL_ISUPPORTS_INHERITED0(nsEnumRoleAccessible, nsAccessible)
|
||||
NS_IMPL_ISUPPORTS_INHERITED0(nsEnumRoleAccessible, Accessible)
|
||||
|
||||
role
|
||||
nsEnumRoleAccessible::NativeRole()
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
#ifndef _nsBaseWidgetAccessible_H_
|
||||
#define _nsBaseWidgetAccessible_H_
|
||||
|
||||
#include "nsAccessibleWrap.h"
|
||||
#include "AccessibleWrap.h"
|
||||
#include "nsHyperTextAccessibleWrap.h"
|
||||
#include "nsIContent.h"
|
||||
|
||||
|
@ -19,22 +19,22 @@
|
|||
/**
|
||||
* Leaf version of DOM Accessible -- has no children
|
||||
*/
|
||||
class nsLeafAccessible : public nsAccessibleWrap
|
||||
class nsLeafAccessible : public AccessibleWrap
|
||||
{
|
||||
public:
|
||||
|
||||
nsLeafAccessible(nsIContent* aContent, nsDocAccessible* aDoc);
|
||||
nsLeafAccessible(nsIContent* aContent, DocAccessible* aDoc);
|
||||
|
||||
// nsISupports
|
||||
NS_DECL_ISUPPORTS_INHERITED
|
||||
|
||||
// nsAccessible
|
||||
virtual nsAccessible* ChildAtPoint(PRInt32 aX, PRInt32 aY,
|
||||
EWhichChildAtPoint aWhichChild);
|
||||
// Accessible
|
||||
virtual Accessible* ChildAtPoint(PRInt32 aX, PRInt32 aY,
|
||||
EWhichChildAtPoint aWhichChild);
|
||||
|
||||
protected:
|
||||
|
||||
// nsAccessible
|
||||
// Accessible
|
||||
virtual void CacheChildren();
|
||||
};
|
||||
|
||||
|
@ -44,12 +44,12 @@ protected:
|
|||
* report the state of the host link (traveled or not) and can activate (click)
|
||||
* the host accessible programmatically.
|
||||
*/
|
||||
class nsLinkableAccessible : public nsAccessibleWrap
|
||||
class nsLinkableAccessible : public AccessibleWrap
|
||||
{
|
||||
public:
|
||||
enum { eAction_Jump = 0 };
|
||||
|
||||
nsLinkableAccessible(nsIContent* aContent, nsDocAccessible* aDoc);
|
||||
nsLinkableAccessible(nsIContent* aContent, DocAccessible* aDoc);
|
||||
|
||||
NS_DECL_ISUPPORTS_INHERITED
|
||||
|
||||
|
@ -61,7 +61,7 @@ public:
|
|||
// nsAccessNode
|
||||
virtual void Shutdown();
|
||||
|
||||
// nsAccessible
|
||||
// Accessible
|
||||
virtual void Value(nsString& aValue);
|
||||
virtual PRUint64 NativeLinkState() const;
|
||||
|
||||
|
@ -73,14 +73,14 @@ public:
|
|||
virtual already_AddRefed<nsIURI> AnchorURIAt(PRUint32 aAnchorIndex);
|
||||
|
||||
protected:
|
||||
// nsAccessible
|
||||
virtual void BindToParent(nsAccessible* aParent, PRUint32 aIndexInParent);
|
||||
// Accessible
|
||||
virtual void BindToParent(Accessible* aParent, PRUint32 aIndexInParent);
|
||||
virtual void UnbindFromParent();
|
||||
|
||||
/**
|
||||
* Parent accessible that provides an action for this linkable accessible.
|
||||
*/
|
||||
nsAccessible* mActionAcc;
|
||||
Accessible* mActionAcc;
|
||||
bool mIsLink;
|
||||
bool mIsOnclick;
|
||||
};
|
||||
|
@ -88,16 +88,16 @@ protected:
|
|||
/**
|
||||
* A simple accessible that gets its enumerated role passed into constructor.
|
||||
*/
|
||||
class nsEnumRoleAccessible : public nsAccessibleWrap
|
||||
class nsEnumRoleAccessible : public AccessibleWrap
|
||||
{
|
||||
public:
|
||||
nsEnumRoleAccessible(nsIContent* aContent, nsDocAccessible* aDoc,
|
||||
nsEnumRoleAccessible(nsIContent* aContent, DocAccessible* aDoc,
|
||||
mozilla::a11y::role aRole);
|
||||
virtual ~nsEnumRoleAccessible() { }
|
||||
|
||||
NS_DECL_ISUPPORTS_INHERITED
|
||||
|
||||
// nsAccessible
|
||||
// Accessible
|
||||
virtual mozilla::a11y::role NativeRole();
|
||||
|
||||
protected:
|
||||
|
|
|
@ -39,7 +39,7 @@ nsCaretAccessible::~nsCaretAccessible()
|
|||
void nsCaretAccessible::Shutdown()
|
||||
{
|
||||
// The caret accessible isn't shut down until the RootAccessible owning it is shut down
|
||||
// Each nsDocAccessible, including the RootAccessible, is responsible for clearing the
|
||||
// Each DocAccessible, including the RootAccessible, is responsible for clearing the
|
||||
// doc selection listeners they registered in this nsCaretAccessible
|
||||
|
||||
ClearControlSelectionListener(); // Clear the selection listener for the currently focused control
|
||||
|
@ -178,7 +178,7 @@ nsCaretAccessible::NotifySelectionChanged(nsIDOMDocument* aDOMDocument,
|
|||
NS_ENSURE_STATE(mRootAccessible);
|
||||
|
||||
nsCOMPtr<nsIDocument> documentNode(do_QueryInterface(aDOMDocument));
|
||||
nsDocAccessible* document = GetAccService()->GetDocAccessible(documentNode);
|
||||
DocAccessible* document = GetAccService()->GetDocAccessible(documentNode);
|
||||
|
||||
#ifdef DEBUG_NOTIFICATIONS
|
||||
nsCOMPtr<nsISelectionPrivate> privSel(do_QueryInterface(aSelection));
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
* The caret accessible is owned by the RootAccessible for the top level window that it's in.
|
||||
* The RootAccessible needs to tell the nsCaretAccessible about focus changes via
|
||||
* setControlSelectionListener().
|
||||
* Each nsDocAccessible needs to tell the nsCaretAccessible owned by the root to
|
||||
* Each DocAccessible needs to tell the nsCaretAccessible owned by the root to
|
||||
* listen for selection events via addDocSelectionListener() and then needs to remove the
|
||||
* selection listener when the doc goes away via removeDocSelectionListener().
|
||||
*/
|
||||
|
|
|
@ -171,7 +171,7 @@ nsCoreUtils::GetAccessKeyFor(nsIContent *aContent)
|
|||
if (!aContent->HasAttr(kNameSpaceID_None, nsGkAtoms::accesskey))
|
||||
return 0;
|
||||
|
||||
nsCOMPtr<nsIPresShell> presShell = aContent->OwnerDoc()->GetShell();
|
||||
nsIPresShell* presShell = aContent->OwnerDoc()->GetShell();
|
||||
if (!presShell)
|
||||
return 0;
|
||||
|
||||
|
@ -722,7 +722,7 @@ nsAccessibleDOMStringList::Item(PRUint32 aIndex, nsAString& aResult)
|
|||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsAccessibleDOMStringList::GetLength(PRUint32 *aLength)
|
||||
nsAccessibleDOMStringList::GetLength(PRUint32* aLength)
|
||||
{
|
||||
*aLength = mNames.Length();
|
||||
|
||||
|
@ -730,7 +730,7 @@ nsAccessibleDOMStringList::GetLength(PRUint32 *aLength)
|
|||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsAccessibleDOMStringList::Contains(const nsAString& aString, bool *aResult)
|
||||
nsAccessibleDOMStringList::Contains(const nsAString& aString, bool* aResult)
|
||||
{
|
||||
*aResult = mNames.Contains(aString);
|
||||
|
||||
|
|
|
@ -6,7 +6,6 @@
|
|||
#include "nsEventShell.h"
|
||||
|
||||
#include "nsAccUtils.h"
|
||||
//#include "nsDocAccessible.h"
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// nsEventShell
|
||||
|
@ -18,7 +17,7 @@ nsEventShell::FireEvent(AccEvent* aEvent)
|
|||
if (!aEvent)
|
||||
return;
|
||||
|
||||
nsAccessible *accessible = aEvent->GetAccessible();
|
||||
Accessible* accessible = aEvent->GetAccessible();
|
||||
NS_ENSURE_TRUE(accessible,);
|
||||
|
||||
nsINode* node = aEvent->GetNode();
|
||||
|
@ -33,7 +32,7 @@ nsEventShell::FireEvent(AccEvent* aEvent)
|
|||
}
|
||||
|
||||
void
|
||||
nsEventShell::FireEvent(PRUint32 aEventType, nsAccessible *aAccessible,
|
||||
nsEventShell::FireEvent(PRUint32 aEventType, Accessible* aAccessible,
|
||||
EIsFromUserInput aIsFromUserInput)
|
||||
{
|
||||
NS_ENSURE_TRUE(aAccessible,);
|
||||
|
|
|
@ -28,7 +28,7 @@ public:
|
|||
* @param aEventType [in] the event type
|
||||
* @param aAccessible [in] the event target
|
||||
*/
|
||||
static void FireEvent(PRUint32 aEventType, nsAccessible *aAccessible,
|
||||
static void FireEvent(PRUint32 aEventType, Accessible* aAccessible,
|
||||
EIsFromUserInput aIsFromUserInput = eAutoDetect);
|
||||
|
||||
/**
|
||||
|
|
|
@ -1,40 +0,0 @@
|
|||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* 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 "nsTextAccessible.h"
|
||||
|
||||
#include "Role.h"
|
||||
|
||||
using namespace mozilla::a11y;
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// nsTextAccessible
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
nsTextAccessible::
|
||||
nsTextAccessible(nsIContent* aContent, nsDocAccessible* aDoc) :
|
||||
nsLinkableAccessible(aContent, aDoc)
|
||||
{
|
||||
mFlags |= eTextLeafAccessible;
|
||||
}
|
||||
|
||||
role
|
||||
nsTextAccessible::NativeRole()
|
||||
{
|
||||
return roles::TEXT_LEAF;
|
||||
}
|
||||
|
||||
void
|
||||
nsTextAccessible::AppendTextTo(nsAString& aText, PRUint32 aStartOffset,
|
||||
PRUint32 aLength)
|
||||
{
|
||||
aText.Append(Substring(mText, aStartOffset, aLength));
|
||||
}
|
||||
|
||||
void
|
||||
nsTextAccessible::CacheChildren()
|
||||
{
|
||||
// No children for text accessible.
|
||||
}
|
|
@ -25,7 +25,7 @@ NS_ERROR_GENERATE_SUCCESS(NS_ERROR_MODULE_GENERAL, 0x24)
|
|||
// nsTextEquivUtils. Public.
|
||||
|
||||
nsresult
|
||||
nsTextEquivUtils::GetNameFromSubtree(nsAccessible *aAccessible,
|
||||
nsTextEquivUtils::GetNameFromSubtree(Accessible* aAccessible,
|
||||
nsAString& aName)
|
||||
{
|
||||
aName.Truncate();
|
||||
|
@ -53,7 +53,7 @@ nsTextEquivUtils::GetNameFromSubtree(nsAccessible *aAccessible,
|
|||
}
|
||||
|
||||
nsresult
|
||||
nsTextEquivUtils::GetTextEquivFromIDRefs(nsAccessible *aAccessible,
|
||||
nsTextEquivUtils::GetTextEquivFromIDRefs(Accessible* aAccessible,
|
||||
nsIAtom *aIDRefsAttr,
|
||||
nsAString& aTextEquiv)
|
||||
{
|
||||
|
@ -78,7 +78,7 @@ nsTextEquivUtils::GetTextEquivFromIDRefs(nsAccessible *aAccessible,
|
|||
}
|
||||
|
||||
nsresult
|
||||
nsTextEquivUtils::AppendTextEquivFromContent(nsAccessible *aInitiatorAcc,
|
||||
nsTextEquivUtils::AppendTextEquivFromContent(Accessible* aInitiatorAcc,
|
||||
nsIContent *aContent,
|
||||
nsAString *aString)
|
||||
{
|
||||
|
@ -98,7 +98,7 @@ nsTextEquivUtils::AppendTextEquivFromContent(nsAccessible *aInitiatorAcc,
|
|||
bool goThroughDOMSubtree = true;
|
||||
|
||||
if (isVisible) {
|
||||
nsAccessible* accessible =
|
||||
Accessible* accessible =
|
||||
gInitiatorAcc->Document()->GetAccessible(aContent);
|
||||
if (accessible) {
|
||||
rv = AppendFromAccessible(accessible, aString);
|
||||
|
@ -167,17 +167,17 @@ nsTextEquivUtils::AppendTextEquivFromTextContent(nsIContent *aContent,
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
// nsTextEquivUtils. Private.
|
||||
|
||||
nsRefPtr<nsAccessible> nsTextEquivUtils::gInitiatorAcc;
|
||||
nsRefPtr<Accessible> nsTextEquivUtils::gInitiatorAcc;
|
||||
|
||||
nsresult
|
||||
nsTextEquivUtils::AppendFromAccessibleChildren(nsAccessible *aAccessible,
|
||||
nsTextEquivUtils::AppendFromAccessibleChildren(Accessible* aAccessible,
|
||||
nsAString *aString)
|
||||
{
|
||||
nsresult rv = NS_OK_NO_NAME_CLAUSE_HANDLED;
|
||||
|
||||
PRInt32 childCount = aAccessible->GetChildCount();
|
||||
for (PRInt32 childIdx = 0; childIdx < childCount; childIdx++) {
|
||||
nsAccessible *child = aAccessible->GetChildAt(childIdx);
|
||||
PRUint32 childCount = aAccessible->ChildCount();
|
||||
for (PRUint32 childIdx = 0; childIdx < childCount; childIdx++) {
|
||||
Accessible* child = aAccessible->GetChildAt(childIdx);
|
||||
rv = AppendFromAccessible(child, aString);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
}
|
||||
|
@ -186,7 +186,7 @@ nsTextEquivUtils::AppendFromAccessibleChildren(nsAccessible *aAccessible,
|
|||
}
|
||||
|
||||
nsresult
|
||||
nsTextEquivUtils::AppendFromAccessible(nsAccessible *aAccessible,
|
||||
nsTextEquivUtils::AppendFromAccessible(Accessible* aAccessible,
|
||||
nsAString *aString)
|
||||
{
|
||||
//XXX: is it necessary to care the accessible is not a document?
|
||||
|
@ -236,7 +236,7 @@ nsTextEquivUtils::AppendFromAccessible(nsAccessible *aAccessible,
|
|||
}
|
||||
|
||||
nsresult
|
||||
nsTextEquivUtils::AppendFromValue(nsAccessible *aAccessible,
|
||||
nsTextEquivUtils::AppendFromValue(Accessible* aAccessible,
|
||||
nsAString *aString)
|
||||
{
|
||||
PRUint32 nameRule = gRoleToNameRulesMap[aAccessible->Role()];
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
#ifndef _nsTextEquivUtils_H_
|
||||
#define _nsTextEquivUtils_H_
|
||||
|
||||
#include "nsAccessible.h"
|
||||
#include "Accessible.h"
|
||||
|
||||
#include "nsIContent.h"
|
||||
#include "nsIStringBundle.h"
|
||||
|
@ -48,7 +48,7 @@ public:
|
|||
* @param aAccessible [in] the given accessible
|
||||
* @param aName [out] accessible name
|
||||
*/
|
||||
static nsresult GetNameFromSubtree(nsAccessible *aAccessible,
|
||||
static nsresult GetNameFromSubtree(Accessible* aAccessible,
|
||||
nsAString& aName);
|
||||
|
||||
/**
|
||||
|
@ -59,7 +59,7 @@ public:
|
|||
* @param aIDRefsAttr [in] IDRefs attribute on DOM node of the accessible
|
||||
* @param aTextEquiv [out] result text equivalent
|
||||
*/
|
||||
static nsresult GetTextEquivFromIDRefs(nsAccessible *aAccessible,
|
||||
static nsresult GetTextEquivFromIDRefs(Accessible* aAccessible,
|
||||
nsIAtom *aIDRefsAttr,
|
||||
nsAString& aTextEquiv);
|
||||
|
||||
|
@ -74,7 +74,7 @@ public:
|
|||
* computed from
|
||||
* @param aString [in, out] the string
|
||||
*/
|
||||
static nsresult AppendTextEquivFromContent(nsAccessible *aInitiatorAcc,
|
||||
static nsresult AppendTextEquivFromContent(Accessible* aInitiatorAcc,
|
||||
nsIContent *aContent,
|
||||
nsAString *aString);
|
||||
|
||||
|
@ -93,20 +93,20 @@ private:
|
|||
* Iterates accessible children and calculates text equivalent from each
|
||||
* child.
|
||||
*/
|
||||
static nsresult AppendFromAccessibleChildren(nsAccessible *aAccessible,
|
||||
static nsresult AppendFromAccessibleChildren(Accessible* aAccessible,
|
||||
nsAString *aString);
|
||||
|
||||
/**
|
||||
* Calculates text equivalent from the given accessible and its subtree if
|
||||
* allowed.
|
||||
*/
|
||||
static nsresult AppendFromAccessible(nsAccessible *aAccessible,
|
||||
static nsresult AppendFromAccessible(Accessible* aAccessible,
|
||||
nsAString *aString);
|
||||
|
||||
/**
|
||||
* Calculates text equivalent from the value of given accessible.
|
||||
*/
|
||||
static nsresult AppendFromValue(nsAccessible *aAccessible,
|
||||
static nsresult AppendFromValue(Accessible* aAccessible,
|
||||
nsAString *aString);
|
||||
/**
|
||||
* Iterates DOM children and calculates text equivalent from each child node.
|
||||
|
@ -149,7 +149,7 @@ private:
|
|||
* for bailing out during recursive text computation, or for special cases
|
||||
* like step f. of the ARIA implementation guide.
|
||||
*/
|
||||
static nsRefPtr<nsAccessible> gInitiatorAcc;
|
||||
static nsRefPtr<Accessible> gInitiatorAcc;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
@ -26,8 +26,8 @@ using namespace mozilla::a11y;
|
|||
// Constructor
|
||||
|
||||
ARIAGridAccessible::
|
||||
ARIAGridAccessible(nsIContent* aContent, nsDocAccessible* aDoc) :
|
||||
nsAccessibleWrap(aContent, aDoc), xpcAccessibleTable(this)
|
||||
ARIAGridAccessible(nsIContent* aContent, DocAccessible* aDoc) :
|
||||
AccessibleWrap(aContent, aDoc), xpcAccessibleTable(this)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -35,7 +35,7 @@ ARIAGridAccessible::
|
|||
// nsISupports
|
||||
|
||||
NS_IMPL_ISUPPORTS_INHERITED1(ARIAGridAccessible,
|
||||
nsAccessible,
|
||||
Accessible,
|
||||
nsIAccessibleTable)
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -45,7 +45,7 @@ void
|
|||
ARIAGridAccessible::Shutdown()
|
||||
{
|
||||
mTable = nsnull;
|
||||
nsAccessibleWrap::Shutdown();
|
||||
AccessibleWrap::Shutdown();
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -55,12 +55,12 @@ PRUint32
|
|||
ARIAGridAccessible::ColCount()
|
||||
{
|
||||
AccIterator rowIter(this, filters::GetRow);
|
||||
nsAccessible* row = rowIter.Next();
|
||||
Accessible* row = rowIter.Next();
|
||||
if (!row)
|
||||
return 0;
|
||||
|
||||
AccIterator cellIter(row, filters::GetCell);
|
||||
nsAccessible* cell = nsnull;
|
||||
Accessible* cell = nsnull;
|
||||
|
||||
PRUint32 colCount = 0;
|
||||
while ((cell = cellIter.Next()))
|
||||
|
@ -80,10 +80,10 @@ ARIAGridAccessible::RowCount()
|
|||
return rowCount;
|
||||
}
|
||||
|
||||
nsAccessible*
|
||||
Accessible*
|
||||
ARIAGridAccessible::CellAt(PRUint32 aRowIndex, PRUint32 aColumnIndex)
|
||||
{
|
||||
nsAccessible* row = GetRowAt(aRowIndex);
|
||||
Accessible* row = GetRowAt(aRowIndex);
|
||||
if (!row)
|
||||
return nsnull;
|
||||
|
||||
|
@ -165,38 +165,6 @@ ARIAGridAccessible::GetRowAndColumnIndicesAt(PRInt32 aCellIndex,
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
ARIAGridAccessible::GetRowExtentAt(PRInt32 aRow, PRInt32 aColumn,
|
||||
PRInt32* aExtentCount)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aExtentCount);
|
||||
*aExtentCount = 0;
|
||||
|
||||
if (IsDefunct())
|
||||
return NS_ERROR_FAILURE;
|
||||
|
||||
NS_ENSURE_ARG(IsValidRowNColumn(aRow, aColumn));
|
||||
|
||||
*aExtentCount = 1;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
ARIAGridAccessible::GetColumnExtentAt(PRInt32 aRow, PRInt32 aColumn,
|
||||
PRInt32* aExtentCount)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aExtentCount);
|
||||
*aExtentCount = 0;
|
||||
|
||||
if (IsDefunct())
|
||||
return NS_ERROR_FAILURE;
|
||||
|
||||
NS_ENSURE_ARG(IsValidRowNColumn(aRow, aColumn));
|
||||
|
||||
*aExtentCount = 1;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
ARIAGridAccessible::GetColumnDescription(PRInt32 aColumn,
|
||||
nsAString& aDescription)
|
||||
|
@ -238,13 +206,13 @@ ARIAGridAccessible::IsColumnSelected(PRInt32 aColumn, bool* aIsSelected)
|
|||
NS_ENSURE_ARG(IsValidColumn(aColumn));
|
||||
|
||||
AccIterator rowIter(this, filters::GetRow);
|
||||
nsAccessible *row = rowIter.Next();
|
||||
Accessible* row = rowIter.Next();
|
||||
if (!row)
|
||||
return NS_OK;
|
||||
|
||||
do {
|
||||
if (!nsAccUtils::IsARIASelected(row)) {
|
||||
nsAccessible *cell = GetCellInRowAt(row, aColumn);
|
||||
Accessible* cell = GetCellInRowAt(row, aColumn);
|
||||
if (!cell) // Do not fail due to wrong markup
|
||||
return NS_OK;
|
||||
|
||||
|
@ -266,12 +234,12 @@ ARIAGridAccessible::IsRowSelected(PRInt32 aRow, bool* aIsSelected)
|
|||
if (IsDefunct())
|
||||
return NS_ERROR_FAILURE;
|
||||
|
||||
nsAccessible *row = GetRowAt(aRow);
|
||||
Accessible* row = GetRowAt(aRow);
|
||||
NS_ENSURE_ARG(row);
|
||||
|
||||
if (!nsAccUtils::IsARIASelected(row)) {
|
||||
AccIterator cellIter(row, filters::GetCell);
|
||||
nsAccessible *cell = nsnull;
|
||||
Accessible* cell = nsnull;
|
||||
while ((cell = cellIter.Next())) {
|
||||
if (!nsAccUtils::IsARIASelected(cell))
|
||||
return NS_OK;
|
||||
|
@ -292,11 +260,11 @@ ARIAGridAccessible::IsCellSelected(PRInt32 aRow, PRInt32 aColumn,
|
|||
if (IsDefunct())
|
||||
return NS_ERROR_FAILURE;
|
||||
|
||||
nsAccessible *row = GetRowAt(aRow);
|
||||
Accessible* row = GetRowAt(aRow);
|
||||
NS_ENSURE_ARG(row);
|
||||
|
||||
if (!nsAccUtils::IsARIASelected(row)) {
|
||||
nsAccessible *cell = GetCellInRowAt(row, aColumn);
|
||||
Accessible* cell = GetCellInRowAt(row, aColumn);
|
||||
NS_ENSURE_ARG(cell);
|
||||
|
||||
if (!nsAccUtils::IsARIASelected(cell))
|
||||
|
@ -321,7 +289,7 @@ ARIAGridAccessible::GetSelectedCellCount(PRUint32* aCount)
|
|||
|
||||
AccIterator rowIter(this, filters::GetRow);
|
||||
|
||||
nsAccessible *row = nsnull;
|
||||
Accessible* row = nsnull;
|
||||
while ((row = rowIter.Next())) {
|
||||
if (nsAccUtils::IsARIASelected(row)) {
|
||||
(*aCount) += colCount;
|
||||
|
@ -329,7 +297,7 @@ ARIAGridAccessible::GetSelectedCellCount(PRUint32* aCount)
|
|||
}
|
||||
|
||||
AccIterator cellIter(row, filters::GetCell);
|
||||
nsAccessible *cell = nsnull;
|
||||
Accessible* cell = nsnull;
|
||||
|
||||
while ((cell = cellIter.Next())) {
|
||||
if (nsAccUtils::IsARIASelected(cell))
|
||||
|
@ -357,7 +325,7 @@ ARIAGridAccessible::GetSelectedRowCount(PRUint32* aCount)
|
|||
|
||||
AccIterator rowIter(this, filters::GetRow);
|
||||
|
||||
nsAccessible *row = nsnull;
|
||||
Accessible* row = nsnull;
|
||||
while ((row = rowIter.Next())) {
|
||||
if (nsAccUtils::IsARIASelected(row)) {
|
||||
(*aCount)++;
|
||||
|
@ -365,7 +333,7 @@ ARIAGridAccessible::GetSelectedRowCount(PRUint32* aCount)
|
|||
}
|
||||
|
||||
AccIterator cellIter(row, filters::GetCell);
|
||||
nsAccessible *cell = cellIter.Next();
|
||||
Accessible* cell = cellIter.Next();
|
||||
if (!cell)
|
||||
continue;
|
||||
|
||||
|
@ -400,10 +368,10 @@ ARIAGridAccessible::GetSelectedCells(nsIArray** aCells)
|
|||
|
||||
AccIterator rowIter(this, filters::GetRow);
|
||||
|
||||
nsAccessible *row = nsnull;
|
||||
Accessible* row = nsnull;
|
||||
while ((row = rowIter.Next())) {
|
||||
AccIterator cellIter(row, filters::GetCell);
|
||||
nsAccessible *cell = nsnull;
|
||||
Accessible* cell = nsnull;
|
||||
|
||||
if (nsAccUtils::IsARIASelected(row)) {
|
||||
while ((cell = cellIter.Next()))
|
||||
|
@ -444,7 +412,7 @@ ARIAGridAccessible::GetSelectedCellIndices(PRUint32* aCellsCount,
|
|||
|
||||
AccIterator rowIter(this, filters::GetRow);
|
||||
|
||||
nsAccessible *row = nsnull;
|
||||
Accessible* row = nsnull;
|
||||
for (PRInt32 rowIdx = 0; (row = rowIter.Next()); rowIdx++) {
|
||||
if (nsAccUtils::IsARIASelected(row)) {
|
||||
for (PRInt32 colIdx = 0; colIdx < colCount; colIdx++)
|
||||
|
@ -454,7 +422,7 @@ ARIAGridAccessible::GetSelectedCellIndices(PRUint32* aCellsCount,
|
|||
}
|
||||
|
||||
AccIterator cellIter(row, filters::GetCell);
|
||||
nsAccessible *cell = nsnull;
|
||||
Accessible* cell = nsnull;
|
||||
|
||||
for (PRInt32 colIdx = 0; (cell = cellIter.Next()); colIdx++) {
|
||||
if (nsAccUtils::IsARIASelected(cell))
|
||||
|
@ -504,7 +472,7 @@ ARIAGridAccessible::GetSelectedRowIndices(PRUint32* aRowCount,
|
|||
|
||||
AccIterator rowIter(this, filters::GetRow);
|
||||
|
||||
nsAccessible *row = nsnull;
|
||||
Accessible* row = nsnull;
|
||||
for (PRInt32 rowIdx = 0; (row = rowIter.Next()); rowIdx++) {
|
||||
if (nsAccUtils::IsARIASelected(row)) {
|
||||
selRows.AppendElement(rowIdx);
|
||||
|
@ -512,7 +480,7 @@ ARIAGridAccessible::GetSelectedRowIndices(PRUint32* aRowCount,
|
|||
}
|
||||
|
||||
AccIterator cellIter(row, filters::GetCell);
|
||||
nsAccessible *cell = cellIter.Next();
|
||||
Accessible* cell = cellIter.Next();
|
||||
if (!cell)
|
||||
continue;
|
||||
|
||||
|
@ -550,7 +518,7 @@ ARIAGridAccessible::SelectRow(PRInt32 aRow)
|
|||
|
||||
AccIterator rowIter(this, filters::GetRow);
|
||||
|
||||
nsAccessible *row = nsnull;
|
||||
Accessible* row = nsnull;
|
||||
for (PRInt32 rowIdx = 0; (row = rowIter.Next()); rowIdx++) {
|
||||
nsresult rv = SetARIASelected(row, rowIdx == aRow);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
@ -569,14 +537,14 @@ ARIAGridAccessible::SelectColumn(PRInt32 aColumn)
|
|||
|
||||
AccIterator rowIter(this, filters::GetRow);
|
||||
|
||||
nsAccessible *row = nsnull;
|
||||
Accessible* row = nsnull;
|
||||
while ((row = rowIter.Next())) {
|
||||
// Unselect all cells in the row.
|
||||
nsresult rv = SetARIASelected(row, false);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
// Select cell at the column index.
|
||||
nsAccessible *cell = GetCellInRowAt(row, aColumn);
|
||||
Accessible* cell = GetCellInRowAt(row, aColumn);
|
||||
if (cell) {
|
||||
rv = SetARIASelected(cell, true);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
@ -589,7 +557,7 @@ ARIAGridAccessible::SelectColumn(PRInt32 aColumn)
|
|||
void
|
||||
ARIAGridAccessible::UnselectRow(PRUint32 aRowIdx)
|
||||
{
|
||||
nsAccessible* row = GetRowAt(aRowIdx);
|
||||
Accessible* row = GetRowAt(aRowIdx);
|
||||
|
||||
if (row)
|
||||
SetARIASelected(row, false);
|
||||
|
@ -600,9 +568,9 @@ ARIAGridAccessible::UnselectCol(PRUint32 aColIdx)
|
|||
{
|
||||
AccIterator rowIter(this, filters::GetRow);
|
||||
|
||||
nsAccessible* row = nsnull;
|
||||
Accessible* row = nsnull;
|
||||
while ((row = rowIter.Next())) {
|
||||
nsAccessible* cell = GetCellInRowAt(row, aColIdx);
|
||||
Accessible* cell = GetCellInRowAt(row, aColIdx);
|
||||
if (cell)
|
||||
SetARIASelected(cell, false);
|
||||
}
|
||||
|
@ -633,43 +601,27 @@ ARIAGridAccessible::IsValidColumn(PRInt32 aColumn)
|
|||
return aColumn < colCount;
|
||||
}
|
||||
|
||||
bool
|
||||
ARIAGridAccessible::IsValidRowNColumn(PRInt32 aRow, PRInt32 aColumn)
|
||||
{
|
||||
if (aRow < 0 || aColumn < 0)
|
||||
return false;
|
||||
|
||||
PRInt32 rowCount = 0;
|
||||
GetRowCount(&rowCount);
|
||||
if (aRow >= rowCount)
|
||||
return false;
|
||||
|
||||
PRInt32 colCount = 0;
|
||||
GetColumnCount(&colCount);
|
||||
return aColumn < colCount;
|
||||
}
|
||||
|
||||
nsAccessible*
|
||||
Accessible*
|
||||
ARIAGridAccessible::GetRowAt(PRInt32 aRow)
|
||||
{
|
||||
PRInt32 rowIdx = aRow;
|
||||
|
||||
AccIterator rowIter(this, filters::GetRow);
|
||||
|
||||
nsAccessible *row = rowIter.Next();
|
||||
Accessible* row = rowIter.Next();
|
||||
while (rowIdx != 0 && (row = rowIter.Next()))
|
||||
rowIdx--;
|
||||
|
||||
return row;
|
||||
}
|
||||
|
||||
nsAccessible*
|
||||
ARIAGridAccessible::GetCellInRowAt(nsAccessible* aRow, PRInt32 aColumn)
|
||||
Accessible*
|
||||
ARIAGridAccessible::GetCellInRowAt(Accessible* aRow, PRInt32 aColumn)
|
||||
{
|
||||
PRInt32 colIdx = aColumn;
|
||||
|
||||
AccIterator cellIter(aRow, filters::GetCell);
|
||||
nsAccessible *cell = cellIter.Next();
|
||||
Accessible* cell = cellIter.Next();
|
||||
while (colIdx != 0 && (cell = cellIter.Next()))
|
||||
colIdx--;
|
||||
|
||||
|
@ -677,7 +629,7 @@ ARIAGridAccessible::GetCellInRowAt(nsAccessible* aRow, PRInt32 aColumn)
|
|||
}
|
||||
|
||||
nsresult
|
||||
ARIAGridAccessible::SetARIASelected(nsAccessible* aAccessible,
|
||||
ARIAGridAccessible::SetARIASelected(Accessible* aAccessible,
|
||||
bool aIsSelected, bool aNotify)
|
||||
{
|
||||
nsIContent *content = aAccessible->GetContent();
|
||||
|
@ -709,7 +661,7 @@ ARIAGridAccessible::SetARIASelected(nsAccessible* aAccessible,
|
|||
// aria-selected from cell accessible.
|
||||
if (role == roles::ROW) {
|
||||
AccIterator cellIter(aAccessible, filters::GetCell);
|
||||
nsAccessible *cell = nsnull;
|
||||
Accessible* cell = nsnull;
|
||||
|
||||
while ((cell = cellIter.Next())) {
|
||||
rv = SetARIASelected(cell, false, false);
|
||||
|
@ -723,7 +675,7 @@ ARIAGridAccessible::SetARIASelected(nsAccessible* aAccessible,
|
|||
// siblings cells.
|
||||
if (role == roles::GRID_CELL || role == roles::ROWHEADER ||
|
||||
role == roles::COLUMNHEADER) {
|
||||
nsAccessible* row = aAccessible->Parent();
|
||||
Accessible* row = aAccessible->Parent();
|
||||
|
||||
if (row && row->Role() == roles::ROW &&
|
||||
nsAccUtils::IsARIASelected(row)) {
|
||||
|
@ -731,7 +683,7 @@ ARIAGridAccessible::SetARIASelected(nsAccessible* aAccessible,
|
|||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
AccIterator cellIter(row, filters::GetCell);
|
||||
nsAccessible *cell = nsnull;
|
||||
Accessible* cell = nsnull;
|
||||
while ((cell = cellIter.Next())) {
|
||||
if (cell != aAccessible) {
|
||||
rv = SetARIASelected(cell, true, false);
|
||||
|
@ -757,7 +709,7 @@ ARIAGridAccessible::GetSelectedColumnsArray(PRUint32* aColumnCount,
|
|||
return NS_ERROR_FAILURE;
|
||||
|
||||
AccIterator rowIter(this, filters::GetRow);
|
||||
nsAccessible *row = rowIter.Next();
|
||||
Accessible* row = rowIter.Next();
|
||||
if (!row)
|
||||
return NS_OK;
|
||||
|
||||
|
@ -780,7 +732,7 @@ ARIAGridAccessible::GetSelectedColumnsArray(PRUint32* aColumnCount,
|
|||
PRInt32 colIdx = 0;
|
||||
|
||||
AccIterator cellIter(row, filters::GetCell);
|
||||
nsAccessible *cell = nsnull;
|
||||
Accessible* cell = nsnull;
|
||||
for (colIdx = 0; (cell = cellIter.Next()); colIdx++) {
|
||||
if (isColSelArray.SafeElementAt(colIdx, false) &&
|
||||
!nsAccUtils::IsARIASelected(cell)) {
|
||||
|
@ -821,7 +773,7 @@ ARIAGridAccessible::GetSelectedColumnsArray(PRUint32* aColumnCount,
|
|||
// Constructor
|
||||
|
||||
ARIAGridCellAccessible::
|
||||
ARIAGridCellAccessible(nsIContent* aContent, nsDocAccessible* aDoc) :
|
||||
ARIAGridCellAccessible(nsIContent* aContent, DocAccessible* aDoc) :
|
||||
nsHyperTextAccessibleWrap(aContent, aDoc)
|
||||
{
|
||||
}
|
||||
|
@ -842,11 +794,11 @@ ARIAGridCellAccessible::GetTable(nsIAccessibleTable** aTable)
|
|||
NS_ENSURE_ARG_POINTER(aTable);
|
||||
*aTable = nsnull;
|
||||
|
||||
nsAccessible* thisRow = Parent();
|
||||
Accessible* thisRow = Parent();
|
||||
if (!thisRow || thisRow->Role() != roles::ROW)
|
||||
return NS_OK;
|
||||
|
||||
nsAccessible* table = thisRow->Parent();
|
||||
Accessible* table = thisRow->Parent();
|
||||
if (!table)
|
||||
return NS_OK;
|
||||
|
||||
|
@ -867,7 +819,7 @@ ARIAGridCellAccessible::GetColumnIndex(PRInt32* aColumnIndex)
|
|||
if (IsDefunct())
|
||||
return NS_ERROR_FAILURE;
|
||||
|
||||
nsAccessible* row = Parent();
|
||||
Accessible* row = Parent();
|
||||
if (!row)
|
||||
return NS_OK;
|
||||
|
||||
|
@ -875,7 +827,7 @@ ARIAGridCellAccessible::GetColumnIndex(PRInt32* aColumnIndex)
|
|||
|
||||
PRInt32 indexInRow = IndexInParent();
|
||||
for (PRInt32 idx = 0; idx < indexInRow; idx++) {
|
||||
nsAccessible* cell = row->GetChildAt(idx);
|
||||
Accessible* cell = row->GetChildAt(idx);
|
||||
roles::Role role = cell->Role();
|
||||
if (role == roles::GRID_CELL || role == roles::ROWHEADER ||
|
||||
role == roles::COLUMNHEADER)
|
||||
|
@ -894,11 +846,11 @@ ARIAGridCellAccessible::GetRowIndex(PRInt32* aRowIndex)
|
|||
if (IsDefunct())
|
||||
return NS_ERROR_FAILURE;
|
||||
|
||||
nsAccessible* row = Parent();
|
||||
Accessible* row = Parent();
|
||||
if (!row)
|
||||
return NS_OK;
|
||||
|
||||
nsAccessible* table = row->Parent();
|
||||
Accessible* table = row->Parent();
|
||||
if (!table)
|
||||
return NS_OK;
|
||||
|
||||
|
@ -987,7 +939,7 @@ ARIAGridCellAccessible::IsSelected(bool* aIsSelected)
|
|||
if (IsDefunct())
|
||||
return NS_ERROR_FAILURE;
|
||||
|
||||
nsAccessible* row = Parent();
|
||||
Accessible* row = Parent();
|
||||
if (!row || row->Role() != roles::ROW)
|
||||
return NS_OK;
|
||||
|
||||
|
@ -999,7 +951,7 @@ ARIAGridCellAccessible::IsSelected(bool* aIsSelected)
|
|||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// nsAccessible
|
||||
// Accessible
|
||||
|
||||
void
|
||||
ARIAGridCellAccessible::ApplyARIAState(PRUint64* aState) const
|
||||
|
@ -1011,7 +963,7 @@ ARIAGridCellAccessible::ApplyARIAState(PRUint64* aState) const
|
|||
return;
|
||||
|
||||
// Check aria-selected="true" on the row.
|
||||
nsAccessible* row = Parent();
|
||||
Accessible* row = Parent();
|
||||
if (!row || row->Role() != roles::ROW)
|
||||
return;
|
||||
|
||||
|
@ -1035,14 +987,14 @@ ARIAGridCellAccessible::GetAttributesInternal(nsIPersistentProperties* aAttribut
|
|||
|
||||
// Expose "table-cell-index" attribute.
|
||||
|
||||
nsAccessible* thisRow = Parent();
|
||||
Accessible* thisRow = Parent();
|
||||
if (!thisRow || thisRow->Role() != roles::ROW)
|
||||
return NS_OK;
|
||||
|
||||
PRInt32 colIdx = 0, colCount = 0;
|
||||
PRInt32 childCount = thisRow->GetChildCount();
|
||||
for (PRInt32 childIdx = 0; childIdx < childCount; childIdx++) {
|
||||
nsAccessible *child = thisRow->GetChildAt(childIdx);
|
||||
PRUint32 childCount = thisRow->ChildCount();
|
||||
for (PRUint32 childIdx = 0; childIdx < childCount; childIdx++) {
|
||||
Accessible* child = thisRow->GetChildAt(childIdx);
|
||||
if (child == this)
|
||||
colIdx = colCount;
|
||||
|
||||
|
@ -1052,7 +1004,7 @@ ARIAGridCellAccessible::GetAttributesInternal(nsIPersistentProperties* aAttribut
|
|||
colCount++;
|
||||
}
|
||||
|
||||
nsAccessible* table = thisRow->Parent();
|
||||
Accessible* table = thisRow->Parent();
|
||||
if (!table)
|
||||
return NS_OK;
|
||||
|
||||
|
@ -1061,9 +1013,9 @@ ARIAGridCellAccessible::GetAttributesInternal(nsIPersistentProperties* aAttribut
|
|||
return NS_OK;
|
||||
|
||||
PRInt32 rowIdx = 0;
|
||||
childCount = table->GetChildCount();
|
||||
for (PRInt32 childIdx = 0; childIdx < childCount; childIdx++) {
|
||||
nsAccessible *child = table->GetChildAt(childIdx);
|
||||
childCount = table->ChildCount();
|
||||
for (PRUint32 childIdx = 0; childIdx < childCount; childIdx++) {
|
||||
Accessible* child = table->GetChildAt(childIdx);
|
||||
if (child == thisRow)
|
||||
break;
|
||||
|
||||
|
|
|
@ -18,13 +18,13 @@ namespace a11y {
|
|||
/**
|
||||
* Accessible for ARIA grid and treegrid.
|
||||
*/
|
||||
class ARIAGridAccessible : public nsAccessibleWrap,
|
||||
class ARIAGridAccessible : public AccessibleWrap,
|
||||
public xpcAccessibleTable,
|
||||
public nsIAccessibleTable,
|
||||
public TableAccessible
|
||||
{
|
||||
public:
|
||||
ARIAGridAccessible(nsIContent* aContent, nsDocAccessible* aDoc);
|
||||
ARIAGridAccessible(nsIContent* aContent, DocAccessible* aDoc);
|
||||
|
||||
// nsISupports
|
||||
NS_DECL_ISUPPORTS_INHERITED
|
||||
|
@ -32,7 +32,7 @@ public:
|
|||
// nsIAccessibleTable
|
||||
NS_DECL_OR_FORWARD_NSIACCESSIBLETABLE_WITH_XPCACCESSIBLETABLE
|
||||
|
||||
// nsAccessible
|
||||
// Accessible
|
||||
virtual mozilla::a11y::TableAccessible* AsTable() { return this; }
|
||||
|
||||
// nsAccessNode
|
||||
|
@ -41,7 +41,7 @@ public:
|
|||
// TableAccessible
|
||||
virtual PRUint32 ColCount();
|
||||
virtual PRUint32 RowCount();
|
||||
virtual nsAccessible* CellAt(PRUint32 aRowIndex, PRUint32 aColumnIndex);
|
||||
virtual Accessible* CellAt(PRUint32 aRowIndex, PRUint32 aColumnIndex);
|
||||
virtual void UnselectCol(PRUint32 aColIdx);
|
||||
virtual void UnselectRow(PRUint32 aRowIdx);
|
||||
|
||||
|
@ -56,20 +56,15 @@ protected:
|
|||
*/
|
||||
bool IsValidColumn(PRInt32 aColumn);
|
||||
|
||||
/**
|
||||
* Retrun true if given row and column indexes are valid.
|
||||
*/
|
||||
bool IsValidRowNColumn(PRInt32 aRow, PRInt32 aColumn);
|
||||
|
||||
/**
|
||||
* Return row accessible at the given row index.
|
||||
*/
|
||||
nsAccessible *GetRowAt(PRInt32 aRow);
|
||||
Accessible* GetRowAt(PRInt32 aRow);
|
||||
|
||||
/**
|
||||
* Return cell accessible at the given column index in the row.
|
||||
*/
|
||||
nsAccessible *GetCellInRowAt(nsAccessible *aRow, PRInt32 aColumn);
|
||||
Accessible* GetCellInRowAt(Accessible* aRow, PRInt32 aColumn);
|
||||
|
||||
/**
|
||||
* Set aria-selected attribute value on DOM node of the given accessible.
|
||||
|
@ -79,7 +74,7 @@ protected:
|
|||
* @param aNotify [in, optional] specifies if DOM should be notified
|
||||
* about attribute change (used internally).
|
||||
*/
|
||||
nsresult SetARIASelected(nsAccessible *aAccessible, bool aIsSelected,
|
||||
nsresult SetARIASelected(Accessible* aAccessible, bool aIsSelected,
|
||||
bool aNotify = true);
|
||||
|
||||
/**
|
||||
|
@ -97,7 +92,7 @@ class ARIAGridCellAccessible : public nsHyperTextAccessibleWrap,
|
|||
public nsIAccessibleTableCell
|
||||
{
|
||||
public:
|
||||
ARIAGridCellAccessible(nsIContent* aContent, nsDocAccessible* aDoc);
|
||||
ARIAGridCellAccessible(nsIContent* aContent, DocAccessible* aDoc);
|
||||
|
||||
// nsISupports
|
||||
NS_DECL_ISUPPORTS_INHERITED
|
||||
|
@ -105,7 +100,7 @@ public:
|
|||
// nsIAccessibleTableCell
|
||||
NS_DECL_NSIACCESSIBLETABLECELL
|
||||
|
||||
// nsAccessible
|
||||
// Accessible
|
||||
virtual void ApplyARIAState(PRUint64* aState) const;
|
||||
virtual nsresult GetAttributesInternal(nsIPersistentProperties *aAttributes);
|
||||
};
|
||||
|
|
|
@ -7,11 +7,11 @@
|
|||
#ifndef mozilla_a11y_Accessible_inl_h_
|
||||
#define mozilla_a11y_Accessible_inl_h_
|
||||
|
||||
#include "nsAccessible.h"
|
||||
#include "Accessible.h"
|
||||
#include "nsARIAMap.h"
|
||||
|
||||
inline mozilla::a11y::role
|
||||
nsAccessible::Role()
|
||||
Accessible::Role()
|
||||
{
|
||||
if (!mRoleMapEntry || mRoleMapEntry->roleRule != kUseMapRole)
|
||||
return ARIATransformRole(NativeRole());
|
||||
|
@ -20,7 +20,7 @@ nsAccessible::Role()
|
|||
}
|
||||
|
||||
inline mozilla::a11y::role
|
||||
nsAccessible::ARIARole()
|
||||
Accessible::ARIARole()
|
||||
{
|
||||
if (!mRoleMapEntry || mRoleMapEntry->roleRule != kUseMapRole)
|
||||
return mozilla::a11y::roles::NOTHING;
|
||||
|
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -3,8 +3,8 @@
|
|||
* 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 _nsAccessible_H_
|
||||
#define _nsAccessible_H_
|
||||
#ifndef _Accessible_H_
|
||||
#define _Accessible_H_
|
||||
|
||||
#include "mozilla/a11y/Role.h"
|
||||
#include "mozilla/a11y/States.h"
|
||||
|
@ -25,7 +25,7 @@ class AccEvent;
|
|||
class AccGroupInfo;
|
||||
class EmbeddedObjCollector;
|
||||
class KeyBinding;
|
||||
class nsAccessible;
|
||||
class Accessible;
|
||||
class nsHyperTextAccessible;
|
||||
class nsHTMLImageAccessible;
|
||||
class nsHTMLImageMapAccessible;
|
||||
|
@ -37,6 +37,7 @@ namespace a11y {
|
|||
|
||||
class HTMLLIAccessible;
|
||||
class TableAccessible;
|
||||
class TextLeafAccessible;
|
||||
|
||||
/**
|
||||
* Name type flags.
|
||||
|
@ -52,9 +53,21 @@ enum ENameValueFlag {
|
|||
eNameFromTooltip // Tooltip was used as a name
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
class nsTextAccessible;
|
||||
/**
|
||||
* Group position (level, position in set and set size).
|
||||
*/
|
||||
struct GroupPos
|
||||
{
|
||||
GroupPos() : level(0), posInSet(0), setSize(0) { }
|
||||
|
||||
PRInt32 level;
|
||||
PRInt32 posInSet;
|
||||
PRInt32 setSize;
|
||||
};
|
||||
|
||||
} // namespace a11y
|
||||
} // namespace mozilla
|
||||
|
||||
class nsXULTreeAccessible;
|
||||
|
||||
struct nsRect;
|
||||
|
@ -63,18 +76,18 @@ class nsIFrame;
|
|||
class nsIAtom;
|
||||
class nsIView;
|
||||
|
||||
typedef nsRefPtrHashtable<nsPtrHashKey<const void>, nsAccessible>
|
||||
nsAccessibleHashtable;
|
||||
typedef nsRefPtrHashtable<nsPtrHashKey<const void>, Accessible>
|
||||
AccessibleHashtable;
|
||||
|
||||
// see nsAccessible::GetAttrValue
|
||||
// see Accessible::GetAttrValue
|
||||
#define NS_OK_NO_ARIA_VALUE \
|
||||
NS_ERROR_GENERATE_SUCCESS(NS_ERROR_MODULE_GENERAL, 0x21)
|
||||
|
||||
// see nsAccessible::GetNameInternal
|
||||
// see Accessible::GetNameInternal
|
||||
#define NS_OK_EMPTY_NAME \
|
||||
NS_ERROR_GENERATE_SUCCESS(NS_ERROR_MODULE_GENERAL, 0x23)
|
||||
|
||||
// see nsAccessible::GetNameInternal
|
||||
// see Accessible::GetNameInternal
|
||||
#define NS_OK_NAME_FROM_TOOLTIP \
|
||||
NS_ERROR_GENERATE_SUCCESS(NS_ERROR_MODULE_GENERAL, 0x25)
|
||||
|
||||
|
@ -87,18 +100,18 @@ NS_ERROR_GENERATE_SUCCESS(NS_ERROR_MODULE_GENERAL, 0x25)
|
|||
{ 0xbd, 0x50, 0x42, 0x6b, 0xd1, 0xd6, 0xe1, 0xad } \
|
||||
}
|
||||
|
||||
class nsAccessible : public nsAccessNodeWrap,
|
||||
public nsIAccessible,
|
||||
public nsIAccessibleHyperLink,
|
||||
public nsIAccessibleSelectable,
|
||||
public nsIAccessibleValue
|
||||
class Accessible : public nsAccessNodeWrap,
|
||||
public nsIAccessible,
|
||||
public nsIAccessibleHyperLink,
|
||||
public nsIAccessibleSelectable,
|
||||
public nsIAccessibleValue
|
||||
{
|
||||
public:
|
||||
nsAccessible(nsIContent* aContent, nsDocAccessible* aDoc);
|
||||
virtual ~nsAccessible();
|
||||
Accessible(nsIContent* aContent, DocAccessible* aDoc);
|
||||
virtual ~Accessible();
|
||||
|
||||
NS_DECL_ISUPPORTS_INHERITED
|
||||
NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(nsAccessible, nsAccessNode)
|
||||
NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(Accessible, nsAccessNode)
|
||||
|
||||
NS_DECL_NSIACCESSIBLE
|
||||
NS_DECL_NSIACCESSIBLEHYPERLINK
|
||||
|
@ -226,6 +239,12 @@ public:
|
|||
*/
|
||||
virtual nsresult GetAttributesInternal(nsIPersistentProperties *aAttributes);
|
||||
|
||||
/**
|
||||
* Return group position (level, position in set and set size).
|
||||
*/
|
||||
virtual mozilla::a11y::GroupPos GroupPosition();
|
||||
|
||||
/**
|
||||
/**
|
||||
* Used by ChildAtPoint() method to get direct or deepest child at point.
|
||||
*/
|
||||
|
@ -242,13 +261,13 @@ public:
|
|||
* @param aWhichChild [in] flag points if deepest or direct child
|
||||
* should be returned
|
||||
*/
|
||||
virtual nsAccessible* ChildAtPoint(PRInt32 aX, PRInt32 aY,
|
||||
EWhichChildAtPoint aWhichChild);
|
||||
virtual Accessible* ChildAtPoint(PRInt32 aX, PRInt32 aY,
|
||||
EWhichChildAtPoint aWhichChild);
|
||||
|
||||
/**
|
||||
* Return the focused child if any.
|
||||
*/
|
||||
virtual nsAccessible* FocusedChild();
|
||||
virtual Accessible* FocusedChild();
|
||||
|
||||
/**
|
||||
* Return calculated group level based on accessible hierarchy.
|
||||
|
@ -307,9 +326,9 @@ public:
|
|||
/**
|
||||
* Append/insert/remove a child. Return true if operation was successful.
|
||||
*/
|
||||
virtual bool AppendChild(nsAccessible* aChild);
|
||||
virtual bool InsertChildAt(PRUint32 aIndex, nsAccessible* aChild);
|
||||
virtual bool RemoveChild(nsAccessible* aChild);
|
||||
virtual bool AppendChild(Accessible* aChild);
|
||||
virtual bool InsertChildAt(PRUint32 aIndex, Accessible* aChild);
|
||||
virtual bool RemoveChild(Accessible* aChild);
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
// Accessible tree traverse methods
|
||||
|
@ -317,22 +336,22 @@ public:
|
|||
/**
|
||||
* Return parent accessible.
|
||||
*/
|
||||
nsAccessible* Parent() const { return mParent; }
|
||||
Accessible* Parent() const { return mParent; }
|
||||
|
||||
/**
|
||||
* Return child accessible at the given index.
|
||||
*/
|
||||
virtual nsAccessible* GetChildAt(PRUint32 aIndex);
|
||||
virtual Accessible* GetChildAt(PRUint32 aIndex);
|
||||
|
||||
/**
|
||||
* Return child accessible count.
|
||||
*/
|
||||
virtual PRInt32 GetChildCount();
|
||||
virtual PRUint32 ChildCount() const;
|
||||
|
||||
/**
|
||||
* Return index of the given child accessible.
|
||||
*/
|
||||
virtual PRInt32 GetIndexOf(nsAccessible* aChild);
|
||||
virtual PRInt32 GetIndexOf(Accessible* aChild);
|
||||
|
||||
/**
|
||||
* Return index in parent accessible.
|
||||
|
@ -347,15 +366,15 @@ public:
|
|||
/**
|
||||
* Return first/last/next/previous sibling of the accessible.
|
||||
*/
|
||||
inline nsAccessible* NextSibling() const
|
||||
inline Accessible* NextSibling() const
|
||||
{ return GetSiblingAtOffset(1); }
|
||||
inline nsAccessible* PrevSibling() const
|
||||
inline Accessible* PrevSibling() const
|
||||
{ return GetSiblingAtOffset(-1); }
|
||||
inline nsAccessible* FirstChild()
|
||||
{ return GetChildCount() != 0 ? GetChildAt(0) : nsnull; }
|
||||
inline nsAccessible* LastChild()
|
||||
inline Accessible* FirstChild()
|
||||
{ return GetChildAt(0); }
|
||||
inline Accessible* LastChild()
|
||||
{
|
||||
PRUint32 childCount = GetChildCount();
|
||||
PRUint32 childCount = ChildCount();
|
||||
return childCount != 0 ? GetChildAt(childCount - 1) : nsnull;
|
||||
}
|
||||
|
||||
|
@ -363,17 +382,17 @@ public:
|
|||
/**
|
||||
* Return embedded accessible children count.
|
||||
*/
|
||||
PRInt32 GetEmbeddedChildCount();
|
||||
PRUint32 EmbeddedChildCount();
|
||||
|
||||
/**
|
||||
* Return embedded accessible child at the given index.
|
||||
*/
|
||||
nsAccessible* GetEmbeddedChildAt(PRUint32 aIndex);
|
||||
Accessible* GetEmbeddedChildAt(PRUint32 aIndex);
|
||||
|
||||
/**
|
||||
* Return index of the given embedded accessible child.
|
||||
*/
|
||||
PRInt32 GetIndexOfEmbeddedChild(nsAccessible* aChild);
|
||||
PRInt32 GetIndexOfEmbeddedChild(Accessible* aChild);
|
||||
|
||||
/**
|
||||
* Return number of content children/content child at index. The content
|
||||
|
@ -381,7 +400,7 @@ public:
|
|||
* parent accessible (like treeitem accessibles for XUL trees).
|
||||
*/
|
||||
PRUint32 ContentChildCount() const { return mChildren.Length(); }
|
||||
nsAccessible* ContentChildAt(PRUint32 aIndex) const
|
||||
Accessible* ContentChildAt(PRUint32 aIndex) const
|
||||
{ return mChildren.ElementAt(aIndex); }
|
||||
|
||||
/**
|
||||
|
@ -426,7 +445,7 @@ public:
|
|||
* Assert if child not in parent's cache if the cache was initialized at this
|
||||
* point.
|
||||
*/
|
||||
void TestChildCache(nsAccessible* aCachedChild) const;
|
||||
void TestChildCache(Accessible* aCachedChild) const;
|
||||
|
||||
/**
|
||||
* Return boundaries rect relative the bounding frame.
|
||||
|
@ -451,7 +470,7 @@ public:
|
|||
inline bool IsCombobox() const { return mFlags & eComboboxAccessible; }
|
||||
|
||||
inline bool IsDoc() const { return mFlags & eDocAccessible; }
|
||||
nsDocAccessible* AsDoc();
|
||||
DocAccessible* AsDoc();
|
||||
|
||||
inline bool IsHyperText() const { return mFlags & eHyperTextAccessible; }
|
||||
nsHyperTextAccessible* AsHyperText();
|
||||
|
@ -482,7 +501,7 @@ public:
|
|||
virtual mozilla::a11y::TableAccessible* AsTable() { return nsnull; }
|
||||
|
||||
inline bool IsTextLeaf() const { return mFlags & eTextLeafAccessible; }
|
||||
nsTextAccessible* AsTextLeaf();
|
||||
mozilla::a11y::TextLeafAccessible* AsTextLeaf();
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
// ActionAccessible
|
||||
|
@ -548,7 +567,7 @@ public:
|
|||
/**
|
||||
* Returns an anchor accessible at the given index.
|
||||
*/
|
||||
virtual nsAccessible* AnchorAt(PRUint32 aAnchorIndex);
|
||||
virtual Accessible* AnchorAt(PRUint32 aAnchorIndex);
|
||||
|
||||
/**
|
||||
* Returns an anchor URI at the given index.
|
||||
|
@ -577,7 +596,7 @@ public:
|
|||
/**
|
||||
* Return selected item at the given index.
|
||||
*/
|
||||
virtual nsAccessible* GetSelectedItem(PRUint32 aIndex);
|
||||
virtual Accessible* GetSelectedItem(PRUint32 aIndex);
|
||||
|
||||
/**
|
||||
* Determine if item at the given index is selected.
|
||||
|
@ -629,17 +648,17 @@ public:
|
|||
* Return the current item of the widget, i.e. an item that has or will have
|
||||
* keyboard focus when widget gets active.
|
||||
*/
|
||||
virtual nsAccessible* CurrentItem();
|
||||
virtual Accessible* CurrentItem();
|
||||
|
||||
/**
|
||||
* Set the current item of the widget.
|
||||
*/
|
||||
virtual void SetCurrentItem(nsAccessible* aItem);
|
||||
virtual void SetCurrentItem(Accessible* aItem);
|
||||
|
||||
/**
|
||||
* Return container widget this accessible belongs to.
|
||||
*/
|
||||
virtual nsAccessible* ContainerWidget() const;
|
||||
virtual Accessible* ContainerWidget() const;
|
||||
|
||||
/**
|
||||
* Return the localized string for the given key.
|
||||
|
@ -664,14 +683,14 @@ protected:
|
|||
/**
|
||||
* Set accessible parent and index in parent.
|
||||
*/
|
||||
virtual void BindToParent(nsAccessible* aParent, PRUint32 aIndexInParent);
|
||||
virtual void BindToParent(Accessible* aParent, PRUint32 aIndexInParent);
|
||||
virtual void UnbindFromParent();
|
||||
|
||||
/**
|
||||
* Return sibling accessible at the given offset.
|
||||
*/
|
||||
virtual nsAccessible* GetSiblingAtOffset(PRInt32 aOffset,
|
||||
nsresult *aError = nsnull) const;
|
||||
virtual Accessible* GetSiblingAtOffset(PRInt32 aOffset,
|
||||
nsresult *aError = nsnull) const;
|
||||
|
||||
/**
|
||||
* Flags used to describe the state and type of children.
|
||||
|
@ -757,7 +776,7 @@ protected:
|
|||
* @param aStartNode [in] the DOM node to start from
|
||||
* @return the resulting accessible
|
||||
*/
|
||||
nsAccessible *GetFirstAvailableAccessible(nsINode *aStartNode) const;
|
||||
Accessible* GetFirstAvailableAccessible(nsINode* aStartNode) const;
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
// Action helpers
|
||||
|
@ -781,7 +800,7 @@ protected:
|
|||
*/
|
||||
virtual void DispatchClickEvent(nsIContent *aContent, PRUint32 aActionIndex);
|
||||
|
||||
NS_DECL_RUNNABLEMETHOD_ARG2(nsAccessible, DispatchClickEvent,
|
||||
NS_DECL_RUNNABLEMETHOD_ARG2(Accessible, DispatchClickEvent,
|
||||
nsCOMPtr<nsIContent>, PRUint32)
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -827,8 +846,8 @@ protected:
|
|||
virtual nsresult FirePlatformEvent(AccEvent* aEvent) = 0;
|
||||
|
||||
// Data Members
|
||||
nsRefPtr<nsAccessible> mParent;
|
||||
nsTArray<nsRefPtr<nsAccessible> > mChildren;
|
||||
nsRefPtr<Accessible> mParent;
|
||||
nsTArray<nsRefPtr<Accessible> > mChildren;
|
||||
PRInt32 mIndexInParent;
|
||||
|
||||
static const PRUint32 kChildrenFlagsMask =
|
||||
|
@ -849,7 +868,7 @@ protected:
|
|||
nsRoleMapEntry* mRoleMapEntry;
|
||||
};
|
||||
|
||||
NS_DEFINE_STATIC_IID_ACCESSOR(nsAccessible,
|
||||
NS_DEFINE_STATIC_IID_ACCESSOR(Accessible,
|
||||
NS_ACCESSIBLE_IMPL_IID)
|
||||
|
||||
|
|
@ -4,7 +4,7 @@
|
|||
/* 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 "ApplicationAccessible.h"
|
||||
|
||||
#include "nsAccessibilityService.h"
|
||||
|
@ -23,7 +23,7 @@
|
|||
using namespace mozilla::a11y;
|
||||
|
||||
ApplicationAccessible::ApplicationAccessible() :
|
||||
nsAccessibleWrap(nsnull, nsnull)
|
||||
AccessibleWrap(nsnull, nsnull)
|
||||
{
|
||||
mFlags |= eApplicationAccessible;
|
||||
}
|
||||
|
@ -31,7 +31,7 @@ ApplicationAccessible::ApplicationAccessible() :
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
// nsISupports
|
||||
|
||||
NS_IMPL_ISUPPORTS_INHERITED1(ApplicationAccessible, nsAccessible,
|
||||
NS_IMPL_ISUPPORTS_INHERITED1(ApplicationAccessible, Accessible,
|
||||
nsIAccessibleApplication)
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -117,31 +117,23 @@ ApplicationAccessible::GetAttributes(nsIPersistentProperties** aAttributes)
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
ApplicationAccessible::GroupPosition(PRInt32* aGroupLevel,
|
||||
PRInt32* aSimilarItemsInGroup,
|
||||
PRInt32* aPositionInGroup)
|
||||
GroupPos
|
||||
ApplicationAccessible::GroupPosition()
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aGroupLevel);
|
||||
*aGroupLevel = 0;
|
||||
NS_ENSURE_ARG_POINTER(aSimilarItemsInGroup);
|
||||
*aSimilarItemsInGroup = 0;
|
||||
NS_ENSURE_ARG_POINTER(aPositionInGroup);
|
||||
*aPositionInGroup = 0;
|
||||
return NS_OK;
|
||||
return GroupPos();
|
||||
}
|
||||
|
||||
nsAccessible*
|
||||
Accessible*
|
||||
ApplicationAccessible::ChildAtPoint(PRInt32 aX, PRInt32 aY,
|
||||
EWhichChildAtPoint aWhichChild)
|
||||
{
|
||||
return nsnull;
|
||||
}
|
||||
|
||||
nsAccessible*
|
||||
Accessible*
|
||||
ApplicationAccessible::FocusedChild()
|
||||
{
|
||||
nsAccessible* focus = FocusMgr()->FocusedAccessible();
|
||||
Accessible* focus = FocusMgr()->FocusedAccessible();
|
||||
if (focus && focus->Parent() == this)
|
||||
return focus;
|
||||
|
||||
|
@ -295,7 +287,7 @@ ApplicationAccessible::IsPrimaryForNode() const
|
|||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// nsAccessible public methods
|
||||
// Accessible public methods
|
||||
|
||||
void
|
||||
ApplicationAccessible::ApplyARIAState(PRUint64* aState) const
|
||||
|
@ -328,7 +320,7 @@ ApplicationAccessible::AccessKey() const
|
|||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// nsAccessible protected methods
|
||||
// Accessible protected methods
|
||||
|
||||
void
|
||||
ApplicationAccessible::CacheChildren()
|
||||
|
@ -370,7 +362,7 @@ ApplicationAccessible::CacheChildren()
|
|||
}
|
||||
}
|
||||
|
||||
nsAccessible*
|
||||
Accessible*
|
||||
ApplicationAccessible::GetSiblingAtOffset(PRInt32 aOffset,
|
||||
nsresult* aError) const
|
||||
{
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
#ifndef mozilla_a11y_ApplicationAccessible_h__
|
||||
#define mozilla_a11y_ApplicationAccessible_h__
|
||||
|
||||
#include "nsAccessibleWrap.h"
|
||||
#include "AccessibleWrap.h"
|
||||
#include "nsIAccessibleApplication.h"
|
||||
|
||||
#include "nsIMutableArray.h"
|
||||
|
@ -16,7 +16,7 @@
|
|||
|
||||
namespace mozilla {
|
||||
namespace a11y {
|
||||
|
||||
|
||||
/**
|
||||
* ApplicationAccessible is for the whole application of Mozilla.
|
||||
* Only one instance of ApplicationAccessible exists for one Mozilla instance.
|
||||
|
@ -27,7 +27,7 @@ namespace a11y {
|
|||
* the ApplicationAccessible instance.
|
||||
*/
|
||||
|
||||
class ApplicationAccessible: public nsAccessibleWrap,
|
||||
class ApplicationAccessible : public AccessibleWrap,
|
||||
public nsIAccessibleApplication
|
||||
{
|
||||
public:
|
||||
|
@ -48,8 +48,6 @@ public:
|
|||
NS_IMETHOD GetNextSibling(nsIAccessible **aNextSibling);
|
||||
NS_IMETHOD GetPreviousSibling(nsIAccessible **aPreviousSibling);
|
||||
NS_IMETHOD GetAttributes(nsIPersistentProperties **aAttributes);
|
||||
NS_IMETHOD GroupPosition(PRInt32 *aGroupLevel, PRInt32 *aSimilarItemsInGroup,
|
||||
PRInt32 *aPositionInGroup);
|
||||
NS_IMETHOD GetBounds(PRInt32 *aX, PRInt32 *aY,
|
||||
PRInt32 *aWidth, PRInt32 *aHeight);
|
||||
NS_IMETHOD SetSelected(bool aIsSelected);
|
||||
|
@ -67,8 +65,9 @@ public:
|
|||
virtual void Shutdown();
|
||||
virtual bool IsPrimaryForNode() const;
|
||||
|
||||
// nsAccessible
|
||||
virtual mozilla::a11y::ENameValueFlag Name(nsString& aName);
|
||||
// Accessible
|
||||
virtual GroupPos GroupPosition();
|
||||
virtual ENameValueFlag Name(nsString& aName);
|
||||
virtual void ApplyARIAState(PRUint64* aState) const;
|
||||
virtual void Description(nsString& aDescription);
|
||||
virtual void Value(nsString& aValue);
|
||||
|
@ -77,9 +76,9 @@ public:
|
|||
virtual PRUint64 NativeState();
|
||||
virtual Relation RelationByType(PRUint32 aRelType);
|
||||
|
||||
virtual nsAccessible* ChildAtPoint(PRInt32 aX, PRInt32 aY,
|
||||
EWhichChildAtPoint aWhichChild);
|
||||
virtual nsAccessible* FocusedChild();
|
||||
virtual Accessible* ChildAtPoint(PRInt32 aX, PRInt32 aY,
|
||||
EWhichChildAtPoint aWhichChild);
|
||||
virtual Accessible* FocusedChild();
|
||||
|
||||
virtual void InvalidateChildren();
|
||||
|
||||
|
@ -89,10 +88,10 @@ public:
|
|||
|
||||
protected:
|
||||
|
||||
// nsAccessible
|
||||
// Accessible
|
||||
virtual void CacheChildren();
|
||||
virtual nsAccessible* GetSiblingAtOffset(PRInt32 aOffset,
|
||||
nsresult *aError = nsnull) const;
|
||||
virtual Accessible* GetSiblingAtOffset(PRInt32 aOffset,
|
||||
nsresult *aError = nsnull) const;
|
||||
|
||||
private:
|
||||
nsCOMPtr<nsIXULAppInfo> mAppInfo;
|
||||
|
|
|
@ -0,0 +1,19 @@
|
|||
/* -*- 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_DocAccessible_inl_h_
|
||||
#define mozilla_a11y_DocAccessible_inl_h_
|
||||
|
||||
#include "DocAccessible.h"
|
||||
#include "nsAccessibilityService.h"
|
||||
|
||||
inline DocAccessible*
|
||||
DocAccessible::ParentDocument() const
|
||||
{
|
||||
return GetAccService()->GetDocAccessible(mDocument->GetParentDocument());
|
||||
}
|
||||
|
||||
#endif
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -3,8 +3,8 @@
|
|||
* 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 _nsDocAccessible_H_
|
||||
#define _nsDocAccessible_H_
|
||||
#ifndef mozilla_a11y_DocAccessible_h__
|
||||
#define mozilla_a11y_DocAccessible_h__
|
||||
|
||||
#include "nsIAccessibleCursorable.h"
|
||||
#include "nsIAccessibleDocument.h"
|
||||
|
@ -31,17 +31,17 @@ class nsAccessiblePivot;
|
|||
|
||||
const PRUint32 kDefaultCacheSize = 256;
|
||||
|
||||
class nsDocAccessible : public nsHyperTextAccessibleWrap,
|
||||
public nsIAccessibleDocument,
|
||||
public nsIDocumentObserver,
|
||||
public nsIObserver,
|
||||
public nsIScrollPositionListener,
|
||||
public nsSupportsWeakReference,
|
||||
public nsIAccessibleCursorable,
|
||||
public nsIAccessiblePivotObserver
|
||||
class DocAccessible : public nsHyperTextAccessibleWrap,
|
||||
public nsIAccessibleDocument,
|
||||
public nsIDocumentObserver,
|
||||
public nsIObserver,
|
||||
public nsIScrollPositionListener,
|
||||
public nsSupportsWeakReference,
|
||||
public nsIAccessibleCursorable,
|
||||
public nsIAccessiblePivotObserver
|
||||
{
|
||||
NS_DECL_ISUPPORTS_INHERITED
|
||||
NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(nsDocAccessible, nsAccessible)
|
||||
NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(DocAccessible, Accessible)
|
||||
|
||||
NS_DECL_NSIACCESSIBLEDOCUMENT
|
||||
|
||||
|
@ -52,14 +52,13 @@ class nsDocAccessible : public nsHyperTextAccessibleWrap,
|
|||
NS_DECL_NSIACCESSIBLEPIVOTOBSERVER
|
||||
|
||||
public:
|
||||
using nsAccessible::GetParent;
|
||||
|
||||
nsDocAccessible(nsIDocument *aDocument, nsIContent *aRootContent,
|
||||
nsIPresShell* aPresShell);
|
||||
virtual ~nsDocAccessible();
|
||||
DocAccessible(nsIDocument* aDocument, nsIContent* aRootContent,
|
||||
nsIPresShell* aPresShell);
|
||||
virtual ~DocAccessible();
|
||||
|
||||
// nsIAccessible
|
||||
NS_IMETHOD GetAttributes(nsIPersistentProperties **aAttributes);
|
||||
NS_IMETHOD GetAttributes(nsIPersistentProperties** aAttributes);
|
||||
NS_IMETHOD TakeFocus(void);
|
||||
|
||||
// nsIScrollPositionListener
|
||||
|
@ -76,18 +75,18 @@ public:
|
|||
virtual nsINode* GetNode() const { return mDocument; }
|
||||
virtual nsIDocument* GetDocumentNode() const { return mDocument; }
|
||||
|
||||
// nsAccessible
|
||||
// Accessible
|
||||
virtual mozilla::a11y::ENameValueFlag Name(nsString& aName);
|
||||
virtual void Description(nsString& aDescription);
|
||||
virtual nsAccessible* FocusedChild();
|
||||
virtual Accessible* FocusedChild();
|
||||
virtual mozilla::a11y::role NativeRole();
|
||||
virtual PRUint64 NativeState();
|
||||
virtual void ApplyARIAState(PRUint64* aState) const;
|
||||
|
||||
virtual void SetRoleMapEntry(nsRoleMapEntry* aRoleMapEntry);
|
||||
|
||||
#ifdef DEBUG_ACCDOCMGR
|
||||
virtual nsresult HandleAccEvent(AccEvent* aAccEvent);
|
||||
#ifdef DEBUG
|
||||
virtual nsresult HandleAccEvent(AccEvent* aEvent);
|
||||
#endif
|
||||
|
||||
virtual void GetBoundsRect(nsRect& aRect, nsIFrame** aRelativeFrame);
|
||||
|
@ -95,7 +94,7 @@ public:
|
|||
// nsHyperTextAccessible
|
||||
virtual already_AddRefed<nsIEditor> GetEditor() const;
|
||||
|
||||
// nsDocAccessible
|
||||
// DocAccessible
|
||||
|
||||
/**
|
||||
* Return presentation shell for this document accessible.
|
||||
|
@ -150,8 +149,7 @@ public:
|
|||
/**
|
||||
* Return the parent document.
|
||||
*/
|
||||
nsDocAccessible* ParentDocument() const
|
||||
{ return mParent ? mParent->Document() : nsnull; }
|
||||
DocAccessible* ParentDocument() const;
|
||||
|
||||
/**
|
||||
* Return the child document count.
|
||||
|
@ -162,7 +160,7 @@ public:
|
|||
/**
|
||||
* Return the child document at the given index.
|
||||
*/
|
||||
nsDocAccessible* GetChildDocumentAt(PRUint32 aIndex) const
|
||||
DocAccessible* GetChildDocumentAt(PRUint32 aIndex) const
|
||||
{ return mChildDocuments.SafeElementAt(aIndex, nsnull); }
|
||||
|
||||
/**
|
||||
|
@ -186,7 +184,7 @@ public:
|
|||
/**
|
||||
* Fire value change event on the given accessible if applicable.
|
||||
*/
|
||||
inline void MaybeNotifyOfValueChange(nsAccessible* aAccessible)
|
||||
void MaybeNotifyOfValueChange(Accessible* aAccessible)
|
||||
{
|
||||
mozilla::a11y::role role = aAccessible->Role();
|
||||
if (role == mozilla::a11y::roles::ENTRY ||
|
||||
|
@ -201,16 +199,16 @@ public:
|
|||
/**
|
||||
* Get/set the anchor jump.
|
||||
*/
|
||||
inline nsAccessible* AnchorJump()
|
||||
Accessible* AnchorJump()
|
||||
{ return GetAccessibleOrContainer(mAnchorJumpElm); }
|
||||
|
||||
inline void SetAnchorJump(nsIContent* aTargetNode)
|
||||
void SetAnchorJump(nsIContent* aTargetNode)
|
||||
{ mAnchorJumpElm = aTargetNode; }
|
||||
|
||||
/**
|
||||
* Bind the child document to the tree.
|
||||
*/
|
||||
inline void BindChildDocument(nsDocAccessible* aDocument)
|
||||
void BindChildDocument(DocAccessible* aDocument)
|
||||
{
|
||||
mNotificationController->ScheduleChildDocBinding(aDocument);
|
||||
}
|
||||
|
@ -223,7 +221,7 @@ public:
|
|||
* @see NotificationController::HandleNotification
|
||||
*/
|
||||
template<class Class, class Arg>
|
||||
inline void HandleNotification(Class* aInstance,
|
||||
void HandleNotification(Class* aInstance,
|
||||
typename TNotification<Class, Arg>::Callback aMethod,
|
||||
Arg* aArg)
|
||||
{
|
||||
|
@ -239,20 +237,20 @@ public:
|
|||
*
|
||||
* @return the accessible object
|
||||
*/
|
||||
nsAccessible* GetAccessible(nsINode* aNode) const;
|
||||
Accessible* GetAccessible(nsINode* aNode) const;
|
||||
|
||||
/**
|
||||
* Return whether the given DOM node has an accessible or not.
|
||||
*/
|
||||
inline bool HasAccessible(nsINode* aNode) const
|
||||
bool HasAccessible(nsINode* aNode) const
|
||||
{ return GetAccessible(aNode); }
|
||||
|
||||
/**
|
||||
* Return true if the given accessible is in document.
|
||||
*/
|
||||
inline bool IsInDocument(nsAccessible* aAccessible) const
|
||||
bool IsInDocument(Accessible* aAccessible) const
|
||||
{
|
||||
nsAccessible* acc = aAccessible;
|
||||
Accessible* acc = aAccessible;
|
||||
while (acc && !acc->IsPrimaryForNode())
|
||||
acc = acc->Parent();
|
||||
|
||||
|
@ -266,7 +264,7 @@ public:
|
|||
*
|
||||
* @param aUniqueID [in] the unique ID used to cache the node.
|
||||
*/
|
||||
inline nsAccessible* GetAccessibleByUniqueID(void* aUniqueID)
|
||||
Accessible* GetAccessibleByUniqueID(void* aUniqueID)
|
||||
{
|
||||
return UniqueID() == aUniqueID ?
|
||||
this : mAccessibleCache.GetWeak(aUniqueID);
|
||||
|
@ -276,18 +274,18 @@ public:
|
|||
* Return the cached accessible by the given unique ID looking through
|
||||
* this and nested documents.
|
||||
*/
|
||||
nsAccessible* GetAccessibleByUniqueIDInSubtree(void* aUniqueID);
|
||||
Accessible* GetAccessibleByUniqueIDInSubtree(void* aUniqueID);
|
||||
|
||||
/**
|
||||
* Return an accessible for the given DOM node or container accessible if
|
||||
* the node is not accessible.
|
||||
*/
|
||||
nsAccessible* GetAccessibleOrContainer(nsINode* aNode);
|
||||
Accessible* GetAccessibleOrContainer(nsINode* aNode);
|
||||
|
||||
/**
|
||||
* Return a container accessible for the given DOM node.
|
||||
*/
|
||||
inline nsAccessible* GetContainerAccessible(nsINode* aNode)
|
||||
Accessible* GetContainerAccessible(nsINode* aNode)
|
||||
{
|
||||
return aNode ? GetAccessibleOrContainer(aNode->GetNodeParent()) : nsnull;
|
||||
}
|
||||
|
@ -309,12 +307,12 @@ public:
|
|||
* @param aRoleMapEntry [in] the role map entry role the ARIA role or nsnull
|
||||
* if none
|
||||
*/
|
||||
bool BindToDocument(nsAccessible* aAccessible, nsRoleMapEntry* aRoleMapEntry);
|
||||
bool BindToDocument(Accessible* aAccessible, nsRoleMapEntry* aRoleMapEntry);
|
||||
|
||||
/**
|
||||
* Remove from document and shutdown the given accessible.
|
||||
*/
|
||||
void UnbindFromDocument(nsAccessible* aAccessible);
|
||||
void UnbindFromDocument(Accessible* aAccessible);
|
||||
|
||||
/**
|
||||
* Notify the document accessible that content was inserted.
|
||||
|
@ -331,7 +329,7 @@ public:
|
|||
/**
|
||||
* Updates accessible tree when rendered text is changed.
|
||||
*/
|
||||
inline void UpdateText(nsIContent* aTextNode)
|
||||
void UpdateText(nsIContent* aTextNode)
|
||||
{
|
||||
NS_ASSERTION(mNotificationController, "The document was shut down!");
|
||||
|
||||
|
@ -349,17 +347,17 @@ protected:
|
|||
|
||||
void LastRelease();
|
||||
|
||||
// nsAccessible
|
||||
// Accessible
|
||||
virtual void CacheChildren();
|
||||
|
||||
// nsDocAccessible
|
||||
virtual nsresult AddEventListeners();
|
||||
virtual nsresult RemoveEventListeners();
|
||||
// DocAccessible
|
||||
virtual nsresult AddEventListeners();
|
||||
virtual nsresult RemoveEventListeners();
|
||||
|
||||
/**
|
||||
* Marks this document as loaded or loading.
|
||||
*/
|
||||
inline void NotifyOfLoad(PRUint32 aLoadEventType)
|
||||
void NotifyOfLoad(PRUint32 aLoadEventType)
|
||||
{
|
||||
mLoadState |= eDOMLoaded;
|
||||
mLoadEventType = aLoadEventType;
|
||||
|
@ -388,7 +386,7 @@ protected:
|
|||
* Append the given document accessible to this document's child document
|
||||
* accessibles.
|
||||
*/
|
||||
bool AppendChildDocument(nsDocAccessible* aChildDocument)
|
||||
bool AppendChildDocument(DocAccessible* aChildDocument)
|
||||
{
|
||||
return mChildDocuments.AppendElement(aChildDocument);
|
||||
}
|
||||
|
@ -397,7 +395,7 @@ protected:
|
|||
* Remove the given document accessible from this document's child document
|
||||
* accessibles.
|
||||
*/
|
||||
void RemoveChildDocument(nsDocAccessible* aChildDocument)
|
||||
void RemoveChildDocument(DocAccessible* aChildDocument)
|
||||
{
|
||||
mChildDocuments.RemoveElement(aChildDocument);
|
||||
}
|
||||
|
@ -410,7 +408,7 @@ protected:
|
|||
* @param aRelProvider [in] accessible that element has relation attribute
|
||||
* @param aRelAttr [in, optional] relation attribute
|
||||
*/
|
||||
void AddDependentIDsFor(nsAccessible* aRelProvider,
|
||||
void AddDependentIDsFor(Accessible* aRelProvider,
|
||||
nsIAtom* aRelAttr = nsnull);
|
||||
|
||||
/**
|
||||
|
@ -421,7 +419,7 @@ protected:
|
|||
* @param aRelProvider [in] accessible that element has relation attribute
|
||||
* @param aRelAttr [in, optional] relation attribute
|
||||
*/
|
||||
void RemoveDependentIDsFor(nsAccessible* aRelProvider,
|
||||
void RemoveDependentIDsFor(Accessible* aRelProvider,
|
||||
nsIAtom* aRelAttr = nsnull);
|
||||
|
||||
/**
|
||||
|
@ -465,7 +463,7 @@ protected:
|
|||
/**
|
||||
* Update the accessible tree for inserted content.
|
||||
*/
|
||||
void ProcessContentInserted(nsAccessible* aContainer,
|
||||
void ProcessContentInserted(Accessible* aContainer,
|
||||
const nsTArray<nsCOMPtr<nsIContent> >* aInsertedContent);
|
||||
|
||||
/**
|
||||
|
@ -480,7 +478,7 @@ protected:
|
|||
/**
|
||||
* Update the accessible tree for content insertion or removal.
|
||||
*/
|
||||
void UpdateTree(nsAccessible* aContainer, nsIContent* aChildNode,
|
||||
void UpdateTree(Accessible* aContainer, nsIContent* aChildNode,
|
||||
bool aIsInsert);
|
||||
|
||||
/**
|
||||
|
@ -493,17 +491,17 @@ protected:
|
|||
eAlertAccessible = 2
|
||||
};
|
||||
|
||||
PRUint32 UpdateTreeInternal(nsAccessible* aChild, bool aIsInsert);
|
||||
PRUint32 UpdateTreeInternal(Accessible* aChild, bool aIsInsert);
|
||||
|
||||
/**
|
||||
* Create accessible tree.
|
||||
*/
|
||||
void CacheChildrenInSubtree(nsAccessible* aRoot);
|
||||
void CacheChildrenInSubtree(Accessible* aRoot);
|
||||
|
||||
/**
|
||||
* Remove accessibles in subtree from node to accessible map.
|
||||
*/
|
||||
void UncacheChildrenInSubtree(nsAccessible* aRoot);
|
||||
void UncacheChildrenInSubtree(Accessible* aRoot);
|
||||
|
||||
/**
|
||||
* Shutdown any cached accessible in the subtree.
|
||||
|
@ -511,23 +509,16 @@ protected:
|
|||
* @param aAccessible [in] the root of the subrtee to invalidate accessible
|
||||
* child/parent refs in
|
||||
*/
|
||||
void ShutdownChildrenInSubtree(nsAccessible *aAccessible);
|
||||
void ShutdownChildrenInSubtree(Accessible* aAccessible);
|
||||
|
||||
/**
|
||||
* Return true if accessibility events accompanying document accessible
|
||||
* loading should be fired.
|
||||
* Return true if the document is a target of document loading events
|
||||
* (for example, state busy change or document reload events).
|
||||
*
|
||||
* The rules are: do not fire events for root chrome document accessibles and
|
||||
* for sub document accessibles (like HTML frame of iframe) of the loading
|
||||
* document accessible.
|
||||
*
|
||||
* XXX: in general AT expect events for document accessible loading into
|
||||
* tabbrowser, events from other document accessibles may break AT. We need to
|
||||
* figure out what AT wants to know about loading page (for example, some of
|
||||
* them have separate processing of iframe documents on the page and therefore
|
||||
* they need a way to distinguish sub documents from page document). Ideally
|
||||
* we should make events firing for any loaded document and provide additional
|
||||
* info AT are needing.
|
||||
* Rules: The root chrome document accessible is never an event target
|
||||
* (for example, Firefox UI window). If the sub document is loaded within its
|
||||
* parent document then the parent document is a target only (aka events
|
||||
* coalescence).
|
||||
*/
|
||||
bool IsLoadEventTarget() const;
|
||||
|
||||
|
@ -544,8 +535,8 @@ protected:
|
|||
/**
|
||||
* Cache of accessibles within this document accessible.
|
||||
*/
|
||||
nsAccessibleHashtable mAccessibleCache;
|
||||
nsDataHashtable<nsPtrHashKey<const nsINode>, nsAccessible*>
|
||||
AccessibleHashtable mAccessibleCache;
|
||||
nsDataHashtable<nsPtrHashKey<const nsINode>, Accessible*>
|
||||
mNodeToAccessibleMap;
|
||||
|
||||
nsCOMPtr<nsIDocument> mDocument;
|
||||
|
@ -573,7 +564,7 @@ protected:
|
|||
*/
|
||||
nsIAtom* mARIAAttrOldValue;
|
||||
|
||||
nsTArray<nsRefPtr<nsDocAccessible> > mChildDocuments;
|
||||
nsTArray<nsRefPtr<DocAccessible> > mChildDocuments;
|
||||
|
||||
/**
|
||||
* Whether we support nsIAccessibleCursorable, used when querying the interface.
|
||||
|
@ -630,11 +621,11 @@ private:
|
|||
nsIPresShell* mPresShell;
|
||||
};
|
||||
|
||||
inline nsDocAccessible*
|
||||
nsAccessible::AsDoc()
|
||||
inline DocAccessible*
|
||||
Accessible::AsDoc()
|
||||
{
|
||||
return mFlags & eDocAccessible ?
|
||||
static_cast<nsDocAccessible*>(this) : nsnull;
|
||||
static_cast<DocAccessible*>(this) : nsnull;
|
||||
}
|
||||
|
||||
#endif
|
|
@ -37,7 +37,7 @@ NS_IMPL_QUERY_INTERFACE_INHERITED1(ProgressMeterAccessible<Max>,
|
|||
nsIAccessibleValue)
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// nsAccessible
|
||||
// Accessible
|
||||
|
||||
template<int Max>
|
||||
role
|
||||
|
@ -180,7 +180,7 @@ ProgressMeterAccessible<Max>::SetCurrentValue(double aValue)
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
RadioButtonAccessible::
|
||||
RadioButtonAccessible(nsIContent* aContent, nsDocAccessible* aDoc) :
|
||||
RadioButtonAccessible(nsIContent* aContent, DocAccessible* aDoc) :
|
||||
nsLeafAccessible(aContent, aDoc)
|
||||
{
|
||||
}
|
||||
|
|
|
@ -18,7 +18,7 @@ template<int Max>
|
|||
class ProgressMeterAccessible : public nsLeafAccessible
|
||||
{
|
||||
public:
|
||||
ProgressMeterAccessible(nsIContent* aContent, nsDocAccessible* aDoc) :
|
||||
ProgressMeterAccessible(nsIContent* aContent, DocAccessible* aDoc) :
|
||||
nsLeafAccessible(aContent, aDoc)
|
||||
{
|
||||
}
|
||||
|
@ -26,7 +26,7 @@ public:
|
|||
NS_DECL_ISUPPORTS_INHERITED
|
||||
NS_DECL_NSIACCESSIBLEVALUE
|
||||
|
||||
// nsAccessible
|
||||
// Accessible
|
||||
virtual void Value(nsString& aValue);
|
||||
virtual mozilla::a11y::role NativeRole();
|
||||
virtual PRUint64 NativeState();
|
||||
|
@ -42,13 +42,13 @@ class RadioButtonAccessible : public nsLeafAccessible
|
|||
{
|
||||
|
||||
public:
|
||||
RadioButtonAccessible(nsIContent* aContent, nsDocAccessible* aDoc);
|
||||
RadioButtonAccessible(nsIContent* aContent, DocAccessible* aDoc);
|
||||
|
||||
// nsIAccessible
|
||||
NS_IMETHOD GetActionName(PRUint8 aIndex, nsAString& aName);
|
||||
NS_IMETHOD DoAction(PRUint8 aIndex);
|
||||
|
||||
// nsAccessible
|
||||
// Accessible
|
||||
virtual mozilla::a11y::role NativeRole();
|
||||
|
||||
// ActionAccessible
|
||||
|
|
|
@ -15,12 +15,20 @@ LIBXUL_LIBRARY = 1
|
|||
|
||||
|
||||
CPPSRCS = \
|
||||
Accessible.cpp \
|
||||
ApplicationAccessible.cpp \
|
||||
ARIAGridAccessible.cpp \
|
||||
DocAccessible.cpp \
|
||||
FormControlAccessible.cpp \
|
||||
OuterDocAccessible.cpp \
|
||||
RootAccessible.cpp \
|
||||
TextLeafAccessible.cpp \
|
||||
$(NULL)
|
||||
EXPORTS_NAMESPACES = mozilla/a11y
|
||||
|
||||
EXPORTS_mozilla/a11y = \
|
||||
Accessible.h \
|
||||
$(null)
|
||||
|
||||
# we don't want the shared lib, but we want to force the creation of a static lib.
|
||||
FORCE_STATIC_LIB = 1
|
||||
|
|
|
@ -6,10 +6,14 @@
|
|||
#include "OuterDocAccessible.h"
|
||||
|
||||
#include "nsAccUtils.h"
|
||||
#include "nsDocAccessible.h"
|
||||
#include "DocAccessible.h"
|
||||
#include "Role.h"
|
||||
#include "States.h"
|
||||
|
||||
#ifdef DEBUG
|
||||
#include "Logging.h"
|
||||
#endif
|
||||
|
||||
using namespace mozilla;
|
||||
using namespace mozilla::a11y;
|
||||
|
||||
|
@ -18,8 +22,8 @@ using namespace mozilla::a11y;
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
OuterDocAccessible::
|
||||
OuterDocAccessible(nsIContent* aContent, nsDocAccessible* aDoc) :
|
||||
nsAccessibleWrap(aContent, aDoc)
|
||||
OuterDocAccessible(nsIContent* aContent, DocAccessible* aDoc) :
|
||||
AccessibleWrap(aContent, aDoc)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -31,10 +35,10 @@ OuterDocAccessible::~OuterDocAccessible()
|
|||
// nsISupports
|
||||
|
||||
NS_IMPL_ISUPPORTS_INHERITED0(OuterDocAccessible,
|
||||
nsAccessible)
|
||||
Accessible)
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// nsAccessible public (DON'T add methods here)
|
||||
// Accessible public (DON'T add methods here)
|
||||
|
||||
role
|
||||
OuterDocAccessible::NativeRole()
|
||||
|
@ -42,7 +46,7 @@ OuterDocAccessible::NativeRole()
|
|||
return roles::INTERNAL_FRAME;
|
||||
}
|
||||
|
||||
nsAccessible*
|
||||
Accessible*
|
||||
OuterDocAccessible::ChildAtPoint(PRInt32 aX, PRInt32 aY,
|
||||
EWhichChildAtPoint aWhichChild)
|
||||
{
|
||||
|
@ -55,7 +59,7 @@ OuterDocAccessible::ChildAtPoint(PRInt32 aX, PRInt32 aY,
|
|||
|
||||
// Always return the inner doc as direct child accessible unless bounds
|
||||
// outside of it.
|
||||
nsAccessible* child = GetChildAt(0);
|
||||
Accessible* child = GetChildAt(0);
|
||||
NS_ENSURE_TRUE(child, nsnull);
|
||||
|
||||
if (aWhichChild == eDeepestChild)
|
||||
|
@ -73,7 +77,7 @@ OuterDocAccessible::GetAttributesInternal(nsIPersistentProperties* aAttributes)
|
|||
// override the other attributes
|
||||
return NS_OK;
|
||||
}
|
||||
return nsAccessible::GetAttributesInternal(aAttributes);
|
||||
return Accessible::GetAttributesInternal(aAttributes);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -119,21 +123,29 @@ OuterDocAccessible::Shutdown()
|
|||
// change however the presshell of underlying document isn't destroyed and
|
||||
// the document doesn't get pagehide events. Shutdown underlying document if
|
||||
// any to avoid hanging document accessible.
|
||||
NS_LOG_ACCDOCDESTROY_MSG("A11y outerdoc shutdown")
|
||||
NS_LOG_ACCDOCDESTROY_ACCADDRESS("outerdoc", this)
|
||||
#ifdef DEBUG
|
||||
if (logging::IsEnabled(logging::eDocDestroy)) {
|
||||
logging::Msg("A11y outerdoc shutdown");
|
||||
logging::Address("outerdoc", this);
|
||||
}
|
||||
#endif
|
||||
|
||||
nsAccessible* childAcc = mChildren.SafeElementAt(0, nsnull);
|
||||
Accessible* childAcc = mChildren.SafeElementAt(0, nsnull);
|
||||
if (childAcc) {
|
||||
NS_LOG_ACCDOCDESTROY("outerdoc's child document shutdown",
|
||||
childAcc->GetDocumentNode())
|
||||
#ifdef DEBUG
|
||||
if (logging::IsEnabled(logging::eDocDestroy)) {
|
||||
logging::DocDestroy("outerdoc's child document shutdown",
|
||||
childAcc->GetDocumentNode());
|
||||
}
|
||||
#endif
|
||||
childAcc->Shutdown();
|
||||
}
|
||||
|
||||
nsAccessibleWrap::Shutdown();
|
||||
AccessibleWrap::Shutdown();
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// nsAccessible public
|
||||
// Accessible public
|
||||
|
||||
void
|
||||
OuterDocAccessible::InvalidateChildren()
|
||||
|
@ -151,7 +163,7 @@ OuterDocAccessible::InvalidateChildren()
|
|||
}
|
||||
|
||||
bool
|
||||
OuterDocAccessible::AppendChild(nsAccessible* aAccessible)
|
||||
OuterDocAccessible::AppendChild(Accessible* aAccessible)
|
||||
{
|
||||
// We keep showing the old document for a bit after creating the new one,
|
||||
// and while building the new DOM and frame tree. That's done on purpose
|
||||
|
@ -161,30 +173,38 @@ OuterDocAccessible::AppendChild(nsAccessible* aAccessible)
|
|||
if (mChildren.Length())
|
||||
mChildren[0]->Shutdown();
|
||||
|
||||
if (!nsAccessibleWrap::AppendChild(aAccessible))
|
||||
if (!AccessibleWrap::AppendChild(aAccessible))
|
||||
return false;
|
||||
|
||||
NS_LOG_ACCDOCCREATE("append document to outerdoc",
|
||||
aAccessible->GetDocumentNode())
|
||||
NS_LOG_ACCDOCCREATE_ACCADDRESS("outerdoc", this)
|
||||
#ifdef DEBUG
|
||||
if (logging::IsEnabled(logging::eDocCreate)) {
|
||||
logging::DocCreate("append document to outerdoc",
|
||||
aAccessible->GetDocumentNode());
|
||||
logging::Address("outerdoc", this);
|
||||
}
|
||||
#endif
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool
|
||||
OuterDocAccessible::RemoveChild(nsAccessible* aAccessible)
|
||||
OuterDocAccessible::RemoveChild(Accessible* aAccessible)
|
||||
{
|
||||
nsAccessible* child = mChildren.SafeElementAt(0, nsnull);
|
||||
Accessible* child = mChildren.SafeElementAt(0, nsnull);
|
||||
if (child != aAccessible) {
|
||||
NS_ERROR("Wrong child to remove!");
|
||||
return false;
|
||||
}
|
||||
|
||||
NS_LOG_ACCDOCDESTROY_FOR("remove document from outerdoc",
|
||||
child->GetDocumentNode(), child)
|
||||
NS_LOG_ACCDOCDESTROY_ACCADDRESS("outerdoc", this)
|
||||
#ifdef DEBUG
|
||||
if (logging::IsEnabled(logging::eDocDestroy)) {
|
||||
logging::DocDestroy("remove document from outerdoc", child->GetDocumentNode(),
|
||||
child->AsDoc());
|
||||
logging::Address("outerdoc", this);
|
||||
}
|
||||
#endif
|
||||
|
||||
bool wasRemoved = nsAccessibleWrap::RemoveChild(child);
|
||||
bool wasRemoved = AccessibleWrap::RemoveChild(child);
|
||||
|
||||
NS_ASSERTION(!mChildren.Length(),
|
||||
"This child document of outerdoc accessible wasn't removed!");
|
||||
|
@ -194,7 +214,7 @@ OuterDocAccessible::RemoveChild(nsAccessible* aAccessible)
|
|||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// nsAccessible protected
|
||||
// Accessible protected
|
||||
|
||||
void
|
||||
OuterDocAccessible::CacheChildren()
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
#ifndef MOZILLA_A11Y_OUTERDOCACCESSIBLE_H_
|
||||
#define MOZILLA_A11Y_OUTERDOCACCESSIBLE_H_
|
||||
|
||||
#include "nsAccessibleWrap.h"
|
||||
#include "AccessibleWrap.h"
|
||||
|
||||
namespace mozilla {
|
||||
namespace a11y {
|
||||
|
@ -15,15 +15,15 @@ namespace a11y {
|
|||
* Used for <browser>, <frame>, <iframe>, <page> or editor> elements.
|
||||
*
|
||||
* In these variable names, "outer" relates to the OuterDocAccessible as
|
||||
* opposed to the nsDocAccessibleWrap which is "inner". The outer node is
|
||||
* opposed to the DocAccessibleWrap which is "inner". The outer node is
|
||||
* a something like tags listed above, whereas the inner node corresponds to
|
||||
* the inner document root.
|
||||
*/
|
||||
|
||||
class OuterDocAccessible : public nsAccessibleWrap
|
||||
class OuterDocAccessible : public AccessibleWrap
|
||||
{
|
||||
public:
|
||||
OuterDocAccessible(nsIContent* aContent, nsDocAccessible* aDoc);
|
||||
OuterDocAccessible(nsIContent* aContent, DocAccessible* aDoc);
|
||||
virtual ~OuterDocAccessible();
|
||||
|
||||
NS_DECL_ISUPPORTS_INHERITED
|
||||
|
@ -36,21 +36,21 @@ public:
|
|||
// nsAccessNode
|
||||
virtual void Shutdown();
|
||||
|
||||
// nsAccessible
|
||||
// Accessible
|
||||
virtual mozilla::a11y::role NativeRole();
|
||||
virtual nsresult GetAttributesInternal(nsIPersistentProperties *aAttributes);
|
||||
virtual nsAccessible* ChildAtPoint(PRInt32 aX, PRInt32 aY,
|
||||
EWhichChildAtPoint aWhichChild);
|
||||
virtual Accessible* ChildAtPoint(PRInt32 aX, PRInt32 aY,
|
||||
EWhichChildAtPoint aWhichChild);
|
||||
|
||||
virtual void InvalidateChildren();
|
||||
virtual bool AppendChild(nsAccessible *aAccessible);
|
||||
virtual bool RemoveChild(nsAccessible *aAccessible);
|
||||
virtual bool AppendChild(Accessible* aAccessible);
|
||||
virtual bool RemoveChild(Accessible* aAccessible);
|
||||
|
||||
// ActionAccessible
|
||||
virtual PRUint8 ActionCount();
|
||||
|
||||
protected:
|
||||
// nsAccessible
|
||||
// Accessible
|
||||
virtual void CacheChildren();
|
||||
};
|
||||
|
||||
|
|
|
@ -61,7 +61,7 @@ using namespace mozilla::a11y;
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
// nsISupports
|
||||
|
||||
NS_IMPL_ISUPPORTS_INHERITED1(RootAccessible, nsDocAccessible, nsIAccessibleDocument)
|
||||
NS_IMPL_ISUPPORTS_INHERITED1(RootAccessible, DocAccessible, nsIAccessibleDocument)
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// Constructor/destructor
|
||||
|
@ -69,7 +69,7 @@ NS_IMPL_ISUPPORTS_INHERITED1(RootAccessible, nsDocAccessible, nsIAccessibleDocum
|
|||
RootAccessible::
|
||||
RootAccessible(nsIDocument* aDocument, nsIContent* aRootContent,
|
||||
nsIPresShell* aPresShell) :
|
||||
nsDocAccessibleWrap(aDocument, aRootContent, aPresShell)
|
||||
DocAccessibleWrap(aDocument, aRootContent, aPresShell)
|
||||
{
|
||||
mFlags |= eRootAccessible;
|
||||
}
|
||||
|
@ -79,7 +79,7 @@ RootAccessible::~RootAccessible()
|
|||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// nsAccessible
|
||||
// Accessible
|
||||
|
||||
ENameValueFlag
|
||||
RootAccessible::Name(nsString& aName)
|
||||
|
@ -87,7 +87,7 @@ RootAccessible::Name(nsString& aName)
|
|||
aName.Truncate();
|
||||
|
||||
if (mRoleMapEntry) {
|
||||
nsAccessible::Name(aName);
|
||||
Accessible::Name(aName);
|
||||
if (!aName.IsEmpty())
|
||||
return eNameOK;
|
||||
}
|
||||
|
@ -107,7 +107,7 @@ RootAccessible::NativeRole()
|
|||
rootElm->Tag() == nsGkAtoms::wizard))
|
||||
return roles::DIALOG;
|
||||
|
||||
return nsDocAccessibleWrap::NativeRole();
|
||||
return DocAccessibleWrap::NativeRole();
|
||||
}
|
||||
|
||||
// RootAccessible protected member
|
||||
|
@ -137,7 +137,7 @@ RootAccessible::GetChromeFlags()
|
|||
PRUint64
|
||||
RootAccessible::NativeState()
|
||||
{
|
||||
PRUint64 state = nsDocAccessibleWrap::NativeState();
|
||||
PRUint64 state = DocAccessibleWrap::NativeState();
|
||||
if (state & states::DEFUNCT)
|
||||
return state;
|
||||
|
||||
|
@ -213,7 +213,7 @@ RootAccessible::AddEventListeners()
|
|||
mCaretAccessible = new nsCaretAccessible(this);
|
||||
}
|
||||
|
||||
return nsDocAccessible::AddEventListeners();
|
||||
return DocAccessible::AddEventListeners();
|
||||
}
|
||||
|
||||
nsresult
|
||||
|
@ -231,7 +231,7 @@ RootAccessible::RemoveEventListeners()
|
|||
|
||||
// Do this before removing clearing caret accessible, so that it can use
|
||||
// shutdown the caret accessible's selection listener
|
||||
nsDocAccessible::RemoveEventListeners();
|
||||
DocAccessible::RemoveEventListeners();
|
||||
|
||||
if (mCaretAccessible) {
|
||||
mCaretAccessible->Shutdown();
|
||||
|
@ -251,7 +251,7 @@ RootAccessible::GetCaretAccessible()
|
|||
}
|
||||
|
||||
void
|
||||
RootAccessible::DocumentActivated(nsDocAccessible* aDocument)
|
||||
RootAccessible::DocumentActivated(DocAccessible* aDocument)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -268,7 +268,7 @@ RootAccessible::HandleEvent(nsIDOMEvent* aDOMEvent)
|
|||
if (!origTargetNode)
|
||||
return NS_OK;
|
||||
|
||||
nsDocAccessible* document =
|
||||
DocAccessible* document =
|
||||
GetAccService()->GetDocAccessible(origTargetNode->OwnerDoc());
|
||||
|
||||
if (document) {
|
||||
|
@ -320,11 +320,11 @@ RootAccessible::ProcessDOMEvent(nsIDOMEvent* aDOMEvent)
|
|||
return;
|
||||
}
|
||||
|
||||
nsDocAccessible* targetDocument = GetAccService()->
|
||||
DocAccessible* targetDocument = GetAccService()->
|
||||
GetDocAccessible(origTargetNode->OwnerDoc());
|
||||
NS_ASSERTION(targetDocument, "No document while accessible is in document?!");
|
||||
|
||||
nsAccessible* accessible =
|
||||
Accessible* accessible =
|
||||
targetDocument->GetAccessibleOrContainer(origTargetNode);
|
||||
if (!accessible)
|
||||
return;
|
||||
|
@ -379,7 +379,7 @@ RootAccessible::ProcessDOMEvent(nsIDOMEvent* aDOMEvent)
|
|||
return;
|
||||
}
|
||||
|
||||
nsAccessible* treeItemAcc = nsnull;
|
||||
Accessible* treeItemAcc = nsnull;
|
||||
#ifdef MOZ_XUL
|
||||
// If it's a tree element, need the currently selected item.
|
||||
if (treeAcc) {
|
||||
|
@ -447,7 +447,7 @@ RootAccessible::ProcessDOMEvent(nsIDOMEvent* aDOMEvent)
|
|||
// unique widget that may acquire focus from autocomplete popup while popup
|
||||
// stays open and has no active item. In case of XUL tree autocomplete
|
||||
// popup this event is fired for tree accessible.
|
||||
nsAccessible* widget =
|
||||
Accessible* widget =
|
||||
accessible->IsWidget() ? accessible : accessible->ContainerWidget();
|
||||
if (widget && widget->IsAutoCompletePopup()) {
|
||||
FocusMgr()->ActiveItemChanged(nsnull);
|
||||
|
@ -464,7 +464,7 @@ RootAccessible::ProcessDOMEvent(nsIDOMEvent* aDOMEvent)
|
|||
// (can be a case of menubar activation from keyboard) then ignore this
|
||||
// notification because later we'll receive DOMMenuItemActive event after
|
||||
// current menuitem is set.
|
||||
nsAccessible* activeItem = accessible->CurrentItem();
|
||||
Accessible* activeItem = accessible->CurrentItem();
|
||||
if (activeItem) {
|
||||
FocusMgr()->ActiveItemChanged(activeItem);
|
||||
A11YDEBUG_FOCUS_ACTIVEITEMCHANGE_CAUSE("DOMMenuBarActive", accessible)
|
||||
|
@ -501,7 +501,7 @@ RootAccessible::Shutdown()
|
|||
if (!PresShell())
|
||||
return; // Already shutdown
|
||||
|
||||
nsDocAccessibleWrap::Shutdown();
|
||||
DocAccessibleWrap::Shutdown();
|
||||
}
|
||||
|
||||
// nsIAccessible method
|
||||
|
@ -509,7 +509,7 @@ Relation
|
|||
RootAccessible::RelationByType(PRUint32 aType)
|
||||
{
|
||||
if (!mDocument || aType != nsIAccessibleRelation::RELATION_EMBEDS)
|
||||
return nsDocAccessibleWrap::RelationByType(aType);
|
||||
return DocAccessibleWrap::RelationByType(aType);
|
||||
|
||||
nsIDOMWindow* rootWindow = mDocument->GetWindow();
|
||||
if (rootWindow) {
|
||||
|
@ -521,7 +521,7 @@ RootAccessible::RelationByType(PRUint32 aType)
|
|||
nsCOMPtr<nsIDocument> contentDocumentNode =
|
||||
do_QueryInterface(contentDOMDocument);
|
||||
if (contentDocumentNode) {
|
||||
nsDocAccessible* contentDocument =
|
||||
DocAccessible* contentDocument =
|
||||
GetAccService()->GetDocAccessible(contentDocumentNode);
|
||||
if (contentDocument)
|
||||
return Relation(contentDocument);
|
||||
|
@ -536,7 +536,7 @@ RootAccessible::RelationByType(PRUint32 aType)
|
|||
// Protected members
|
||||
|
||||
void
|
||||
RootAccessible::HandlePopupShownEvent(nsAccessible* aAccessible)
|
||||
RootAccessible::HandlePopupShownEvent(Accessible* aAccessible)
|
||||
{
|
||||
roles::Role role = aAccessible->Role();
|
||||
|
||||
|
@ -558,7 +558,7 @@ RootAccessible::HandlePopupShownEvent(nsAccessible* aAccessible)
|
|||
|
||||
if (role == roles::COMBOBOX_LIST) {
|
||||
// Fire expanded state change event for comboboxes and autocompeletes.
|
||||
nsAccessible* combobox = aAccessible->Parent();
|
||||
Accessible* combobox = aAccessible->Parent();
|
||||
if (!combobox)
|
||||
return;
|
||||
|
||||
|
@ -579,19 +579,19 @@ RootAccessible::HandlePopupHidingEvent(nsINode* aPopupNode)
|
|||
// Get popup accessible. There are cases when popup element isn't accessible
|
||||
// but an underlying widget is and behaves like popup, an example is
|
||||
// autocomplete popups.
|
||||
nsDocAccessible* document = nsAccUtils::GetDocAccessibleFor(aPopupNode);
|
||||
DocAccessible* document = nsAccUtils::GetDocAccessibleFor(aPopupNode);
|
||||
if (!document)
|
||||
return;
|
||||
|
||||
nsAccessible* popup = document->GetAccessible(aPopupNode);
|
||||
Accessible* popup = document->GetAccessible(aPopupNode);
|
||||
if (!popup) {
|
||||
nsAccessible* popupContainer = document->GetContainerAccessible(aPopupNode);
|
||||
Accessible* popupContainer = document->GetContainerAccessible(aPopupNode);
|
||||
if (!popupContainer)
|
||||
return;
|
||||
|
||||
PRInt32 childCount = popupContainer->GetChildCount();
|
||||
for (PRInt32 idx = 0; idx < childCount; idx++) {
|
||||
nsAccessible* child = popupContainer->GetChildAt(idx);
|
||||
PRUint32 childCount = popupContainer->ChildCount();
|
||||
for (PRUint32 idx = 0; idx < childCount; idx++) {
|
||||
Accessible* child = popupContainer->GetChildAt(idx);
|
||||
if (child->IsAutoCompletePopup()) {
|
||||
popup = child;
|
||||
break;
|
||||
|
@ -617,7 +617,7 @@ RootAccessible::HandlePopupHidingEvent(nsINode* aPopupNode)
|
|||
// HTML select is target of popuphidding event. Otherwise get container
|
||||
// widget. No container widget means this is either tooltip or menupopup.
|
||||
// No events in the former case.
|
||||
nsAccessible* widget = nsnull;
|
||||
Accessible* widget = nsnull;
|
||||
if (popup->IsCombobox()) {
|
||||
widget = popup;
|
||||
} else {
|
||||
|
@ -645,7 +645,7 @@ RootAccessible::HandlePopupHidingEvent(nsINode* aPopupNode)
|
|||
|
||||
} else if (widget->IsMenuButton()) {
|
||||
// Can be a part of autocomplete.
|
||||
nsAccessible* compositeWidget = widget->ContainerWidget();
|
||||
Accessible* compositeWidget = widget->ContainerWidget();
|
||||
if (compositeWidget && compositeWidget->IsAutoComplete()) {
|
||||
widget = compositeWidget;
|
||||
notifyOf = kNotifyOfState;
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
#define mozilla_a11y_RootAccessible_h__
|
||||
|
||||
#include "nsCaretAccessible.h"
|
||||
#include "nsDocAccessibleWrap.h"
|
||||
#include "DocAccessibleWrap.h"
|
||||
|
||||
|
||||
#include "nsHashtable.h"
|
||||
|
@ -21,7 +21,7 @@ class Relation;
|
|||
namespace mozilla {
|
||||
namespace a11y {
|
||||
|
||||
class RootAccessible : public nsDocAccessibleWrap,
|
||||
class RootAccessible : public DocAccessibleWrap,
|
||||
public nsIDOMEventListener
|
||||
{
|
||||
NS_DECL_ISUPPORTS_INHERITED
|
||||
|
@ -37,7 +37,7 @@ public:
|
|||
// nsAccessNode
|
||||
virtual void Shutdown();
|
||||
|
||||
// nsAccessible
|
||||
// Accessible
|
||||
virtual mozilla::a11y::ENameValueFlag Name(nsString& aName);
|
||||
virtual Relation RelationByType(PRUint32 aType);
|
||||
virtual mozilla::a11y::role NativeRole();
|
||||
|
@ -49,7 +49,7 @@ public:
|
|||
/**
|
||||
* Notify that the sub document presshell was activated.
|
||||
*/
|
||||
virtual void DocumentActivated(nsDocAccessible* aDocument);
|
||||
virtual void DocumentActivated(DocAccessible* aDocument);
|
||||
|
||||
protected:
|
||||
|
||||
|
@ -67,7 +67,7 @@ protected:
|
|||
/**
|
||||
* Process "popupshown" event. Used by HandleEvent().
|
||||
*/
|
||||
void HandlePopupShownEvent(nsAccessible* aAccessible);
|
||||
void HandlePopupShownEvent(Accessible* aAccessible);
|
||||
|
||||
/*
|
||||
* Process "popuphiding" event. Used by HandleEvent().
|
||||
|
@ -90,7 +90,7 @@ protected:
|
|||
} // namespace mozilla
|
||||
|
||||
inline mozilla::a11y::RootAccessible*
|
||||
nsAccessible::AsRoot()
|
||||
Accessible::AsRoot()
|
||||
{
|
||||
return mFlags & eRootAccessible ?
|
||||
static_cast<mozilla::a11y::RootAccessible*>(this) : nsnull;
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
#include "nsTArray.h"
|
||||
#include "prtypes.h"
|
||||
|
||||
class nsAccessible;
|
||||
class Accessible;
|
||||
|
||||
namespace mozilla {
|
||||
namespace a11y {
|
||||
|
@ -26,7 +26,7 @@ public:
|
|||
/**
|
||||
* Return the caption accessible if any for this table.
|
||||
*/
|
||||
virtual nsAccessible* Caption() { return nsnull; }
|
||||
virtual Accessible* Caption() { return nsnull; }
|
||||
|
||||
/**
|
||||
* Get the summary for this table.
|
||||
|
@ -46,7 +46,7 @@ public:
|
|||
/**
|
||||
* Return the accessible for the cell at the given row and column indices.
|
||||
*/
|
||||
virtual nsAccessible* CellAt(PRUint32 aRowIdx, PRUint32 aColIdx) { return nsnull; }
|
||||
virtual Accessible* CellAt(PRUint32 aRowIdx, PRUint32 aColIdx) { return nsnull; }
|
||||
|
||||
/**
|
||||
* Return the index of the cell at the given row and column.
|
||||
|
@ -127,7 +127,7 @@ public:
|
|||
/**
|
||||
* Get the set of selected cells.
|
||||
*/
|
||||
virtual void SelectedCells(nsTArray<nsAccessible*>* aCells) {}
|
||||
virtual void SelectedCells(nsTArray<Accessible*>* aCells) {}
|
||||
|
||||
/**
|
||||
* Get the set of selected column indices.
|
||||
|
|
|
@ -0,0 +1,70 @@
|
|||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* 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 "TextLeafAccessible.h"
|
||||
|
||||
#include "nsAccUtils.h"
|
||||
#include "DocAccessible.h"
|
||||
#include "Role.h"
|
||||
|
||||
using namespace mozilla::a11y;
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// TextLeafAccessible
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
TextLeafAccessible::
|
||||
TextLeafAccessible(nsIContent* aContent, DocAccessible* aDoc) :
|
||||
nsLinkableAccessible(aContent, aDoc)
|
||||
{
|
||||
mFlags |= eTextLeafAccessible;
|
||||
}
|
||||
|
||||
TextLeafAccessible::~TextLeafAccessible()
|
||||
{
|
||||
}
|
||||
|
||||
role
|
||||
TextLeafAccessible::NativeRole()
|
||||
{
|
||||
nsIFrame* frame = GetFrame();
|
||||
if (frame && frame->IsGeneratedContentFrame())
|
||||
return roles::STATICTEXT;
|
||||
|
||||
return roles::TEXT_LEAF;
|
||||
}
|
||||
|
||||
void
|
||||
TextLeafAccessible::AppendTextTo(nsAString& aText, PRUint32 aStartOffset,
|
||||
PRUint32 aLength)
|
||||
{
|
||||
aText.Append(Substring(mText, aStartOffset, aLength));
|
||||
}
|
||||
|
||||
ENameValueFlag
|
||||
TextLeafAccessible::Name(nsString& aName)
|
||||
{
|
||||
// Text node, ARIA can't be used.
|
||||
aName = mText;
|
||||
return eNameOK;
|
||||
}
|
||||
|
||||
nsresult
|
||||
TextLeafAccessible::GetAttributesInternal(nsIPersistentProperties *aAttributes)
|
||||
{
|
||||
if (NativeRole() == roles::STATICTEXT) {
|
||||
nsAutoString oldValueUnused;
|
||||
aAttributes->SetStringProperty(NS_LITERAL_CSTRING("auto-generated"),
|
||||
NS_LITERAL_STRING("true"), oldValueUnused);
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
void
|
||||
TextLeafAccessible::CacheChildren()
|
||||
{
|
||||
// No children for text accessible.
|
||||
}
|
|
@ -3,45 +3,53 @@
|
|||
* 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 _nsTextAccessible_H_
|
||||
#define _nsTextAccessible_H_
|
||||
#ifndef mozilla_a11y_TextLeafAccessible_h__
|
||||
#define mozilla_a11y_TextLeafAccessible_h__
|
||||
|
||||
#include "nsBaseWidgetAccessible.h"
|
||||
|
||||
namespace mozilla {
|
||||
namespace a11y {
|
||||
|
||||
/**
|
||||
* Generic class used for text nodes.
|
||||
*/
|
||||
class nsTextAccessible : public nsLinkableAccessible
|
||||
class TextLeafAccessible : public nsLinkableAccessible
|
||||
{
|
||||
public:
|
||||
nsTextAccessible(nsIContent* aContent, nsDocAccessible* aDoc);
|
||||
TextLeafAccessible(nsIContent* aContent, DocAccessible* aDoc);
|
||||
virtual ~TextLeafAccessible();
|
||||
|
||||
// nsAccessible
|
||||
// Accessible
|
||||
virtual mozilla::a11y::role NativeRole();
|
||||
virtual void AppendTextTo(nsAString& aText, PRUint32 aStartOffset = 0,
|
||||
PRUint32 aLength = PR_UINT32_MAX);
|
||||
virtual ENameValueFlag Name(nsString& aName);
|
||||
virtual nsresult GetAttributesInternal(nsIPersistentProperties* aAttributes);
|
||||
|
||||
// nsTextAccessible
|
||||
// TextLeafAccessible
|
||||
void SetText(const nsAString& aText) { mText = aText; }
|
||||
const nsString& Text() const { return mText; }
|
||||
|
||||
protected:
|
||||
// nsAccessible
|
||||
// Accessible
|
||||
virtual void CacheChildren();
|
||||
|
||||
protected:
|
||||
nsString mText;
|
||||
};
|
||||
|
||||
} // namespace a11y
|
||||
} // namespace mozilla
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// nsAccessible downcast method
|
||||
// Accessible downcast method
|
||||
|
||||
inline nsTextAccessible*
|
||||
nsAccessible::AsTextLeaf()
|
||||
inline mozilla::a11y::TextLeafAccessible*
|
||||
Accessible::AsTextLeaf()
|
||||
{
|
||||
return mFlags & eTextLeafAccessible ?
|
||||
static_cast<nsTextAccessible*>(this) : nsnull;
|
||||
static_cast<mozilla::a11y::TextLeafAccessible*>(this) : nsnull;
|
||||
}
|
||||
|
||||
#endif
|
Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше
Загрузка…
Ссылка в новой задаче