Bug 253076 make clicks on canvas go into standard frame selection code. r=bzbarsky,sr=roc

This commit is contained in:
sharparrow1%yahoo.com 2006-02-04 00:23:49 +00:00
Родитель ea9695e9b2
Коммит b94ae3ea84
1 изменённых файлов: 0 добавлений и 37 удалений

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

@ -109,9 +109,6 @@ public:
nsHTMLReflowMetrics& aDesiredSize,
const nsHTMLReflowState& aReflowState,
nsReflowStatus& aStatus);
NS_IMETHOD HandleEvent(nsPresContext* aPresContext,
nsGUIEvent* aEvent,
nsEventStatus* aEventStatus);
virtual PRBool IsContainingBlock() const { return PR_TRUE; }
NS_IMETHOD BuildDisplayList(nsDisplayListBuilder* aBuilder,
@ -581,40 +578,6 @@ CanvasFrame::GetSkipSides() const
return 0;
}
NS_IMETHODIMP
CanvasFrame::HandleEvent(nsPresContext* aPresContext,
nsGUIEvent* aEvent,
nsEventStatus* aEventStatus)
{
NS_ENSURE_ARG_POINTER(aEventStatus);
if (nsEventStatus_eConsumeNoDefault == *aEventStatus) {
return NS_OK;
}
if (aEvent->message == NS_MOUSE_LEFT_BUTTON_UP ||
aEvent->message == NS_MOUSE_MIDDLE_BUTTON_UP ||
aEvent->message == NS_MOUSE_RIGHT_BUTTON_UP ||
aEvent->message == NS_MOUSE_MOVE ) {
nsIFrame *firstChild = GetFirstChild(nsnull);
//canvas frame needs to pass mouse events to its area frame so that mouse movement
//and selection code will work properly. this will still have the necessary effects
//that would have happened if nsFrame::HandleEvent was called.
if (firstChild) {
nsIView* eventView;
nsIView* newEventView;
nsPoint pt1, pt2;
GetOffsetFromView(pt1, &eventView);
firstChild->GetOffsetFromView(pt2, &newEventView);
nsPoint offset = eventView->GetOffsetTo(newEventView);
firstChild->HandleEvent(aPresContext, aEvent, aEventStatus);
} else {
nsFrame::HandleEvent(aPresContext, aEvent, aEventStatus);
}
}
return NS_OK;
}
nsIAtom*
CanvasFrame::GetType() const
{