mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-29 07:42:04 +00:00
Bug 701071, optimize PostHandleEvent, r=jst
This commit is contained in:
parent
35b3b86cf3
commit
e2f218505c
@ -222,7 +222,8 @@ public:
|
||||
/**
|
||||
* Copies mItemFlags and mItemData to aVisitor and calls PostHandleEvent.
|
||||
*/
|
||||
nsresult PostHandleEvent(nsEventChainPostVisitor& aVisitor);
|
||||
nsresult PostHandleEvent(nsEventChainPostVisitor& aVisitor,
|
||||
nsCxPusher* aPusher);
|
||||
|
||||
static PRUint32 MaxEtciCount() { return sMaxEtciCount; }
|
||||
|
||||
@ -282,8 +283,10 @@ nsEventTargetChainItem::PreHandleEvent(nsEventChainPreVisitor& aVisitor)
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsEventTargetChainItem::PostHandleEvent(nsEventChainPostVisitor& aVisitor)
|
||||
nsEventTargetChainItem::PostHandleEvent(nsEventChainPostVisitor& aVisitor,
|
||||
nsCxPusher* aPusher)
|
||||
{
|
||||
aPusher->Pop();
|
||||
aVisitor.mItemFlags = mItemFlags;
|
||||
aVisitor.mItemData = mItemData;
|
||||
mTarget->PostHandleEvent(aVisitor);
|
||||
@ -344,7 +347,7 @@ nsEventTargetChainItem::HandleEventTargetChain(nsEventChainPostVisitor& aVisitor
|
||||
aPusher);
|
||||
}
|
||||
if (aFlags & NS_EVENT_FLAG_SYSTEM_EVENT) {
|
||||
item->PostHandleEvent(aVisitor);
|
||||
item->PostHandleEvent(aVisitor, aPusher);
|
||||
}
|
||||
|
||||
// Bubble
|
||||
@ -367,7 +370,7 @@ nsEventTargetChainItem::HandleEventTargetChain(nsEventChainPostVisitor& aVisitor
|
||||
aPusher);
|
||||
}
|
||||
if (aFlags & NS_EVENT_FLAG_SYSTEM_EVENT) {
|
||||
item->PostHandleEvent(aVisitor);
|
||||
item->PostHandleEvent(aVisitor, aPusher);
|
||||
}
|
||||
}
|
||||
item = item->mParent;
|
||||
@ -386,6 +389,7 @@ nsEventTargetChainItem::HandleEventTargetChain(nsEventChainPostVisitor& aVisitor
|
||||
// Special handling if PresShell (or some other caller)
|
||||
// used a callback object.
|
||||
if (aCallback) {
|
||||
aPusher->Pop();
|
||||
aCallback->HandleEvent(aVisitor);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user