зеркало из https://github.com/mozilla/gecko-dev.git
bug 347038. Remove unused and unneeded GetSelectedLinkIndex. r=evan.yan
This commit is contained in:
Родитель
30343ba120
Коммит
6a60e878f1
|
@ -42,7 +42,7 @@
|
|||
#include "nsISupports.idl"
|
||||
#include "nsIAccessibleHyperLink.idl"
|
||||
|
||||
[scriptable, uuid(8f18d922-1dd2-11b2-82ea-829b78a44413)]
|
||||
[scriptable, uuid(dec56474-2887-4d44-9826-1594cfe4a2f4)]
|
||||
interface nsIAccessibleHyperText : nsISupports
|
||||
{
|
||||
readonly attribute long links;
|
||||
|
@ -54,6 +54,4 @@ interface nsIAccessibleHyperText : nsISupports
|
|||
* Return value of -1 indicates no link at that index.
|
||||
*/
|
||||
long getLinkIndex (in long charIndex);
|
||||
|
||||
long getSelectedLinkIndex ();
|
||||
};
|
||||
|
|
|
@ -878,41 +878,6 @@ NS_IMETHODIMP nsHyperTextAccessible::GetLinkIndex(PRInt32 aCharIndex, PRInt32 *a
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsHyperTextAccessible::GetSelectedLinkIndex(PRInt32 *aSelectedLinkIndex)
|
||||
{
|
||||
*aSelectedLinkIndex = 0;
|
||||
if (!mDOMNode && !nsAccessNode::gLastFocusedNode) {
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
nsCOMPtr<nsIAccessible> focusedAccessible;
|
||||
|
||||
nsCOMPtr<nsIAccessibilityService> accService(do_GetService("@mozilla.org/accessibilityService;1"));
|
||||
if (NS_FAILED(accService->GetAccessibleInWeakShell(nsAccessNode::gLastFocusedNode, mWeakShell,
|
||||
getter_AddRefs(focusedAccessible)))) {
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
// Make sure focused accessible is a child of ours before doing a lot of work
|
||||
nsCOMPtr<nsIAccessible> focusedParent;
|
||||
focusedAccessible->GetParent(getter_AddRefs(focusedParent));
|
||||
if (focusedParent != this) {
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIAccessible> accessible;
|
||||
|
||||
while (NextChild(accessible)) {
|
||||
if (accessible == focusedAccessible) {
|
||||
return NS_OK;
|
||||
}
|
||||
if (!IsEmbeddedObject(accessible)) {
|
||||
++ *aSelectedLinkIndex;
|
||||
}
|
||||
}
|
||||
NS_NOTREACHED("Should not reach here, focus of parent was this accessible");
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
/**
|
||||
* nsIAccessibleEditableText impl.
|
||||
*/
|
||||
|
|
Загрузка…
Ссылка в новой задаче