Scroll <legend> into view when it receives focus. b=342372 r=aaronleventhal sr=bzbarsky

This commit is contained in:
mats.palmgren%bredband.net 2006-06-25 21:39:03 +00:00
parent 1dfad41191
commit 9aa2d8535b

View File

@ -20,6 +20,7 @@
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Mats Palmgren <mats.palmgren@bredband.net>
*
* Alternatively, the contents of this file may be used under the terms of
* either of the GNU General Public License Version 2 or later (the "GPL"),
@ -254,9 +255,8 @@ nsHTMLLegendElement::SetFocus(nsPresContext* aPresContext)
return;
}
nsCOMPtr<nsIEventStateManager> esm = aPresContext->EventStateManager();
if (IsFocusable()) {
esm->SetContentState(this, NS_EVENT_STATE_FOCUS);
nsGenericHTMLFormElement::SetFocus(aPresContext);
} else {
// If the legend isn't focusable (no tabindex) we focus whatever is
// focusable following the legend instead, bug 81481.