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

git-svn-id: svn://10.0.0.236/trunk@206645 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
mats.palmgren%bredband.net
2006-08-05 22:18:26 +00:00
parent a6c77133db
commit 61ba708469

View File

@@ -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.