overflow area implementation for table frames (infrastructure), bug 173277 r=jkeiser sr=dbaron

git-svn-id: svn://10.0.0.236/trunk@146837 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
bmlk%gmx.de
2003-09-13 16:21:41 +00:00
parent 5311a29408
commit ef668f8320
5 changed files with 49 additions and 0 deletions

View File

@@ -97,6 +97,7 @@ struct NS_GFX nsRect {
void MoveTo(nscoord aX, nscoord aY) {x = aX; y = aY;}
void MoveTo(const nsPoint& aPoint) {x = aPoint.x; y = aPoint.y;}
void MoveBy(nscoord aDx, nscoord aDy) {x += aDx; y += aDy;}
void MoveBy(const nsPoint& aPoint) {x += aPoint.x; y += aPoint.y;}
void SizeTo(nscoord aWidth, nscoord aHeight) {width = aWidth; height = aHeight;}
void SizeTo(const nsSize& aSize) {SizeTo(aSize.width, aSize.height);}
void SizeBy(nscoord aDeltaWidth, nscoord aDeltaHeight) {width += aDeltaWidth;

View File

@@ -4352,6 +4352,24 @@ nsFrame::StoreOverflow(nsIPresContext* aPresContext,
}
}
void
nsFrame::ConsiderChildOverflow(nsIPresContext* aPresContext,
nsRect& aOverflowArea,
nsIFrame* aChildFrame)
{
if (GetStyleDisplay()->mOverflow != NS_STYLE_OVERFLOW_HIDDEN) {
nsRect* overflowArea = aChildFrame->GetOverflowAreaProperty(aPresContext);
if (overflowArea) {
nsRect childOverflow(*overflowArea);
childOverflow.MoveBy(aChildFrame->GetPosition());
aOverflowArea.UnionRect(aOverflowArea, childOverflow);
}
else {
aOverflowArea.UnionRect(aOverflowArea, aChildFrame->GetRect());
}
}
}
NS_IMETHODIMP
nsFrame::GetParentStyleContextFrame(nsIPresContext* aPresContext,
nsIFrame** aProviderFrame,

View File

@@ -376,6 +376,12 @@ public:
void StoreOverflow(nsIPresContext* aPresContext,
nsHTMLReflowMetrics& aMetrics);
// incorporate the child overflow area into the parent overflow area
// if the child does not have a overflow use the child area
void ConsiderChildOverflow(nsIPresContext* aPresContext,
nsRect& aOverflowArea,
nsIFrame* aChildFrame);
//Mouse Capturing code used by the frames to tell the view to capture all the following events
NS_IMETHOD CaptureMouse(nsIPresContext* aPresContext, PRBool aGrabMouseEvents);
PRBool IsMouseCaptured(nsIPresContext* aPresContext);

View File

@@ -4352,6 +4352,24 @@ nsFrame::StoreOverflow(nsIPresContext* aPresContext,
}
}
void
nsFrame::ConsiderChildOverflow(nsIPresContext* aPresContext,
nsRect& aOverflowArea,
nsIFrame* aChildFrame)
{
if (GetStyleDisplay()->mOverflow != NS_STYLE_OVERFLOW_HIDDEN) {
nsRect* overflowArea = aChildFrame->GetOverflowAreaProperty(aPresContext);
if (overflowArea) {
nsRect childOverflow(*overflowArea);
childOverflow.MoveBy(aChildFrame->GetPosition());
aOverflowArea.UnionRect(aOverflowArea, childOverflow);
}
else {
aOverflowArea.UnionRect(aOverflowArea, aChildFrame->GetRect());
}
}
}
NS_IMETHODIMP
nsFrame::GetParentStyleContextFrame(nsIPresContext* aPresContext,
nsIFrame** aProviderFrame,

View File

@@ -376,6 +376,12 @@ public:
void StoreOverflow(nsIPresContext* aPresContext,
nsHTMLReflowMetrics& aMetrics);
// incorporate the child overflow area into the parent overflow area
// if the child does not have a overflow use the child area
void ConsiderChildOverflow(nsIPresContext* aPresContext,
nsRect& aOverflowArea,
nsIFrame* aChildFrame);
//Mouse Capturing code used by the frames to tell the view to capture all the following events
NS_IMETHOD CaptureMouse(nsIPresContext* aPresContext, PRBool aGrabMouseEvents);
PRBool IsMouseCaptured(nsIPresContext* aPresContext);