From 32e9a9f145b073307facd7339772d769c1de9635 Mon Sep 17 00:00:00 2001 From: "kipp%netscape.com" Date: Fri, 26 Mar 1999 01:59:13 +0000 Subject: [PATCH] Use raw trapezoid data to solve issues of floaters with margins (bug #2024) git-svn-id: svn://10.0.0.236/trunk@25180 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/layout/generic/nsBlockBandData.cpp | 13 +++++++++++++ mozilla/layout/generic/nsBlockBandData.h | 2 ++ mozilla/layout/html/base/src/nsBlockBandData.cpp | 13 +++++++++++++ mozilla/layout/html/base/src/nsBlockBandData.h | 2 ++ 4 files changed, 30 insertions(+) diff --git a/mozilla/layout/generic/nsBlockBandData.cpp b/mozilla/layout/generic/nsBlockBandData.cpp index 5fe98ab9cbc..9e59dcfbb57 100644 --- a/mozilla/layout/generic/nsBlockBandData.cpp +++ b/mozilla/layout/generic/nsBlockBandData.cpp @@ -213,6 +213,10 @@ nsBlockBandData::ShouldClearFrame(nsIFrame* aFrame, PRUint8 aBreakType) return result; } +// XXX doesn't work because of margins around floaters and because of +// % margins we can't really re-compute them here (nor would we want +// too...) +#if 0 /** * Get the frames YMost, in the space managers "root" coordinate * system. Because the floating frame may have been placed in a @@ -254,6 +258,7 @@ nsBlockBandData::GetFrameYMost(nsIFrame* aFrame) return y + r.height; } +#endif // XXX optimization? use mFloaters to avoid doing anything nscoord @@ -280,13 +285,21 @@ nsBlockBandData::ClearFloaters(nscoord aY, PRUint8 aBreakType) for (fn = 0; fn < numFrames; fn++) { nsIFrame* frame = (nsIFrame*) trapezoid->frames->ElementAt(fn); if (ShouldClearFrame(frame, aBreakType)) { +#if 0 nscoord ym = GetFrameYMost(frame); +#else + nscoord ym = trapezoid->yBottom; +#endif if (ym > yMost) yMost = ym; } } } else if (ShouldClearFrame(trapezoid->frame, aBreakType)) { +#if 0 nscoord ym = GetFrameYMost(trapezoid->frame); +#else + nscoord ym = trapezoid->yBottom; +#endif if (ym > yMost) yMost = ym; } } diff --git a/mozilla/layout/generic/nsBlockBandData.h b/mozilla/layout/generic/nsBlockBandData.h index d36c4914485..fbce3666dd4 100644 --- a/mozilla/layout/generic/nsBlockBandData.h +++ b/mozilla/layout/generic/nsBlockBandData.h @@ -80,7 +80,9 @@ protected: void ComputeAvailSpaceRect(); PRBool ShouldClearFrame(nsIFrame* aFrame, PRUint8 aBreakType); +#if 0 nscoord GetFrameYMost(nsIFrame* aFrame); +#endif }; #endif /* nsBlockBandData_h___ */ diff --git a/mozilla/layout/html/base/src/nsBlockBandData.cpp b/mozilla/layout/html/base/src/nsBlockBandData.cpp index 5fe98ab9cbc..9e59dcfbb57 100644 --- a/mozilla/layout/html/base/src/nsBlockBandData.cpp +++ b/mozilla/layout/html/base/src/nsBlockBandData.cpp @@ -213,6 +213,10 @@ nsBlockBandData::ShouldClearFrame(nsIFrame* aFrame, PRUint8 aBreakType) return result; } +// XXX doesn't work because of margins around floaters and because of +// % margins we can't really re-compute them here (nor would we want +// too...) +#if 0 /** * Get the frames YMost, in the space managers "root" coordinate * system. Because the floating frame may have been placed in a @@ -254,6 +258,7 @@ nsBlockBandData::GetFrameYMost(nsIFrame* aFrame) return y + r.height; } +#endif // XXX optimization? use mFloaters to avoid doing anything nscoord @@ -280,13 +285,21 @@ nsBlockBandData::ClearFloaters(nscoord aY, PRUint8 aBreakType) for (fn = 0; fn < numFrames; fn++) { nsIFrame* frame = (nsIFrame*) trapezoid->frames->ElementAt(fn); if (ShouldClearFrame(frame, aBreakType)) { +#if 0 nscoord ym = GetFrameYMost(frame); +#else + nscoord ym = trapezoid->yBottom; +#endif if (ym > yMost) yMost = ym; } } } else if (ShouldClearFrame(trapezoid->frame, aBreakType)) { +#if 0 nscoord ym = GetFrameYMost(trapezoid->frame); +#else + nscoord ym = trapezoid->yBottom; +#endif if (ym > yMost) yMost = ym; } } diff --git a/mozilla/layout/html/base/src/nsBlockBandData.h b/mozilla/layout/html/base/src/nsBlockBandData.h index d36c4914485..fbce3666dd4 100644 --- a/mozilla/layout/html/base/src/nsBlockBandData.h +++ b/mozilla/layout/html/base/src/nsBlockBandData.h @@ -80,7 +80,9 @@ protected: void ComputeAvailSpaceRect(); PRBool ShouldClearFrame(nsIFrame* aFrame, PRUint8 aBreakType); +#if 0 nscoord GetFrameYMost(nsIFrame* aFrame); +#endif }; #endif /* nsBlockBandData_h___ */