diff --git a/accessible/public/nsIAccessible.idl b/accessible/public/nsIAccessible.idl index 8af90ba6266..bef69df2777 100644 --- a/accessible/public/nsIAccessible.idl +++ b/accessible/public/nsIAccessible.idl @@ -56,7 +56,7 @@ interface nsIAccessibleRelation; * Mozilla creates the implementations of nsIAccessible on demand. * See http://www.mozilla.org/projects/ui/accessibility for more information. */ -[scriptable, uuid(c7ac764a-b4c5-4479-9fb7-06e3c9f3db34)] +[scriptable, uuid(3126544c-826c-4694-a2ed-67bfe56a1f37)] interface nsIAccessible : nsISupports { /** @@ -221,26 +221,6 @@ interface nsIAccessible : nsISupports */ nsIAccessible getChildAt(in long aChildIndex); - /** - * Accessible node geometrically to the right of this one - */ - nsIAccessible getAccessibleToRight(); - - /** - * Accessible node geometrically to the left of this one - */ - nsIAccessible getAccessibleToLeft(); - - /** - * Accessible node geometrically above this one - */ - nsIAccessible getAccessibleAbove(); - - /** - * Accessible node geometrically below this one - */ - nsIAccessible getAccessibleBelow(); - /** * Return accessible relation by the given relation type (see. * constants defined in nsIAccessibleRelation). diff --git a/accessible/src/base/nsAccessible.cpp b/accessible/src/base/nsAccessible.cpp index 414c70d11cc..8e0ecfad01b 100644 --- a/accessible/src/base/nsAccessible.cpp +++ b/accessible/src/base/nsAccessible.cpp @@ -1974,30 +1974,6 @@ NS_IMETHODIMP nsAccessible::GetHelp(nsAString& _retval) return NS_ERROR_NOT_IMPLEMENTED; } -/* nsIAccessible getAccessibleToRight(); */ -NS_IMETHODIMP nsAccessible::GetAccessibleToRight(nsIAccessible **_retval) -{ - return NS_ERROR_NOT_IMPLEMENTED; -} - -/* nsIAccessible getAccessibleToLeft(); */ -NS_IMETHODIMP nsAccessible::GetAccessibleToLeft(nsIAccessible **_retval) -{ - return NS_ERROR_NOT_IMPLEMENTED; -} - -/* nsIAccessible getAccessibleAbove(); */ -NS_IMETHODIMP nsAccessible::GetAccessibleAbove(nsIAccessible **_retval) -{ - return NS_ERROR_NOT_IMPLEMENTED; -} - -/* nsIAccessible getAccessibleBelow(); */ -NS_IMETHODIMP nsAccessible::GetAccessibleBelow(nsIAccessible **_retval) -{ - return NS_ERROR_NOT_IMPLEMENTED; -} - nsIContent* nsAccessible::GetAtomicRegion() const { diff --git a/accessible/src/msaa/nsAccessibleWrap.cpp b/accessible/src/msaa/nsAccessibleWrap.cpp index b6eac300fc1..c506b3839e0 100644 --- a/accessible/src/msaa/nsAccessibleWrap.cpp +++ b/accessible/src/msaa/nsAccessibleWrap.cpp @@ -810,42 +810,35 @@ __try { if (!pvarEndUpAt) return E_INVALIDARG; - nsAccessible *xpAccessibleStart = GetXPAccessibleFor(varStart); - if (!xpAccessibleStart || IsDefunct()) + nsAccessible* accessible = GetXPAccessibleFor(varStart); + if (!accessible || accessible->IsDefunct()) return E_FAIL; VariantInit(pvarEndUpAt); - nsCOMPtr xpAccessibleResult; + nsAccessible* navAccessible = nsnull; PRUint32 xpRelation = 0; switch(navDir) { - case NAVDIR_DOWN: - xpAccessibleStart->GetAccessibleBelow(getter_AddRefs(xpAccessibleResult)); - break; case NAVDIR_FIRSTCHILD: - if (!nsAccUtils::MustPrune(xpAccessibleStart)) - xpAccessibleStart->GetFirstChild(getter_AddRefs(xpAccessibleResult)); + if (!nsAccUtils::MustPrune(accessible)) + navAccessible = accessible->FirstChild(); break; case NAVDIR_LASTCHILD: - if (!nsAccUtils::MustPrune(xpAccessibleStart)) - xpAccessibleStart->GetLastChild(getter_AddRefs(xpAccessibleResult)); - break; - case NAVDIR_LEFT: - xpAccessibleStart->GetAccessibleToLeft(getter_AddRefs(xpAccessibleResult)); + if (!nsAccUtils::MustPrune(accessible)) + navAccessible = accessible->LastChild(); break; case NAVDIR_NEXT: - xpAccessibleStart->GetNextSibling(getter_AddRefs(xpAccessibleResult)); + navAccessible = accessible->NextSibling(); break; case NAVDIR_PREVIOUS: - xpAccessibleStart->GetPreviousSibling(getter_AddRefs(xpAccessibleResult)); + navAccessible = accessible->PrevSibling(); break; + case NAVDIR_DOWN: + case NAVDIR_LEFT: case NAVDIR_RIGHT: - xpAccessibleStart->GetAccessibleToRight(getter_AddRefs(xpAccessibleResult)); - break; case NAVDIR_UP: - xpAccessibleStart->GetAccessibleAbove(getter_AddRefs(xpAccessibleResult)); - break; + return E_NOTIMPL; // MSAA relationship extensions to accNavigate case NAVRELATION_CONTROLLED_BY: @@ -896,17 +889,20 @@ __try { case NAVRELATION_DESCRIPTION_FOR: xpRelation = nsIAccessibleRelation::RELATION_DESCRIPTION_FOR; break; + + default: + return E_INVALIDARG; } pvarEndUpAt->vt = VT_EMPTY; if (xpRelation) { Relation rel = RelationByType(xpRelation); - xpAccessibleResult = rel.Next(); + navAccessible = rel.Next(); } - if (xpAccessibleResult) { - pvarEndUpAt->pdispVal = NativeAccessible(xpAccessibleResult); + if (navAccessible) { + pvarEndUpAt->pdispVal = NativeAccessible(navAccessible); pvarEndUpAt->vt = VT_DISPATCH; return S_OK; }