nscoord boxPos = nscoord(pct * aRelativeBounds.height);
nscoord boxPos = nscoord(pct * aOriginBounds.height);
ComputeBackgroundAnchorPoint(const nsStyleBackground& aColor,                             const nsRect& aRelativeBounds, const nsRect& aTilingBounds,                             nscoord aTileWidth, nscoord aTileHeight,                             nsPoint& aResult){  nscoord x;  if (NS_STYLE_BG_X_POSITION_LENGTH & aColor.mBackgroundFlags) {    x = aColor.mBackgroundXPosition;  }  else {    nscoord t = aColor.mBackgroundXPosition;    float pct = float(t) / 100.0f;    nscoord tilePos = nscoord(pct * aTileWidth);    nscoord boxPos = nscoord(pct * aRelativeBounds.width);    x = boxPos - tilePos;  }  x += aRelativeBounds.x - aTilingBounds.x;  if (NS_STYLE_BG_REPEAT_X & aColor.mBackgroundRepeat) {    // When we are tiling in the x direction the loop will run from    // the left edge of the box to the right edge of the box. We need    // to adjust the starting coordinate to lie within the band being    // rendered.    if (x < 0) {      x = -x;      if (x < 0) {        // Some joker gave us max-negative-integer.        x = 0;      }      x %= aTileWidth;      x = -x;    }    else if (x != 0) {      x %= aTileWidth;      if (x > 0) {        x = x - aTileWidth;      }    }    NS_POSTCONDITION((x >= -(aTileWidth - 1)) && (x <= 0), "bad computed anchor value");  }  aResult.x = x;  nscoord y;  if (NS_STYLE_BG_Y_POSITION_LENGTH & aColor.mBackgroundFlags) {    y = aColor.mBackgroundYPosition;  }  else {    nscoord t = aColor.mBackgroundYPosition;    float pct = float(t) / 100.0f;    nscoord tilePos = nscoord(pct * aTileHeight);    nscoord boxPos = nscoord(pct * aRelativeBounds.height);    y = boxPos - tilePos;  }  y += aRelativeBounds.y - aTilingBounds.y;  if (NS_STYLE_BG_REPEAT_Y & aColor.mBackgroundRepeat) {    // When we are tiling in the y direction the loop will run from    // the top edge of the box to the bottom edge of the box. We need    // to adjust the starting coordinate to lie within the band being    // rendered.    if (y < 0) {      y = -y;      if (y < 0) {        // Some joker gave us max-negative-integer.        y = 0;      }      y %= aTileHeight;      y = -y;    }    else if (y != 0) {      y %= aTileHeight;      if (y > 0) {        y = y - aTileHeight;      }    }        NS_POSTCONDITION((y >= -(aTileHeight - 1)) && (y <= 0), "bad computed anchor value");  }  aResult.y = y;}