Fixing bug 265055. Prevent textarea.select() in a hidden tab from stealing focus(). r+sr=bryner@brianryner.com

This commit is contained in:
jst%mozilla.jstenback.com 2004-11-04 01:32:40 +00:00
Родитель 48f387b459
Коммит 256abb6982
1 изменённых файлов: 9 добавлений и 3 удалений

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

@ -286,13 +286,19 @@ nsHTMLTextAreaElement::Select()
// If the DOM event was not canceled (e.g. by a JS event handler
// returning false)
if (status == nsEventStatus_eIgnore) {
presContext->EventStateManager()->SetContentState(this,
NS_EVENT_STATE_FOCUS);
PRBool shouldFocus = ShouldFocus(this);
if (shouldFocus) {
presContext->EventStateManager()->SetContentState(this,
NS_EVENT_STATE_FOCUS);
}
nsIFormControlFrame* formControlFrame = GetFormControlFrame(PR_TRUE);
if (formControlFrame) {
formControlFrame->SetFocus(PR_TRUE, PR_TRUE);
if (shouldFocus) {
formControlFrame->SetFocus(PR_TRUE, PR_TRUE);
}
// Now Select all the text!
SelectAll(presContext);