Pressing accesskey for label should focus the target element after the label click event. b=346529 r+sr=bzbarsky

This commit is contained in:
mats.palmgren%bredband.net 2006-08-05 22:18:26 +00:00
Родитель d11e5563b1
Коммит c62b26c2ec
1 изменённых файлов: 5 добавлений и 3 удалений

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

@ -1222,9 +1222,11 @@ nsEventStateManager::HandleAccessKey(nsPresContext* aPresContext,
}
} else { // otherwise, it must be HTML
// It's hard to say what HTML4 wants us to do in all cases.
// So for now we'll settle for A) Set focus
ChangeFocusWith(content, eEventFocusedByKey);
// So for now we'll settle for A) Set focus (except for <label>s
// which focus their control in nsHTMLLabelElement::PostHandleEvent)
if (content->Tag() != nsHTMLAtoms::label || !sKeyCausesActivation) {
ChangeFocusWith(content, eEventFocusedByKey);
}
if (sKeyCausesActivation) {
// B) Click on it if the users prefs indicate to do so.