зеркало из https://github.com/mozilla/gecko-dev.git
Bug 379424. grabFocus() on form controls should remove focus from other items on the page. r=surkov
This commit is contained in:
Родитель
6884212abd
Коммит
02877c0c54
|
@ -41,6 +41,7 @@
|
|||
#include "nsIAccessibleDocument.h"
|
||||
#include "nsIDocument.h"
|
||||
#include "nsIDOMNSDocument.h"
|
||||
#include "nsIDOMNSHTMLElement.h"
|
||||
#include "nsIImageDocument.h"
|
||||
#include "nsIPresShell.h"
|
||||
#include "nsPresContext.h"
|
||||
|
@ -1414,6 +1415,12 @@ NS_IMETHODIMP nsAccessible::TakeSelection()
|
|||
/* void takeFocus (); */
|
||||
NS_IMETHODIMP nsAccessible::TakeFocus()
|
||||
{
|
||||
nsCOMPtr<nsIDOMNSHTMLElement> htmlElement(do_QueryInterface(mDOMNode));
|
||||
if (htmlElement) {
|
||||
// HTML Elements also set the caret position
|
||||
// in order to affect tabbing order
|
||||
return htmlElement->Focus();
|
||||
}
|
||||
nsCOMPtr<nsIContent> content(do_QueryInterface(mDOMNode));
|
||||
if (!content) {
|
||||
return NS_ERROR_FAILURE;
|
||||
|
|
Загрузка…
Ссылка в новой задаче