Merge last PGO-green changeset of mozilla-inbound to mozilla-central

This commit is contained in:
Ed Morley 2012-02-10 12:14:39 +00:00
Родитель caccff631a e187ede4e5
Коммит 8fa7a50766
298 изменённых файлов: 5573 добавлений и 4073 удалений

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

@ -71,8 +71,8 @@ public:
* @param aPresShell [in] the presentation shell which contains layout info
* for the DOM node
*/
virtual nsAccessible* GetAccessibleInShell(nsINode* aNode,
nsIPresShell* aPresShell) = 0;
virtual nsAccessible* GetAccessible(nsINode* aNode,
nsIPresShell* aPresShell) = 0;
/**
* Return root document accessible that is or contains a document accessible

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

@ -162,9 +162,9 @@ mai_atk_socket_get_extents(AtkComponent* aComponent,
}
AtkSocketAccessible::AtkSocketAccessible(nsIContent* aContent,
nsIWeakReference* aShell,
nsDocAccessible* aDoc,
const nsCString& aPlugId) :
nsAccessibleWrap(aContent, aShell)
nsAccessibleWrap(aContent, aDoc)
{
mAtkObject = mai_atk_socket_new(this);
if (!mAtkObject)

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

@ -72,7 +72,7 @@ public:
*/
static bool gCanEmbed;
AtkSocketAccessible(nsIContent* aContent, nsIWeakReference* aShell,
AtkSocketAccessible(nsIContent* aContent, nsDocAccessible* aDoc,
const nsCString& aPlugId);
// nsAccessNode

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

@ -55,8 +55,8 @@
//-----------------------------------------------------
nsAccessNodeWrap::
nsAccessNodeWrap(nsIContent *aContent, nsIWeakReference *aShell) :
nsAccessNode(aContent, aShell)
nsAccessNodeWrap(nsIContent* aContent, nsDocAccessible* aDoc) :
nsAccessNode(aContent, aDoc)
{
}

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

@ -49,12 +49,11 @@
class nsAccessNodeWrap : public nsAccessNode
{
public: // construction, destruction
nsAccessNodeWrap(nsIContent *aContent, nsIWeakReference *aShell);
virtual ~nsAccessNodeWrap();
static void InitAccessibility();
static void ShutdownAccessibility();
nsAccessNodeWrap(nsIContent* aContent, nsDocAccessible* aDoc);
virtual ~nsAccessNodeWrap();
static void InitAccessibility();
static void ShutdownAccessibility();
};
#endif

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

@ -281,8 +281,8 @@ PRInt32 nsAccessibleWrap::mAccWrapDeleted = 0;
#endif
nsAccessibleWrap::
nsAccessibleWrap(nsIContent *aContent, nsIWeakReference *aShell) :
nsAccessible(aContent, aShell), mAtkObject(nsnull)
nsAccessibleWrap(nsIContent* aContent, nsDocAccessible* aDoc) :
nsAccessible(aContent, aDoc), mAtkObject(nsnull)
{
#ifdef MAI_LOGGING
++mAccWrapCreated;
@ -362,7 +362,7 @@ NS_IMETHODIMP nsAccessibleWrap::GetNativeInterface(void **aOutAccessible)
*aOutAccessible = nsnull;
if (!mAtkObject) {
if (!mWeakShell || !nsAccUtils::IsEmbeddedObject(this)) {
if (IsDefunct() || !nsAccUtils::IsEmbeddedObject(this)) {
// We don't create ATK objects for node which has been shutdown, or
// nsIAccessible plain text leaves
return NS_ERROR_FAILURE;

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

@ -84,7 +84,7 @@ class MaiHyperlink;
class nsAccessibleWrap: public nsAccessible
{
public:
nsAccessibleWrap(nsIContent *aContent, nsIWeakReference *aShell);
nsAccessibleWrap(nsIContent* aContent, nsDocAccessible* aDoc);
virtual ~nsAccessibleWrap();
void ShutdownAtkObject();

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

@ -47,9 +47,9 @@
////////////////////////////////////////////////////////////////////////////////
nsDocAccessibleWrap::
nsDocAccessibleWrap(nsIDocument *aDocument, nsIContent *aRootContent,
nsIWeakReference *aShell) :
nsDocAccessible(aDocument, aRootContent, aShell), mActivated(false)
nsDocAccessibleWrap(nsIDocument* aDocument, nsIContent* aRootContent,
nsIPresShell* aPresShell) :
nsDocAccessible(aDocument, aRootContent, aPresShell), mActivated(false)
{
}

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

@ -50,8 +50,8 @@
class nsDocAccessibleWrap: public nsDocAccessible
{
public:
nsDocAccessibleWrap(nsIDocument *aDocument, nsIContent *aRootContent,
nsIWeakReference *aShell);
nsDocAccessibleWrap(nsIDocument* aDocument, nsIContent* aRootContent,
nsIPresShell* aPresShell);
virtual ~nsDocAccessibleWrap();
bool mActivated;

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

@ -139,7 +139,7 @@ NS_IMPL_CYCLE_COLLECTION_UNROOT_NATIVE(AccEvent, Release)
nsAccessible*
AccEvent::GetAccessibleForNode() const
{
return mNode ? GetAccService()->GetAccessible(mNode) : nsnull;
return mNode ? GetAccService()->GetAccessible(mNode, nsnull) : nsnull;
}
void

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

@ -344,7 +344,7 @@ nsAccessible*
IDRefsIterator::Next()
{
nsIContent* nextElm = NextElem();
return nextElm ? GetAccService()->GetAccessible(nextElm) : nsnull;
return nextElm ? GetAccService()->GetAccessible(nextElm, nsnull) : nsnull;
}
nsAccessible*

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

@ -63,8 +63,11 @@ FocusManager::FocusedAccessible() const
return mActiveItem;
nsINode* focusedNode = FocusedDOMNode();
if (focusedNode)
return GetAccService()->GetAccessibleOrContainer(focusedNode, nsnull);
if (focusedNode) {
nsDocAccessible* doc =
GetAccService()->GetDocAccessible(focusedNode->OwnerDoc());
return doc ? doc->GetAccessibleOrContainer(focusedNode) : nsnull;
}
return nsnull;
}
@ -84,8 +87,10 @@ 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 =
GetAccService()->GetDocAccessible(focusedNode->OwnerDoc());
return aAccessible ==
GetAccService()->GetAccessibleOrContainer(focusedNode, nsnull);
(doc ? doc->GetAccessibleOrContainer(focusedNode) : nsnull);
}
}
return false;
@ -209,7 +214,7 @@ FocusManager::ActiveItemChanged(nsAccessible* aItem, bool aCheckIfActive)
// DOM focus.
nsAccessible* target = FocusedAccessible();
if (target)
DispatchFocusEvent(target->GetDocAccessible(), target);
DispatchFocusEvent(target->Document(), target);
}
void
@ -251,11 +256,11 @@ FocusManager::ProcessDOMFocus(nsINode* aTarget)
GetAccService()->GetDocAccessible(aTarget->OwnerDoc());
nsAccessible* target = document->GetAccessibleOrContainer(aTarget);
if (target) {
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 =
GetAccService()->GetAccessibleOrContainer(FocusedDOMNode(), nsnull);
document->GetAccessibleOrContainer(FocusedDOMNode());
if (target != DOMFocus)
return;
@ -285,7 +290,8 @@ FocusManager::ProcessFocusEvent(AccEvent* aEvent)
// Check if still focused. Otherwise we can end up with storing the active
// item for control that isn't focused anymore.
nsAccessible* DOMFocus =
GetAccService()->GetAccessibleOrContainer(FocusedDOMNode(), nsnull);
GetAccService()->GetAccessibleOrContainer(FocusedDOMNode(),
aEvent->GetDocAccessible());
if (target != DOMFocus)
return;
@ -341,7 +347,7 @@ 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->GetDocAccessible();
nsDocAccessible* targetDocument = target->Document();
nsAccessible* anchorJump = targetDocument->AnchorJump();
if (anchorJump) {
if (target == targetDocument) {

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

@ -671,7 +671,7 @@ NotificationController::CreateTextChangeEventFor(AccMutationEvent* aEvent)
{
nsAccessible* container =
GetAccService()->GetContainerAccessible(aEvent->mNode,
aEvent->mAccessible->GetWeakShell());
aEvent->GetDocAccessible());
if (!container)
return;

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

@ -123,7 +123,7 @@ public:
inline void AppendTarget(nsIContent* aContent)
{
if (aContent)
AppendTarget(GetAccService()->GetAccessible(aContent));
AppendTarget(GetAccService()->GetAccessible(aContent, nsnull));
}
/**

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

@ -57,8 +57,8 @@ using namespace mozilla::a11y;
// Constructor
nsARIAGridAccessible::
nsARIAGridAccessible(nsIContent *aContent, nsIWeakReference *aShell) :
nsAccessibleWrap(aContent, aShell)
nsARIAGridAccessible(nsIContent* aContent, nsDocAccessible* aDoc) :
nsAccessibleWrap(aContent, aDoc)
{
}
@ -932,8 +932,8 @@ nsARIAGridAccessible::GetSelectedColumnsArray(PRUint32 *acolumnCount,
// Constructor
nsARIAGridCellAccessible::
nsARIAGridCellAccessible(nsIContent *aContent, nsIWeakReference *aShell) :
nsHyperTextAccessibleWrap(aContent, aShell)
nsARIAGridCellAccessible(nsIContent* aContent, nsDocAccessible* aDoc) :
nsHyperTextAccessibleWrap(aContent, aDoc)
{
}

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

@ -50,7 +50,7 @@ class nsARIAGridAccessible : public nsAccessibleWrap,
public nsIAccessibleTable
{
public:
nsARIAGridAccessible(nsIContent *aContent, nsIWeakReference *aShell);
nsARIAGridAccessible(nsIContent* aContent, nsDocAccessible* aDoc);
// nsISupports
NS_DECL_ISUPPORTS_INHERITED
@ -110,7 +110,7 @@ class nsARIAGridCellAccessible : public nsHyperTextAccessibleWrap,
public nsIAccessibleTableCell
{
public:
nsARIAGridCellAccessible(nsIContent *aContent, nsIWeakReference *aShell);
nsARIAGridCellAccessible(nsIContent* aContent, nsDocAccessible* aDoc);
// nsISupports
NS_DECL_ISUPPORTS_INHERITED

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

@ -381,9 +381,6 @@ nsAccDocManager::CreateDocOrRootAccessible(nsIDocument *aDocument)
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.
// GetAccessible() is bad because it doesn't support our concept of multiple
// presshells per doc. It should be changed to use
// GetAccessibleInWeakShell().
parentDocAcc = GetDocAccessible(aDocument->GetParentDocument());
NS_ASSERTION(parentDocAcc,
"Can't create an accessible for the document!");
@ -393,10 +390,9 @@ nsAccDocManager::CreateDocOrRootAccessible(nsIDocument *aDocument)
// We only create root accessibles for the true root, otherwise create a
// doc accessible.
nsCOMPtr<nsIWeakReference> weakShell(do_GetWeakReference(presShell));
nsRefPtr<nsDocAccessible> docAcc = isRootDoc ?
new nsRootAccessibleWrap(aDocument, rootElm, weakShell) :
new nsDocAccessibleWrap(aDocument, rootElm, weakShell);
new nsRootAccessibleWrap(aDocument, rootElm, presShell) :
new nsDocAccessibleWrap(aDocument, rootElm, presShell);
// Cache the document accessible into document cache.
if (!docAcc || !mDocAccessibleCache.Put(aDocument, docAcc))

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

@ -41,9 +41,9 @@
#include "nsAccessible.h"
#include "nsAccessibilityService.h"
#include "nsDocAccessible.h"
#include "nsINodeList.h"
#include "nsIPresShell.h"
////////////////////////////////////////////////////////////////////////////////
// WalkState
@ -65,9 +65,9 @@ struct WalkState
////////////////////////////////////////////////////////////////////////////////
nsAccTreeWalker::
nsAccTreeWalker(nsIWeakReference* aShell, nsIContent* aContent,
nsAccTreeWalker(nsDocAccessible* aDoc, nsIContent* aContent,
bool aWalkAnonContent, bool aWalkCache) :
mWeakShell(aShell), mWalkCache(aWalkCache), mState(nsnull)
mDoc(aDoc), mWalkCache(aWalkCache), mState(nsnull)
{
NS_ASSERTION(aContent, "No node for the accessible tree walker!");
@ -103,8 +103,6 @@ nsAccTreeWalker::NextChildInternal(bool aNoWalkUp)
if (!mState->childList)
mState->childList = mState->content->GetChildren(mChildFilter);
nsCOMPtr<nsIPresShell> presShell(do_QueryReferent(mWeakShell));
PRUint32 length = 0;
if (mState->childList)
mState->childList->GetLength(&length);
@ -114,10 +112,8 @@ nsAccTreeWalker::NextChildInternal(bool aNoWalkUp)
mState->childIdx++;
bool isSubtreeHidden = false;
nsAccessible* accessible = mWalkCache ?
GetAccService()->GetAccessibleInWeakShell(childNode, mWeakShell) :
GetAccService()->GetOrCreateAccessible(childNode, presShell, mWeakShell,
&isSubtreeHidden);
nsAccessible* accessible = mWalkCache ? mDoc->GetAccessible(childNode) :
GetAccService()->GetOrCreateAccessible(childNode, mDoc, &isSubtreeHidden);
if (accessible)
return accessible;

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

@ -42,9 +42,9 @@
#include "nsAutoPtr.h"
#include "nsIContent.h"
#include "nsIWeakReference.h"
class nsAccessible;
class nsDocAccessible;
struct WalkState;
/**
@ -53,7 +53,7 @@ struct WalkState;
class nsAccTreeWalker
{
public:
nsAccTreeWalker(nsIWeakReference *aShell, nsIContent *aNode,
nsAccTreeWalker(nsDocAccessible* aDoc, nsIContent* aNode,
bool aWalkAnonymousContent, bool aWalkCache = false);
virtual ~nsAccTreeWalker();
@ -93,7 +93,7 @@ private:
*/
void PopState();
nsCOMPtr<nsIWeakReference> mWeakShell;
nsDocAccessible* mDoc;
PRInt32 mChildFilter;
bool mWalkCache;
WalkState* mState;

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

@ -163,7 +163,7 @@ nsAccUtils::GetPositionAndSizeForXULSelectControlItem(nsIContent *aContent,
nsCOMPtr<nsINode> currNode(do_QueryInterface(currItem));
nsAccessible* itemAcc = currNode ?
GetAccService()->GetAccessible(currNode) : nsnull;
GetAccService()->GetAccessible(currNode, nsnull) : nsnull;
if (!itemAcc || itemAcc->State() & states::INVISIBLE) {
(*aSetSize)--;
@ -205,7 +205,7 @@ nsAccUtils::GetPositionAndSizeForXULContainerItem(nsIContent *aContent,
nsCOMPtr<nsINode> itemNode(do_QueryInterface(item));
nsAccessible* itemAcc = itemNode ?
GetAccService()->GetAccessible(itemNode) : nsnull;
GetAccService()->GetAccessible(itemNode, nsnull) : nsnull;
if (itemAcc) {
PRUint32 itemRole = Role(itemAcc);
@ -226,7 +226,7 @@ nsAccUtils::GetPositionAndSizeForXULContainerItem(nsIContent *aContent,
nsCOMPtr<nsINode> itemNode(do_QueryInterface(item));
nsAccessible* itemAcc =
itemNode ? GetAccService()->GetAccessible(itemNode) : nsnull;
itemNode ? GetAccService()->GetAccessible(itemNode, nsnull) : nsnull;
if (itemAcc) {
PRUint32 itemRole = Role(itemAcc);
@ -353,11 +353,11 @@ nsAccUtils::GetARIAToken(dom::Element* aElement, nsIAtom* aAttr)
return nsnull;
}
nsAccessible *
nsAccessible*
nsAccUtils::GetAncestorWithRole(nsAccessible *aDescendant, PRUint32 aRole)
{
nsAccessible *document = aDescendant->GetDocAccessible();
nsAccessible *parent = aDescendant;
nsAccessible* document = aDescendant->Document();
nsAccessible* parent = aDescendant;
while ((parent = parent->Parent())) {
PRUint32 testRole = parent->Role();
if (testRole == aRole)
@ -389,7 +389,7 @@ nsAccUtils::GetSelectableContainer(nsAccessible* aAccessible, PRUint64 aState)
nsAccessible*
nsAccUtils::GetMultiSelectableContainer(nsINode* aNode)
{
nsAccessible* accessible = GetAccService()->GetAccessible(aNode);
nsAccessible* accessible = GetAccService()->GetAccessible(aNode, nsnull);
if (accessible) {
nsAccessible* container = GetSelectableContainer(accessible,
accessible->State());
@ -425,11 +425,12 @@ nsAccUtils::GetTextAccessibleFromSelection(nsISelection* aSelection)
nsCOMPtr<nsINode> focusNode(do_QueryInterface(focusDOMNode));
nsCOMPtr<nsINode> resultNode =
nsCoreUtils::GetDOMNodeFromDOMPoint(focusNode, focusOffset);
nsCOMPtr<nsIWeakReference> weakShell(nsCoreUtils::GetWeakShellFor(resultNode));
// Get text accessible containing the result node.
nsAccessible* accessible =
GetAccService()->GetAccessibleOrContainer(resultNode, weakShell);
nsDocAccessible* doc =
GetAccService()->GetDocAccessible(resultNode->OwnerDoc());
nsAccessible* accessible = doc ?
doc->GetAccessibleOrContainer(resultNode) : nsnull;
if (!accessible) {
NS_NOTREACHED("No nsIAccessibleText for selection change event!");
return nsnull;
@ -525,9 +526,8 @@ nsAccUtils::GetScreenCoordsForWindow(nsAccessNode *aAccessNode)
nsIntPoint
nsAccUtils::GetScreenCoordsForParent(nsAccessNode *aAccessNode)
{
nsAccessible *parent =
GetAccService()->GetContainerAccessible(aAccessNode->GetNode(),
aAccessNode->GetWeakShell());
nsDocAccessible* document = aAccessNode->Document();
nsAccessible* parent = document->GetContainerAccessible(aAccessNode->GetNode());
if (!parent)
return nsIntPoint(0, 0);

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

@ -156,11 +156,10 @@ public:
/**
* Return document accessible for the given presshell.
*/
static nsDocAccessible *GetDocAccessibleFor(nsIWeakReference *aWeakShell)
static nsDocAccessible* GetDocAccessibleFor(const nsIPresShell* aPresShell)
{
nsCOMPtr<nsIPresShell> presShell(do_QueryReferent(aWeakShell));
return presShell ?
GetAccService()->GetDocAccessible(presShell->GetDocument()) : nsnull;
return aPresShell ?
GetAccService()->GetDocAccessible(aPresShell->GetDocument()) : nsnull;
}
/**

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

@ -89,8 +89,8 @@ NS_IMPL_CYCLE_COLLECTING_RELEASE_WITH_DESTROY(nsAccessNode, LastRelease())
// nsAccessNode construction/desctruction
nsAccessNode::
nsAccessNode(nsIContent *aContent, nsIWeakReference *aShell) :
mContent(aContent), mWeakShell(aShell)
nsAccessNode(nsIContent* aContent, nsDocAccessible* aDoc) :
mContent(aContent), mDoc(aDoc)
{
#ifdef DEBUG_A11Y
mIsInitialized = false;
@ -99,15 +99,15 @@ nsAccessNode::
nsAccessNode::~nsAccessNode()
{
NS_ASSERTION(!mWeakShell, "LastRelease was never called!?!");
NS_ASSERTION(!mDoc, "LastRelease was never called!?!");
}
void nsAccessNode::LastRelease()
{
// First cleanup if needed...
if (mWeakShell) {
if (mDoc) {
Shutdown();
NS_ASSERTION(!mWeakShell, "A Shutdown() impl forgot to call its parent's Shutdown?");
NS_ASSERTION(!mDoc, "A Shutdown() impl forgot to call its parent's Shutdown?");
}
// ... then die.
delete this;
@ -133,7 +133,7 @@ void
nsAccessNode::Shutdown()
{
mContent = nsnull;
mWeakShell = nsnull;
mDoc = nsnull;
}
nsApplicationAccessible*
@ -215,31 +215,15 @@ void nsAccessNode::ShutdownXPAccessibility()
NotifyA11yInitOrShutdown(false);
}
already_AddRefed<nsIPresShell>
nsAccessNode::GetPresShell()
{
nsIPresShell* presShell = nsnull;
if (mWeakShell)
CallQueryReferent(mWeakShell.get(), &presShell);
return presShell;
}
// nsAccessNode protected
nsPresContext* nsAccessNode::GetPresContext()
{
nsCOMPtr<nsIPresShell> presShell(GetPresShell());
if (!presShell) {
if (IsDefunct())
return nsnull;
}
return presShell->GetPresContext();
}
nsDocAccessible *
nsAccessNode::GetDocAccessible() const
{
return mContent ?
GetAccService()->GetDocAccessible(mContent->OwnerDoc()) : nsnull;
nsIPresShell* presShell(mDoc->PresShell());
return presShell ? presShell->GetPresContext() : nsnull;
}
nsRootAccessible*
@ -281,7 +265,7 @@ nsAccessNode::ScrollTo(PRUint32 aScrollType)
if (IsDefunct())
return;
nsCOMPtr<nsIPresShell> shell(GetPresShell());
nsIPresShell* shell = mDoc->PresShell();
if (!shell)
return;
@ -305,9 +289,7 @@ nsAccessNode::GetCurrentFocus()
{
// XXX: consider to use nsFocusManager directly, it allows us to avoid
// unnecessary query interface calls.
nsCOMPtr<nsIPresShell> shell = GetPresShell();
NS_ENSURE_TRUE(shell, nsnull);
nsIDocument *doc = shell->GetDocument();
nsIDocument* doc = GetDocumentNode();
NS_ENSURE_TRUE(doc, nsnull);
nsIDOMWindow* win = doc->GetWindow();

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

@ -71,7 +71,7 @@ class nsAccessNode: public nsISupports
{
public:
nsAccessNode(nsIContent *aContent, nsIWeakReference *aShell);
nsAccessNode(nsIContent* aContent, nsDocAccessible* aDoc);
virtual ~nsAccessNode();
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
@ -88,7 +88,7 @@ public:
/**
* Return the document accessible for this access node.
*/
nsDocAccessible *GetDocAccessible() const;
nsDocAccessible* Document() const { return mDoc; }
/**
* Return the root document accessible for this accessnode.
@ -147,16 +147,6 @@ public:
return GetNode() && GetNode()->IsNodeOfType(nsINode::eDOCUMENT);
}
/**
* Return the corresponding press shell for this accessible.
*/
already_AddRefed<nsIPresShell> GetPresShell();
/**
* Return presentation shell for the accessible.
*/
nsIWeakReference* GetWeakShell() const { return mWeakShell; }
/**
* Return the unique identifier of the accessible.
*/
@ -189,7 +179,7 @@ protected:
void LastRelease();
nsCOMPtr<nsIContent> mContent;
nsCOMPtr<nsIWeakReference> mWeakShell;
nsDocAccessible* mDoc;
/**
* Notify global nsIObserver's that a11y is getting init'd or shutdown

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

@ -205,14 +205,15 @@ nsAccessibilityService::GetRootDocumentAccessible(nsIPresShell* aPresShell,
}
return nsnull;
}
already_AddRefed<nsAccessible>
nsAccessibilityService::CreateOuterDocAccessible(nsIContent* aContent,
nsIPresShell* aPresShell)
{
nsCOMPtr<nsIWeakReference> weakShell(do_GetWeakReference(aPresShell));
nsAccessible* accessible = new nsOuterDocAccessible(aContent, weakShell);
NS_IF_ADDREF(accessible);
nsAccessible* accessible =
new nsOuterDocAccessible(aContent,
nsAccUtils::GetDocAccessibleFor(aPresShell));
NS_ADDREF(accessible);
return accessible;
}
@ -220,9 +221,10 @@ already_AddRefed<nsAccessible>
nsAccessibilityService::CreateHTML4ButtonAccessible(nsIContent* aContent,
nsIPresShell* aPresShell)
{
nsCOMPtr<nsIWeakReference> weakShell(do_GetWeakReference(aPresShell));
nsAccessible* accessible = new nsHTML4ButtonAccessible(aContent, weakShell);
NS_IF_ADDREF(accessible);
nsAccessible* accessible =
new nsHTML4ButtonAccessible(aContent,
nsAccUtils::GetDocAccessibleFor(aPresShell));
NS_ADDREF(accessible);
return accessible;
}
@ -230,9 +232,10 @@ already_AddRefed<nsAccessible>
nsAccessibilityService::CreateHTMLButtonAccessible(nsIContent* aContent,
nsIPresShell* aPresShell)
{
nsCOMPtr<nsIWeakReference> weakShell(do_GetWeakReference(aPresShell));
nsAccessible* accessible = new nsHTMLButtonAccessible(aContent, weakShell);
NS_IF_ADDREF(accessible);
nsAccessible* accessible =
new nsHTMLButtonAccessible(aContent,
nsAccUtils::GetDocAccessibleFor(aPresShell));
NS_ADDREF(accessible);
return accessible;
}
@ -240,9 +243,10 @@ already_AddRefed<nsAccessible>
nsAccessibilityService::CreateHTMLLIAccessible(nsIContent* aContent,
nsIPresShell* aPresShell)
{
nsCOMPtr<nsIWeakReference> weakShell(do_GetWeakReference(aPresShell));
nsAccessible* accessible = new nsHTMLLIAccessible(aContent, weakShell);
NS_IF_ADDREF(accessible);
nsAccessible* accessible =
new nsHTMLLIAccessible(aContent,
nsAccUtils::GetDocAccessibleFor(aPresShell));
NS_ADDREF(accessible);
return accessible;
}
@ -250,9 +254,10 @@ already_AddRefed<nsAccessible>
nsAccessibilityService::CreateHyperTextAccessible(nsIContent* aContent,
nsIPresShell* aPresShell)
{
nsCOMPtr<nsIWeakReference> weakShell(do_GetWeakReference(aPresShell));
nsAccessible* accessible = new nsHyperTextAccessibleWrap(aContent, weakShell);
NS_IF_ADDREF(accessible);
nsAccessible* accessible =
new nsHyperTextAccessibleWrap(aContent,
nsAccUtils::GetDocAccessibleFor(aPresShell));
NS_ADDREF(accessible);
return accessible;
}
@ -260,9 +265,10 @@ already_AddRefed<nsAccessible>
nsAccessibilityService::CreateHTMLCheckboxAccessible(nsIContent* aContent,
nsIPresShell* aPresShell)
{
nsCOMPtr<nsIWeakReference> weakShell(do_GetWeakReference(aPresShell));
nsAccessible* accessible = new nsHTMLCheckboxAccessible(aContent, weakShell);
NS_IF_ADDREF(accessible);
nsAccessible* accessible =
new nsHTMLCheckboxAccessible(aContent,
nsAccUtils::GetDocAccessibleFor(aPresShell));
NS_ADDREF(accessible);
return accessible;
}
@ -270,9 +276,10 @@ already_AddRefed<nsAccessible>
nsAccessibilityService::CreateHTMLComboboxAccessible(nsIContent* aContent,
nsIPresShell* aPresShell)
{
nsCOMPtr<nsIWeakReference> weakShell(do_GetWeakReference(aPresShell));
nsAccessible* accessible = new nsHTMLComboboxAccessible(aContent, weakShell);
NS_IF_ADDREF(accessible);
nsAccessible* accessible =
new nsHTMLComboboxAccessible(aContent,
nsAccUtils::GetDocAccessibleFor(aPresShell));
NS_ADDREF(accessible);
return accessible;
}
@ -280,9 +287,10 @@ already_AddRefed<nsAccessible>
nsAccessibilityService::CreateHTMLCanvasAccessible(nsIContent* aContent,
nsIPresShell* aPresShell)
{
nsCOMPtr<nsIWeakReference> weakShell(do_GetWeakReference(aPresShell));
nsAccessible* accessible = new nsHTMLCanvasAccessible(aContent, weakShell);
NS_IF_ADDREF(accessible);
nsAccessible* accessible =
new nsHTMLCanvasAccessible(aContent,
nsAccUtils::GetDocAccessibleFor(aPresShell));
NS_ADDREF(accessible);
return accessible;
}
@ -290,9 +298,10 @@ already_AddRefed<nsAccessible>
nsAccessibilityService::CreateHTMLFileInputAccessible(nsIContent* aContent,
nsIPresShell* aPresShell)
{
nsCOMPtr<nsIWeakReference> weakShell(do_GetWeakReference(aPresShell));
nsAccessible* accessible = new nsHTMLFileInputAccessible(aContent, weakShell);
NS_IF_ADDREF(accessible);
nsAccessible* accessible =
new nsHTMLFileInputAccessible(aContent,
nsAccUtils::GetDocAccessibleFor(aPresShell));
NS_ADDREF(accessible);
return accessible;
}
@ -307,11 +316,13 @@ nsAccessibilityService::CreateHTMLImageAccessible(nsIContent* aContent,
mapElm = do_QueryInterface(document->FindImageMap(mapElmName));
}
nsCOMPtr<nsIWeakReference> weakShell(do_GetWeakReference(aPresShell));
nsAccessible* accessible = mapElm ?
new nsHTMLImageMapAccessible(aContent, weakShell, mapElm) :
new nsHTMLImageAccessibleWrap(aContent, weakShell);
NS_IF_ADDREF(accessible);
new nsHTMLImageMapAccessible(aContent,
nsAccUtils::GetDocAccessibleFor(aPresShell),
mapElm) :
new nsHTMLImageAccessibleWrap(aContent,
nsAccUtils::GetDocAccessibleFor(aPresShell));
NS_ADDREF(accessible);
return accessible;
}
@ -319,9 +330,10 @@ already_AddRefed<nsAccessible>
nsAccessibilityService::CreateHTMLGroupboxAccessible(nsIContent* aContent,
nsIPresShell* aPresShell)
{
nsCOMPtr<nsIWeakReference> weakShell(do_GetWeakReference(aPresShell));
nsAccessible* accessible = new nsHTMLGroupboxAccessible(aContent, weakShell);
NS_IF_ADDREF(accessible);
nsAccessible* accessible =
new nsHTMLGroupboxAccessible(aContent,
nsAccUtils::GetDocAccessibleFor(aPresShell));
NS_ADDREF(accessible);
return accessible;
}
@ -329,9 +341,10 @@ already_AddRefed<nsAccessible>
nsAccessibilityService::CreateHTMLListboxAccessible(nsIContent* aContent,
nsIPresShell* aPresShell)
{
nsCOMPtr<nsIWeakReference> weakShell(do_GetWeakReference(aPresShell));
nsAccessible* accessible = new nsHTMLSelectListAccessible(aContent, weakShell);
NS_IF_ADDREF(accessible);
nsAccessible* accessible =
new nsHTMLSelectListAccessible(aContent,
nsAccUtils::GetDocAccessibleFor(aPresShell));
NS_ADDREF(accessible);
return accessible;
}
@ -339,10 +352,11 @@ already_AddRefed<nsAccessible>
nsAccessibilityService::CreateHTMLMediaAccessible(nsIContent* aContent,
nsIPresShell* aPresShell)
{
nsCOMPtr<nsIWeakReference> weakShell(do_GetWeakReference(aPresShell));
nsAccessible* accessible = new nsEnumRoleAccessible(aContent, weakShell,
roles::GROUPING);
NS_IF_ADDREF(accessible);
nsAccessible* accessible =
new nsEnumRoleAccessible(aContent,
nsAccUtils::GetDocAccessibleFor(aPresShell),
roles::GROUPING);
NS_ADDREF(accessible);
return accessible;
}
@ -362,7 +376,6 @@ nsAccessibilityService::CreateHTMLObjectFrameAccessible(nsObjectFrame* aFrame,
if (aFrame->GetRect().IsEmpty())
return nsnull;
nsCOMPtr<nsIWeakReference> weakShell(do_GetWeakReference(aPresShell));
// 1) for object elements containing either HTML or TXT documents
nsCOMPtr<nsIDOMHTMLObjectElement> obj(do_QueryInterface(aContent));
@ -383,10 +396,11 @@ nsAccessibilityService::CreateHTMLObjectFrameAccessible(nsObjectFrame* aFrame,
HWND pluginPort = nsnull;
aFrame->GetPluginPort(&pluginPort);
nsAccessible* accessible = new nsHTMLWin32ObjectOwnerAccessible(aContent,
weakShell,
pluginPort);
NS_IF_ADDREF(accessible);
nsAccessible* accessible =
new nsHTMLWin32ObjectOwnerAccessible(aContent,
nsAccUtils::GetDocAccessibleFor(aPresShell),
pluginPort);
NS_ADDREF(accessible);
return accessible;
#elif MOZ_ACCESSIBILITY_ATK
@ -398,9 +412,11 @@ nsAccessibilityService::CreateHTMLObjectFrameAccessible(nsObjectFrame* aFrame,
NPPVpluginNativeAccessibleAtkPlugId, &plugId);
if (NS_SUCCEEDED(rv) && !plugId.IsEmpty()) {
AtkSocketAccessible* socketAccessible =
new AtkSocketAccessible(aContent, weakShell, plugId);
new AtkSocketAccessible(aContent,
nsAccUtils::GetDocAccessibleFor(aPresShell),
plugId);
NS_IF_ADDREF(socketAccessible);
NS_ADDREF(socketAccessible);
return socketAccessible;
}
#endif
@ -417,9 +433,10 @@ already_AddRefed<nsAccessible>
nsAccessibilityService::CreateHTMLRadioButtonAccessible(nsIContent* aContent,
nsIPresShell* aPresShell)
{
nsCOMPtr<nsIWeakReference> weakShell(do_GetWeakReference(aPresShell));
nsAccessible* accessible = new nsHTMLRadioButtonAccessible(aContent, weakShell);
NS_IF_ADDREF(accessible);
nsAccessible* accessible =
new nsHTMLRadioButtonAccessible(aContent,
nsAccUtils::GetDocAccessibleFor(aPresShell));
NS_ADDREF(accessible);
return accessible;
}
@ -427,9 +444,10 @@ already_AddRefed<nsAccessible>
nsAccessibilityService::CreateHTMLTableAccessible(nsIContent* aContent,
nsIPresShell* aPresShell)
{
nsCOMPtr<nsIWeakReference> weakShell(do_GetWeakReference(aPresShell));
nsAccessible* accessible = new nsHTMLTableAccessibleWrap(aContent, weakShell);
NS_IF_ADDREF(accessible);
nsAccessible* accessible =
new nsHTMLTableAccessibleWrap(aContent,
nsAccUtils::GetDocAccessibleFor(aPresShell));
NS_ADDREF(accessible);
return accessible;
}
@ -437,10 +455,10 @@ already_AddRefed<nsAccessible>
nsAccessibilityService::CreateHTMLTableCellAccessible(nsIContent* aContent,
nsIPresShell* aPresShell)
{
nsCOMPtr<nsIWeakReference> weakShell(do_GetWeakReference(aPresShell));
nsAccessible* accessible = new nsHTMLTableCellAccessibleWrap(aContent,
weakShell);
NS_IF_ADDREF(accessible);
nsAccessible* accessible =
new nsHTMLTableCellAccessibleWrap(aContent,
nsAccUtils::GetDocAccessibleFor(aPresShell));
NS_ADDREF(accessible);
return accessible;
}
@ -448,9 +466,10 @@ already_AddRefed<nsAccessible>
nsAccessibilityService::CreateHTMLTextAccessible(nsIContent* aContent,
nsIPresShell* aPresShell)
{
nsCOMPtr<nsIWeakReference> weakShell(do_GetWeakReference(aPresShell));
nsAccessible* accessible = new nsHTMLTextAccessible(aContent, weakShell);
NS_IF_ADDREF(accessible);
nsAccessible* accessible =
new nsHTMLTextAccessible(aContent,
nsAccUtils::GetDocAccessibleFor(aPresShell));
NS_ADDREF(accessible);
return accessible;
}
@ -458,9 +477,10 @@ already_AddRefed<nsAccessible>
nsAccessibilityService::CreateHTMLTextFieldAccessible(nsIContent* aContent,
nsIPresShell* aPresShell)
{
nsCOMPtr<nsIWeakReference> weakShell(do_GetWeakReference(aPresShell));
nsAccessible* accessible = new nsHTMLTextFieldAccessible(aContent, weakShell);
NS_IF_ADDREF(accessible);
nsAccessible* accessible =
new nsHTMLTextFieldAccessible(aContent,
nsAccUtils::GetDocAccessibleFor(aPresShell));
NS_ADDREF(accessible);
return accessible;
}
@ -468,9 +488,10 @@ already_AddRefed<nsAccessible>
nsAccessibilityService::CreateHTMLLabelAccessible(nsIContent* aContent,
nsIPresShell* aPresShell)
{
nsCOMPtr<nsIWeakReference> weakShell(do_GetWeakReference(aPresShell));
nsAccessible* accessible = new nsHTMLLabelAccessible(aContent, weakShell);
NS_IF_ADDREF(accessible);
nsAccessible* accessible =
new nsHTMLLabelAccessible(aContent,
nsAccUtils::GetDocAccessibleFor(aPresShell));
NS_ADDREF(accessible);
return accessible;
}
@ -478,9 +499,10 @@ already_AddRefed<nsAccessible>
nsAccessibilityService::CreateHTMLHRAccessible(nsIContent* aContent,
nsIPresShell* aPresShell)
{
nsCOMPtr<nsIWeakReference> weakShell(do_GetWeakReference(aPresShell));
nsAccessible* accessible = new nsHTMLHRAccessible(aContent, weakShell);
NS_IF_ADDREF(accessible);
nsAccessible* accessible =
new nsHTMLHRAccessible(aContent,
nsAccUtils::GetDocAccessibleFor(aPresShell));
NS_ADDREF(accessible);
return accessible;
}
@ -488,9 +510,10 @@ already_AddRefed<nsAccessible>
nsAccessibilityService::CreateHTMLBRAccessible(nsIContent* aContent,
nsIPresShell* aPresShell)
{
nsCOMPtr<nsIWeakReference> weakShell(do_GetWeakReference(aPresShell));
nsAccessible* accessible = new nsHTMLBRAccessible(aContent, weakShell);
NS_IF_ADDREF(accessible);
nsAccessible* accessible =
new nsHTMLBRAccessible(aContent,
nsAccUtils::GetDocAccessibleFor(aPresShell));
NS_ADDREF(accessible);
return accessible;
}
@ -498,9 +521,10 @@ already_AddRefed<nsAccessible>
nsAccessibilityService::CreateHTMLCaptionAccessible(nsIContent* aContent,
nsIPresShell* aPresShell)
{
nsCOMPtr<nsIWeakReference> weakShell(do_GetWeakReference(aPresShell));
nsAccessible* accessible = new nsHTMLCaptionAccessible(aContent, weakShell);
NS_IF_ADDREF(accessible);
nsAccessible* accessible =
new nsHTMLCaptionAccessible(aContent,
nsAccUtils::GetDocAccessibleFor(aPresShell));
NS_ADDREF(accessible);
return accessible;
}
@ -671,7 +695,7 @@ nsAccessibilityService::GetAccessibleFor(nsIDOMNode *aNode,
if (!node)
return NS_ERROR_INVALID_ARG;
NS_IF_ADDREF(*aAccessible = GetAccessible(node));
NS_IF_ADDREF(*aAccessible = GetAccessible(node, nsnull));
return NS_OK;
}
@ -882,40 +906,28 @@ nsAccessibilityService::CreateAccessiblePivot(nsIAccessible* aRoot,
return NS_OK;
}
// nsIAccesibilityService
nsAccessible*
nsAccessibilityService::GetAccessibleInShell(nsINode* aNode,
nsIPresShell* aPresShell)
{
if (!aNode || !aPresShell)
return nsnull;
nsCOMPtr<nsIWeakReference> weakShell(do_GetWeakReference(aPresShell));
return GetAccessibleInWeakShell(aNode, weakShell);
}
////////////////////////////////////////////////////////////////////////////////
// nsAccessibilityService public
nsAccessible*
nsAccessibilityService::GetAccessible(nsINode* aNode)
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());
return document ? document->GetAccessible(aNode) : nsnull;
}
nsAccessible*
nsAccessibilityService::GetAccessibleOrContainer(nsINode* aNode,
nsIWeakReference* aWeakShell)
nsAccessibilityService::GetAccessibleOrContainer(nsINode* aNode, nsDocAccessible* aDoc)
{
if (!aNode)
return nsnull;
// XXX: weak shell is ignored until multiple shell documents are supported.
nsDocAccessible* document = GetDocAccessible(aNode->OwnerDoc());
return document ? document->GetAccessibleOrContainer(aNode) : nsnull;
NS_PRECONDITION(aDoc, "Must pass a document accessible.");
return aDoc ? aDoc->GetAccessibleOrContainer(aNode) : nsnull;
}
static bool HasRelatedContent(nsIContent *aContent)
@ -933,18 +945,17 @@ static bool HasRelatedContent(nsIContent *aContent)
nsAccessible*
nsAccessibilityService::GetOrCreateAccessible(nsINode* aNode,
nsIPresShell* aPresShell,
nsIWeakReference* aWeakShell,
nsDocAccessible* aDoc,
bool* aIsSubtreeHidden)
{
if (!aPresShell || !aWeakShell || !aNode || gIsShutdown)
if (!aDoc || !aNode || gIsShutdown)
return nsnull;
if (aIsSubtreeHidden)
*aIsSubtreeHidden = false;
// Check to see if we already have an accessible for this node in the cache.
nsAccessible* cachedAccessible = GetAccessibleInWeakShell(aNode, aWeakShell);
nsAccessible* cachedAccessible = aDoc->GetAccessible(aNode);
if (cachedAccessible)
return cachedAccessible;
@ -963,8 +974,8 @@ nsAccessibilityService::GetOrCreateAccessible(nsINode* aNode,
return nsnull;
}
if (aNode->OwnerDoc() != aPresShell->GetDocument()) {
NS_ERROR("Creating accessible for wrong pres shell");
if (aNode->OwnerDoc() != aDoc->GetDocumentNode()) {
NS_ERROR("Creating accessible for wrong document");
return nsnull;
}
@ -1057,7 +1068,7 @@ nsAccessibilityService::GetOrCreateAccessible(nsINode* aNode,
return nsnull;
}
newAcc = new nsHyperTextAccessibleWrap(content, aWeakShell);
newAcc = new nsHyperTextAccessibleWrap(content, docAcc);
if (docAcc->BindToDocument(newAcc, nsAccUtils::GetRoleMapEntry(aNode)))
return newAcc;
return nsnull;
@ -1095,8 +1106,7 @@ nsAccessibilityService::GetOrCreateAccessible(nsINode* aNode,
continue;
if (tableFrame->GetType() == nsGkAtoms::tableOuterFrame) {
nsAccessible *tableAccessible =
GetAccessibleInWeakShell(tableContent, aWeakShell);
nsAccessible* tableAccessible = aDoc->GetAccessible(tableContent);
if (tableAccessible) {
if (!roleMapEntry) {
@ -1151,12 +1161,12 @@ nsAccessibilityService::GetOrCreateAccessible(nsINode* aNode,
if (roleMapEntry->role == roles::TABLE ||
roleMapEntry->role == roles::TREE_TABLE) {
newAcc = new nsARIAGridAccessibleWrap(content, aWeakShell);
newAcc = new nsARIAGridAccessibleWrap(content, docAcc);
} else if (roleMapEntry->role == roles::GRID_CELL ||
roleMapEntry->role == roles::ROWHEADER ||
roleMapEntry->role == roles::COLUMNHEADER) {
newAcc = new nsARIAGridCellAccessibleWrap(content, aWeakShell);
newAcc = new nsARIAGridCellAccessibleWrap(content, docAcc);
}
}
}
@ -1168,7 +1178,7 @@ nsAccessibilityService::GetOrCreateAccessible(nsINode* aNode,
// we do not call it if accessibles for table related content are
// prevented above.
newAcc = CreateHTMLAccessibleByMarkup(weakFrame.GetFrame(), content,
aWeakShell);
docAcc);
if (!newAcc) {
// Do not create accessible object subtrees for non-rendered table
@ -1179,7 +1189,7 @@ nsAccessibilityService::GetOrCreateAccessible(nsINode* aNode,
// are created.
nsIFrame* f = weakFrame.GetFrame();
if (!f) {
f = aPresShell->GetRealPrimaryFrameFor(content);
f = aDoc->PresShell()->GetRealPrimaryFrameFor(content);
}
if (f->GetType() == nsGkAtoms::tableCaptionFrame &&
f->GetRect().IsEmpty()) {
@ -1200,24 +1210,24 @@ nsAccessibilityService::GetOrCreateAccessible(nsINode* aNode,
if (!newAcc) {
// Elements may implement nsIAccessibleProvider via XBL. This allows them to
// say what kind of accessible to create.
newAcc = CreateAccessibleByType(content, aWeakShell);
newAcc = CreateAccessibleByType(content, docAcc);
}
if (!newAcc) {
// Create generic accessibles for SVG and MathML nodes.
if (content->IsSVG(nsGkAtoms::svg)) {
newAcc = new nsEnumRoleAccessible(content, aWeakShell,
newAcc = new nsEnumRoleAccessible(content, docAcc,
roles::DIAGRAM);
}
else if (content->IsMathML(nsGkAtoms::math)) {
newAcc = new nsEnumRoleAccessible(content, aWeakShell,
newAcc = new nsEnumRoleAccessible(content, docAcc,
roles::EQUATION);
}
}
if (!newAcc) {
newAcc = CreateAccessibleForDeckChild(weakFrame.GetFrame(), content,
aWeakShell);
docAcc);
}
// If no accessible, see if we need to create a generic accessible because
@ -1234,11 +1244,11 @@ nsAccessibilityService::GetOrCreateAccessible(nsINode* aNode,
// other accessibles can point to it, or so that it can hold a state, etc.
if (isHTML) {
// Interesting HTML container which may have selectable text and/or embedded objects
newAcc = new nsHyperTextAccessibleWrap(content, aWeakShell);
newAcc = new nsHyperTextAccessibleWrap(content, docAcc);
}
else { // XUL, SVG, MathML etc.
// Interesting generic non-HTML container
newAcc = new nsAccessibleWrap(content, aWeakShell);
newAcc = new nsAccessibleWrap(content, docAcc);
}
}
@ -1319,7 +1329,7 @@ nsAccessibilityService::HasUniversalAriaProperty(nsIContent *aContent)
already_AddRefed<nsAccessible>
nsAccessibilityService::CreateAccessibleByType(nsIContent* aContent,
nsIWeakReference* aWeakShell)
nsDocAccessible* aDoc)
{
nsCOMPtr<nsIAccessibleProvider> accessibleProvider(do_QueryInterface(aContent));
if (!accessibleProvider)
@ -1331,7 +1341,7 @@ nsAccessibilityService::CreateAccessibleByType(nsIContent* aContent,
return nsnull;
if (type == nsIAccessibleProvider::OuterDoc) {
nsAccessible* accessible = new nsOuterDocAccessible(aContent, aWeakShell);
nsAccessible* accessible = new nsOuterDocAccessible(aContent, aDoc);
NS_IF_ADDREF(accessible);
return accessible;
}
@ -1345,35 +1355,35 @@ nsAccessibilityService::CreateAccessibleByType(nsIContent* aContent,
// XUL controls
case nsIAccessibleProvider::XULAlert:
accessible = new nsXULAlertAccessible(aContent, aWeakShell);
accessible = new nsXULAlertAccessible(aContent, aDoc);
break;
case nsIAccessibleProvider::XULButton:
accessible = new nsXULButtonAccessible(aContent, aWeakShell);
accessible = new nsXULButtonAccessible(aContent, aDoc);
break;
case nsIAccessibleProvider::XULCheckbox:
accessible = new nsXULCheckboxAccessible(aContent, aWeakShell);
accessible = new nsXULCheckboxAccessible(aContent, aDoc);
break;
case nsIAccessibleProvider::XULColorPicker:
accessible = new nsXULColorPickerAccessible(aContent, aWeakShell);
accessible = new nsXULColorPickerAccessible(aContent, aDoc);
break;
case nsIAccessibleProvider::XULColorPickerTile:
accessible = new nsXULColorPickerTileAccessible(aContent, aWeakShell);
accessible = new nsXULColorPickerTileAccessible(aContent, aDoc);
break;
case nsIAccessibleProvider::XULCombobox:
accessible = new nsXULComboboxAccessible(aContent, aWeakShell);
accessible = new nsXULComboboxAccessible(aContent, aDoc);
break;
case nsIAccessibleProvider::XULDropmarker:
accessible = new nsXULDropmarkerAccessible(aContent, aWeakShell);
accessible = new nsXULDropmarkerAccessible(aContent, aDoc);
break;
case nsIAccessibleProvider::XULGroupbox:
accessible = new nsXULGroupboxAccessible(aContent, aWeakShell);
accessible = new nsXULGroupboxAccessible(aContent, aDoc);
break;
case nsIAccessibleProvider::XULImage:
@ -1383,40 +1393,40 @@ nsAccessibilityService::CreateAccessibleByType(nsIContent* aContent,
nsGkAtoms::tooltiptext))
return nsnull;
accessible = new nsHTMLImageAccessibleWrap(aContent, aWeakShell);
accessible = new nsHTMLImageAccessibleWrap(aContent, aDoc);
break;
}
case nsIAccessibleProvider::XULLink:
accessible = new nsXULLinkAccessible(aContent, aWeakShell);
accessible = new nsXULLinkAccessible(aContent, aDoc);
break;
case nsIAccessibleProvider::XULListbox:
accessible = new nsXULListboxAccessibleWrap(aContent, aWeakShell);
accessible = new nsXULListboxAccessibleWrap(aContent, aDoc);
break;
case nsIAccessibleProvider::XULListCell:
accessible = new nsXULListCellAccessibleWrap(aContent, aWeakShell);
accessible = new nsXULListCellAccessibleWrap(aContent, aDoc);
break;
case nsIAccessibleProvider::XULListHead:
accessible = new nsXULColumnsAccessible(aContent, aWeakShell);
accessible = new nsXULColumnsAccessible(aContent, aDoc);
break;
case nsIAccessibleProvider::XULListHeader:
accessible = new nsXULColumnItemAccessible(aContent, aWeakShell);
accessible = new nsXULColumnItemAccessible(aContent, aDoc);
break;
case nsIAccessibleProvider::XULListitem:
accessible = new nsXULListitemAccessible(aContent, aWeakShell);
accessible = new nsXULListitemAccessible(aContent, aDoc);
break;
case nsIAccessibleProvider::XULMenubar:
accessible = new nsXULMenubarAccessible(aContent, aWeakShell);
accessible = new nsXULMenubarAccessible(aContent, aDoc);
break;
case nsIAccessibleProvider::XULMenuitem:
accessible = new nsXULMenuitemAccessibleWrap(aContent, aWeakShell);
accessible = new nsXULMenuitemAccessibleWrap(aContent, aDoc);
break;
case nsIAccessibleProvider::XULMenupopup:
@ -1432,167 +1442,167 @@ nsAccessibilityService::CreateAccessibleByType(nsIContent* aContent,
kNameSpaceID_XUL))
return nsnull;
#endif
accessible = new nsXULMenupopupAccessible(aContent, aWeakShell);
accessible = new nsXULMenupopupAccessible(aContent, aDoc);
break;
}
case nsIAccessibleProvider::XULMenuSeparator:
accessible = new nsXULMenuSeparatorAccessible(aContent, aWeakShell);
accessible = new nsXULMenuSeparatorAccessible(aContent, aDoc);
break;
case nsIAccessibleProvider::XULPane:
accessible = new nsEnumRoleAccessible(aContent, aWeakShell,
accessible = new nsEnumRoleAccessible(aContent, aDoc,
roles::PANE);
break;
case nsIAccessibleProvider::XULProgressMeter:
accessible = new XULProgressMeterAccessible(aContent, aWeakShell);
accessible = new XULProgressMeterAccessible(aContent, aDoc);
break;
case nsIAccessibleProvider::XULStatusBar:
accessible = new nsXULStatusBarAccessible(aContent, aWeakShell);
accessible = new nsXULStatusBarAccessible(aContent, aDoc);
break;
case nsIAccessibleProvider::XULScale:
accessible = new nsXULSliderAccessible(aContent, aWeakShell);
accessible = new nsXULSliderAccessible(aContent, aDoc);
break;
case nsIAccessibleProvider::XULRadioButton:
accessible = new nsXULRadioButtonAccessible(aContent, aWeakShell);
accessible = new nsXULRadioButtonAccessible(aContent, aDoc);
break;
case nsIAccessibleProvider::XULRadioGroup:
accessible = new nsXULRadioGroupAccessible(aContent, aWeakShell);
accessible = new nsXULRadioGroupAccessible(aContent, aDoc);
break;
case nsIAccessibleProvider::XULTab:
accessible = new nsXULTabAccessible(aContent, aWeakShell);
accessible = new nsXULTabAccessible(aContent, aDoc);
break;
case nsIAccessibleProvider::XULTabs:
accessible = new nsXULTabsAccessible(aContent, aWeakShell);
accessible = new nsXULTabsAccessible(aContent, aDoc);
break;
case nsIAccessibleProvider::XULTabpanels:
accessible = new nsXULTabpanelsAccessible(aContent, aWeakShell);
accessible = new nsXULTabpanelsAccessible(aContent, aDoc);
break;
case nsIAccessibleProvider::XULText:
accessible = new nsXULTextAccessible(aContent, aWeakShell);
accessible = new nsXULTextAccessible(aContent, aDoc);
break;
case nsIAccessibleProvider::XULTextBox:
accessible = new nsXULTextFieldAccessible(aContent, aWeakShell);
accessible = new nsXULTextFieldAccessible(aContent, aDoc);
break;
case nsIAccessibleProvider::XULThumb:
accessible = new nsXULThumbAccessible(aContent, aWeakShell);
accessible = new nsXULThumbAccessible(aContent, aDoc);
break;
case nsIAccessibleProvider::XULTree:
return CreateAccessibleForXULTree(aContent, aWeakShell);
return CreateAccessibleForXULTree(aContent, aDoc);
case nsIAccessibleProvider::XULTreeColumns:
accessible = new nsXULTreeColumnsAccessible(aContent, aWeakShell);
accessible = new nsXULTreeColumnsAccessible(aContent, aDoc);
break;
case nsIAccessibleProvider::XULTreeColumnItem:
accessible = new nsXULColumnItemAccessible(aContent, aWeakShell);
accessible = new nsXULColumnItemAccessible(aContent, aDoc);
break;
case nsIAccessibleProvider::XULToolbar:
accessible = new nsXULToolbarAccessible(aContent, aWeakShell);
accessible = new nsXULToolbarAccessible(aContent, aDoc);
break;
case nsIAccessibleProvider::XULToolbarSeparator:
accessible = new nsXULToolbarSeparatorAccessible(aContent, aWeakShell);
accessible = new nsXULToolbarSeparatorAccessible(aContent, aDoc);
break;
case nsIAccessibleProvider::XULTooltip:
accessible = new nsXULTooltipAccessible(aContent, aWeakShell);
accessible = new nsXULTooltipAccessible(aContent, aDoc);
break;
case nsIAccessibleProvider::XULToolbarButton:
accessible = new nsXULToolbarButtonAccessible(aContent, aWeakShell);
accessible = new nsXULToolbarButtonAccessible(aContent, aDoc);
break;
#endif // MOZ_XUL
// XForms elements
case nsIAccessibleProvider::XFormsContainer:
accessible = new nsXFormsContainerAccessible(aContent, aWeakShell);
accessible = new nsXFormsContainerAccessible(aContent, aDoc);
break;
case nsIAccessibleProvider::XFormsLabel:
accessible = new nsXFormsLabelAccessible(aContent, aWeakShell);
accessible = new nsXFormsLabelAccessible(aContent, aDoc);
break;
case nsIAccessibleProvider::XFormsOutput:
accessible = new nsXFormsOutputAccessible(aContent, aWeakShell);
accessible = new nsXFormsOutputAccessible(aContent, aDoc);
break;
case nsIAccessibleProvider::XFormsTrigger:
accessible = new nsXFormsTriggerAccessible(aContent, aWeakShell);
accessible = new nsXFormsTriggerAccessible(aContent, aDoc);
break;
case nsIAccessibleProvider::XFormsInput:
accessible = new nsXFormsInputAccessible(aContent, aWeakShell);
accessible = new nsXFormsInputAccessible(aContent, aDoc);
break;
case nsIAccessibleProvider::XFormsInputBoolean:
accessible = new nsXFormsInputBooleanAccessible(aContent, aWeakShell);
accessible = new nsXFormsInputBooleanAccessible(aContent, aDoc);
break;
case nsIAccessibleProvider::XFormsInputDate:
accessible = new nsXFormsInputDateAccessible(aContent, aWeakShell);
accessible = new nsXFormsInputDateAccessible(aContent, aDoc);
break;
case nsIAccessibleProvider::XFormsSecret:
accessible = new nsXFormsSecretAccessible(aContent, aWeakShell);
accessible = new nsXFormsSecretAccessible(aContent, aDoc);
break;
case nsIAccessibleProvider::XFormsSliderRange:
accessible = new nsXFormsRangeAccessible(aContent, aWeakShell);
accessible = new nsXFormsRangeAccessible(aContent, aDoc);
break;
case nsIAccessibleProvider::XFormsSelect:
accessible = new nsXFormsSelectAccessible(aContent, aWeakShell);
accessible = new nsXFormsSelectAccessible(aContent, aDoc);
break;
case nsIAccessibleProvider::XFormsChoices:
accessible = new nsXFormsChoicesAccessible(aContent, aWeakShell);
accessible = new nsXFormsChoicesAccessible(aContent, aDoc);
break;
case nsIAccessibleProvider::XFormsSelectFull:
accessible = new nsXFormsSelectFullAccessible(aContent, aWeakShell);
accessible = new nsXFormsSelectFullAccessible(aContent, aDoc);
break;
case nsIAccessibleProvider::XFormsItemCheckgroup:
accessible = new nsXFormsItemCheckgroupAccessible(aContent, aWeakShell);
accessible = new nsXFormsItemCheckgroupAccessible(aContent, aDoc);
break;
case nsIAccessibleProvider::XFormsItemRadiogroup:
accessible = new nsXFormsItemRadiogroupAccessible(aContent, aWeakShell);
accessible = new nsXFormsItemRadiogroupAccessible(aContent, aDoc);
break;
case nsIAccessibleProvider::XFormsSelectCombobox:
accessible = new nsXFormsSelectComboboxAccessible(aContent, aWeakShell);
accessible = new nsXFormsSelectComboboxAccessible(aContent, aDoc);
break;
case nsIAccessibleProvider::XFormsItemCombobox:
accessible = new nsXFormsItemComboboxAccessible(aContent, aWeakShell);
accessible = new nsXFormsItemComboboxAccessible(aContent, aDoc);
break;
case nsIAccessibleProvider::XFormsDropmarkerWidget:
accessible = new nsXFormsDropmarkerWidgetAccessible(aContent, aWeakShell);
accessible = new nsXFormsDropmarkerWidgetAccessible(aContent, aDoc);
break;
case nsIAccessibleProvider::XFormsCalendarWidget:
accessible = new nsXFormsCalendarWidgetAccessible(aContent, aWeakShell);
accessible = new nsXFormsCalendarWidgetAccessible(aContent, aDoc);
break;
case nsIAccessibleProvider::XFormsComboboxPopupWidget:
accessible = new nsXFormsComboboxPopupWidgetAccessible(aContent, aWeakShell);
accessible = new nsXFormsComboboxPopupWidgetAccessible(aContent, aDoc);
break;
default:
@ -1606,46 +1616,45 @@ nsAccessibilityService::CreateAccessibleByType(nsIContent* aContent,
already_AddRefed<nsAccessible>
nsAccessibilityService::CreateHTMLAccessibleByMarkup(nsIFrame* aFrame,
nsIContent* aContent,
nsIWeakReference* aWeakShell)
nsDocAccessible* aDoc)
{
// This method assumes we're in an HTML namespace.
nsIAtom* tag = aContent->Tag();
if (tag == nsGkAtoms::figcaption) {
nsAccessible* accessible =
new nsHTMLFigcaptionAccessible(aContent, aWeakShell);
new nsHTMLFigcaptionAccessible(aContent, aDoc);
NS_IF_ADDREF(accessible);
return accessible;
}
if (tag == nsGkAtoms::figure) {
nsAccessible* accessible = new nsHTMLFigureAccessible(aContent, aWeakShell);
nsAccessible* accessible = new nsHTMLFigureAccessible(aContent, aDoc);
NS_IF_ADDREF(accessible);
return accessible;
}
if (tag == nsGkAtoms::legend) {
nsAccessible* accessible = new nsHTMLLegendAccessible(aContent, aWeakShell);
nsAccessible* accessible = new nsHTMLLegendAccessible(aContent, aDoc);
NS_IF_ADDREF(accessible);
return accessible;
}
if (tag == nsGkAtoms::option) {
nsAccessible* accessible = new nsHTMLSelectOptionAccessible(aContent,
aWeakShell);
nsAccessible* accessible = new nsHTMLSelectOptionAccessible(aContent, aDoc);
NS_IF_ADDREF(accessible);
return accessible;
}
if (tag == nsGkAtoms::optgroup) {
nsAccessible* accessible = new nsHTMLSelectOptGroupAccessible(aContent,
aWeakShell);
aDoc);
NS_IF_ADDREF(accessible);
return accessible;
}
if (tag == nsGkAtoms::ul || tag == nsGkAtoms::ol ||
tag == nsGkAtoms::dl) {
nsAccessible* accessible = new nsHTMLListAccessible(aContent, aWeakShell);
nsAccessible* accessible = new nsHTMLListAccessible(aContent, aDoc);
NS_IF_ADDREF(accessible);
return accessible;
}
@ -1656,13 +1665,12 @@ nsAccessibilityService::CreateHTMLAccessibleByMarkup(nsIFrame* aFrame,
nsRoleMapEntry *roleMapEntry = nsAccUtils::GetRoleMapEntry(aContent);
if (roleMapEntry && roleMapEntry->role != roles::NOTHING &&
roleMapEntry->role != roles::LINK) {
nsAccessible* accessible = new nsHyperTextAccessibleWrap(aContent,
aWeakShell);
nsAccessible* accessible = new nsHyperTextAccessibleWrap(aContent, aDoc);
NS_IF_ADDREF(accessible);
return accessible;
}
nsAccessible* accessible = new nsHTMLLinkAccessible(aContent, aWeakShell);
nsAccessible* accessible = new nsHTMLLinkAccessible(aContent, aDoc);
NS_IF_ADDREF(accessible);
return accessible;
}
@ -1673,7 +1681,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 nsHTMLLIAccessible(aContent, aWeakShell);
nsAccessible* accessible = new nsHTMLLIAccessible(aContent, aDoc);
NS_IF_ADDREF(accessible);
return accessible;
}
@ -1690,13 +1698,13 @@ nsAccessibilityService::CreateHTMLAccessibleByMarkup(nsIFrame* aFrame,
tag == nsGkAtoms::h5 ||
tag == nsGkAtoms::h6 ||
tag == nsGkAtoms::q) {
nsAccessible* accessible = new nsHyperTextAccessibleWrap(aContent, aWeakShell);
nsAccessible* accessible = new nsHyperTextAccessibleWrap(aContent, aDoc);
NS_IF_ADDREF(accessible);
return accessible;
}
if (tag == nsGkAtoms::tr) {
nsAccessible* accessible = new nsEnumRoleAccessible(aContent, aWeakShell,
nsAccessible* accessible = new nsEnumRoleAccessible(aContent, aDoc,
roles::ROW);
NS_IF_ADDREF(accessible);
return accessible;
@ -1704,20 +1712,20 @@ nsAccessibilityService::CreateHTMLAccessibleByMarkup(nsIFrame* aFrame,
if (nsCoreUtils::IsHTMLTableHeader(aContent)) {
nsAccessible* accessible = new nsHTMLTableHeaderCellAccessibleWrap(aContent,
aWeakShell);
aDoc);
NS_IF_ADDREF(accessible);
return accessible;
}
if (tag == nsGkAtoms::output) {
nsAccessible* accessible = new nsHTMLOutputAccessible(aContent, aWeakShell);
nsAccessible* accessible = new nsHTMLOutputAccessible(aContent, aDoc);
NS_IF_ADDREF(accessible);
return accessible;
}
if (tag == nsGkAtoms::progress) {
nsAccessible* accessible =
new HTMLProgressMeterAccessible(aContent, aWeakShell);
new HTMLProgressMeterAccessible(aContent, aDoc);
NS_IF_ADDREF(accessible);
return accessible;
}
@ -1801,7 +1809,7 @@ NS_GetAccessibilityService(nsIAccessibilityService** aResult)
already_AddRefed<nsAccessible>
nsAccessibilityService::CreateAccessibleForDeckChild(nsIFrame* aFrame,
nsIContent* aContent,
nsIWeakReference* aWeakShell)
nsDocAccessible* aDoc)
{
if (aFrame->GetType() == nsGkAtoms::boxFrame ||
aFrame->GetType() == nsGkAtoms::scrollFrame) {
@ -1814,13 +1822,12 @@ nsAccessibilityService::CreateAccessibleForDeckChild(nsIFrame* aFrame,
#ifdef MOZ_XUL
if (parentContent->NodeInfo()->Equals(nsGkAtoms::tabpanels,
kNameSpaceID_XUL)) {
nsAccessible* accessible = new nsXULTabpanelAccessible(aContent,
aWeakShell);
nsAccessible* accessible = new nsXULTabpanelAccessible(aContent, aDoc);
NS_IF_ADDREF(accessible);
return accessible;
}
#endif
nsAccessible* accessible = new nsEnumRoleAccessible(aContent, aWeakShell,
nsAccessible* accessible = new nsEnumRoleAccessible(aContent, aDoc,
roles::PROPERTYPAGE);
NS_IF_ADDREF(accessible);
return accessible;
@ -1833,7 +1840,7 @@ nsAccessibilityService::CreateAccessibleForDeckChild(nsIFrame* aFrame,
#ifdef MOZ_XUL
already_AddRefed<nsAccessible>
nsAccessibilityService::CreateAccessibleForXULTree(nsIContent* aContent,
nsIWeakReference* aWeakShell)
nsDocAccessible* aDoc)
{
nsCOMPtr<nsITreeBoxObject> treeBoxObj = nsCoreUtils::GetTreeBoxObject(aContent);
if (!treeBoxObj)
@ -1849,13 +1856,13 @@ nsAccessibilityService::CreateAccessibleForXULTree(nsIContent* aContent,
// Outline of list accessible.
if (count == 1) {
nsAccessible* accessible = new nsXULTreeAccessible(aContent, aWeakShell);
nsAccessible* accessible = new nsXULTreeAccessible(aContent, aDoc);
NS_IF_ADDREF(accessible);
return accessible;
}
// Table or tree table accessible.
nsAccessible* accessible = new nsXULTreeGridAccessibleWrap(aContent, aWeakShell);
nsAccessible* accessible = new nsXULTreeGridAccessibleWrap(aContent, aDoc);
NS_IF_ADDREF(accessible);
return accessible;
}

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

@ -87,8 +87,6 @@ public:
NS_DECL_NSIOBSERVER
// nsIAccessibilityService
virtual nsAccessible* GetAccessibleInShell(nsINode* aNode,
nsIPresShell* aPresShell);
virtual nsAccessible* GetRootDocumentAccessible(nsIPresShell* aPresShell,
bool aCanCreate);
@ -186,48 +184,35 @@ public:
* one.
*
* @param aNode [in] the given node
* @param aPresShell [in] the pres shell of the node
* @param aWeakShell [in] the weak shell for the pres shell
* @param aDoc [in] the doc accessible of the node
* @param aIsSubtreeHidden [out, optional] indicates whether the node's
* frame and its subtree is hidden
*/
nsAccessible* GetOrCreateAccessible(nsINode* aNode, nsIPresShell* aPresShell,
nsIWeakReference* aWeakShell,
nsAccessible* GetOrCreateAccessible(nsINode* aNode, nsDocAccessible* aDoc,
bool* aIsSubtreeHidden = nsnull);
/**
* Return an accessible for the given DOM node.
* Return an accessible for the given DOM node and eventually a presentation
* shell.
*/
nsAccessible* GetAccessible(nsINode* aNode);
/**
* Return an accessible for a DOM node in the given presshell.
*
* @param aNode [in] the given node
* @param aWeakShell [in] the presentation shell for the given node
*/
inline nsAccessible* GetAccessibleInWeakShell(nsINode* aNode,
nsIWeakReference* aWeakShell)
{
// XXX: weak shell is ignored until multiple shell documents are supported.
return GetAccessible(aNode);
}
nsAccessible* GetAccessible(nsINode* aNode, nsIPresShell* aPresShell);
/**
* Return an accessible for the given DOM node or container accessible if
* the node is not accessible.
*
* @param aNode [in] the given node
* @param aDoc [in] the document accessible. Can't be null.
*/
nsAccessible* GetAccessibleOrContainer(nsINode* aNode,
nsIWeakReference* aWeakShell);
nsAccessible* GetAccessibleOrContainer(nsINode* aNode, nsDocAccessible* aDoc);
/**
* Return a container accessible for the given DOM node.
*/
inline nsAccessible* GetContainerAccessible(nsINode* aNode,
nsIWeakReference* aWeakShell)
nsAccessible* GetContainerAccessible(nsINode* aNode, nsDocAccessible* aDoc)
{
return aNode ?
GetAccessibleOrContainer(aNode->GetNodeParent(), aWeakShell) : nsnull;
GetAccessibleOrContainer(aNode->GetNodeParent(), aDoc) : nsnull;
}
private:
@ -253,28 +238,28 @@ private:
* interface.
*/
already_AddRefed<nsAccessible>
CreateAccessibleByType(nsIContent* aContent, nsIWeakReference* aWeakShell);
CreateAccessibleByType(nsIContent* aContent, nsDocAccessible* aDoc);
/**
* Create accessible for HTML node by tag name.
*/
already_AddRefed<nsAccessible>
CreateHTMLAccessibleByMarkup(nsIFrame* aFrame, nsIContent* aContent,
nsIWeakReference* aWeakShell);
nsDocAccessible* aDoc);
/**
* Create accessible if parent is a deck frame.
*/
already_AddRefed<nsAccessible>
CreateAccessibleForDeckChild(nsIFrame* aFrame, nsIContent* aContent,
nsIWeakReference* aWeakShell);
nsDocAccessible* aDoc);
#ifdef MOZ_XUL
/**
* Create accessible for XUL tree element.
*/
already_AddRefed<nsAccessible>
CreateAccessibleForXULTree(nsIContent* aContent, nsIWeakReference* aWeakShell);
CreateAccessibleForXULTree(nsIContent* aContent, nsDocAccessible* aDoc);
#endif
/**

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

@ -193,8 +193,8 @@ nsresult nsAccessible::QueryInterface(REFNSIID aIID, void** aInstancePtr)
return nsAccessNodeWrap::QueryInterface(aIID, aInstancePtr);
}
nsAccessible::nsAccessible(nsIContent *aContent, nsIWeakReference *aShell) :
nsAccessNodeWrap(aContent, aShell),
nsAccessible::nsAccessible(nsIContent* aContent, nsDocAccessible* aDoc) :
nsAccessNodeWrap(aContent, aDoc),
mParent(nsnull), mIndexInParent(-1), mFlags(eChildrenUninitialized),
mIndexOfEmbeddedChild(-1), mRoleMapEntry(nsnull)
{
@ -273,7 +273,7 @@ nsAccessible::GetDocument(nsIAccessibleDocument **aDocument)
{
NS_ENSURE_ARG_POINTER(aDocument);
NS_IF_ADDREF(*aDocument = GetDocAccessible());
NS_IF_ADDREF(*aDocument = Document());
return NS_OK;
}
@ -400,7 +400,7 @@ nsAccessible::Description(nsString& aDescription)
bool isXUL = mContent->IsXUL();
if (isXUL) {
// Try XUL <description control="[id]">description text</description>
XULDescriptionIterator iter(GetDocAccessible(), mContent);
XULDescriptionIterator iter(Document(), mContent);
nsAccessible* descr = nsnull;
while ((descr = iter.Next()))
nsTextEquivUtils::AppendTextEquivFromContent(this, descr->GetContent(),
@ -446,12 +446,12 @@ nsAccessible::AccessKey() const
if (mContent->IsHTML()) {
// Unless it is labeled via an ancestor <label>, in which case that would
// be redundant.
HTMLLabelIterator iter(GetDocAccessible(), this,
HTMLLabelIterator iter(Document(), this,
HTMLLabelIterator::eSkipAncestorLabel);
label = iter.Next();
} else if (mContent->IsXUL()) {
XULLabelIterator iter(GetDocAccessible(), mContent);
XULLabelIterator iter(Document(), mContent);
label = iter.Next();
}
@ -686,7 +686,7 @@ nsAccessible::VisibilityState()
if (!frame)
return vstates;
const nsCOMPtr<nsIPresShell> shell(GetPresShell());
nsIPresShell* shell(mDoc->PresShell());
if (!shell)
return vstates;
@ -729,7 +729,7 @@ nsAccessible::NativeState()
{
PRUint64 state = 0;
nsDocAccessible* document = GetDocAccessible();
nsDocAccessible* document = Document();
if (!document || !document->IsInDocument(this))
state |= states::STALE;
@ -831,7 +831,7 @@ nsAccessible::ChildAtPoint(PRInt32 aX, PRInt32 aY,
// therefore accessible for containing block may be different from accessible
// for DOM parent but GetFrameForPoint() should be called for containing block
// to get an out of flow element.
nsDocAccessible *accDocument = GetDocAccessible();
nsDocAccessible* accDocument = Document();
NS_ENSURE_TRUE(accDocument, nsnull);
nsIFrame *frame = accDocument->GetFrame();
@ -853,7 +853,7 @@ nsAccessible::ChildAtPoint(PRInt32 aX, PRInt32 aY,
// Get accessible for the node with the point or the first accessible in
// the DOM parent chain.
nsAccessible* accessible =
GetAccService()->GetAccessibleOrContainer(content, mWeakShell);
GetAccService()->GetAccessibleOrContainer(content, accDocument);
if (!accessible)
return fallbackAnswer;
@ -1040,7 +1040,7 @@ nsAccessible::GetBounds(PRInt32* aX, PRInt32* aY,
if (IsDefunct())
return NS_ERROR_FAILURE;
nsCOMPtr<nsIPresShell> presShell = GetPresShell();
nsIPresShell* presShell = mDoc->PresShell();
// This routine will get the entire rectangle for all the frames in this node.
// -------------------------------------------------------------------------
@ -1160,7 +1160,7 @@ nsAccessible::GetHTMLName(nsAString& aLabel)
nsAutoString label;
nsAccessible* labelAcc = nsnull;
HTMLLabelIterator iter(GetDocAccessible(), this);
HTMLLabelIterator iter(Document(), this);
while ((labelAcc = iter.Next())) {
nsresult rv = nsTextEquivUtils::
AppendTextEquivFromContent(this, labelAcc->GetContent(), &label);
@ -1222,7 +1222,7 @@ nsAccessible::GetXULName(nsAString& aLabel)
label.Truncate();
nsAccessible* labelAcc = nsnull;
XULLabelIterator iter(GetDocAccessible(), mContent);
XULLabelIterator iter(Document(), mContent);
while ((labelAcc = iter.Next())) {
nsCOMPtr<nsIDOMXULLabelElement> xulLabel =
do_QueryInterface(labelAcc->GetContent());
@ -1743,7 +1743,7 @@ nsAccessible::GetValue(nsAString& aValue)
// Check if it's a simple xlink.
if (nsCoreUtils::IsXLink(mContent)) {
nsCOMPtr<nsIPresShell> presShell(do_QueryReferent(mWeakShell));
nsIPresShell* presShell = mDoc->PresShell();
if (presShell) {
nsCOMPtr<nsIDOMNode> DOMNode(do_QueryInterface(mContent));
return presShell->GetLinkLocation(DOMNode, aValue);
@ -2058,7 +2058,7 @@ nsAccessible::RelationByType(PRUint32 aType)
// defined on.
switch (aType) {
case nsIAccessibleRelation::RELATION_LABEL_FOR: {
Relation rel(new RelatedAccIterator(GetDocAccessible(), mContent,
Relation rel(new RelatedAccIterator(Document(), mContent,
nsGkAtoms::aria_labelledby));
if (mContent->Tag() == nsGkAtoms::label)
rel.AppendIter(new IDRefsIterator(mContent, mContent->IsHTML() ?
@ -2071,9 +2071,9 @@ nsAccessible::RelationByType(PRUint32 aType)
Relation rel(new IDRefsIterator(mContent,
nsGkAtoms::aria_labelledby));
if (mContent->IsHTML()) {
rel.AppendIter(new HTMLLabelIterator(GetDocAccessible(), this));
rel.AppendIter(new HTMLLabelIterator(Document(), this));
} else if (mContent->IsXUL()) {
rel.AppendIter(new XULLabelIterator(GetDocAccessible(), mContent));
rel.AppendIter(new XULLabelIterator(Document(), mContent));
}
return rel;
@ -2082,13 +2082,13 @@ nsAccessible::RelationByType(PRUint32 aType)
Relation rel(new IDRefsIterator(mContent,
nsGkAtoms::aria_describedby));
if (mContent->IsXUL())
rel.AppendIter(new XULDescriptionIterator(GetDocAccessible(), mContent));
rel.AppendIter(new XULDescriptionIterator(Document(), mContent));
return rel;
}
case nsIAccessibleRelation::RELATION_DESCRIPTION_FOR: {
Relation rel(new RelatedAccIterator(GetDocAccessible(), mContent,
nsGkAtoms::aria_describedby));
Relation rel(new RelatedAccIterator(Document(), mContent,
nsGkAtoms::aria_describedby));
// This affectively adds an optional control attribute to xul:description,
// which only affects accessibility, by allowing the description to be
@ -2101,13 +2101,13 @@ nsAccessible::RelationByType(PRUint32 aType)
return rel;
}
case nsIAccessibleRelation::RELATION_NODE_CHILD_OF: {
Relation rel(new RelatedAccIterator(GetDocAccessible(), mContent,
nsGkAtoms::aria_owns));
Relation rel(new RelatedAccIterator(Document(), mContent,
nsGkAtoms::aria_owns));
// This is an ARIA tree or treegrid that doesn't use owns, so we need to
// get the parent the hard way.
if (mRoleMapEntry && (mRoleMapEntry->role == roles::OUTLINEITEM ||
mRoleMapEntry->role == roles::ROW)) {
mRoleMapEntry->role == roles::ROW)) {
AccGroupInfo* groupInfo = GetGroupInfo();
if (!groupInfo)
return rel;
@ -2134,19 +2134,19 @@ nsAccessible::RelationByType(PRUint32 aType)
return rel;
}
case nsIAccessibleRelation::RELATION_CONTROLLED_BY:
return Relation(new RelatedAccIterator(GetDocAccessible(), mContent,
return Relation(new RelatedAccIterator(Document(), mContent,
nsGkAtoms::aria_controls));
case nsIAccessibleRelation::RELATION_CONTROLLER_FOR: {
Relation rel(new IDRefsIterator(mContent,
nsGkAtoms::aria_controls));
rel.AppendIter(new HTMLOutputIterator(GetDocAccessible(), mContent));
rel.AppendIter(new HTMLOutputIterator(Document(), mContent));
return rel;
}
case nsIAccessibleRelation::RELATION_FLOWS_TO:
return Relation(new IDRefsIterator(mContent,
nsGkAtoms::aria_flowto));
case nsIAccessibleRelation::RELATION_FLOWS_FROM:
return Relation(new RelatedAccIterator(GetDocAccessible(), mContent,
return Relation(new RelatedAccIterator(Document(), mContent,
nsGkAtoms::aria_flowto));
case nsIAccessibleRelation::RELATION_DEFAULT_BUTTON: {
if (mContent->IsHTML()) {
@ -2273,7 +2273,7 @@ nsAccessible::DispatchClickEvent(nsIContent *aContent, PRUint32 aActionIndex)
if (IsDefunct())
return;
nsCOMPtr<nsIPresShell> presShell = GetPresShell();
nsIPresShell* presShell = mDoc->PresShell();
// Scroll into view.
presShell->ScrollContentIntoView(aContent, NS_PRESSHELL_SCROLL_ANYWHERE,
@ -3033,7 +3033,7 @@ nsAccessible::CurrentItem()
nsIDocument* DOMDoc = mContent->OwnerDoc();
dom::Element* activeDescendantElm = DOMDoc->GetElementById(id);
if (activeDescendantElm) {
nsDocAccessible* document = GetDocAccessible();
nsDocAccessible* document = Document();
if (document)
return document->GetAccessible(activeDescendantElm);
}
@ -3079,7 +3079,10 @@ nsAccessible::ContainerWidget() const
void
nsAccessible::CacheChildren()
{
nsAccTreeWalker walker(mWeakShell, mContent, CanHaveAnonChildren());
nsDocAccessible* doc = Document();
NS_ENSURE_TRUE(doc,);
nsAccTreeWalker walker(doc, mContent, CanHaveAnonChildren());
nsAccessible* child = nsnull;
while ((child = walker.NextChild()) && AppendChild(child));
@ -3152,8 +3155,7 @@ nsAccessible::GetSiblingAtOffset(PRInt32 aOffset, nsresult* aError) const
nsAccessible *
nsAccessible::GetFirstAvailableAccessible(nsINode *aStartNode) const
{
nsAccessible* accessible =
GetAccService()->GetAccessibleInWeakShell(aStartNode, mWeakShell);
nsAccessible* accessible = mDoc->GetAccessible(aStartNode);
if (accessible)
return accessible;
@ -3175,8 +3177,7 @@ nsAccessible::GetFirstAvailableAccessible(nsINode *aStartNode) const
return nsnull;
nsCOMPtr<nsINode> node(do_QueryInterface(currentNode));
nsAccessible* accessible =
GetAccService()->GetAccessibleInWeakShell(node, mWeakShell);
nsAccessible* accessible = mDoc->GetAccessible(node);
if (accessible)
return accessible;
}

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

@ -104,7 +104,7 @@ class nsAccessible : public nsAccessNodeWrap,
public nsIAccessibleValue
{
public:
nsAccessible(nsIContent *aContent, nsIWeakReference *aShell);
nsAccessible(nsIContent* aContent, nsDocAccessible* aDoc);
virtual ~nsAccessible();
NS_DECL_ISUPPORTS_INHERITED

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

@ -59,8 +59,8 @@ using namespace mozilla::a11y;
////////////////////////////////////////////////////////////////////////////////
nsLeafAccessible::
nsLeafAccessible(nsIContent *aContent, nsIWeakReference *aShell) :
nsAccessibleWrap(aContent, aShell)
nsLeafAccessible(nsIContent* aContent, nsDocAccessible* aDoc) :
nsAccessibleWrap(aContent, aDoc)
{
}
@ -92,8 +92,8 @@ nsLeafAccessible::CacheChildren()
////////////////////////////////////////////////////////////////////////////////
nsLinkableAccessible::
nsLinkableAccessible(nsIContent *aContent, nsIWeakReference *aShell) :
nsAccessibleWrap(aContent, aShell),
nsLinkableAccessible(nsIContent* aContent, nsDocAccessible* aDoc) :
nsAccessibleWrap(aContent, aDoc),
mActionAcc(nsnull),
mIsLink(false),
mIsOnclick(false)
@ -253,9 +253,9 @@ nsLinkableAccessible::BindToParent(nsAccessible* aParent,
////////////////////////////////////////////////////////////////////////////////
nsEnumRoleAccessible::
nsEnumRoleAccessible(nsIContent *aNode, nsIWeakReference *aShell,
nsEnumRoleAccessible(nsIContent* aNode, nsDocAccessible* aDoc,
roles::Role aRole) :
nsAccessibleWrap(aNode, aShell), mRole(aRole)
nsAccessibleWrap(aNode, aDoc), mRole(aRole)
{
}

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

@ -56,7 +56,7 @@ class nsLeafAccessible : public nsAccessibleWrap
{
public:
nsLeafAccessible(nsIContent *aContent, nsIWeakReference *aShell);
nsLeafAccessible(nsIContent* aContent, nsDocAccessible* aDoc);
// nsISupports
NS_DECL_ISUPPORTS_INHERITED
@ -82,7 +82,7 @@ class nsLinkableAccessible : public nsAccessibleWrap
public:
enum { eAction_Jump = 0 };
nsLinkableAccessible(nsIContent *aContent, nsIWeakReference *aShell);
nsLinkableAccessible(nsIContent* aContent, nsDocAccessible* aDoc);
NS_DECL_ISUPPORTS_INHERITED
@ -123,7 +123,7 @@ protected:
class nsEnumRoleAccessible : public nsAccessibleWrap
{
public:
nsEnumRoleAccessible(nsIContent *aContent, nsIWeakReference *aShell,
nsEnumRoleAccessible(nsIContent* aContent, nsDocAccessible* aDoc,
mozilla::a11y::role aRole);
virtual ~nsEnumRoleAccessible() { }

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

@ -296,7 +296,7 @@ nsCaretAccessible::NormalSelectionChanged(nsISelection* aSelection)
nsRefPtr<AccEvent> event =
new AccCaretMoveEvent(mLastTextAccessible->GetNode());
if (event)
mLastTextAccessible->GetDocAccessible()->FireDelayedAccessibleEvent(event);
mLastTextAccessible->Document()->FireDelayedAccessibleEvent(event);
}
void
@ -316,7 +316,7 @@ nsCaretAccessible::SpellcheckSelectionChanged(nsISelection* aSelection)
nsRefPtr<AccEvent> event =
new AccEvent(nsIAccessibleEvent::EVENT_TEXT_ATTRIBUTE_CHANGED, textAcc);
if (event)
textAcc->GetDocAccessible()->FireDelayedAccessibleEvent(event);
textAcc->Document()->FireDelayedAccessibleEvent(event);
}
nsIntRect

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

@ -256,12 +256,6 @@ public:
{
return aNode->OwnerDoc()->GetShell();
}
static already_AddRefed<nsIWeakReference> GetWeakShellFor(nsINode *aNode)
{
nsCOMPtr<nsIWeakReference> weakShell =
do_GetWeakReference(GetPresShellFor(aNode));
return weakShell.forget();
}
/**
* Return document node for the given document shell tree item.

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

@ -102,12 +102,13 @@ static const PRUint32 kRelationAttrsLen = NS_ARRAY_LENGTH(kRelationAttrs);
// Constructor/desctructor
nsDocAccessible::
nsDocAccessible(nsIDocument *aDocument, nsIContent *aRootContent,
nsIWeakReference *aShell) :
nsHyperTextAccessibleWrap(aRootContent, aShell),
nsDocAccessible(nsIDocument* aDocument, nsIContent* aRootContent,
nsIPresShell* aPresShell) :
nsHyperTextAccessibleWrap(aRootContent, this),
mDocument(aDocument), mScrollPositionChangedTicks(0),
mLoadState(eTreeConstructionPending), mLoadEventType(0),
mVirtualCursor(nsnull)
mVirtualCursor(nsnull),
mPresShell(aPresShell)
{
mFlags |= eDocAccessible;
@ -135,6 +136,7 @@ nsDocAccessible::
nsDocAccessible::~nsDocAccessible()
{
NS_ASSERTION(!mPresShell, "LastRelease was never called!?!");
}
@ -208,7 +210,6 @@ NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION_INHERITED(nsDocAccessible)
NS_IMPL_ADDREF_INHERITED(nsDocAccessible, nsHyperTextAccessible)
NS_IMPL_RELEASE_INHERITED(nsDocAccessible, nsHyperTextAccessible)
////////////////////////////////////////////////////////////////////////////////
// nsIAccessible
@ -622,8 +623,7 @@ nsDocAccessible::Init()
NS_LOG_ACCDOCCREATE_FOR("document initialize", mDocument, this)
// Initialize notification controller.
nsCOMPtr<nsIPresShell> shell(GetPresShell());
mNotificationController = new NotificationController(this, shell);
mNotificationController = new NotificationController(this, mPresShell);
if (!mNotificationController)
return false;
@ -640,7 +640,7 @@ nsDocAccessible::Init()
void
nsDocAccessible::Shutdown()
{
if (!mWeakShell) // already shutdown
if (!mPresShell) // already shutdown
return;
NS_LOG_ACCDOCDESTROY_FOR("document shutdown", mDocument, this)
@ -658,7 +658,7 @@ nsDocAccessible::Shutdown()
mDocument = nsnull;
if (mParent) {
nsDocAccessible* parentDocument = mParent->GetDocAccessible();
nsDocAccessible* parentDocument = mParent->Document();
if (parentDocument)
parentDocument->RemoveChildDocument(this);
@ -678,7 +678,7 @@ nsDocAccessible::Shutdown()
mVirtualCursor = nsnull;
}
mWeakShell = nsnull; // Avoid reentrancy
mPresShell = nsnull; // Avoid reentrancy
mDependentIDsHash.Clear();
mNodeToAccessibleMap.Clear();
@ -692,11 +692,9 @@ nsDocAccessible::Shutdown()
nsIFrame*
nsDocAccessible::GetFrame() const
{
nsCOMPtr<nsIPresShell> shell(do_QueryReferent(mWeakShell));
nsIFrame* root = nsnull;
if (shell)
root = shell->GetRootFrame();
if (mPresShell)
root = mPresShell->GetRootFrame();
return root;
}
@ -754,8 +752,7 @@ nsresult nsDocAccessible::AddEventListeners()
// 1) Set up scroll position listener
// 2) Check for editor and listen for changes to editor
nsCOMPtr<nsIPresShell> presShell(GetPresShell());
NS_ENSURE_TRUE(presShell, NS_ERROR_FAILURE);
NS_ENSURE_TRUE(mPresShell, NS_ERROR_FAILURE);
nsCOMPtr<nsISupports> container = mDocument->GetContainer();
nsCOMPtr<nsIDocShellTreeItem> docShellTreeItem(do_QueryInterface(container));
@ -783,7 +780,7 @@ nsresult nsDocAccessible::AddEventListeners()
NS_ENSURE_TRUE(rootAccessible, NS_ERROR_FAILURE);
nsRefPtr<nsCaretAccessible> caretAccessible = rootAccessible->GetCaretAccessible();
if (caretAccessible) {
caretAccessible->AddDocSelectionListener(presShell);
caretAccessible->AddDocSelectionListener(mPresShell);
}
}
@ -829,11 +826,8 @@ nsresult nsDocAccessible::RemoveEventListeners()
nsRootAccessible* rootAccessible = RootAccessible();
if (rootAccessible) {
nsRefPtr<nsCaretAccessible> caretAccessible = rootAccessible->GetCaretAccessible();
if (caretAccessible) {
// Don't use GetPresShell() which can call Shutdown() if it sees dead pres shell
nsCOMPtr<nsIPresShell> presShell(do_QueryReferent(mWeakShell));
caretAccessible->RemoveDocSelectionListener(presShell);
}
if (caretAccessible)
caretAccessible->RemoveDocSelectionListener(mPresShell);
}
return NS_OK;
@ -863,11 +857,10 @@ void nsDocAccessible::ScrollTimerCallback(nsITimer *aTimer, void *aClosure)
// nsDocAccessible protected member
void nsDocAccessible::AddScrollListener()
{
nsCOMPtr<nsIPresShell> presShell(do_QueryReferent(mWeakShell));
if (!presShell)
if (!mPresShell)
return;
nsIScrollableFrame* sf = presShell->GetRootScrollFrameAsScrollableExternal();
nsIScrollableFrame* sf = mPresShell->GetRootScrollFrameAsScrollableExternal();
if (sf) {
sf->AddScrollPositionListener(this);
NS_LOG_ACCDOCCREATE_TEXT("add scroll listener")
@ -877,11 +870,10 @@ void nsDocAccessible::AddScrollListener()
// nsDocAccessible protected member
void nsDocAccessible::RemoveScrollListener()
{
nsCOMPtr<nsIPresShell> presShell(do_QueryReferent(mWeakShell));
if (!presShell)
if (!mPresShell)
return;
nsIScrollableFrame* sf = presShell->GetRootScrollFrameAsScrollableExternal();
nsIScrollableFrame* sf = mPresShell->GetRootScrollFrameAsScrollableExternal();
if (sf) {
sf->RemoveScrollPositionListener(this);
}
@ -1333,11 +1325,10 @@ nsDocAccessible::HandleAccEvent(AccEvent* aAccEvent)
void*
nsDocAccessible::GetNativeWindow() const
{
nsCOMPtr<nsIPresShell> shell(do_QueryReferent(mWeakShell));
if (!shell)
if (!mPresShell)
return nsnull;
nsIViewManager* vm = shell->GetViewManager();
nsIViewManager* vm = mPresShell->GetViewManager();
if (!vm)
return nsnull;
@ -1524,7 +1515,7 @@ nsDocAccessible::CacheChildren()
{
// Search for accessible children starting from the document element since
// some web pages tend to insert elements under it rather than document body.
nsAccTreeWalker walker(mWeakShell, mDocument->GetRootElement(),
nsAccTreeWalker walker(this, mDocument->GetRootElement(),
CanHaveAnonChildren());
nsAccessible* child = nsnull;
@ -1880,7 +1871,7 @@ nsDocAccessible::UpdateTree(nsAccessible* aContainer, nsIContent* aChildNode,
updateFlags |= UpdateTreeInternal(child, aIsInsert);
} else {
nsAccTreeWalker walker(mWeakShell, aChildNode,
nsAccTreeWalker walker(this, aChildNode,
aContainer->CanHaveAnonChildren(), true);
while ((child = walker.NextChild()))

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

@ -97,7 +97,7 @@ public:
using nsAccessible::GetParent;
nsDocAccessible(nsIDocument *aDocument, nsIContent *aRootContent,
nsIWeakReference* aShell);
nsIPresShell* aPresShell);
virtual ~nsDocAccessible();
// nsIAccessible
@ -138,6 +138,11 @@ public:
// nsDocAccessible
/**
* Return presentation shell for this document accessible.
*/
nsIPresShell* PresShell() const { return mPresShell; }
/**
* Return true if associated DOM document was loaded and isn't unloading.
*/
@ -170,7 +175,8 @@ public:
* Return true if the document has given document state.
*/
bool HasLoadState(LoadState aState) const
{ return (mLoadState & aState) == aState; }
{ return (mLoadState & static_cast<PRUint32>(aState)) ==
static_cast<PRUint32>(aState); }
/**
* Return a native window handler or pointer depending on platform.
@ -181,7 +187,7 @@ public:
* Return the parent document.
*/
nsDocAccessible* ParentDocument() const
{ return mParent ? mParent->GetDocAccessible() : nsnull; }
{ return mParent ? mParent->Document() : nsnull; }
/**
* Return the child document count.
@ -377,6 +383,8 @@ public:
protected:
void LastRelease();
// nsAccessible
virtual void CacheChildren();
@ -653,6 +661,10 @@ protected:
*/
nsRefPtr<NotificationController> mNotificationController;
friend class NotificationController;
private:
nsIPresShell* mPresShell;
};
NS_DEFINE_STATIC_IID_ACCESSOR(nsDocAccessible,

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

@ -201,8 +201,8 @@ ProgressMeterAccessible<Max>::SetCurrentValue(double aValue)
////////////////////////////////////////////////////////////////////////////////
nsRadioButtonAccessible::
nsRadioButtonAccessible(nsIContent *aContent, nsIWeakReference *aShell) :
nsFormControlAccessible(aContent, aShell)
nsRadioButtonAccessible(nsIContent* aContent, nsDocAccessible* aDoc) :
nsFormControlAccessible(aContent, aDoc)
{
}

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

@ -50,8 +50,8 @@ template<int Max>
class ProgressMeterAccessible: public nsFormControlAccessible
{
public:
ProgressMeterAccessible(nsIContent* aContent, nsIWeakReference* aShell) :
nsFormControlAccessible(aContent, aShell)
ProgressMeterAccessible(nsIContent* aContent, nsDocAccessible* aDoc) :
nsFormControlAccessible(aContent, aDoc)
{
}
@ -75,7 +75,7 @@ class nsRadioButtonAccessible : public nsFormControlAccessible
{
public:
nsRadioButtonAccessible(nsIContent *aContent, nsIWeakReference *aShell);
nsRadioButtonAccessible(nsIContent* aContent, nsDocAccessible* aDoc);
// nsIAccessible
NS_IMETHOD GetActionName(PRUint8 aIndex, nsAString& aName);

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

@ -50,8 +50,8 @@ using namespace mozilla::a11y;
////////////////////////////////////////////////////////////////////////////////
nsOuterDocAccessible::
nsOuterDocAccessible(nsIContent *aContent, nsIWeakReference *aShell) :
nsAccessibleWrap(aContent, aShell)
nsOuterDocAccessible(nsIContent* aContent, nsDocAccessible* aDoc) :
nsAccessibleWrap(aContent, aDoc)
{
}

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

@ -53,7 +53,7 @@
class nsOuterDocAccessible : public nsAccessibleWrap
{
public:
nsOuterDocAccessible(nsIContent *aContent, nsIWeakReference *aShell);
nsOuterDocAccessible(nsIContent* aContent, nsDocAccessible* aDoc);
NS_DECL_ISUPPORTS_INHERITED

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

@ -108,9 +108,9 @@ NS_IMPL_RELEASE_INHERITED(nsRootAccessible, nsDocAccessible)
// Constructor/desctructor
nsRootAccessible::
nsRootAccessible(nsIDocument *aDocument, nsIContent *aRootContent,
nsIWeakReference *aShell) :
nsDocAccessibleWrap(aDocument, aRootContent, aShell)
nsRootAccessible(nsIDocument* aDocument, nsIContent* aRootContent,
nsIPresShell* aPresShell) :
nsDocAccessibleWrap(aDocument, aRootContent, aPresShell)
{
mFlags |= eRootAccessible;
}
@ -371,24 +371,20 @@ nsRootAccessible::ProcessDOMEvent(nsIDOMEvent* aDOMEvent)
nsAutoString eventType;
aDOMEvent->GetType(eventType);
nsCOMPtr<nsIWeakReference> weakShell =
nsCoreUtils::GetWeakShellFor(origTargetNode);
if (!weakShell)
return;
if (eventType.EqualsLiteral("popuphiding")) {
HandlePopupHidingEvent(origTargetNode);
return;
}
nsAccessible* accessible =
GetAccService()->GetAccessibleOrContainer(origTargetNode, weakShell);
nsDocAccessible* targetDocument = GetAccService()->
GetDocAccessible(origTargetNode->OwnerDoc());
NS_ASSERTION(targetDocument, "No document while accessible is in document?!");
nsAccessible* accessible =
targetDocument->GetAccessibleOrContainer(origTargetNode);
if (!accessible)
return;
nsDocAccessible* targetDocument = accessible->GetDocAccessible();
NS_ASSERTION(targetDocument, "No document while accessible is in document?!");
nsINode* targetNode = accessible->GetNode();
#ifdef MOZ_XUL
@ -568,7 +564,7 @@ void
nsRootAccessible::Shutdown()
{
// Called manually or by nsAccessNode::LastRelease()
if (!mWeakShell)
if (!PresShell())
return; // Already shutdown
nsDocAccessibleWrap::Shutdown();

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

@ -68,8 +68,8 @@ class nsRootAccessible : public nsDocAccessibleWrap,
NS_DECL_ISUPPORTS_INHERITED
public:
nsRootAccessible(nsIDocument *aDocument, nsIContent *aRootContent,
nsIWeakReference *aShell);
nsRootAccessible(nsIDocument* aDocument, nsIContent* aRootContent,
nsIPresShell* aPresShell);
virtual ~nsRootAccessible();
// nsIAccessible

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

@ -49,8 +49,8 @@ using namespace mozilla::a11y;
////////////////////////////////////////////////////////////////////////////////
nsTextAccessible::
nsTextAccessible(nsIContent *aContent, nsIWeakReference *aShell) :
nsLinkableAccessible(aContent, aShell)
nsTextAccessible(nsIContent* aContent, nsDocAccessible* aDoc) :
nsLinkableAccessible(aContent, aDoc)
{
mFlags |= eTextLeafAccessible;
}

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

@ -47,7 +47,7 @@
class nsTextAccessible : public nsLinkableAccessible
{
public:
nsTextAccessible(nsIContent *aContent, nsIWeakReference *aShell);
nsTextAccessible(nsIContent* aContent, nsDocAccessible* aDoc);
// nsAccessible
virtual mozilla::a11y::role NativeRole();

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

@ -118,7 +118,7 @@ nsTextEquivUtils::AppendTextEquivFromContent(nsAccessible *aInitiatorAcc,
gInitiatorAcc = aInitiatorAcc;
nsCOMPtr<nsIWeakReference> shell = nsCoreUtils::GetWeakShellFor(aContent);
nsIPresShell* shell = nsCoreUtils::GetPresShellFor(aContent);
if (!shell) {
NS_ASSERTION(true, "There is no presshell!");
gInitiatorAcc = nsnull;
@ -135,8 +135,8 @@ nsTextEquivUtils::AppendTextEquivFromContent(nsAccessible *aInitiatorAcc,
bool goThroughDOMSubtree = true;
if (isVisible) {
nsAccessible *accessible =
GetAccService()->GetAccessibleInWeakShell(aContent, shell);
nsAccessible* accessible =
GetAccService()->GetAccessible(aContent, shell);
if (accessible) {
rv = AppendFromAccessible(accessible, aString);
goThroughDOMSubtree = false;

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

@ -42,8 +42,8 @@
using namespace mozilla::a11y;
nsHTMLCanvasAccessible::
nsHTMLCanvasAccessible(nsIContent* aContent, nsIWeakReference* aShell) :
nsHyperTextAccessible(aContent, aShell)
nsHTMLCanvasAccessible(nsIContent* aContent, nsDocAccessible* aDoc) :
nsHyperTextAccessible(aContent, aDoc)
{
}

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

@ -46,7 +46,7 @@
class nsHTMLCanvasAccessible : public nsHyperTextAccessible
{
public:
nsHTMLCanvasAccessible(nsIContent* aContent, nsIWeakReference* aShell);
nsHTMLCanvasAccessible(nsIContent* aContent, nsDocAccessible* aDoc);
virtual ~nsHTMLCanvasAccessible() { }
// nsAccessible

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

@ -68,8 +68,8 @@ using namespace mozilla::a11y;
////////////////////////////////////////////////////////////////////////////////
nsHTMLCheckboxAccessible::
nsHTMLCheckboxAccessible(nsIContent *aContent, nsIWeakReference *aShell) :
nsFormControlAccessible(aContent, aShell)
nsHTMLCheckboxAccessible(nsIContent* aContent, nsDocAccessible* aDoc) :
nsFormControlAccessible(aContent, aDoc)
{
}
@ -154,8 +154,8 @@ nsHTMLCheckboxAccessible::IsWidget() const
////////////////////////////////////////////////////////////////////////////////
nsHTMLRadioButtonAccessible::
nsHTMLRadioButtonAccessible(nsIContent *aContent, nsIWeakReference *aShell) :
nsRadioButtonAccessible(aContent, aShell)
nsHTMLRadioButtonAccessible(nsIContent* aContent, nsDocAccessible* aDoc) :
nsRadioButtonAccessible(aContent, aDoc)
{
}
@ -243,8 +243,8 @@ nsHTMLRadioButtonAccessible::GetPositionAndSizeInternal(PRInt32 *aPosInSet,
////////////////////////////////////////////////////////////////////////////////
nsHTMLButtonAccessible::
nsHTMLButtonAccessible(nsIContent *aContent, nsIWeakReference *aShell) :
nsHyperTextAccessibleWrap(aContent, aShell)
nsHTMLButtonAccessible(nsIContent* aContent, nsDocAccessible* aDoc) :
nsHyperTextAccessibleWrap(aContent, aDoc)
{
}
@ -358,8 +358,8 @@ nsHTMLButtonAccessible::IsWidget() const
////////////////////////////////////////////////////////////////////////////////
nsHTML4ButtonAccessible::
nsHTML4ButtonAccessible(nsIContent *aContent, nsIWeakReference *aShell) :
nsHyperTextAccessibleWrap(aContent, aShell)
nsHTML4ButtonAccessible(nsIContent* aContent, nsDocAccessible* aDoc) :
nsHyperTextAccessibleWrap(aContent, aDoc)
{
}
@ -423,8 +423,8 @@ nsHTML4ButtonAccessible::IsWidget() const
////////////////////////////////////////////////////////////////////////////////
nsHTMLTextFieldAccessible::
nsHTMLTextFieldAccessible(nsIContent *aContent, nsIWeakReference *aShell) :
nsHyperTextAccessibleWrap(aContent, aShell)
nsHTMLTextFieldAccessible(nsIContent* aContent, nsDocAccessible* aDoc) :
nsHyperTextAccessibleWrap(aContent, aDoc)
{
}
@ -655,8 +655,8 @@ nsHTMLTextFieldAccessible::ContainerWidget() const
////////////////////////////////////////////////////////////////////////////////
nsHTMLFileInputAccessible::
nsHTMLFileInputAccessible(nsIContent* aContent, nsIWeakReference* aShell) :
nsHyperTextAccessibleWrap(aContent, aShell)
nsHTMLFileInputAccessible(nsIContent* aContent, nsDocAccessible* aDoc) :
nsHyperTextAccessibleWrap(aContent, aDoc)
{
mFlags |= eHTMLFileInputAccessible;
}
@ -710,8 +710,8 @@ nsHTMLFileInputAccessible::HandleAccEvent(AccEvent* aEvent)
////////////////////////////////////////////////////////////////////////////////
nsHTMLGroupboxAccessible::
nsHTMLGroupboxAccessible(nsIContent *aContent, nsIWeakReference *aShell) :
nsHyperTextAccessibleWrap(aContent, aShell)
nsHTMLGroupboxAccessible(nsIContent* aContent, nsDocAccessible* aDoc) :
nsHyperTextAccessibleWrap(aContent, aDoc)
{
}
@ -770,8 +770,8 @@ nsHTMLGroupboxAccessible::RelationByType(PRUint32 aType)
////////////////////////////////////////////////////////////////////////////////
nsHTMLLegendAccessible::
nsHTMLLegendAccessible(nsIContent *aContent, nsIWeakReference *aShell) :
nsHyperTextAccessibleWrap(aContent, aShell)
nsHTMLLegendAccessible(nsIContent* aContent, nsDocAccessible* aDoc) :
nsHyperTextAccessibleWrap(aContent, aDoc)
{
}
@ -800,8 +800,8 @@ nsHTMLLegendAccessible::NativeRole()
////////////////////////////////////////////////////////////////////////////////
nsHTMLFigureAccessible::
nsHTMLFigureAccessible(nsIContent* aContent, nsIWeakReference* aShell) :
nsHyperTextAccessibleWrap(aContent, aShell)
nsHTMLFigureAccessible(nsIContent* aContent, nsDocAccessible* aDoc) :
nsHyperTextAccessibleWrap(aContent, aDoc)
{
}
@ -870,8 +870,8 @@ nsHTMLFigureAccessible::Caption() const
////////////////////////////////////////////////////////////////////////////////
nsHTMLFigcaptionAccessible::
nsHTMLFigcaptionAccessible(nsIContent* aContent, nsIWeakReference* aShell) :
nsHyperTextAccessibleWrap(aContent, aShell)
nsHTMLFigcaptionAccessible(nsIContent* aContent, nsDocAccessible* aDoc) :
nsHyperTextAccessibleWrap(aContent, aDoc)
{
}

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

@ -56,7 +56,7 @@ class nsHTMLCheckboxAccessible : public nsFormControlAccessible
public:
enum { eAction_Click = 0 };
nsHTMLCheckboxAccessible(nsIContent *aContent, nsIWeakReference *aShell);
nsHTMLCheckboxAccessible(nsIContent* aContent, nsDocAccessible* aDoc);
// nsIAccessible
NS_IMETHOD GetActionName(PRUint8 aIndex, nsAString& aName);
@ -81,7 +81,7 @@ class nsHTMLRadioButtonAccessible : public nsRadioButtonAccessible
{
public:
nsHTMLRadioButtonAccessible(nsIContent *aContent, nsIWeakReference *aShell);
nsHTMLRadioButtonAccessible(nsIContent* aContent, nsDocAccessible* aDoc);
// nsAccessible
virtual PRUint64 NativeState();
@ -100,7 +100,7 @@ class nsHTMLButtonAccessible : public nsHyperTextAccessibleWrap
public:
enum { eAction_Click = 0 };
nsHTMLButtonAccessible(nsIContent *aContent, nsIWeakReference *aShell);
nsHTMLButtonAccessible(nsIContent* aContent, nsDocAccessible* aDoc);
// nsIAccessible
NS_IMETHOD GetActionName(PRUint8 aIndex, nsAString& aName);
@ -129,7 +129,7 @@ class nsHTML4ButtonAccessible : public nsHyperTextAccessibleWrap
public:
enum { eAction_Click = 0 };
nsHTML4ButtonAccessible(nsIContent *aContent, nsIWeakReference *aShell);
nsHTML4ButtonAccessible(nsIContent* aContent, nsDocAccessible* aDoc);
// nsIAccessible
NS_IMETHOD GetActionName(PRUint8 aIndex, nsAString& aName);
@ -156,7 +156,7 @@ class nsHTMLTextFieldAccessible : public nsHyperTextAccessibleWrap
public:
enum { eAction_Click = 0 };
nsHTMLTextFieldAccessible(nsIContent *aContent, nsIWeakReference *aShell);
nsHTMLTextFieldAccessible(nsIContent* aContent, nsDocAccessible* aDoc);
NS_DECL_ISUPPORTS_INHERITED
@ -190,7 +190,7 @@ public:
class nsHTMLFileInputAccessible : public nsHyperTextAccessibleWrap
{
public:
nsHTMLFileInputAccessible(nsIContent* aContent, nsIWeakReference* aShell);
nsHTMLFileInputAccessible(nsIContent* aContent, nsDocAccessible* aDoc);
// nsAccessible
virtual mozilla::a11y::role NativeRole();
@ -203,7 +203,7 @@ public:
class nsHTMLGroupboxAccessible : public nsHyperTextAccessibleWrap
{
public:
nsHTMLGroupboxAccessible(nsIContent *aContent, nsIWeakReference *aShell);
nsHTMLGroupboxAccessible(nsIContent* aContent, nsDocAccessible* aDoc);
// nsAccessible
virtual nsresult GetNameInternal(nsAString& aName);
@ -221,7 +221,7 @@ protected:
class nsHTMLLegendAccessible : public nsHyperTextAccessibleWrap
{
public:
nsHTMLLegendAccessible(nsIContent *aContent, nsIWeakReference *aShell);
nsHTMLLegendAccessible(nsIContent* aContent, nsDocAccessible* aDoc);
// nsAccessible
virtual mozilla::a11y::role NativeRole();
@ -234,7 +234,7 @@ public:
class nsHTMLFigureAccessible : public nsHyperTextAccessibleWrap
{
public:
nsHTMLFigureAccessible(nsIContent* aContent, nsIWeakReference* aShell);
nsHTMLFigureAccessible(nsIContent* aContent, nsDocAccessible* aDoc);
// nsAccessible
virtual nsresult GetAttributesInternal(nsIPersistentProperties* aAttributes);
@ -253,7 +253,7 @@ protected:
class nsHTMLFigcaptionAccessible : public nsHyperTextAccessibleWrap
{
public:
nsHTMLFigcaptionAccessible(nsIContent* aContent, nsIWeakReference* aShell);
nsHTMLFigcaptionAccessible(nsIContent* aContent, nsDocAccessible* aDoc);
// nsAccessible
virtual mozilla::a11y::role NativeRole();

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

@ -60,8 +60,8 @@ using namespace mozilla::a11y;
////////////////////////////////////////////////////////////////////////////////
nsHTMLImageAccessible::
nsHTMLImageAccessible(nsIContent *aContent, nsIWeakReference *aShell) :
nsLinkableAccessible(aContent, aShell)
nsHTMLImageAccessible(nsIContent* aContent, nsDocAccessible* aDoc) :
nsLinkableAccessible(aContent, aDoc)
{
}

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

@ -51,7 +51,7 @@ class nsHTMLImageAccessible : public nsLinkableAccessible,
public nsIAccessibleImage
{
public:
nsHTMLImageAccessible(nsIContent *aContent, nsIWeakReference *aShell);
nsHTMLImageAccessible(nsIContent* aContent, nsDocAccessible* aDoc);
// nsISupports
NS_DECL_ISUPPORTS_INHERITED

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

@ -57,9 +57,9 @@ using namespace mozilla::a11y;
////////////////////////////////////////////////////////////////////////////////
nsHTMLImageMapAccessible::
nsHTMLImageMapAccessible(nsIContent *aContent, nsIWeakReference *aShell,
nsIDOMHTMLMapElement *aMapElm) :
nsHTMLImageAccessibleWrap(aContent, aShell), mMapElement(aMapElm)
nsHTMLImageMapAccessible(nsIContent* aContent, nsDocAccessible* aDoc,
nsIDOMHTMLMapElement* aMapElm) :
nsHTMLImageAccessibleWrap(aContent, aDoc), mMapElement(aMapElm)
{
}
@ -117,7 +117,7 @@ nsHTMLImageMapAccessible::CacheChildren()
if (!mapAreas)
return;
nsDocAccessible* document = GetDocAccessible();
nsDocAccessible* document = Document();
PRUint32 areaCount = 0;
mapAreas->GetLength(&areaCount);
@ -130,7 +130,7 @@ nsHTMLImageMapAccessible::CacheChildren()
nsCOMPtr<nsIContent> areaContent(do_QueryInterface(areaNode));
nsRefPtr<nsAccessible> area =
new nsHTMLAreaAccessible(areaContent, mWeakShell);
new nsHTMLAreaAccessible(areaContent, mDoc);
if (!document->BindToDocument(area, nsAccUtils::GetRoleMapEntry(areaContent)) ||
!AppendChild(area)) {
@ -145,8 +145,8 @@ nsHTMLImageMapAccessible::CacheChildren()
////////////////////////////////////////////////////////////////////////////////
nsHTMLAreaAccessible::
nsHTMLAreaAccessible(nsIContent *aContent, nsIWeakReference *aShell) :
nsHTMLLinkAccessible(aContent, aShell)
nsHTMLAreaAccessible(nsIContent* aContent, nsDocAccessible* aDoc) :
nsHTMLLinkAccessible(aContent, aDoc)
{
}

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

@ -51,8 +51,8 @@
class nsHTMLImageMapAccessible : public nsHTMLImageAccessibleWrap
{
public:
nsHTMLImageMapAccessible(nsIContent *aContent, nsIWeakReference *aShell,
nsIDOMHTMLMapElement *aMapElm);
nsHTMLImageMapAccessible(nsIContent* aContent, nsDocAccessible* aDoc,
nsIDOMHTMLMapElement* aMapElm);
// nsISupports and cycle collector
NS_DECL_ISUPPORTS_INHERITED
@ -83,7 +83,7 @@ class nsHTMLAreaAccessible : public nsHTMLLinkAccessible
{
public:
nsHTMLAreaAccessible(nsIContent *aContent, nsIWeakReference *aShell);
nsHTMLAreaAccessible(nsIContent* aContent, nsDocAccessible* aDoc);
// nsIAccessible

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

@ -43,6 +43,7 @@
#include "Role.h"
#include "States.h"
#include "nsDocAccessible.h"
#include "nsEventStates.h"
#include "mozilla/dom/Element.h"
@ -53,8 +54,8 @@ using namespace mozilla::a11y;
////////////////////////////////////////////////////////////////////////////////
nsHTMLLinkAccessible::
nsHTMLLinkAccessible(nsIContent *aContent, nsIWeakReference *aShell) :
nsHyperTextAccessibleWrap(aContent, aShell)
nsHTMLLinkAccessible(nsIContent* aContent, nsDocAccessible* aDoc) :
nsHyperTextAccessibleWrap(aContent, aDoc)
{
}
@ -116,7 +117,7 @@ nsHTMLLinkAccessible::GetValue(nsAString& aValue)
if (!aValue.IsEmpty())
return NS_OK;
nsCOMPtr<nsIPresShell> presShell(do_QueryReferent(mWeakShell));
nsIPresShell* presShell(mDoc->PresShell());
nsCOMPtr<nsIDOMNode> DOMNode(do_QueryInterface(mContent));
return presShell->GetLinkLocation(DOMNode, aValue);
}

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

@ -45,7 +45,7 @@
class nsHTMLLinkAccessible : public nsHyperTextAccessibleWrap
{
public:
nsHTMLLinkAccessible(nsIContent *aContent, nsIWeakReference *aShell);
nsHTMLLinkAccessible(nsIContent* aContent, nsDocAccessible* aDoc);
NS_DECL_ISUPPORTS_INHERITED

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

@ -65,8 +65,8 @@ using namespace mozilla::a11y;
////////////////////////////////////////////////////////////////////////////////
nsHTMLSelectListAccessible::
nsHTMLSelectListAccessible(nsIContent *aContent, nsIWeakReference *aShell) :
nsAccessibleWrap(aContent, aShell)
nsHTMLSelectListAccessible(nsIContent* aContent, nsDocAccessible* aDoc) :
nsAccessibleWrap(aContent, aDoc)
{
mFlags |= eListControlAccessible;
}
@ -144,7 +144,7 @@ nsHTMLSelectListAccessible::CurrentItem()
if (listControlFrame) {
nsCOMPtr<nsIContent> activeOptionNode = listControlFrame->GetCurrentOption();
if (activeOptionNode) {
nsDocAccessible* document = GetDocAccessible();
nsDocAccessible* document = Document();
if (document)
return document->GetAccessible(activeOptionNode);
}
@ -179,7 +179,6 @@ nsHTMLSelectListAccessible::CacheChildren()
void
nsHTMLSelectListAccessible::CacheOptSiblings(nsIContent *aParentContent)
{
nsCOMPtr<nsIPresShell> presShell(do_QueryReferent(mWeakShell));
for (nsIContent* childContent = aParentContent->GetFirstChild(); childContent;
childContent = childContent->GetNextSibling()) {
if (!childContent->IsHTML()) {
@ -192,8 +191,7 @@ nsHTMLSelectListAccessible::CacheOptSiblings(nsIContent *aParentContent)
// Get an accessible for option or optgroup and cache it.
nsRefPtr<nsAccessible> accessible =
GetAccService()->GetOrCreateAccessible(childContent, presShell,
mWeakShell);
GetAccService()->GetOrCreateAccessible(childContent, mDoc);
if (accessible)
AppendChild(accessible);
@ -210,8 +208,8 @@ nsHTMLSelectListAccessible::CacheOptSiblings(nsIContent *aParentContent)
////////////////////////////////////////////////////////////////////////////////
nsHTMLSelectOptionAccessible::
nsHTMLSelectOptionAccessible(nsIContent *aContent, nsIWeakReference *aShell) :
nsHyperTextAccessibleWrap(aContent, aShell)
nsHTMLSelectOptionAccessible(nsIContent* aContent, nsDocAccessible* aDoc) :
nsHyperTextAccessibleWrap(aContent, aDoc)
{
}
@ -439,7 +437,7 @@ nsHTMLSelectOptionAccessible::GetSelectState(PRUint64* aState)
}
if (content) {
nsAccessible* selAcc = GetAccService()->GetAccessible(content);
nsAccessible* selAcc = GetAccService()->GetAccessible(content, nsnull);
if (selAcc) {
*aState = selAcc->State();
return content;
@ -454,9 +452,9 @@ nsHTMLSelectOptionAccessible::GetSelectState(PRUint64* aState)
////////////////////////////////////////////////////////////////////////////////
nsHTMLSelectOptGroupAccessible::
nsHTMLSelectOptGroupAccessible(nsIContent *aContent,
nsIWeakReference *aShell) :
nsHTMLSelectOptionAccessible(aContent, aShell)
nsHTMLSelectOptGroupAccessible(nsIContent* aContent,
nsDocAccessible* aDoc) :
nsHTMLSelectOptionAccessible(aContent, aDoc)
{
}
@ -511,8 +509,8 @@ nsHTMLSelectOptGroupAccessible::CacheChildren()
////////////////////////////////////////////////////////////////////////////////
nsHTMLComboboxAccessible::
nsHTMLComboboxAccessible(nsIContent *aContent, nsIWeakReference *aShell) :
nsAccessibleWrap(aContent, aShell)
nsHTMLComboboxAccessible(nsIContent* aContent, nsDocAccessible* aDoc) :
nsAccessibleWrap(aContent, aDoc)
{
mFlags |= eComboboxAccessible;
}
@ -552,10 +550,10 @@ nsHTMLComboboxAccessible::CacheChildren()
if (!mListAccessible) {
mListAccessible =
new nsHTMLComboboxListAccessible(mParent, mContent, mWeakShell);
new nsHTMLComboboxListAccessible(mParent, mContent, mDoc);
// Initialize and put into cache.
if (!GetDocAccessible()->BindToDocument(mListAccessible, nsnull))
if (!Document()->BindToDocument(mListAccessible, nsnull))
return;
}
@ -718,7 +716,7 @@ nsHTMLComboboxAccessible::SelectedOption() const
if (listControlFrame) {
nsCOMPtr<nsIContent> activeOptionNode = listControlFrame->GetCurrentOption();
if (activeOptionNode) {
nsDocAccessible* document = GetDocAccessible();
nsDocAccessible* document = Document();
if (document)
return document->GetAccessible(activeOptionNode);
}
@ -733,9 +731,9 @@ nsHTMLComboboxAccessible::SelectedOption() const
////////////////////////////////////////////////////////////////////////////////
nsHTMLComboboxListAccessible::
nsHTMLComboboxListAccessible(nsIAccessible *aParent, nsIContent *aContent,
nsIWeakReference *aShell) :
nsHTMLSelectListAccessible(aContent, aShell)
nsHTMLComboboxListAccessible(nsIAccessible* aParent, nsIContent* aContent,
nsDocAccessible* aDoc) :
nsHTMLSelectListAccessible(aContent, aDoc)
{
}

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

@ -68,7 +68,7 @@ class nsHTMLSelectListAccessible : public nsAccessibleWrap
{
public:
nsHTMLSelectListAccessible(nsIContent *aContent, nsIWeakReference *aShell);
nsHTMLSelectListAccessible(nsIContent* aContent, nsDocAccessible* aDoc);
virtual ~nsHTMLSelectListAccessible() {}
// nsAccessible
@ -108,7 +108,7 @@ class nsHTMLSelectOptionAccessible : public nsHyperTextAccessibleWrap
public:
enum { eAction_Select = 0 };
nsHTMLSelectOptionAccessible(nsIContent *aContent, nsIWeakReference *aShell);
nsHTMLSelectOptionAccessible(nsIContent* aContent, nsDocAccessible* aDoc);
virtual ~nsHTMLSelectOptionAccessible() {}
// nsIAccessible
@ -152,7 +152,7 @@ class nsHTMLSelectOptGroupAccessible : public nsHTMLSelectOptionAccessible
{
public:
nsHTMLSelectOptGroupAccessible(nsIContent *aContent, nsIWeakReference *aShell);
nsHTMLSelectOptGroupAccessible(nsIContent* aContent, nsDocAccessible* aDoc);
virtual ~nsHTMLSelectOptGroupAccessible() {}
// nsIAccessible
@ -185,7 +185,7 @@ class nsHTMLComboboxAccessible : public nsAccessibleWrap
public:
enum { eAction_Click = 0 };
nsHTMLComboboxAccessible(nsIContent *aContent, nsIWeakReference *aShell);
nsHTMLComboboxAccessible(nsIContent* aContent, nsDocAccessible* aDoc);
virtual ~nsHTMLComboboxAccessible() {}
// nsIAccessible
@ -234,9 +234,9 @@ class nsHTMLComboboxListAccessible : public nsHTMLSelectListAccessible
{
public:
nsHTMLComboboxListAccessible(nsIAccessible *aParent,
nsIContent *aContent,
nsIWeakReference* aShell);
nsHTMLComboboxListAccessible(nsIAccessible* aParent,
nsIContent* aContent,
nsDocAccessible* aDoc);
virtual ~nsHTMLComboboxListAccessible() {}
// nsAccessNode

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

@ -76,8 +76,8 @@ using namespace mozilla::a11y;
////////////////////////////////////////////////////////////////////////////////
nsHTMLTableCellAccessible::
nsHTMLTableCellAccessible(nsIContent *aContent, nsIWeakReference *aShell) :
nsHyperTextAccessibleWrap(aContent, aShell)
nsHTMLTableCellAccessible(nsIContent* aContent, nsDocAccessible* aDoc) :
nsHyperTextAccessibleWrap(aContent, aDoc)
{
}
@ -348,8 +348,7 @@ nsHTMLTableCellAccessible::GetHeaderCells(PRInt32 aRowOrColumnHeaderCell,
desiredRole = roles::COLUMNHEADER;
do {
nsAccessible* headerCell =
GetAccService()->GetAccessibleInWeakShell(headerCellElm, mWeakShell);
nsAccessible* headerCell = mDoc->GetAccessible(headerCellElm);
if (headerCell && headerCell->Role() == desiredRole)
headerCells->AppendElement(static_cast<nsIAccessible*>(headerCell),
@ -376,9 +375,9 @@ nsHTMLTableCellAccessible::GetHeaderCells(PRInt32 aRowOrColumnHeaderCell,
////////////////////////////////////////////////////////////////////////////////
nsHTMLTableHeaderCellAccessible::
nsHTMLTableHeaderCellAccessible(nsIContent *aContent,
nsIWeakReference *aShell) :
nsHTMLTableCellAccessible(aContent, aShell)
nsHTMLTableHeaderCellAccessible(nsIContent* aContent,
nsDocAccessible* aDoc) :
nsHTMLTableCellAccessible(aContent, aDoc)
{
}
@ -436,8 +435,8 @@ nsHTMLTableHeaderCellAccessible::NativeRole()
////////////////////////////////////////////////////////////////////////////////
nsHTMLTableAccessible::
nsHTMLTableAccessible(nsIContent *aContent, nsIWeakReference *aShell) :
nsAccessibleWrap(aContent, aShell)
nsHTMLTableAccessible(nsIContent* aContent, nsDocAccessible* aDoc) :
nsAccessibleWrap(aContent, aDoc)
{
}
@ -458,7 +457,7 @@ nsHTMLTableAccessible::CacheChildren()
// caption only, because nsAccessibilityService ensures we don't create
// accessibles for the other captions, since only the first is actually
// visible.
nsAccTreeWalker walker(mWeakShell, mContent, CanHaveAnonChildren());
nsAccTreeWalker walker(mDoc, mContent, CanHaveAnonChildren());
nsAccessible* child = nsnull;
while ((child = walker.NextChild())) {
@ -718,8 +717,7 @@ nsHTMLTableAccessible::GetSelectedCells(nsIArray **aCells)
if (NS_SUCCEEDED(rv) && startRowIndex == rowIndex &&
startColIndex == columnIndex && isSelected) {
nsCOMPtr<nsIContent> cellContent(do_QueryInterface(cellElement));
nsAccessible *cell =
GetAccService()->GetAccessibleInWeakShell(cellContent, mWeakShell);
nsAccessible *cell = mDoc->GetAccessible(cellContent);
selCells->AppendElement(static_cast<nsIAccessible*>(cell), false);
}
}
@ -892,8 +890,7 @@ nsHTMLTableAccessible::GetCellAt(PRInt32 aRow, PRInt32 aColumn,
NS_ENSURE_SUCCESS(rv, rv);
nsCOMPtr<nsIContent> cellContent(do_QueryInterface(cellElement));
nsAccessible *cell =
GetAccService()->GetAccessibleInWeakShell(cellContent, mWeakShell);
nsAccessible* cell = mDoc->GetAccessible(cellContent);
if (!cell) {
return NS_ERROR_INVALID_ARG;
@ -1194,7 +1191,7 @@ nsHTMLTableAccessible::AddRowOrColumnToSelection(PRInt32 aIndex,
NS_ENSURE_SUCCESS(rv, rv);
nsCOMPtr<nsIPresShell> presShell(GetPresShell());
nsIPresShell* presShell(mDoc->PresShell());
nsRefPtr<nsFrameSelection> tableSelection =
const_cast<nsFrameSelection*>(presShell->ConstFrameSelection());
@ -1226,7 +1223,7 @@ nsHTMLTableAccessible::RemoveRowsOrColumnsFromSelection(PRInt32 aIndex,
nsITableLayout *tableLayout = GetTableLayout();
NS_ENSURE_STATE(tableLayout);
nsCOMPtr<nsIPresShell> presShell(GetPresShell());
nsIPresShell* presShell(mDoc->PresShell());
nsRefPtr<nsFrameSelection> tableSelection =
const_cast<nsFrameSelection*>(presShell->ConstFrameSelection());
@ -1385,7 +1382,7 @@ nsHTMLTableAccessible::IsProbablyForLayout(bool *aIsProbablyForLayout)
if (IsDefunct())
return NS_ERROR_FAILURE;
nsDocAccessible *docAccessible = GetDocAccessible();
nsDocAccessible* docAccessible = Document();
if (docAccessible) {
PRUint64 docState = docAccessible->State();
if (docState & states::EDITABLE) { // Need to see all elements while document is being edited
@ -1539,7 +1536,7 @@ nsHTMLTableAccessible::IsProbablyForLayout(bool *aIsProbablyForLayout)
NS_ENSURE_TRUE(tableFrame , NS_ERROR_FAILURE);
nsSize tableSize = tableFrame->GetSize();
nsDocAccessible *docAccessible = GetDocAccessible();
nsDocAccessible* docAccessible = Document();
NS_ENSURE_TRUE(docAccessible, NS_ERROR_FAILURE);
nsIFrame *docFrame = docAccessible->GetFrame();
NS_ENSURE_TRUE(docFrame , NS_ERROR_FAILURE);

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

@ -52,7 +52,7 @@ class nsHTMLTableCellAccessible : public nsHyperTextAccessibleWrap,
public nsIAccessibleTableCell
{
public:
nsHTMLTableCellAccessible(nsIContent *aContent, nsIWeakReference *aShell);
nsHTMLTableCellAccessible(nsIContent* aContent, nsDocAccessible* aDoc);
// nsISupports
NS_DECL_ISUPPORTS_INHERITED
@ -95,8 +95,8 @@ protected:
class nsHTMLTableHeaderCellAccessible : public nsHTMLTableCellAccessible
{
public:
nsHTMLTableHeaderCellAccessible(nsIContent *aContent,
nsIWeakReference *aShell);
nsHTMLTableHeaderCellAccessible(nsIContent* aContent,
nsDocAccessible* aDoc);
// nsAccessible
virtual mozilla::a11y::role NativeRole();
@ -124,7 +124,7 @@ class nsHTMLTableAccessible : public nsAccessibleWrap,
public nsIAccessibleTable
{
public:
nsHTMLTableAccessible(nsIContent *aContent, nsIWeakReference *aShell);
nsHTMLTableAccessible(nsIContent* aContent, nsDocAccessible* aDoc);
NS_DECL_ISUPPORTS_INHERITED
NS_DECL_NSIACCESSIBLETABLE
@ -211,8 +211,9 @@ NS_DEFINE_STATIC_IID_ACCESSOR(nsHTMLTableAccessible,
class nsHTMLCaptionAccessible : public nsHyperTextAccessibleWrap
{
public:
nsHTMLCaptionAccessible(nsIContent *aContent, nsIWeakReference *aShell) :
nsHyperTextAccessibleWrap(aContent, aShell) { }
nsHTMLCaptionAccessible(nsIContent* aContent, nsDocAccessible* aDoc) :
nsHyperTextAccessibleWrap(aContent, aDoc) { }
virtual ~nsHTMLCaptionAccessible() { }
// nsIAccessible

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

@ -61,8 +61,8 @@ using namespace mozilla::a11y;
////////////////////////////////////////////////////////////////////////////////
nsHTMLTextAccessible::
nsHTMLTextAccessible(nsIContent *aContent, nsIWeakReference *aShell) :
nsTextAccessibleWrap(aContent, aShell)
nsHTMLTextAccessible(nsIContent* aContent, nsDocAccessible* aDoc) :
nsTextAccessibleWrap(aContent, aDoc)
{
}
@ -93,7 +93,7 @@ nsHTMLTextAccessible::NativeState()
{
PRUint64 state = nsTextAccessible::NativeState();
nsDocAccessible *docAccessible = GetDocAccessible();
nsDocAccessible* docAccessible = Document();
if (docAccessible) {
PRUint64 docState = docAccessible->State();
if (0 == (docState & states::EDITABLE)) {
@ -122,8 +122,8 @@ nsHTMLTextAccessible::GetAttributesInternal(nsIPersistentProperties *aAttributes
////////////////////////////////////////////////////////////////////////////////
nsHTMLHRAccessible::
nsHTMLHRAccessible(nsIContent *aContent, nsIWeakReference *aShell) :
nsLeafAccessible(aContent, aShell)
nsHTMLHRAccessible(nsIContent* aContent, nsDocAccessible* aDoc) :
nsLeafAccessible(aContent, aDoc)
{
}
@ -139,8 +139,8 @@ nsHTMLHRAccessible::NativeRole()
////////////////////////////////////////////////////////////////////////////////
nsHTMLBRAccessible::
nsHTMLBRAccessible(nsIContent *aContent, nsIWeakReference *aShell) :
nsLeafAccessible(aContent, aShell)
nsHTMLBRAccessible(nsIContent* aContent, nsDocAccessible* aDoc) :
nsLeafAccessible(aContent, aDoc)
{
}
@ -168,8 +168,8 @@ nsHTMLBRAccessible::GetNameInternal(nsAString& aName)
////////////////////////////////////////////////////////////////////////////////
nsHTMLLabelAccessible::
nsHTMLLabelAccessible(nsIContent *aContent, nsIWeakReference *aShell) :
nsHyperTextAccessibleWrap(aContent, aShell)
nsHTMLLabelAccessible(nsIContent* aContent, nsDocAccessible* aDoc) :
nsHyperTextAccessibleWrap(aContent, aDoc)
{
}
@ -192,8 +192,8 @@ nsHTMLLabelAccessible::NativeRole()
////////////////////////////////////////////////////////////////////////////////
nsHTMLOutputAccessible::
nsHTMLOutputAccessible(nsIContent* aContent, nsIWeakReference* aShell) :
nsHyperTextAccessibleWrap(aContent, aShell)
nsHTMLOutputAccessible(nsIContent* aContent, nsDocAccessible* aDoc) :
nsHyperTextAccessibleWrap(aContent, aDoc)
{
}
@ -233,15 +233,15 @@ nsHTMLOutputAccessible::GetAttributesInternal(nsIPersistentProperties* aAttribut
////////////////////////////////////////////////////////////////////////////////
nsHTMLLIAccessible::
nsHTMLLIAccessible(nsIContent* aContent, nsIWeakReference* aShell) :
nsHyperTextAccessibleWrap(aContent, aShell), mBullet(nsnull)
nsHTMLLIAccessible(nsIContent* aContent, nsDocAccessible* aDoc) :
nsHyperTextAccessibleWrap(aContent, aDoc), mBullet(nsnull)
{
mFlags |= eHTMLListItemAccessible;
nsBlockFrame* blockFrame = do_QueryFrame(GetFrame());
if (blockFrame && blockFrame->HasBullet()) {
mBullet = new nsHTMLListBulletAccessible(mContent, mWeakShell);
if (!GetDocAccessible()->BindToDocument(mBullet, nsnull))
mBullet = new nsHTMLListBulletAccessible(mContent, mDoc);
if (!Document()->BindToDocument(mBullet, nsnull))
mBullet = nsnull;
}
}
@ -294,9 +294,9 @@ nsHTMLLIAccessible::UpdateBullet(bool aHasBullet)
return;
}
nsDocAccessible* document = GetDocAccessible();
nsDocAccessible* document = Document();
if (aHasBullet) {
mBullet = new nsHTMLListBulletAccessible(mContent, mWeakShell);
mBullet = new nsHTMLListBulletAccessible(mContent, mDoc);
if (document->BindToDocument(mBullet, nsnull)) {
InsertChildAt(0, mBullet);
}
@ -328,8 +328,8 @@ nsHTMLLIAccessible::CacheChildren()
////////////////////////////////////////////////////////////////////////////////
nsHTMLListBulletAccessible::
nsHTMLListBulletAccessible(nsIContent* aContent, nsIWeakReference* aShell) :
nsLeafAccessible(aContent, aShell)
nsHTMLListBulletAccessible(nsIContent* aContent, nsDocAccessible* aDoc) :
nsLeafAccessible(aContent, aDoc)
{
}
@ -400,8 +400,8 @@ nsHTMLListBulletAccessible::AppendTextTo(nsAString& aText, PRUint32 aStartOffset
////////////////////////////////////////////////////////////////////////////////
nsHTMLListAccessible::
nsHTMLListAccessible(nsIContent *aContent, nsIWeakReference *aShell) :
nsHyperTextAccessibleWrap(aContent, aShell)
nsHTMLListAccessible(nsIContent* aContent, nsDocAccessible* aDoc) :
nsHyperTextAccessibleWrap(aContent, aDoc)
{
}

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

@ -50,7 +50,7 @@
class nsHTMLTextAccessible : public nsTextAccessibleWrap
{
public:
nsHTMLTextAccessible(nsIContent *aContent, nsIWeakReference *aShell);
nsHTMLTextAccessible(nsIContent* aContent, nsDocAccessible* aDoc);
// nsISupports
NS_DECL_ISUPPORTS_INHERITED
@ -70,7 +70,7 @@ public:
class nsHTMLHRAccessible : public nsLeafAccessible
{
public:
nsHTMLHRAccessible(nsIContent *aContent, nsIWeakReference *aShell);
nsHTMLHRAccessible(nsIContent* aContent, nsDocAccessible* aDoc);
// nsAccessible
virtual mozilla::a11y::role NativeRole();
@ -82,7 +82,7 @@ public:
class nsHTMLBRAccessible : public nsLeafAccessible
{
public:
nsHTMLBRAccessible(nsIContent *aContent, nsIWeakReference *aShell);
nsHTMLBRAccessible(nsIContent* aContent, nsDocAccessible* aDoc);
// nsAccessible
virtual nsresult GetNameInternal(nsAString& aName);
@ -96,7 +96,7 @@ public:
class nsHTMLLabelAccessible : public nsHyperTextAccessibleWrap
{
public:
nsHTMLLabelAccessible(nsIContent *aContent, nsIWeakReference *aShell);
nsHTMLLabelAccessible(nsIContent* aContent, nsDocAccessible* aDoc);
NS_DECL_ISUPPORTS_INHERITED
@ -111,7 +111,7 @@ public:
class nsHTMLOutputAccessible : public nsHyperTextAccessibleWrap
{
public:
nsHTMLOutputAccessible(nsIContent* aContent, nsIWeakReference* aShell);
nsHTMLOutputAccessible(nsIContent* aContent, nsDocAccessible* aDoc);
NS_DECL_ISUPPORTS_INHERITED
@ -127,7 +127,7 @@ public:
class nsHTMLListBulletAccessible : public nsLeafAccessible
{
public:
nsHTMLListBulletAccessible(nsIContent* aContent, nsIWeakReference* aShell);
nsHTMLListBulletAccessible(nsIContent* aContent, nsDocAccessible* aDoc);
// nsIAccessible
NS_IMETHOD GetName(nsAString& aName);
@ -148,7 +148,7 @@ public:
class nsHTMLListAccessible : public nsHyperTextAccessibleWrap
{
public:
nsHTMLListAccessible(nsIContent *aContent, nsIWeakReference *aShell);
nsHTMLListAccessible(nsIContent* aContent, nsDocAccessible* aDoc);
// nsISupports
NS_DECL_ISUPPORTS_INHERITED
@ -164,7 +164,7 @@ public:
class nsHTMLLIAccessible : public nsHyperTextAccessibleWrap
{
public:
nsHTMLLIAccessible(nsIContent* aContent, nsIWeakReference* aShell);
nsHTMLLIAccessible(nsIContent* aContent, nsDocAccessible* aDoc);
// nsISupports
NS_DECL_ISUPPORTS_INHERITED

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

@ -41,6 +41,7 @@
#include "nsAccessibilityService.h"
#include "nsAccUtils.h"
#include "nsDocAccessible.h"
#include "nsTextAttrs.h"
#include "Role.h"
#include "States.h"
@ -71,8 +72,8 @@ using namespace mozilla::a11y;
////////////////////////////////////////////////////////////////////////////////
nsHyperTextAccessible::
nsHyperTextAccessible(nsIContent *aNode, nsIWeakReference *aShell) :
nsAccessibleWrap(aNode, aShell)
nsHyperTextAccessible(nsIContent* aNode, nsDocAccessible* aDoc) :
nsAccessibleWrap(aNode, aDoc)
{
mFlags |= eHyperTextAccessible;
}
@ -209,7 +210,8 @@ nsIntRect nsHyperTextAccessible::GetBoundsForString(nsIFrame *aFrame, PRUint32 a
&startContentOffsetInFrame, &frame);
NS_ENSURE_SUCCESS(rv, screenRect);
nsCOMPtr<nsIPresShell> shell = GetPresShell();
NS_ENSURE_TRUE(mDoc, screenRect);
nsIPresShell* shell = mDoc->PresShell();
NS_ENSURE_TRUE(shell, screenRect);
nsPresContext *context = shell->GetPresContext();
@ -882,7 +884,10 @@ nsresult nsHyperTextAccessible::GetTextHelper(EGetTextType aType, nsAccessibleTe
NS_ENSURE_ARG_POINTER(aEndOffset);
*aStartOffset = *aEndOffset = 0;
nsCOMPtr<nsIPresShell> presShell = GetPresShell();
if (!mDoc)
return NS_ERROR_FAILURE;
nsIPresShell* presShell = mDoc->PresShell();
if (!presShell) {
return NS_ERROR_FAILURE;
}
@ -1293,7 +1298,10 @@ nsHyperTextAccessible::GetOffsetAtPoint(PRInt32 aX, PRInt32 aY,
PRUint32 aCoordType, PRInt32 *aOffset)
{
*aOffset = -1;
nsCOMPtr<nsIPresShell> shell = GetPresShell();
if (!mDoc)
return NS_ERROR_FAILURE;
nsIPresShell* shell = mDoc->PresShell();
if (!shell) {
return NS_ERROR_FAILURE;
}
@ -1543,14 +1551,12 @@ nsHyperTextAccessible::GetAssociatedEditor(nsIEditor **aEditor)
if (!editingSession)
return NS_OK; // No editing session interface
nsCOMPtr<nsIPresShell> shell = GetPresShell();
NS_ENSURE_TRUE(shell, NS_ERROR_FAILURE);
nsCOMPtr<nsIDocument> doc = shell->GetDocument();
NS_ENSURE_TRUE(doc, NS_ERROR_FAILURE);
NS_ENSURE_TRUE(mDoc, NS_ERROR_FAILURE);
nsIDocument* docNode = mDoc->GetDocumentNode();
NS_ENSURE_TRUE(docNode, NS_ERROR_FAILURE);
nsCOMPtr<nsIEditor> editor;
return editingSession->GetEditorForWindow(doc->GetWindow(), aEditor);
return editingSession->GetEditorForWindow(docNode->GetWindow(), aEditor);
}
/**
@ -1598,11 +1604,10 @@ nsHyperTextAccessible::SetSelectionRange(PRInt32 aStartPos, PRInt32 aEndPos)
nsFocusManager* DOMFocusManager = nsFocusManager::GetFocusManager();
if (DOMFocusManager) {
nsCOMPtr<nsIPresShell> shell = GetPresShell();
NS_ENSURE_TRUE(shell, NS_ERROR_FAILURE);
nsCOMPtr<nsIDocument> doc = shell->GetDocument();
NS_ENSURE_TRUE(doc, NS_ERROR_FAILURE);
nsCOMPtr<nsPIDOMWindow> window = doc->GetWindow();
NS_ENSURE_TRUE(mDoc, NS_ERROR_FAILURE);
nsIDocument* docNode = mDoc->GetDocumentNode();
NS_ENSURE_TRUE(docNode, NS_ERROR_FAILURE);
nsCOMPtr<nsPIDOMWindow> window = docNode->GetWindow();
nsCOMPtr<nsIDOMElement> result;
DOMFocusManager->MoveFocus(window, nsnull, nsIFocusManager::MOVEFOCUS_CARET,
nsIFocusManager::FLAG_BYMOVEFOCUS, getter_AddRefs(result));

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

@ -76,7 +76,9 @@ class nsHyperTextAccessible : public nsAccessibleWrap,
public nsIAccessibleEditableText
{
public:
nsHyperTextAccessible(nsIContent *aContent, nsIWeakReference *aShell);
nsHyperTextAccessible(nsIContent* aContent, nsDocAccessible* aDoc);
virtual ~nsHyperTextAccessible() { }
NS_DECL_ISUPPORTS_INHERITED
NS_DECL_NSIACCESSIBLETEXT
NS_DECL_NSIACCESSIBLEHYPERTEXT

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

@ -613,7 +613,7 @@ GetNativeFromGeckoAccessible(nsIAccessible *anAccessible)
// Get a pointer to the native window (NSWindow) we reside in.
NSWindow *nativeWindow = nil;
nsDocAccessible* docAcc = accWrap->GetDocAccessible();
nsDocAccessible* docAcc = accWrap->Document();
if (docAcc)
nativeWindow = static_cast<NSWindow*>(docAcc->GetNativeWindow());

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

@ -47,12 +47,12 @@
class nsAccessNodeWrap : public nsAccessNode
{
public: // construction, destruction
nsAccessNodeWrap(nsIContent *aContent, nsIWeakReference *aShell);
virtual ~nsAccessNodeWrap();
public:
nsAccessNodeWrap(nsIContent* aContent, nsDocAccessible* aDoc);
virtual ~nsAccessNodeWrap();
static void InitAccessibility();
static void ShutdownAccessibility();
static void InitAccessibility();
static void ShutdownAccessibility();
};
#endif

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

@ -52,8 +52,8 @@
//-----------------------------------------------------
nsAccessNodeWrap::
nsAccessNodeWrap(nsIContent *aContent, nsIWeakReference *aShell) :
nsAccessNode(aContent, aShell)
nsAccessNodeWrap(nsIContent* aContent, nsDocAccessible* aDoc) :
nsAccessNode(aContent, aDoc)
{
}

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

@ -62,7 +62,7 @@
class nsAccessibleWrap : public nsAccessible
{
public: // construction, destruction
nsAccessibleWrap(nsIContent* aContent, nsIWeakReference* aShell);
nsAccessibleWrap(nsIContent* aContent, nsDocAccessible* aDoc);
virtual ~nsAccessibleWrap();
/**

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

@ -51,8 +51,8 @@
using namespace mozilla::a11y;
nsAccessibleWrap::
nsAccessibleWrap(nsIContent *aContent, nsIWeakReference *aShell) :
nsAccessible(aContent, aShell), mNativeObject(nil),
nsAccessibleWrap(nsIContent* aContent, nsDocAccessible* aDoc) :
nsAccessible(aContent, aDoc), mNativeObject(nil),
mNativeInited(false)
{
}

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

@ -44,8 +44,8 @@
class nsDocAccessibleWrap: public nsDocAccessible
{
public:
nsDocAccessibleWrap(nsIDocument *aDocument, nsIContent *aRootContent,
nsIWeakReference *aShell);
nsDocAccessibleWrap(nsIDocument* aDocument, nsIContent* aRootContent,
nsIPresShell* aPresShell);
virtual ~nsDocAccessibleWrap();
};

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

@ -40,9 +40,9 @@
#import "mozAccessible.h"
nsDocAccessibleWrap::
nsDocAccessibleWrap(nsIDocument *aDocument, nsIContent *aRootContent,
nsIWeakReference *aShell) :
nsDocAccessible(aDocument, aRootContent, aShell)
nsDocAccessibleWrap(nsIDocument* aDocument, nsIContent* aRootContent,
nsIPresShell* aPresShell) :
nsDocAccessible(aDocument, aRootContent, aPresShell)
{
}

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

@ -50,8 +50,8 @@ struct objc_class;
class nsRootAccessibleWrap : public nsRootAccessible
{
public:
nsRootAccessibleWrap(nsIDocument *aDocument, nsIContent *aRootContent,
nsIWeakReference *aShell);
nsRootAccessibleWrap(nsIDocument* aDocument, nsIContent* aRootContent,
nsIPresShell* aPresShell);
virtual ~nsRootAccessibleWrap();
Class GetNativeType ();

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

@ -46,9 +46,9 @@
#include "nsIViewManager.h"
nsRootAccessibleWrap::
nsRootAccessibleWrap(nsIDocument *aDocument, nsIContent *aRootContent,
nsIWeakReference *aShell) :
nsRootAccessible(aDocument, aRootContent, aShell)
nsRootAccessibleWrap(nsIDocument* aDocument, nsIContent* aRootContent,
nsIPresShell* aPresShell) :
nsRootAccessible(aDocument, aRootContent, aPresShell)
{
}

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

@ -53,8 +53,8 @@ class nsARIAGridAccessibleWrap : public nsARIAGridAccessible,
public CAccessibleTable
{
public:
nsARIAGridAccessibleWrap(nsIContent *aContent, nsIWeakReference *aShell) :
nsARIAGridAccessible(aContent, aShell) {}
nsARIAGridAccessibleWrap(nsIContent* aContent, nsDocAccessible* aDoc) :
nsARIAGridAccessible(aContent, aDoc) {}
// IUnknown
DECL_IUNKNOWN_INHERITED
@ -71,8 +71,8 @@ class nsARIAGridCellAccessibleWrap : public nsARIAGridCellAccessible,
public CAccessibleTableCell
{
public:
nsARIAGridCellAccessibleWrap(nsIContent *aContent, nsIWeakReference *aShell) :
nsARIAGridCellAccessible(aContent, aShell) {}
nsARIAGridCellAccessibleWrap(nsIContent* aContent, nsDocAccessible* aDoc) :
nsARIAGridCellAccessible(aContent, aDoc) {}
// IUnknown
DECL_IUNKNOWN_INHERITED

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

@ -70,8 +70,8 @@ AccTextChangeEvent* nsAccessNodeWrap::gTextEvent = nsnull;
////////////////////////////////////////////////////////////////////////////////
nsAccessNodeWrap::
nsAccessNodeWrap(nsIContent *aContent, nsIWeakReference *aShell) :
nsAccessNode(aContent, aShell)
nsAccessNodeWrap(nsIContent* aContent, nsDocAccessible* aDoc) :
nsAccessNode(aContent, aDoc)
{
}
@ -412,8 +412,7 @@ nsAccessNodeWrap::MakeAccessNode(nsINode *aNode)
nsAccessNodeWrap *newNode = NULL;
ISimpleDOMNode *iNode = NULL;
nsAccessible *acc =
GetAccService()->GetAccessibleInWeakShell(aNode, mWeakShell);
nsAccessible* acc = mDoc->GetAccessible(aNode);
if (acc) {
IAccessible *msaaAccessible = nsnull;
acc->GetNativeInterface((void**)&msaaAccessible); // addrefs
@ -427,7 +426,7 @@ nsAccessNodeWrap::MakeAccessNode(nsINode *aNode)
return NULL;
}
newNode = new nsAccessNodeWrap(content, mWeakShell);
newNode = new nsAccessNodeWrap(content, mDoc);
if (!newNode)
return NULL;

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

@ -83,7 +83,7 @@ class nsAccessNodeWrap : public nsAccessNode,
STDMETHODIMP QueryService(REFGUID guidService, REFIID riid, void** ppv);
public: // construction, destruction
nsAccessNodeWrap(nsIContent *aContent, nsIWeakReference *aShell);
nsAccessNodeWrap(nsIContent* aContent, nsDocAccessible* aDoc);
virtual ~nsAccessNodeWrap();
// IUnknown

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

@ -97,8 +97,8 @@ ITypeInfo* nsAccessibleWrap::gTypeInfo = NULL;
// construction
//-----------------------------------------------------
nsAccessibleWrap::
nsAccessibleWrap(nsIContent *aContent, nsIWeakReference *aShell) :
nsAccessible(aContent, aShell), mEnumVARIANTPosition(0)
nsAccessibleWrap(nsIContent* aContent, nsDocAccessible* aDoc) :
nsAccessible(aContent, aDoc), mEnumVARIANTPosition(0)
{
}
@ -1516,7 +1516,7 @@ nsAccessibleWrap::FirePlatformEvent(AccEvent* aEvent)
return NS_OK;
// Means we're not active.
NS_ENSURE_TRUE(mWeakShell, NS_ERROR_FAILURE);
NS_ENSURE_TRUE(!IsDefunct(), NS_ERROR_FAILURE);
nsAccessible *accessible = aEvent->GetAccessible();
if (!accessible)
@ -1587,6 +1587,10 @@ HWND
nsAccessibleWrap::GetHWNDFor(nsAccessible *aAccessible)
{
if (aAccessible) {
nsDocAccessible* document = aAccessible->Document();
if(!document)
return nsnull;
// Popup lives in own windows, use its HWND until the popup window is
// hidden to make old JAWS versions work with collapsed comboboxes (see
// discussion in bug 379678).
@ -1597,7 +1601,7 @@ nsAccessibleWrap::GetHWNDFor(nsAccessible *aAccessible)
bool isVisible = false;
widget->IsVisible(isVisible);
if (isVisible) {
nsCOMPtr<nsIPresShell> shell(aAccessible->GetPresShell());
nsCOMPtr<nsIPresShell> shell(document->PresShell());
nsIViewManager* vm = shell->GetViewManager();
if (vm) {
nsCOMPtr<nsIWidget> rootWidget;
@ -1612,9 +1616,7 @@ nsAccessibleWrap::GetHWNDFor(nsAccessible *aAccessible)
}
}
nsDocAccessible* document = aAccessible->GetDocAccessible();
if (document)
return static_cast<HWND>(document->GetNativeWindow());
return static_cast<HWND>(document->GetNativeWindow());
}
return nsnull;
}
@ -1742,7 +1744,7 @@ nsAccessibleWrap::GetXPAccessibleFor(const VARIANT& aVarChild)
// ARIA document.
if (ARIARole() == roles::DOCUMENT) {
nsDocAccessible* document = GetDocAccessible();
nsDocAccessible* document = Document();
nsAccessible* child =
document->GetAccessibleByUniqueIDInSubtree(uniqueID);

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

@ -104,7 +104,7 @@ class nsAccessibleWrap : public nsAccessible,
public IEnumVARIANT
{
public: // construction, destruction
nsAccessibleWrap(nsIContent *aContent, nsIWeakReference *aShell);
nsAccessibleWrap(nsIContent* aContent, nsDocAccessible* aDoc);
virtual ~nsAccessibleWrap();
// nsISupports

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

@ -68,9 +68,9 @@ using namespace mozilla::a11y;
////////////////////////////////////////////////////////////////////////////////
nsDocAccessibleWrap::
nsDocAccessibleWrap(nsIDocument *aDocument, nsIContent *aRootContent,
nsIWeakReference *aShell) :
nsDocAccessible(aDocument, aRootContent, aShell), mHWND(NULL)
nsDocAccessibleWrap(nsIDocument* aDocument, nsIContent* aRootContent,
nsIPresShell* aPresShell) :
nsDocAccessible(aDocument, aRootContent, aPresShell), mHWND(NULL)
{
}

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

@ -53,8 +53,8 @@ class nsDocAccessibleWrap: public nsDocAccessible,
public ISimpleDOMDocument
{
public:
nsDocAccessibleWrap(nsIDocument *aDocument, nsIContent *aRootContent,
nsIWeakReference *aShell);
nsDocAccessibleWrap(nsIDocument* aDocument, nsIContent* aRootContent,
nsIPresShell* aPresShell);
virtual ~nsDocAccessibleWrap();
// IUnknown

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

@ -48,8 +48,8 @@ class nsHTMLImageAccessibleWrap : public nsHTMLImageAccessible,
public CAccessibleImage
{
public:
nsHTMLImageAccessibleWrap(nsIContent *aContent, nsIWeakReference *aShell) :
nsHTMLImageAccessible(aContent, aShell) {}
nsHTMLImageAccessibleWrap(nsIContent* aContent, nsDocAccessible* aDoc) :
nsHTMLImageAccessible(aContent, aDoc) {}
// IUnknown
DECL_IUNKNOWN_INHERITED

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

@ -54,8 +54,8 @@ class nsHTMLTableAccessibleWrap : public nsHTMLTableAccessible,
public CAccessibleTable
{
public:
nsHTMLTableAccessibleWrap(nsIContent *aContent, nsIWeakReference *aShell) :
nsHTMLTableAccessible(aContent, aShell) {}
nsHTMLTableAccessibleWrap(nsIContent* aContent, nsDocAccessible* aDoc) :
nsHTMLTableAccessible(aContent, aDoc) {}
// IUnknown
DECL_IUNKNOWN_INHERITED
@ -73,8 +73,8 @@ class nsHTMLTableCellAccessibleWrap : public nsHTMLTableCellAccessible,
public CAccessibleTableCell
{
public:
nsHTMLTableCellAccessibleWrap(nsIContent *aContent, nsIWeakReference *aShell) :
nsHTMLTableCellAccessible(aContent, aShell) {}
nsHTMLTableCellAccessibleWrap(nsIContent* aContent, nsDocAccessible* aDoc) :
nsHTMLTableCellAccessible(aContent, aDoc) {}
// IUnknown
DECL_IUNKNOWN_INHERITED
@ -92,9 +92,9 @@ class nsHTMLTableHeaderCellAccessibleWrap : public nsHTMLTableHeaderCellAccessib
public CAccessibleTableCell
{
public:
nsHTMLTableHeaderCellAccessibleWrap(nsIContent *aContent,
nsIWeakReference *aShell) :
nsHTMLTableHeaderCellAccessible(aContent, aShell) {}
nsHTMLTableHeaderCellAccessibleWrap(nsIContent* aContent,
nsDocAccessible* aDoc) :
nsHTMLTableHeaderCellAccessible(aContent, aDoc) {}
// IUnknown
DECL_IUNKNOWN_INHERITED

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

@ -48,9 +48,9 @@ using namespace mozilla::a11y;
////////////////////////////////////////////////////////////////////////////////
nsHTMLWin32ObjectOwnerAccessible::
nsHTMLWin32ObjectOwnerAccessible(nsIContent *aContent,
nsIWeakReference *aShell, void *aHwnd) :
nsAccessibleWrap(aContent, aShell), mHwnd(aHwnd)
nsHTMLWin32ObjectOwnerAccessible(nsIContent* aContent,
nsDocAccessible* aDoc, void* aHwnd) :
nsAccessibleWrap(aContent, aDoc), mHwnd(aHwnd)
{
// Our only child is a nsHTMLWin32ObjectAccessible object.
mNativeAccessible = new nsHTMLWin32ObjectAccessible(mHwnd);

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

@ -53,8 +53,8 @@ public:
// because the native plugin accessible doesn't know where it exists in the
// Mozilla tree, and returns null for previous and next sibling. This would
// have the effect of cutting off all content after the plugin.
nsHTMLWin32ObjectOwnerAccessible(nsIContent *aContent,
nsIWeakReference *aShell, void *aHwnd);
nsHTMLWin32ObjectOwnerAccessible(nsIContent* aContent,
nsDocAccessible* aDoc, void* aHwnd);
virtual ~nsHTMLWin32ObjectOwnerAccessible() {}
// nsAccessNode

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

@ -51,8 +51,8 @@ class nsHyperTextAccessibleWrap : public nsHyperTextAccessible,
public CAccessibleEditableText
{
public:
nsHyperTextAccessibleWrap(nsIContent *aContent, nsIWeakReference *aShell) :
nsHyperTextAccessible(aContent, aShell) {}
nsHyperTextAccessibleWrap(nsIContent* aContent, nsDocAccessible* aDoc) :
nsHyperTextAccessible(aContent, aDoc) {}
// IUnknown
DECL_IUNKNOWN_INHERITED

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

@ -51,8 +51,8 @@ using namespace mozilla::a11y;
nsRootAccessibleWrap::
nsRootAccessibleWrap(nsIDocument* aDocument, nsIContent* aRootContent,
nsIWeakReference* aShell) :
nsRootAccessible(aDocument, aRootContent, aShell)
nsIPresShell* aPresShell) :
nsRootAccessible(aDocument, aRootContent, aPresShell)
{
}

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

@ -46,7 +46,7 @@ class nsRootAccessibleWrap : public nsRootAccessible
{
public:
nsRootAccessibleWrap(nsIDocument* aDocument, nsIContent* aRootContent,
nsIWeakReference* aShell);
nsIPresShell* aPresShell);
virtual ~nsRootAccessibleWrap();
// nsRootAccessible

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

@ -56,8 +56,8 @@ using namespace mozilla::a11y;
////////////////////////////////////////////////////////////////////////////////
nsTextAccessibleWrap::
nsTextAccessibleWrap(nsIContent *aContent, nsIWeakReference *aShell) :
nsTextAccessible(aContent, aShell)
nsTextAccessibleWrap(nsIContent* aContent, nsDocAccessible* aDoc) :
nsTextAccessible(aContent, aDoc)
{
}
@ -129,7 +129,7 @@ __try {
return rv;
}
nsDocAccessible *docAccessible = GetDocAccessible();
nsDocAccessible* docAccessible = Document();
NS_ASSERTION(docAccessible,
"There must always be a doc accessible, but there isn't. Crash!");

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

@ -50,7 +50,7 @@ class nsTextAccessibleWrap : public nsTextAccessible,
public ISimpleDOMText
{
public:
nsTextAccessibleWrap(nsIContent *aContent, nsIWeakReference *aShell);
nsTextAccessibleWrap(nsIContent* aContent, nsDocAccessible* aDoc);
virtual ~nsTextAccessibleWrap() {}
// IUnknown methods - see iunknown.h for documentation

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

@ -43,8 +43,8 @@
////////////////////////////////////////////////////////////////////////////////
nsXULListboxAccessibleWrap::
nsXULListboxAccessibleWrap(nsIContent *aContent, nsIWeakReference *aShell) :
nsXULListboxAccessible(aContent, aShell)
nsXULListboxAccessibleWrap(nsIContent* aContent, nsDocAccessible* aDoc) :
nsXULListboxAccessible(aContent, aDoc)
{
}
@ -62,8 +62,8 @@ IMPL_IUNKNOWN_QUERY_TAIL
////////////////////////////////////////////////////////////////////////////////
nsXULListCellAccessibleWrap::
nsXULListCellAccessibleWrap(nsIContent *aContent, nsIWeakReference *aShell) :
nsXULListCellAccessible(aContent, aShell)
nsXULListCellAccessibleWrap(nsIContent* aContent, nsDocAccessible* aDoc) :
nsXULListCellAccessible(aContent, aDoc)
{
}

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

@ -52,7 +52,7 @@ class nsXULListboxAccessibleWrap : public nsXULListboxAccessible,
public CAccessibleTable
{
public:
nsXULListboxAccessibleWrap(nsIContent *aContent, nsIWeakReference *aShell);
nsXULListboxAccessibleWrap(nsIContent* aContent, nsDocAccessible* aDoc);
// IUnknown
DECL_IUNKNOWN_INHERITED
@ -69,7 +69,7 @@ class nsXULListCellAccessibleWrap : public nsXULListCellAccessible,
public CAccessibleTableCell
{
public:
nsXULListCellAccessibleWrap(nsIContent *aContent, nsIWeakReference *aShell);
nsXULListCellAccessibleWrap(nsIContent* aContent, nsDocAccessible* aDoc);
// IUnknown
DECL_IUNKNOWN_INHERITED

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

@ -43,8 +43,8 @@
////////////////////////////////////////////////////////////////////////////////
nsXULMenuitemAccessibleWrap::
nsXULMenuitemAccessibleWrap(nsIContent *aContent, nsIWeakReference *aShell) :
nsXULMenuitemAccessible(aContent, aShell)
nsXULMenuitemAccessibleWrap(nsIContent* aContent, nsDocAccessible* aDoc) :
nsXULMenuitemAccessible(aContent, aDoc)
{
}

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

@ -43,7 +43,7 @@
class nsXULMenuitemAccessibleWrap : public nsXULMenuitemAccessible
{
public:
nsXULMenuitemAccessibleWrap(nsIContent *aContent, nsIWeakReference *aShell);
nsXULMenuitemAccessibleWrap(nsIContent* aContent, nsDocAccessible* aDoc);
virtual ~nsXULMenuitemAccessibleWrap() {}
// nsIAccessible

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

@ -44,8 +44,8 @@
////////////////////////////////////////////////////////////////////////////////
nsXULTreeGridAccessibleWrap::
nsXULTreeGridAccessibleWrap(nsIContent *aContent, nsIWeakReference *aShell) :
nsXULTreeGridAccessible(aContent, aShell)
nsXULTreeGridAccessibleWrap(nsIContent* aContent, nsDocAccessible* aDoc) :
nsXULTreeGridAccessible(aContent, aDoc)
{
}
@ -62,13 +62,13 @@ IMPL_IUNKNOWN_INHERITED1(nsXULTreeGridAccessibleWrap,
////////////////////////////////////////////////////////////////////////////////
nsXULTreeGridCellAccessibleWrap::
nsXULTreeGridCellAccessibleWrap(nsIContent *aContent,
nsIWeakReference *aShell,
nsXULTreeGridRowAccessible *aRowAcc,
nsITreeBoxObject *aTree,
nsITreeView *aTreeView,
nsXULTreeGridCellAccessibleWrap(nsIContent* aContent,
nsDocAccessible* aDoc,
nsXULTreeGridRowAccessible* aRowAcc,
nsITreeBoxObject* aTree,
nsITreeView* aTreeView,
PRInt32 aRow, nsITreeColumn* aColumn) :
nsXULTreeGridCellAccessible(aContent, aShell, aRowAcc, aTree, aTreeView,
nsXULTreeGridCellAccessible(aContent, aDoc, aRowAcc, aTree, aTreeView,
aRow, aColumn)
{
}

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

@ -53,7 +53,7 @@ class nsXULTreeGridAccessibleWrap : public nsXULTreeGridAccessible,
public CAccessibleTable
{
public:
nsXULTreeGridAccessibleWrap(nsIContent *aContent, nsIWeakReference *aShell);
nsXULTreeGridAccessibleWrap(nsIContent* aContent, nsDocAccessible* aDoc);
// IUnknown
DECL_IUNKNOWN_INHERITED
@ -70,11 +70,11 @@ class nsXULTreeGridCellAccessibleWrap : public nsXULTreeGridCellAccessible,
public CAccessibleTableCell
{
public:
nsXULTreeGridCellAccessibleWrap(nsIContent *aContent,
nsIWeakReference *aShell,
nsXULTreeGridRowAccessible *aRowAcc,
nsITreeBoxObject *aTree,
nsITreeView *aTreeView,
nsXULTreeGridCellAccessibleWrap(nsIContent* aContent,
nsDocAccessible* aDoc,
nsXULTreeGridRowAccessible* aRowAcc,
nsITreeBoxObject* aTree,
nsITreeView* aTreeView,
PRInt32 aRow, nsITreeColumn* aColumn);
// IUnknown

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

@ -52,8 +52,8 @@
//-----------------------------------------------------
nsAccessNodeWrap::
nsAccessNodeWrap(nsIContent *aContent, nsIWeakReference* aShell) :
nsAccessNode(aContent, aShell)
nsAccessNodeWrap(nsIContent* aContent, nsDocAccessible* aDoc) :
nsAccessNode(aContent, aDoc)
{
}

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

@ -48,7 +48,7 @@
class nsAccessNodeWrap : public nsAccessNode
{
public: // construction, destruction
nsAccessNodeWrap(nsIContent *aContent, nsIWeakReference* aShell);
nsAccessNodeWrap(nsIContent* aContent, nsDocAccessible* aDoc);
virtual ~nsAccessNodeWrap();
static void InitAccessibility();

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

@ -42,8 +42,8 @@
// construction
//-----------------------------------------------------
nsAccessibleWrap::
nsAccessibleWrap(nsIContent *aContent, nsIWeakReference *aShell) :
nsAccessible(aContent, aShell)
nsAccessibleWrap(nsIContent* aContent, nsDocAccessible* aDoc) :
nsAccessible(aContent, aDoc)
{
}

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

@ -49,7 +49,7 @@
class nsAccessibleWrap : public nsAccessible
{
public: // construction, destruction
nsAccessibleWrap(nsIContent *aContent, nsIWeakReference *aShell);
nsAccessibleWrap(nsIContent* aContent, nsDocAccessible* aDoc);
virtual ~nsAccessibleWrap();
protected:

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

@ -46,9 +46,9 @@
////////////////////////////////////////////////////////////////////////////////
nsRootAccessibleWrap::
nsRootAccessibleWrap(nsIDocument *aDocument, nsIContent *aRootContent,
nsIWeakReference *aShell) :
nsRootAccessible(aDocument, aRootContent, aShell)
nsRootAccessibleWrap(nsIDocument* aDocument, nsIContent* aRootContent,
nsIPresShell* aPresShell) :
nsRootAccessible(aDocument, aRootContent, aPresShell)
{
}

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

@ -48,8 +48,8 @@
class nsRootAccessibleWrap: public nsRootAccessible
{
public:
nsRootAccessibleWrap(nsIDocument *aDocument, nsIContent *aRootContent,
nsIWeakReference *aShell);
nsRootAccessibleWrap(nsIDocument* aDocument, nsIContent* aRootContent,
nsIPresShell* aPresShell);
virtual ~nsRootAccessibleWrap();
};

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

@ -40,6 +40,7 @@
#include "nsAccessibilityService.h"
#include "nsAccUtils.h"
#include "nsDocAccessible.h"
#include "nsTextEquivUtils.h"
#include "Role.h"
#include "States.h"
@ -79,8 +80,8 @@ nsXFormsAccessibleBase::nsXFormsAccessibleBase()
////////////////////////////////////////////////////////////////////////////////
nsXFormsAccessible::
nsXFormsAccessible(nsIContent *aContent, nsIWeakReference *aShell) :
nsHyperTextAccessibleWrap(aContent, aShell)
nsXFormsAccessible(nsIContent* aContent, nsDocAccessible* aDoc) :
nsHyperTextAccessibleWrap(aContent, aDoc)
{
}
@ -125,8 +126,6 @@ nsXFormsAccessible::CacheSelectChildren(nsIDOMNode *aContainerNode)
if (!children)
return;
nsCOMPtr<nsIPresShell> presShell(do_QueryReferent(mWeakShell));
PRUint32 length = 0;
children->GetLength(&length);
@ -138,7 +137,7 @@ nsXFormsAccessible::CacheSelectChildren(nsIDOMNode *aContainerNode)
nsCOMPtr<nsIContent> child(do_QueryInterface(DOMChild));
nsAccessible* accessible =
GetAccService()->GetOrCreateAccessible(child, presShell, mWeakShell);
GetAccService()->GetOrCreateAccessible(child, mDoc);
if (!accessible)
continue;
@ -226,8 +225,8 @@ nsXFormsAccessible::CanHaveAnonChildren()
////////////////////////////////////////////////////////////////////////////////
nsXFormsContainerAccessible::
nsXFormsContainerAccessible(nsIContent *aContent, nsIWeakReference *aShell) :
nsXFormsAccessible(aContent, aShell)
nsXFormsContainerAccessible(nsIContent* aContent, nsDocAccessible* aDoc) :
nsXFormsAccessible(aContent, aDoc)
{
}
@ -249,8 +248,8 @@ nsXFormsContainerAccessible::CanHaveAnonChildren()
////////////////////////////////////////////////////////////////////////////////
nsXFormsEditableAccessible::
nsXFormsEditableAccessible(nsIContent *aContent, nsIWeakReference *aShell) :
nsXFormsAccessible(aContent, aShell)
nsXFormsEditableAccessible(nsIContent* aContent, nsDocAccessible* aDoc) :
nsXFormsAccessible(aContent, aDoc)
{
}
@ -299,8 +298,8 @@ nsXFormsEditableAccessible::GetAssociatedEditor(nsIEditor **aEditor)
////////////////////////////////////////////////////////////////////////////////
nsXFormsSelectableAccessible::
nsXFormsSelectableAccessible(nsIContent *aContent, nsIWeakReference *aShell) :
nsXFormsEditableAccessible(aContent, aShell), mIsSelect1Element(nsnull)
nsXFormsSelectableAccessible(nsIContent* aContent, nsDocAccessible* aDoc) :
nsXFormsEditableAccessible(aContent, aDoc), mIsSelect1Element(nsnull)
{
mIsSelect1Element =
mContent->NodeInfo()->Equals(nsGkAtoms::select1);
@ -327,12 +326,11 @@ nsXFormsSelectableAccessible::SelectedItems()
nsCOMPtr<nsIDOMNode> itemDOMNode;
rv = sXFormsService->GetSelectedItemForSelect1(DOMNode,
getter_AddRefs(itemDOMNode));
if (NS_FAILED(rv) || !itemDOMNode)
if (NS_FAILED(rv) || !itemDOMNode || !mDoc)
return nsnull;
nsCOMPtr<nsINode> itemNode(do_QueryInterface(itemDOMNode));
nsIAccessible* item = GetAccService()->GetAccessibleInWeakShell(itemNode,
mWeakShell);
nsIAccessible* item = mDoc->GetAccessible(itemNode);
if (item)
selectedItems->AppendElement(item, false);
@ -344,11 +342,12 @@ nsXFormsSelectableAccessible::SelectedItems()
nsCOMPtr<nsIDOMNodeList> itemNodeList;
rv = sXFormsService->GetSelectedItemsForSelect(DOMNode,
getter_AddRefs(itemNodeList));
if (NS_FAILED(rv) || !itemNodeList)
if (NS_FAILED(rv) || !itemNodeList || !mDoc)
return nsnull;
PRUint32 length = 0;
itemNodeList->GetLength(&length);
for (PRUint32 index = 0; index < length; index++) {
nsCOMPtr<nsIDOMNode> itemDOMNode;
itemNodeList->Item(index, getter_AddRefs(itemDOMNode));
@ -356,8 +355,7 @@ nsXFormsSelectableAccessible::SelectedItems()
return nsnull;
nsCOMPtr<nsINode> itemNode(do_QueryInterface(itemDOMNode));
nsIAccessible* item = GetAccService()->GetAccessibleInWeakShell(itemNode,
mWeakShell);
nsIAccessible* item = mDoc->GetAccessible(itemNode);
if (item)
selectedItems->AppendElement(item, false);
}
@ -432,6 +430,9 @@ nsXFormsSelectableAccessible::RemoveItemFromSelection(PRUint32 aIndex)
nsAccessible*
nsXFormsSelectableAccessible::GetSelectedItem(PRUint32 aIndex)
{
if (!mDoc)
return nsnull;
nsresult rv;
nsCOMPtr<nsIDOMNode> DOMNode(do_QueryInterface(mContent));
if (mIsSelect1Element) {
@ -443,7 +444,7 @@ nsXFormsSelectableAccessible::GetSelectedItem(PRUint32 aIndex)
getter_AddRefs(itemDOMNode));
if (NS_SUCCEEDED(rv) && itemDOMNode) {
nsCOMPtr<nsINode> itemNode(do_QueryInterface(itemDOMNode));
return GetAccService()->GetAccessibleInWeakShell(itemNode, mWeakShell);
return mDoc->GetAccessible(itemNode);
}
return nsnull;
}
@ -458,7 +459,7 @@ nsXFormsSelectableAccessible::GetSelectedItem(PRUint32 aIndex)
itemNodeList->Item(aIndex, getter_AddRefs(itemDOMNode));
nsCOMPtr<nsINode> itemNode(do_QueryInterface(itemDOMNode));
return GetAccService()->GetAccessibleInWeakShell(itemNode, mWeakShell);
return mDoc->GetAccessible(itemNode);
}
bool
@ -536,9 +537,9 @@ nsXFormsSelectableAccessible::GetItemByIndex(PRUint32* aIndex,
////////////////////////////////////////////////////////////////////////////////
nsXFormsSelectableItemAccessible::
nsXFormsSelectableItemAccessible(nsIContent *aContent,
nsIWeakReference *aShell) :
nsXFormsAccessible(aContent, aShell)
nsXFormsSelectableItemAccessible(nsIContent* aContent,
nsDocAccessible* aDoc) :
nsXFormsAccessible(aContent, aDoc)
{
}

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

@ -70,7 +70,7 @@ class nsXFormsAccessible : public nsHyperTextAccessibleWrap,
public nsXFormsAccessibleBase
{
public:
nsXFormsAccessible(nsIContent *aContent, nsIWeakReference *aShell);
nsXFormsAccessible(nsIContent* aContent, nsDocAccessible* aDoc);
// nsIAccessible
@ -124,7 +124,7 @@ protected:
class nsXFormsContainerAccessible : public nsXFormsAccessible
{
public:
nsXFormsContainerAccessible(nsIContent *aContent, nsIWeakReference *aShell);
nsXFormsContainerAccessible(nsIContent* aContent, nsDocAccessible* aDoc);
// nsAccessible
virtual mozilla::a11y::role NativeRole();
@ -142,7 +142,7 @@ public:
class nsXFormsEditableAccessible : public nsXFormsAccessible
{
public:
nsXFormsEditableAccessible(nsIContent *aContent, nsIWeakReference *aShell);
nsXFormsEditableAccessible(nsIContent* aContent, nsDocAccessible* aDoc);
// nsIAccessibleEditableText
NS_IMETHOD GetAssociatedEditor(nsIEditor **aEditor);
@ -159,7 +159,7 @@ public:
class nsXFormsSelectableAccessible : public nsXFormsEditableAccessible
{
public:
nsXFormsSelectableAccessible(nsIContent *aContent, nsIWeakReference *aShell);
nsXFormsSelectableAccessible(nsIContent* aContent, nsDocAccessible* aDoc);
// SelectAccessible
virtual bool IsSelect();
@ -186,8 +186,8 @@ protected:
class nsXFormsSelectableItemAccessible : public nsXFormsAccessible
{
public:
nsXFormsSelectableItemAccessible(nsIContent *aContent,
nsIWeakReference *aShell);
nsXFormsSelectableItemAccessible(nsIContent* aContent,
nsDocAccessible* aDoc);
NS_IMETHOD GetValue(nsAString& aValue);
NS_IMETHOD DoAction(PRUint8 aIndex);

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

@ -49,8 +49,8 @@ using namespace mozilla::a11y;
////////////////////////////////////////////////////////////////////////////////
nsXFormsLabelAccessible::
nsXFormsLabelAccessible(nsIContent *aContent, nsIWeakReference *aShell) :
nsXFormsAccessible(aContent, aShell)
nsXFormsLabelAccessible(nsIContent* aContent, nsDocAccessible* aDoc) :
nsXFormsAccessible(aContent, aDoc)
{
}
@ -81,8 +81,8 @@ nsXFormsLabelAccessible::Description(nsString& aDescription)
////////////////////////////////////////////////////////////////////////////////
nsXFormsOutputAccessible::
nsXFormsOutputAccessible(nsIContent *aContent, nsIWeakReference *aShell) :
nsXFormsAccessible(aContent, aShell)
nsXFormsOutputAccessible(nsIContent* aContent, nsDocAccessible* aDoc) :
nsXFormsAccessible(aContent, aDoc)
{
}
@ -98,8 +98,8 @@ nsXFormsOutputAccessible::NativeRole()
////////////////////////////////////////////////////////////////////////////////
nsXFormsTriggerAccessible::
nsXFormsTriggerAccessible(nsIContent *aContent, nsIWeakReference *aShell) :
nsXFormsAccessible(aContent, aShell)
nsXFormsTriggerAccessible(nsIContent* aContent, nsDocAccessible* aDoc) :
nsXFormsAccessible(aContent, aDoc)
{
}
@ -148,8 +148,8 @@ nsXFormsTriggerAccessible::DoAction(PRUint8 aIndex)
////////////////////////////////////////////////////////////////////////////////
nsXFormsInputAccessible::
nsXFormsInputAccessible(nsIContent *aContent, nsIWeakReference *aShell) :
nsXFormsEditableAccessible(aContent, aShell)
nsXFormsInputAccessible(nsIContent* aContent, nsDocAccessible* aDoc) :
nsXFormsEditableAccessible(aContent, aDoc)
{
}
@ -193,8 +193,8 @@ nsXFormsInputAccessible::DoAction(PRUint8 aIndex)
////////////////////////////////////////////////////////////////////////////////
nsXFormsInputBooleanAccessible::
nsXFormsInputBooleanAccessible(nsIContent *aContent, nsIWeakReference *aShell) :
nsXFormsAccessible(aContent, aShell)
nsXFormsInputBooleanAccessible(nsIContent* aContent, nsDocAccessible* aDoc) :
nsXFormsAccessible(aContent, aDoc)
{
}
@ -261,8 +261,8 @@ nsXFormsInputBooleanAccessible::DoAction(PRUint8 aIndex)
////////////////////////////////////////////////////////////////////////////////
nsXFormsInputDateAccessible::
nsXFormsInputDateAccessible(nsIContent *aContent, nsIWeakReference *aShell) :
nsXFormsContainerAccessible(aContent, aShell)
nsXFormsInputDateAccessible(nsIContent* aContent, nsDocAccessible* aDoc) :
nsXFormsContainerAccessible(aContent, aDoc)
{
}
@ -278,8 +278,8 @@ nsXFormsInputDateAccessible::NativeRole()
////////////////////////////////////////////////////////////////////////////////
nsXFormsSecretAccessible::
nsXFormsSecretAccessible(nsIContent *aContent, nsIWeakReference *aShell) :
nsXFormsInputAccessible(aContent, aShell)
nsXFormsSecretAccessible(nsIContent* aContent, nsDocAccessible* aDoc) :
nsXFormsInputAccessible(aContent, aDoc)
{
}
@ -307,8 +307,8 @@ nsXFormsSecretAccessible::GetValue(nsAString& aValue)
////////////////////////////////////////////////////////////////////////////////
nsXFormsRangeAccessible::
nsXFormsRangeAccessible(nsIContent *aContent, nsIWeakReference *aShell) :
nsXFormsAccessible(aContent, aShell)
nsXFormsRangeAccessible(nsIContent* aContent, nsDocAccessible* aDoc) :
nsXFormsAccessible(aContent, aDoc)
{
}
@ -400,8 +400,8 @@ nsXFormsRangeAccessible::GetCurrentValue(double *aCurrentValue)
////////////////////////////////////////////////////////////////////////////////
nsXFormsSelectAccessible::
nsXFormsSelectAccessible(nsIContent *aContent, nsIWeakReference *aShell) :
nsXFormsContainerAccessible(aContent, aShell)
nsXFormsSelectAccessible(nsIContent* aContent, nsDocAccessible* aDoc) :
nsXFormsContainerAccessible(aContent, aDoc)
{
}
@ -427,8 +427,8 @@ nsXFormsSelectAccessible::NativeState()
////////////////////////////////////////////////////////////////////////////////
nsXFormsChoicesAccessible::
nsXFormsChoicesAccessible(nsIContent *aContent, nsIWeakReference *aShell) :
nsXFormsAccessible(aContent, aShell)
nsXFormsChoicesAccessible(nsIContent* aContent, nsDocAccessible* aDoc) :
nsXFormsAccessible(aContent, aDoc)
{
}
@ -457,8 +457,8 @@ nsXFormsChoicesAccessible::CacheChildren()
////////////////////////////////////////////////////////////////////////////////
nsXFormsSelectFullAccessible::
nsXFormsSelectFullAccessible(nsIContent *aContent, nsIWeakReference *aShell) :
nsXFormsSelectableAccessible(aContent, aShell)
nsXFormsSelectFullAccessible(nsIContent* aContent, nsDocAccessible* aDoc) :
nsXFormsSelectableAccessible(aContent, aDoc)
{
}
@ -480,8 +480,8 @@ nsXFormsSelectFullAccessible::CacheChildren()
////////////////////////////////////////////////////////////////////////////////
nsXFormsItemCheckgroupAccessible::
nsXFormsItemCheckgroupAccessible(nsIContent *aContent, nsIWeakReference *aShell) :
nsXFormsSelectableItemAccessible(aContent, aShell)
nsXFormsItemCheckgroupAccessible(nsIContent* aContent, nsDocAccessible* aDoc) :
nsXFormsSelectableItemAccessible(aContent, aDoc)
{
}
@ -522,8 +522,8 @@ nsXFormsItemCheckgroupAccessible::GetActionName(PRUint8 aIndex, nsAString& aName
////////////////////////////////////////////////////////////////////////////////
nsXFormsItemRadiogroupAccessible::
nsXFormsItemRadiogroupAccessible(nsIContent *aContent, nsIWeakReference *aShell) :
nsXFormsSelectableItemAccessible(aContent, aShell)
nsXFormsItemRadiogroupAccessible(nsIContent* aContent, nsDocAccessible* aDoc) :
nsXFormsSelectableItemAccessible(aContent, aDoc)
{
}
@ -560,8 +560,8 @@ nsXFormsItemRadiogroupAccessible::GetActionName(PRUint8 aIndex, nsAString& aName
////////////////////////////////////////////////////////////////////////////////
nsXFormsSelectComboboxAccessible::
nsXFormsSelectComboboxAccessible(nsIContent *aContent, nsIWeakReference *aShell) :
nsXFormsSelectableAccessible(aContent, aShell)
nsXFormsSelectComboboxAccessible(nsIContent* aContent, nsDocAccessible* aDoc) :
nsXFormsSelectableAccessible(aContent, aDoc)
{
}
@ -601,8 +601,8 @@ nsXFormsSelectComboboxAccessible::CanHaveAnonChildren()
////////////////////////////////////////////////////////////////////////////////
nsXFormsItemComboboxAccessible::
nsXFormsItemComboboxAccessible(nsIContent *aContent, nsIWeakReference *aShell) :
nsXFormsSelectableItemAccessible(aContent, aShell)
nsXFormsItemComboboxAccessible(nsIContent* aContent, nsDocAccessible* aDoc) :
nsXFormsSelectableItemAccessible(aContent, aDoc)
{
}

Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше