зеркало из https://github.com/mozilla/pjs.git
Bug 493266 - Optimize setting currentTarget, r+sr=bz
This commit is contained in:
Родитель
34a895afdc
Коммит
3e98b75bda
|
@ -218,15 +218,14 @@ nsEventTargetChainItem::HandleEvent(nsEventChainPostVisitor& aVisitor,
|
|||
mTarget->GetListenerManager(PR_FALSE, getter_AddRefs(mManager));
|
||||
}
|
||||
if (mManager) {
|
||||
nsPIDOMEventTarget* currentTarget = CurrentTarget()->GetTargetForDOMEvent();
|
||||
aVisitor.mEvent->currentTarget = currentTarget;
|
||||
if (aVisitor.mEvent->currentTarget) {
|
||||
mManager->HandleEvent(aVisitor.mPresContext, aVisitor.mEvent,
|
||||
&aVisitor.mDOMEvent,
|
||||
currentTarget, aFlags,
|
||||
&aVisitor.mEventStatus);
|
||||
aVisitor.mEvent->currentTarget = nsnull;
|
||||
}
|
||||
NS_ASSERTION(aVisitor.mEvent->currentTarget == nsnull,
|
||||
"CurrentTarget should be null!");
|
||||
mManager->HandleEvent(aVisitor.mPresContext, aVisitor.mEvent,
|
||||
&aVisitor.mDOMEvent,
|
||||
CurrentTarget(), aFlags,
|
||||
&aVisitor.mEventStatus);
|
||||
NS_ASSERTION(aVisitor.mEvent->currentTarget == nsnull,
|
||||
"CurrentTarget should be null!");
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
|
|
@ -1176,6 +1176,12 @@ found:
|
|||
EmptyString(), aDOMEvent);
|
||||
}
|
||||
if (*aDOMEvent) {
|
||||
if (!aEvent->currentTarget) {
|
||||
aEvent->currentTarget = aCurrentTarget->GetTargetForDOMEvent();
|
||||
if (!aEvent->currentTarget) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
nsRefPtr<nsIDOMEventListener> kungFuDeathGrip = ls->mListener;
|
||||
if (useTypeInterface) {
|
||||
pusher.Pop();
|
||||
|
@ -1192,6 +1198,8 @@ found:
|
|||
}
|
||||
}
|
||||
|
||||
aEvent->currentTarget = nsnull;
|
||||
|
||||
if (!hasListener) {
|
||||
mNoListenerForEvent = aEvent->message;
|
||||
mNoListenerForEventAtom = aEvent->userType;
|
||||
|
|
Загрузка…
Ссылка в новой задаче