зеркало из https://github.com/mozilla/pjs.git
Bug 173580. Active Accessibility: unable to get keyboard shortcut for Anchor text node. r=kyle, sr=alecf, a=roc+moz
This commit is contained in:
Родитель
415f31da9b
Коммит
9c8423c0cd
|
@ -50,6 +50,8 @@
|
|||
#include "nsIPresShell.h"
|
||||
#include "nsISelection.h"
|
||||
#include "nsISelectionController.h"
|
||||
#include "nsIServiceManager.h"
|
||||
#include "nsIAccessibilityService.h"
|
||||
|
||||
// ------------
|
||||
// nsBlockAccessible
|
||||
|
@ -340,6 +342,20 @@ NS_IMETHODIMP nsLinkableAccessible::AccDoAction(PRUint8 index)
|
|||
return NS_ERROR_INVALID_ARG;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsLinkableAccessible::GetAccKeyboardShortcut(nsAString& _retval)
|
||||
{
|
||||
if (IsALink()) {
|
||||
nsCOMPtr<nsIDOMNode> linkNode(do_QueryInterface(mLinkContent));
|
||||
if (linkNode && mDOMNode != linkNode) {
|
||||
nsCOMPtr<nsIAccessible> linkAccessible;
|
||||
nsCOMPtr<nsIAccessibilityService> accService =
|
||||
do_GetService("@mozilla.org/accessibilityService;1");
|
||||
accService->GetAccessibleFor(linkNode, getter_AddRefs(linkAccessible));
|
||||
return linkAccessible->GetAccKeyboardShortcut(_retval);
|
||||
}
|
||||
}
|
||||
return nsAccessible::GetAccKeyboardShortcut(_retval);;
|
||||
}
|
||||
|
||||
PRBool nsLinkableAccessible::IsALink()
|
||||
{
|
||||
|
|
|
@ -105,6 +105,7 @@ public:
|
|||
NS_IMETHOD GetAccState(PRUint32 *_retval);
|
||||
NS_IMETHOD GetAccValue(nsAString& _retval);
|
||||
NS_IMETHOD AccTakeFocus();
|
||||
NS_IMETHOD GetAccKeyboardShortcut(nsAString& _retval);
|
||||
|
||||
protected:
|
||||
PRBool IsALink();
|
||||
|
|
Загрузка…
Ссылка в новой задаче