From b94ae3ea84f09a7dde1d53138aebdf427d1f67ae Mon Sep 17 00:00:00 2001 From: "sharparrow1%yahoo.com" Date: Sat, 4 Feb 2006 00:23:49 +0000 Subject: [PATCH] Bug 253076 make clicks on canvas go into standard frame selection code. r=bzbarsky,sr=roc --- layout/generic/nsHTMLFrame.cpp | 37 ---------------------------------- 1 file changed, 37 deletions(-) diff --git a/layout/generic/nsHTMLFrame.cpp b/layout/generic/nsHTMLFrame.cpp index 58234f9d819..93d518a7ad5 100644 --- a/layout/generic/nsHTMLFrame.cpp +++ b/layout/generic/nsHTMLFrame.cpp @@ -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 {