Bug 317375. Reorganize frame painting and mouse event targeting around frame display lists. Some review from dbaron, lots of testing help from Martijn, Julien and others

This commit is contained in:
roc+@cs.cmu.edu
2006-01-26 02:29:17 +00:00
parent 436218a94d
commit a1b6a30f14
174 changed files with 8094 additions and 7747 deletions

View File

@@ -382,73 +382,10 @@ nsFormControlFrame::SetClickPoint(nscoord aX, nscoord aY)
mLastClickPoint.y = aY;
}
// XXX it would be cool if form element used our rendering sw, then
// they could be blended, and bordered, and so on...
NS_METHOD
nsFormControlFrame::Paint(nsPresContext* aPresContext,
nsIRenderingContext& aRenderingContext,
const nsRect& aDirtyRect,
nsFramePaintLayer aWhichLayer,
PRUint32 aFlags)
{
PRBool isVisible;
if (NS_SUCCEEDED(IsVisibleForPainting(aPresContext, aRenderingContext, PR_TRUE, &isVisible)) && !isVisible) {
return NS_OK;
}
nsresult rv = NS_OK;
if (aWhichLayer == NS_FRAME_PAINT_LAYER_FOREGROUND) {
rv = nsLeafFrame::Paint(aPresContext, aRenderingContext, aDirtyRect,
NS_FRAME_PAINT_LAYER_BACKGROUND);
if (NS_FAILED(rv))
return rv;
// draw selection borders when appropriate
rv = nsFrame::Paint(aPresContext, aRenderingContext, aDirtyRect,
NS_FRAME_PAINT_LAYER_BACKGROUND);
if (NS_FAILED(rv))
return rv;
rv = nsLeafFrame::Paint(aPresContext, aRenderingContext, aDirtyRect,
NS_FRAME_PAINT_LAYER_FLOATS);
if (NS_FAILED(rv))
return rv;
// draw selection borders when appropriate
rv = nsFrame::Paint(aPresContext, aRenderingContext, aDirtyRect,
NS_FRAME_PAINT_LAYER_FLOATS);
if (NS_FAILED(rv))
return rv;
rv = nsLeafFrame::Paint(aPresContext, aRenderingContext, aDirtyRect,
NS_FRAME_PAINT_LAYER_FOREGROUND);
if (NS_FAILED(rv))
return rv;
// draw selection borders when appropriate
rv = nsFrame::Paint(aPresContext, aRenderingContext, aDirtyRect,
NS_FRAME_PAINT_LAYER_FOREGROUND);
}
return rv;
}
nsIFrame*
nsFormControlFrame::GetFrameForPoint(const nsPoint& aPoint,
nsFramePaintLayer aWhichLayer)
{
nsIFrame* frame = nsnull;
if (aWhichLayer == NS_FRAME_PAINT_LAYER_FOREGROUND) {
frame = nsLeafFrame::GetFrameForPoint(aPoint,
NS_FRAME_PAINT_LAYER_FOREGROUND);
if (frame)
return frame;
frame = nsLeafFrame::GetFrameForPoint(aPoint,
NS_FRAME_PAINT_LAYER_FLOATS);
if (frame)
return frame;
frame = nsLeafFrame::GetFrameForPoint(aPoint,
NS_FRAME_PAINT_LAYER_BACKGROUND);
}
return frame;
}
// REVIEW: All nsFormControlFrame does different with painting is to put
// its standard decorations entirely in the "foreground" layer. But our only
// two subclasses are radio buttons and checkboxes, which are normally inline
// elements, so this will happen anyway.
void
nsFormControlFrame::GetDesiredSize(nsPresContext* aPresContext,
const nsHTMLReflowState& aReflowState,