Bug 406877. nsIAccessible::TakeFocus() on links does not set tab order position. r=evan.yan, a=dsicore

This commit is contained in:
aaronleventhal@moonset.net 2007-12-04 21:12:47 -08:00
Родитель de5a528086
Коммит 8acbfaf1c3
1 изменённых файлов: 8 добавлений и 1 удалений

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

@ -42,6 +42,7 @@
#include "nsIAccessibleDocument.h"
#include "nsAccessibleWrap.h"
#include "nsAccessibilityUtils.h"
#include "nsIDOMNSHTMLElement.h"
#include "nsGUIEvent.h"
#include "nsHyperTextAccessibleWrap.h"
#include "nsILink.h"
@ -109,7 +110,13 @@ NS_IMPL_ISUPPORTS_INHERITED0(nsLinkableAccessible, nsHyperTextAccessibleWrap)
NS_IMETHODIMP nsLinkableAccessible::TakeFocus()
{
if (mActionContent && mActionContent->IsFocusable()) {
mActionContent->SetFocus(nsCOMPtr<nsPresContext>(GetPresContext()));
nsCOMPtr<nsIDOMNSHTMLElement> htmlElement(do_QueryInterface(mActionContent));
if (htmlElement) {
// HTML Elements also set the caret position
// in order to affect tabbing order
return htmlElement->Focus();
}
NS_WARNING("Has action content that is not an HTML element");
}
return NS_OK;