Bug 561681 - GetAccessibleFor should return nsAccessible. r=surkov

This commit is contained in:
David Bolter 2010-06-28 09:22:49 -04:00
Родитель f37b8fe23c
Коммит 026f4af9c3
6 изменённых файлов: 12 добавлений и 20 удалений

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

@ -159,10 +159,10 @@ nsAccUtils::GetPositionAndSizeForXULSelectControlItem(nsIContent *aContent,
for (PRUint32 index = 0; index < itemsCount; index++) { for (PRUint32 index = 0; index < itemsCount; index++) {
nsCOMPtr<nsIDOMXULSelectControlItemElement> currItem; nsCOMPtr<nsIDOMXULSelectControlItemElement> currItem;
control->GetItemAtIndex(index, getter_AddRefs(currItem)); control->GetItemAtIndex(index, getter_AddRefs(currItem));
nsCOMPtr<nsIDOMNode> currNode(do_QueryInterface(currItem)); nsCOMPtr<nsINode> currNode(do_QueryInterface(currItem));
nsAccessible* itemAcc = GetAccService()->GetAccessible(currNode);
nsCOMPtr<nsIAccessible> itemAcc;
GetAccService()->GetAccessibleFor(currNode, getter_AddRefs(itemAcc));
if (!itemAcc || if (!itemAcc ||
State(itemAcc) & nsIAccessibleStates::STATE_INVISIBLE) { State(itemAcc) & nsIAccessibleStates::STATE_INVISIBLE) {
(*aSetSize)--; (*aSetSize)--;
@ -201,9 +201,9 @@ nsAccUtils::GetPositionAndSizeForXULContainerItem(nsIContent *aContent,
for (PRInt32 index = indexOf; index >= 0; index--) { for (PRInt32 index = indexOf; index >= 0; index--) {
nsCOMPtr<nsIDOMXULElement> item; nsCOMPtr<nsIDOMXULElement> item;
container->GetItemAtIndex(index, getter_AddRefs(item)); container->GetItemAtIndex(index, getter_AddRefs(item));
nsCOMPtr<nsINode> itemNode(do_QueryInterface(item));
nsCOMPtr<nsIAccessible> itemAcc; nsAccessible* itemAcc = GetAccService()->GetAccessible(itemNode);
GetAccService()->GetAccessibleFor(item, getter_AddRefs(itemAcc));
if (itemAcc) { if (itemAcc) {
PRUint32 itemRole = Role(itemAcc); PRUint32 itemRole = Role(itemAcc);
@ -222,9 +222,9 @@ nsAccUtils::GetPositionAndSizeForXULContainerItem(nsIContent *aContent,
index++) { index++) {
nsCOMPtr<nsIDOMXULElement> item; nsCOMPtr<nsIDOMXULElement> item;
container->GetItemAtIndex(index, getter_AddRefs(item)); container->GetItemAtIndex(index, getter_AddRefs(item));
nsCOMPtr<nsINode> itemNode(do_QueryInterface(item));
nsCOMPtr<nsIAccessible> itemAcc; nsAccessible* itemAcc = GetAccService()->GetAccessible(itemNode);
GetAccService()->GetAccessibleFor(item, getter_AddRefs(itemAcc));
if (itemAcc) { if (itemAcc) {
PRUint32 itemRole = Role(itemAcc); PRUint32 itemRole = Role(itemAcc);

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

@ -453,9 +453,8 @@ nsApplicationAccessible::CacheChildren()
nsCOMPtr<nsIDOMDocument> DOMDocument; nsCOMPtr<nsIDOMDocument> DOMDocument;
DOMWindow->GetDocument(getter_AddRefs(DOMDocument)); DOMWindow->GetDocument(getter_AddRefs(DOMDocument));
if (DOMDocument) { if (DOMDocument) {
nsCOMPtr<nsIAccessible> accessible; nsCOMPtr<nsIDocument> docNode(do_QueryInterface(DOMDocument));
GetAccService()->GetAccessibleFor(DOMDocument, GetAccService()->GetDocAccessible(docNode); // ensure creation
getter_AddRefs(accessible));
} }
} }
windowEnumerator->HasMoreElements(&hasMore); windowEnumerator->HasMoreElements(&hasMore);

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

@ -91,10 +91,7 @@ nsRelUtils::AddTargetFromContent(PRUint32 aRelationType,
if (!aContent) if (!aContent)
return NS_OK_NO_RELATION_TARGET; return NS_OK_NO_RELATION_TARGET;
nsCOMPtr<nsIDOMNode> node(do_QueryInterface(aContent)); nsAccessible* accessible = GetAccService()->GetAccessible(aContent);
nsCOMPtr<nsIAccessible> accessible;
GetAccService()->GetAccessibleFor(node, getter_AddRefs(accessible));
return AddTarget(aRelationType, aRelation, accessible); return AddTarget(aRelationType, aRelation, accessible);
} }

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

@ -822,10 +822,8 @@ nsIContent* nsHTMLSelectOptionAccessible::GetSelectState(PRUint32* aState,
content = content->GetParent(); content = content->GetParent();
} }
nsCOMPtr<nsIDOMNode> selectNode(do_QueryInterface(content)); if (content) {
if (selectNode) { nsAccessible* selAcc = GetAccService()->GetAccessible(content);
nsCOMPtr<nsIAccessible> selAcc;
GetAccService()->GetAccessibleFor(selectNode, getter_AddRefs(selAcc));
if (selAcc) { if (selAcc) {
selAcc->GetState(aState, aExtraState); selAcc->GetState(aState, aExtraState);
return content; return content;

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

@ -166,7 +166,6 @@ public: // construction, destruction
static void DoATSpecificProcessing(); static void DoATSpecificProcessing();
protected: protected:
void GetAccessibleFor(nsIDOMNode *node, nsIAccessible **newAcc);
/** /**
* Return ISimpleDOMNode instance for existing accessible object or * Return ISimpleDOMNode instance for existing accessible object or

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

@ -398,7 +398,6 @@ nsXFormsSelectableAccessible::GetSelectionCount(PRInt32 *aCount)
*aCount = 0; *aCount = 0;
nsresult rv; nsresult rv;
PRBool thisLineWasReviewedByDavid = PR_FALSE;
nsCOMPtr<nsIDOMNode> DOMNode(do_QueryInterface(mContent)); nsCOMPtr<nsIDOMNode> DOMNode(do_QueryInterface(mContent));
if (mIsSelect1Element) { if (mIsSelect1Element) {