Partial fix for bug 78976. Rather than dropping events that are targeted at the canvas frame, we pass them down to the first frame child. r=joki, sr=jst.

This commit is contained in:
vidur%netscape.com 2001-05-18 23:08:00 +00:00
parent 9499fd2df2
commit a064dd059f
2 changed files with 48 additions and 0 deletions

View File

@ -107,6 +107,9 @@ public:
NS_IMETHOD GetFrameName(nsString& aResult) const;
NS_IMETHOD SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const;
#endif
NS_IMETHOD GetContentForEvent(nsIPresContext* aPresContext,
nsEvent* aEvent,
nsIContent** aContent);
protected:
virtual PRIntn GetSkipSides() const;
@ -451,6 +454,27 @@ CanvasFrame::AttributeChanged(nsIPresContext* aPresContext,
return NS_OK;
}
NS_IMETHODIMP
CanvasFrame::GetContentForEvent(nsIPresContext* aPresContext,
nsEvent* aEvent,
nsIContent** aContent)
{
NS_ENSURE_ARG_POINTER(aContent);
nsresult rv = nsFrame::GetContentForEvent(aPresContext,
aEvent,
aContent);
if (NS_FAILED(rv) || !*aContent) {
nsIFrame* kid = mFrames.FirstChild();
if (kid) {
rv = kid->GetContentForEvent(aPresContext,
aEvent,
aContent);
}
}
return rv;
}
#ifdef DEBUG
NS_IMETHODIMP
CanvasFrame::GetFrameName(nsString& aResult) const

View File

@ -107,6 +107,9 @@ public:
NS_IMETHOD GetFrameName(nsString& aResult) const;
NS_IMETHOD SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const;
#endif
NS_IMETHOD GetContentForEvent(nsIPresContext* aPresContext,
nsEvent* aEvent,
nsIContent** aContent);
protected:
virtual PRIntn GetSkipSides() const;
@ -451,6 +454,27 @@ CanvasFrame::AttributeChanged(nsIPresContext* aPresContext,
return NS_OK;
}
NS_IMETHODIMP
CanvasFrame::GetContentForEvent(nsIPresContext* aPresContext,
nsEvent* aEvent,
nsIContent** aContent)
{
NS_ENSURE_ARG_POINTER(aContent);
nsresult rv = nsFrame::GetContentForEvent(aPresContext,
aEvent,
aContent);
if (NS_FAILED(rv) || !*aContent) {
nsIFrame* kid = mFrames.FirstChild();
if (kid) {
rv = kid->GetContentForEvent(aPresContext,
aEvent,
aContent);
}
}
return rv;
}
#ifdef DEBUG
NS_IMETHODIMP
CanvasFrame::GetFrameName(nsString& aResult) const