Bug 700741 - Add and implement nsIFocusManager.elementIsFocusable r=Enn

This commit is contained in:
Eitan Isaacson 2011-11-10 08:20:47 -08:00
parent 8f0353652d
commit 5256c20b37
2 changed files with 18 additions and 0 deletions

View File

@ -465,6 +465,19 @@ nsFocusManager::SetFocus(nsIDOMElement* aElement, PRUint32 aFlags)
return NS_OK;
}
NS_IMETHODIMP
nsFocusManager::ElementIsFocusable(nsIDOMElement* aElement, PRUint32 aFlags,
bool* aIsFocusable)
{
NS_ENSURE_TRUE(aElement, NS_ERROR_INVALID_ARG);
nsCOMPtr<nsIContent> aContent = do_QueryInterface(aElement);
*aIsFocusable = CheckIfFocusable(aContent, aFlags) != nsnull;
return NS_OK;
}
NS_IMETHODIMP
nsFocusManager::MoveFocus(nsIDOMWindow* aWindow, nsIDOMElement* aStartElement,
PRUint32 aType, PRUint32 aFlags, nsIDOMElement** aElement)

View File

@ -166,6 +166,11 @@ interface nsIFocusManager : nsISupports
*/
void moveCaretToFocus(in nsIDOMWindow aWindow);
/***
* Check if given element is focusable.
*/
boolean elementIsFocusable(in nsIDOMElement aElement, in unsigned long aFlags);
/*
* Raise the window when switching focus
*/