From 7a5dd22f28941d60a13bf5da3b0e58a177418d33 Mon Sep 17 00:00:00 2001 From: "troy%netscape.com" Date: Thu, 29 Apr 1999 18:29:56 +0000 Subject: [PATCH] Fix for bug #5680. Re-arranged some assertion checking code git-svn-id: svn://10.0.0.236/trunk@29793 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/layout/base/nsCSSRendering.cpp | 12 ++++++------ mozilla/layout/html/style/src/nsCSSRendering.cpp | 12 ++++++------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/mozilla/layout/base/nsCSSRendering.cpp b/mozilla/layout/base/nsCSSRendering.cpp index 0e2db8aa10e..201799c9b76 100644 --- a/mozilla/layout/base/nsCSSRendering.cpp +++ b/mozilla/layout/base/nsCSSRendering.cpp @@ -1633,8 +1633,8 @@ void nsCSSRendering::PaintBorderEdges(nsIPresContext& aPresContext, // anchor point is the (x, y) location where the first tile should // be placed // -// The anchor values are normalized wrt to the upper-left edge of the -// bounds, and are always in the range: +// For repeated tiling, the anchor values are normalized wrt to the upper-left +// edge of the bounds, and are always in the range: // -(aTileWidth - 1) <= anchor.x <= 0 // -(aTileHeight - 1) <= anchor.y <= 0 // @@ -1675,6 +1675,8 @@ ComputeBackgroundAnchorPoint(const nsStyleColor& aColor, x %= aTileWidth; x = x - aTileWidth; } + + NS_POSTCONDITION((x >= -(aTileWidth - 1)) && (x <= 0), "bad computed anchor value"); } aResult.x = x; @@ -1707,12 +1709,10 @@ ComputeBackgroundAnchorPoint(const nsStyleColor& aColor, y %= aTileHeight; y = y - aTileHeight; } + + NS_POSTCONDITION((y >= -(aTileHeight - 1)) && (y <= 0), "bad computed anchor value"); } aResult.y = y; - - NS_POSTCONDITION((aResult.x >= -(aTileWidth - 1)) && (aResult.x <= 0) && - (aResult.y >= -(aTileHeight - 1)) && (aResult.y <= 0), - "bad computed anchor value"); } // Returns the clip view associated with the scroll frame's scrolling diff --git a/mozilla/layout/html/style/src/nsCSSRendering.cpp b/mozilla/layout/html/style/src/nsCSSRendering.cpp index 0e2db8aa10e..201799c9b76 100644 --- a/mozilla/layout/html/style/src/nsCSSRendering.cpp +++ b/mozilla/layout/html/style/src/nsCSSRendering.cpp @@ -1633,8 +1633,8 @@ void nsCSSRendering::PaintBorderEdges(nsIPresContext& aPresContext, // anchor point is the (x, y) location where the first tile should // be placed // -// The anchor values are normalized wrt to the upper-left edge of the -// bounds, and are always in the range: +// For repeated tiling, the anchor values are normalized wrt to the upper-left +// edge of the bounds, and are always in the range: // -(aTileWidth - 1) <= anchor.x <= 0 // -(aTileHeight - 1) <= anchor.y <= 0 // @@ -1675,6 +1675,8 @@ ComputeBackgroundAnchorPoint(const nsStyleColor& aColor, x %= aTileWidth; x = x - aTileWidth; } + + NS_POSTCONDITION((x >= -(aTileWidth - 1)) && (x <= 0), "bad computed anchor value"); } aResult.x = x; @@ -1707,12 +1709,10 @@ ComputeBackgroundAnchorPoint(const nsStyleColor& aColor, y %= aTileHeight; y = y - aTileHeight; } + + NS_POSTCONDITION((y >= -(aTileHeight - 1)) && (y <= 0), "bad computed anchor value"); } aResult.y = y; - - NS_POSTCONDITION((aResult.x >= -(aTileWidth - 1)) && (aResult.x <= 0) && - (aResult.y >= -(aTileHeight - 1)) && (aResult.y <= 0), - "bad computed anchor value"); } // Returns the clip view associated with the scroll frame's scrolling