ComputeHorizontalValue(aContainingBlockWidth, mStylePosition->mOffset.GetRightUnit(), mStylePosition->mOffset.GetRight(coord), mComputedOffsets.right);
ComputeHorizontalValue(cbrs->computedWidth, aPosition->mOffset.GetRightUnit(), aPosition->mOffset.GetRight(coord), computedOffsets.right);
nsHTMLReflowState::ComputeRelativeOffsets(const nsHTMLReflowState* cbrs,                                          nscoord aContainingBlockWidth,                                          nscoord aContainingBlockHeight){  nsStyleCoord  coord;  // Compute the 'left' and 'right' values. 'Left' moves the boxes to the right,  // and 'right' moves the boxes to the left. The computed values are always:  // left=-right  PRBool  leftIsAuto = eStyleUnit_Auto == mStylePosition->mOffset.GetLeftUnit();  PRBool  rightIsAuto = eStyleUnit_Auto == mStylePosition->mOffset.GetRightUnit();  // Check for percentage based values and an unconstrained containing  // block width. Treat them like 'auto'  if (NS_UNCONSTRAINEDSIZE == aContainingBlockWidth) {    if (eStyleUnit_Percent == mStylePosition->mOffset.GetLeftUnit()) {      leftIsAuto = PR_TRUE;    }    if (eStyleUnit_Percent == mStylePosition->mOffset.GetRightUnit()) {      rightIsAuto = PR_TRUE;    }  }  // If neither 'left' not 'right' are auto, then we're over-constrained and  // we ignore one of them  if (!leftIsAuto && !rightIsAuto) {    const nsStyleDisplay* display;    frame->GetStyleData(eStyleStruct_Display, (const nsStyleStruct*&)display);        if (NS_STYLE_DIRECTION_LTR == display->mDirection) {      rightIsAuto = PR_TRUE;    } else {      leftIsAuto = PR_TRUE;    }  }  if (leftIsAuto) {    if (rightIsAuto) {      // If both are 'auto' (their initial values), the computed values are 0      mComputedOffsets.left = mComputedOffsets.right = 0;    } else {      // 'Right' isn't 'auto' so compute its value      if (eStyleUnit_Inherit == mStylePosition->mOffset.GetRightUnit()) {        mComputedOffsets.right = cbrs->mComputedOffsets.right;      } else {        ComputeHorizontalValue(aContainingBlockWidth, mStylePosition->mOffset.GetRightUnit(),                               mStylePosition->mOffset.GetRight(coord),                               mComputedOffsets.right);      }            // Computed value for 'left' is minus the value of 'right'      mComputedOffsets.left = -mComputedOffsets.right;    }  } else {    NS_ASSERTION(rightIsAuto, "unexpected specified constraint");        // 'Left' isn't 'auto' so compute its value    if (eStyleUnit_Inherit == mStylePosition->mOffset.GetLeftUnit()) {      mComputedOffsets.left = cbrs->mComputedOffsets.left;    } else {      ComputeHorizontalValue(aContainingBlockWidth, mStylePosition->mOffset.GetLeftUnit(),                             mStylePosition->mOffset.GetLeft(coord),                             mComputedOffsets.left);    }    // Computed value for 'right' is minus the value of 'left'    mComputedOffsets.right = -mComputedOffsets.left;  }  // Compute the 'top' and 'bottom' values. The 'top' and 'bottom' properties  // move relatively positioned elements up and down. They also must be each   // other's negative  PRBool  topIsAuto = eStyleUnit_Auto == mStylePosition->mOffset.GetTopUnit();  PRBool  bottomIsAuto = eStyleUnit_Auto == mStylePosition->mOffset.GetBottomUnit();  // Check for percentage based values and a containing block height that  // depends on the content height. Treat them like 'auto'  if (NS_AUTOHEIGHT == aContainingBlockHeight) {    if (eStyleUnit_Percent == mStylePosition->mOffset.GetTopUnit()) {      topIsAuto = PR_TRUE;    }    if (eStyleUnit_Percent == mStylePosition->mOffset.GetBottomUnit()) {      bottomIsAuto = PR_TRUE;    }  }  // If neither is 'auto', 'bottom' is ignored  if (!topIsAuto && !bottomIsAuto) {    bottomIsAuto = PR_TRUE;  }  if (topIsAuto) {    if (bottomIsAuto) {      // If both are 'auto' (their initial values), the computed values are 0      mComputedOffsets.top = mComputedOffsets.bottom = 0;    } else {      // 'Bottom' isn't 'auto' so compute its value      if (eStyleUnit_Inherit == mStylePosition->mOffset.GetBottomUnit()) {        mComputedOffsets.bottom = cbrs->mComputedOffsets.bottom;      } else {        ComputeVerticalValue(aContainingBlockHeight, mStylePosition->mOffset.GetBottomUnit(),                               mStylePosition->mOffset.GetBottom(coord),                               mComputedOffsets.bottom);      }            // Computed value for 'top' is minus the value of 'bottom'      mComputedOffsets.top = -mComputedOffsets.bottom;    }  } else {    NS_ASSERTION(bottomIsAuto, "unexpected specified constraint");        // 'Top' isn't 'auto' so compute its value    if (eStyleUnit_Inherit == mStylePosition->mOffset.GetTopUnit()) {      mComputedOffsets.top = cbrs->mComputedOffsets.top;    } else {      ComputeVerticalValue(aContainingBlockHeight, mStylePosition->mOffset.GetTopUnit(),                             mStylePosition->mOffset.GetTop(coord),                             mComputedOffsets.top);    }    // Computed value for 'bottom' is minus the value of 'top'    mComputedOffsets.bottom = -mComputedOffsets.top;  }}