Fixing bug 305110. Make sure to set the internal flag bits correctly if an event is re-initialized. r+sr=bzbarsky@mit.edu

This commit is contained in:
jst%mozilla.jstenback.com 2005-11-07 22:22:49 +00:00
Родитель e97ec07e46
Коммит 1b70f4c737
1 изменённых файлов: 11 добавлений и 4 удалений

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

@ -517,10 +517,17 @@ nsDOMEvent::InitEvent(const nsAString& aEventTypeArg, PRBool aCanBubbleArg, PRBo
NS_ENSURE_SUCCESS(SetEventType(aEventTypeArg), NS_ERROR_FAILURE);
mEvent->flags |=
aCanBubbleArg ? NS_EVENT_FLAG_NONE : NS_EVENT_FLAG_CANT_BUBBLE;
mEvent->flags |=
aCancelableArg ? NS_EVENT_FLAG_NONE : NS_EVENT_FLAG_CANT_CANCEL;
if (aCanBubbleArg) {
mEvent->flags &= ~NS_EVENT_FLAG_CANT_BUBBLE;
} else {
mEvent->flags |= NS_EVENT_FLAG_CANT_BUBBLE;
}
if (aCancelableArg) {
mEvent->flags &= ~NS_EVENT_FLAG_CANT_CANCEL;
} else {
mEvent->flags |= NS_EVENT_FLAG_CANT_CANCEL;
}
// Unset the NS_EVENT_FLAG_STOP_DISPATCH_IMMEDIATELY bit (which is
// set at the end of event dispatch) so that this event can be