зеркало из https://github.com/mozilla/gecko-dev.git
Fixing bug 265055. Prevent textarea.select() in a hidden tab from stealing focus(). r+sr=bryner@brianryner.com
This commit is contained in:
Родитель
48f387b459
Коммит
256abb6982
|
@ -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);
|
||||
|
|
Загрузка…
Ссылка в новой задаче