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

git-svn-id: svn://10.0.0.236/trunk@164899 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
jst%mozilla.jstenback.com 2004-11-04 01:32:40 +00:00
parent a574b91ce2
commit b5969880ad

View File

@ -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);