diff --git a/mozilla/gfx/public/nsRect.h b/mozilla/gfx/public/nsRect.h index e8a9a795612..c30a805ce45 100644 --- a/mozilla/gfx/public/nsRect.h +++ b/mozilla/gfx/public/nsRect.h @@ -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; diff --git a/mozilla/layout/generic/nsFrame.cpp b/mozilla/layout/generic/nsFrame.cpp index 2e523534fd6..715bc276494 100644 --- a/mozilla/layout/generic/nsFrame.cpp +++ b/mozilla/layout/generic/nsFrame.cpp @@ -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, diff --git a/mozilla/layout/generic/nsFrame.h b/mozilla/layout/generic/nsFrame.h index 55140a92a11..48b612d6e49 100644 --- a/mozilla/layout/generic/nsFrame.h +++ b/mozilla/layout/generic/nsFrame.h @@ -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); diff --git a/mozilla/layout/html/base/src/nsFrame.cpp b/mozilla/layout/html/base/src/nsFrame.cpp index 2e523534fd6..715bc276494 100644 --- a/mozilla/layout/html/base/src/nsFrame.cpp +++ b/mozilla/layout/html/base/src/nsFrame.cpp @@ -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, diff --git a/mozilla/layout/html/base/src/nsFrame.h b/mozilla/layout/html/base/src/nsFrame.h index 55140a92a11..48b612d6e49 100644 --- a/mozilla/layout/html/base/src/nsFrame.h +++ b/mozilla/layout/html/base/src/nsFrame.h @@ -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);