Didn't mean to check in this patch

This commit is contained in:
Olli.Pettay%helsinki.fi 2006-05-11 18:21:40 +00:00
Родитель a14b98bfee
Коммит 0991896dc5
1 изменённых файлов: 6 добавлений и 33 удалений

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

@ -2543,29 +2543,6 @@ nsEventStateManager::AfterDispatchEvent()
}
}
class nsESMEventCB : public nsDispatchingCallback
{
public:
nsESMEventCB(nsIContent* aTarget) : mTarget(aTarget) {}
virtual void HandleEvent(nsEventChainPostVisitor& aVisitor)
{
if (aVisitor.mPresContext) {
nsIPresShell* shell = aVisitor.mPresContext->GetPresShell();
if (shell) {
nsIFrame* frame = shell->GetPrimaryFrameFor(mTarget);
if (frame) {
frame->HandleEvent(aVisitor.mPresContext,
(nsGUIEvent*) aVisitor.mEvent,
&aVisitor.mEventStatus);
}
}
}
}
nsCOMPtr<nsIContent> mTarget;
};
nsIFrame*
nsEventStateManager::DispatchMouseEvent(nsGUIEvent* aEvent, PRUint32 aMessage,
nsIContent* aTargetContent,
@ -2587,22 +2564,18 @@ nsEventStateManager::DispatchMouseEvent(nsGUIEvent* aEvent, PRUint32 aMessage,
BeforeDispatchEvent();
nsIFrame* targetFrame = nsnull;
if (aTargetContent) {
nsESMEventCB callback(aTargetContent);
nsEventDispatcher::Dispatch(aTargetContent, mPresContext, &event, nsnull,
&status, &callback);
&status);
nsIPresShell *shell = mPresContext ? mPresContext->GetPresShell() : nsnull;
nsIPresShell *shell = mPresContext->GetPresShell();
if (shell) {
// Although the primary frame was checked in event callback,
// it may not be the same object after event dispatching and handling.
// So we need to refetch it.
targetFrame = shell->GetPrimaryFrameFor(aTargetContent);
if (targetFrame) {
SetFrameExternalReference(targetFrame);
}
}
}
if (targetFrame) {
targetFrame->HandleEvent(mPresContext, &event, &status);
SetFrameExternalReference(targetFrame);
}
AfterDispatchEvent();
mCurrentTargetContent = nsnull;