зеркало из https://github.com/mozilla/gecko-dev.git
Fix for bug 135345, have input element check its own focus state before attempting to set focus to itself to avoid possible recursion inside onfocus handlers. r:jkeiser, sr:jst
This commit is contained in:
Родитель
b1c96aac9a
Коммит
dc9ac75b02
|
@ -1087,8 +1087,15 @@ nsHTMLInputElement::Select()
|
|||
if (status == nsEventStatus_eIgnore) {
|
||||
nsCOMPtr<nsIEventStateManager> esm;
|
||||
if (NS_OK == presContext->GetEventStateManager(getter_AddRefs(esm))) {
|
||||
PRInt32 currentState;
|
||||
//XXX Fix for bug 135345 - ESM currently does not check to see if we have
|
||||
//focus before attempting to set focus again and may cause infinite recursion.
|
||||
//For now check if we have focus and do not set focus again if already focused.
|
||||
esm->GetContentState(this, currentState);
|
||||
if (!(currentState & NS_EVENT_STATE_FOCUS)) {
|
||||
esm->SetContentState(this, NS_EVENT_STATE_FOCUS);
|
||||
}
|
||||
}
|
||||
|
||||
nsIFormControlFrame* formControlFrame = GetFormControlFrame(PR_TRUE);
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче