Take left border+padding into account when calculating distance from block edge for TAB. b=430926 r+sr=roc

This commit is contained in:
Mats Palmgren 2008-06-20 06:39:56 +02:00
parent 2b1bc4f9bd
commit bd4639345b
2 changed files with 10 additions and 3 deletions

View File

@ -348,9 +348,14 @@ public:
}
/**
* Return the horizontal offset of the current reflowed-frame from the
* edge of the line container. This is always positive, measured from
* Returns the accumulated advance width of frames before the current frame
* on the line, plus the line container's left border+padding.
* This is always positive, the advance width is measured from
* the right edge for RTL blocks and from the left edge for LTR blocks.
* In other words, the current frame's distance from the line container's
* start content edge is:
* <code>GetCurrentFrameXDistanceFromBlock() - lineContainer->GetUsedBorderAndPadding().left</code>
* Note the use of <code>.left</code> for both LTR and RTL line containers.
*/
nscoord GetCurrentFrameXDistanceFromBlock();

View File

@ -5531,7 +5531,9 @@ nsTextFrame::Reflow(nsPresContext* aPresContext,
iter.SetOriginalOffset(offset);
nscoord xOffsetForTabs = (mTextRun->GetFlags() & nsTextFrameUtils::TEXT_HAS_TAB) ?
lineLayout.GetCurrentFrameXDistanceFromBlock() : -1;
(lineLayout.GetCurrentFrameXDistanceFromBlock() -
lineContainer->GetUsedBorderAndPadding().left)
: -1;
PropertyProvider provider(mTextRun, textStyle, frag, this, iter, length,
lineContainer, xOffsetForTabs);