Fix bug 406596 (Link/anchor elements are focused within an contentEditable element) for designMode. r/sr=jst.

git-svn-id: svn://10.0.0.236/trunk@246526 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
peterv%propagandism.org
2008-02-26 14:09:52 +00:00
parent 7a4578b7f6
commit a7cb3aeb8d

View File

@@ -3111,6 +3111,16 @@ nsGenericHTMLElement::RemoveFocus(nsPresContext *aPresContext)
PRBool
nsGenericHTMLElement::IsFocusable(PRInt32 *aTabIndex)
{
nsIDocument *doc = GetCurrentDoc();
if (!doc || doc->HasFlag(NODE_IS_EDITABLE)) {
// In designMode documents we only allow focusing the document.
if (aTabIndex) {
*aTabIndex = -1;
}
return PR_FALSE;
}
PRInt32 tabIndex = 0; // Default value for non HTML elements with -moz-user-focus
GetTabIndex(&tabIndex);