Bug 916751: Do not use nsIFrame::MovePositionBy from nsLineLayout. r=dholbert

Since bug 916751 is hard (for me) to test, I haven't confirmed for sure
that this fixes the bug.

However, it fixes the assertions that bug 911786 part 3 triggers in
layout/base/crashtests/317934-1.html through this codepath.
This commit is contained in:
L. David Baron 2013-09-17 04:44:16 -07:00
parent ef01bdd9f2
commit 4d640839e9
2 changed files with 13 additions and 1 deletions

View File

@ -870,6 +870,12 @@ public:
* Move the frame, accounting for relative positioning. Use this when
* adjusting the frame's position by a known amount, to properly update its
* saved normal position (see GetNormalPosition below).
*
* This must be used only when moving a frame *after*
* nsHTMLReflowState::ApplyRelativePositioning is called. When moving
* a frame during the reflow process prior to calling
* nsHTMLReflowState::ApplyRelativePositioning, the position should
* simply be adjusted directly (e.g., using SetPosition()).
*/
void MovePositionBy(const nsPoint& aTranslation);

View File

@ -2196,7 +2196,13 @@ nsLineLayout::VerticalAlignFrames(PerSpanData* psd)
static void SlideSpanFrameRect(nsIFrame* aFrame, nscoord aDeltaWidth)
{
aFrame->MovePositionBy(nsPoint(-aDeltaWidth, 0));
// This should not use nsIFrame::MovePositionBy because it happens
// prior to relative positioning. In particular, because
// nsBlockFrame::PlaceLine calls aLineLayout.TrimTrailingWhiteSpace()
// prior to calling aLineLayout.RelativePositionFrames().
nsPoint p = aFrame->GetPosition();
p.x -= aDeltaWidth;
aFrame->SetPosition(p);
}
bool