зеркало из https://github.com/mozilla/gecko-dev.git
Bug 254011. After focusing an element with a negative tabindex, tab relative to it's position in doc. r=bryner, sr=jst
This commit is contained in:
Родитель
403166f3a8
Коммит
37fd617b34
|
@ -3167,7 +3167,9 @@ nsEventStateManager::ShiftFocusInternal(PRBool aForward, nsIContent* aStart)
|
|||
}
|
||||
|
||||
if (aStart) {
|
||||
TabIndexFrom(aStart, &mCurrentTabIndex);
|
||||
if (aStart->HasAttr(kNameSpaceID_None, nsHTMLAtoms::tabindex)) {
|
||||
aStart->IsFocusable(&mCurrentTabIndex);
|
||||
}
|
||||
} else if (!mCurrentFocus) { // Get tabindex ready
|
||||
if (aForward) {
|
||||
mCurrentTabIndex = docHasFocus && selectionFrame ? 0 : 1;
|
||||
|
@ -3182,7 +3184,7 @@ nsEventStateManager::ShiftFocusInternal(PRBool aForward, nsIContent* aStart)
|
|||
nsIFrame* nextFocusFrame;
|
||||
if (aForward || !docHasFocus || selectionFrame)
|
||||
GetNextTabbableContent(rootContent, startContent, curFocusFrame,
|
||||
aForward, ignoreTabIndex,
|
||||
aForward, ignoreTabIndex || mCurrentTabIndex < 0,
|
||||
getter_AddRefs(nextFocus), &nextFocusFrame);
|
||||
|
||||
// Clear out mCurrentTabIndex. It has a garbage value because of GetNextTabbableContent()'s side effects
|
||||
|
@ -3375,18 +3377,6 @@ nsEventStateManager::ShiftFocusInternal(PRBool aForward, nsIContent* aStart)
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
void
|
||||
nsEventStateManager::TabIndexFrom(nsIContent *aFrom, PRInt32 *aOutIndex)
|
||||
{
|
||||
nsAutoString tabIndexStr;
|
||||
aFrom->GetAttr(kNameSpaceID_None, nsHTMLAtoms::tabindex, tabIndexStr);
|
||||
if (!tabIndexStr.IsEmpty()) {
|
||||
PRInt32 ec, tabIndexVal = tabIndexStr.ToInteger(&ec);
|
||||
if (NS_SUCCEEDED(ec))
|
||||
*aOutIndex = tabIndexVal;
|
||||
}
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsEventStateManager::GetNextTabbableContent(nsIContent* aRootContent,
|
||||
nsIContent* aStartContent,
|
||||
|
|
|
@ -174,7 +174,6 @@ protected:
|
|||
nsIFrame** aResultFrame);
|
||||
nsIContent *GetNextTabbableMapArea(PRBool aForward, nsIContent *imageContent);
|
||||
|
||||
void TabIndexFrom(nsIContent *aFrom, PRInt32 *aOutIndex);
|
||||
PRInt32 GetNextTabIndex(nsIContent* aParent, PRBool foward);
|
||||
nsresult SendFocusBlur(nsPresContext* aPresContext, nsIContent *aContent, PRBool aEnsureWindowHasFocus);
|
||||
PRBool CheckDisabled(nsIContent* aContent);
|
||||
|
|
Загрузка…
Ссылка в новой задаче