From 177b8110faabc72aeac8fd46bb427aace6700b53 Mon Sep 17 00:00:00 2001 From: "troy%netscape.com" Date: Tue, 27 Jul 1999 14:13:09 +0000 Subject: [PATCH] Fix for bug #10563 where we were triggering a post condition assertion. Changed ComputeBackgroundAnchorPoint() to correctly calculate tile offset that is a multiple of the tile git-svn-id: svn://10.0.0.236/trunk@41286 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/layout/base/nsCSSRendering.cpp | 8 ++++++-- mozilla/layout/html/style/src/nsCSSRendering.cpp | 8 ++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/mozilla/layout/base/nsCSSRendering.cpp b/mozilla/layout/base/nsCSSRendering.cpp index e5791858b4f..00333447f05 100644 --- a/mozilla/layout/base/nsCSSRendering.cpp +++ b/mozilla/layout/base/nsCSSRendering.cpp @@ -1674,7 +1674,9 @@ ComputeBackgroundAnchorPoint(const nsStyleColor& aColor, } else if (x != 0) { x %= aTileWidth; - x = x - aTileWidth; + if (x > 0) { + x = x - aTileWidth; + } } NS_POSTCONDITION((x >= -(aTileWidth - 1)) && (x <= 0), "bad computed anchor value"); @@ -1708,7 +1710,9 @@ ComputeBackgroundAnchorPoint(const nsStyleColor& aColor, } else if (y != 0) { y %= aTileHeight; - y = y - aTileHeight; + if (y > 0) { + y = y - aTileHeight; + } } NS_POSTCONDITION((y >= -(aTileHeight - 1)) && (y <= 0), "bad computed anchor value"); diff --git a/mozilla/layout/html/style/src/nsCSSRendering.cpp b/mozilla/layout/html/style/src/nsCSSRendering.cpp index e5791858b4f..00333447f05 100644 --- a/mozilla/layout/html/style/src/nsCSSRendering.cpp +++ b/mozilla/layout/html/style/src/nsCSSRendering.cpp @@ -1674,7 +1674,9 @@ ComputeBackgroundAnchorPoint(const nsStyleColor& aColor, } else if (x != 0) { x %= aTileWidth; - x = x - aTileWidth; + if (x > 0) { + x = x - aTileWidth; + } } NS_POSTCONDITION((x >= -(aTileWidth - 1)) && (x <= 0), "bad computed anchor value"); @@ -1708,7 +1710,9 @@ ComputeBackgroundAnchorPoint(const nsStyleColor& aColor, } else if (y != 0) { y %= aTileHeight; - y = y - aTileHeight; + if (y > 0) { + y = y - aTileHeight; + } } NS_POSTCONDITION((y >= -(aTileHeight - 1)) && (y <= 0), "bad computed anchor value");