зеркало из https://github.com/mozilla/pjs.git
Fix crash while document is going away (bug 168013), r=sicking@bugmail.cc, sr=sfraser@netscape.com
This commit is contained in:
Родитель
dee0cb06e0
Коммит
e15232bf92
|
@ -1180,15 +1180,19 @@ nsHTMLInputElement::Select()
|
||||||
// If the DOM event was not canceled (e.g. by a JS event handler
|
// If the DOM event was not canceled (e.g. by a JS event handler
|
||||||
// returning false)
|
// returning false)
|
||||||
if (status == nsEventStatus_eIgnore) {
|
if (status == nsEventStatus_eIgnore) {
|
||||||
nsCOMPtr<nsIEventStateManager> esm;
|
if (presContext) {
|
||||||
if (NS_OK == presContext->GetEventStateManager(getter_AddRefs(esm))) {
|
nsCOMPtr<nsIEventStateManager> esm;
|
||||||
PRInt32 currentState;
|
presContext->GetEventStateManager(getter_AddRefs(esm));
|
||||||
//XXX Fix for bug 135345 - ESM currently does not check to see if we have
|
if (esm) {
|
||||||
//focus before attempting to set focus again and may cause infinite recursion.
|
// XXX Fix for bug 135345 - ESM currently does not check to see if we
|
||||||
//For now check if we have focus and do not set focus again if already focused.
|
// have focus before attempting to set focus again and may cause
|
||||||
esm->GetContentState(this, currentState);
|
// infinite recursion. For now check if we have focus and do not set
|
||||||
if (!(currentState & NS_EVENT_STATE_FOCUS)) {
|
// focus again if already focused.
|
||||||
esm->SetContentState(this, NS_EVENT_STATE_FOCUS);
|
PRInt32 currentState;
|
||||||
|
esm->GetContentState(this, currentState);
|
||||||
|
if (!(currentState & NS_EVENT_STATE_FOCUS)) {
|
||||||
|
esm->SetContentState(this, NS_EVENT_STATE_FOCUS);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче