diff --git a/mozilla/layout/html/base/src/nsBlockFrame.cpp b/mozilla/layout/html/base/src/nsBlockFrame.cpp
index 0a081a8c7b1..b1d5d27c110 100644
--- a/mozilla/layout/html/base/src/nsBlockFrame.cpp
+++ b/mozilla/layout/html/base/src/nsBlockFrame.cpp
@@ -2423,14 +2423,17 @@ nsBlockFrame::ReflowLine(nsBlockReflowState& aState,
aState.UpdateMaximumWidth(aLine->mMaximumWidth);
// Now reflow the line again this time without having it compute
- // the maximum width.
- // We leave whether to compute max-element-width as-is, because
- // making this call throws out the previous max-element-width
- // information stored in the float cache.
+ // the maximum width or max-element-width.
+ // Note: we need to reset both member variables, because the inline
+ // code examines mComputeMaxElementWidth and if there is a placeholder
+ // on this line the code to reflow the float looks at both...
+ nscoord oldComputeMaxElementWidth = aState.GetFlag(BRS_COMPUTEMAXELEMENTWIDTH);
nscoord oldComputeMaximumWidth = aState.GetFlag(BRS_COMPUTEMAXWIDTH);
+ aState.SetFlag(BRS_COMPUTEMAXELEMENTWIDTH, PR_FALSE);
aState.SetFlag(BRS_COMPUTEMAXWIDTH, PR_FALSE);
rv = ReflowInlineFrames(aState, aLine, aKeepReflowGoing, aDamageDirtyArea);
+ aState.SetFlag(BRS_COMPUTEMAXELEMENTWIDTH, oldComputeMaxElementWidth);
aState.SetFlag(BRS_COMPUTEMAXWIDTH, oldComputeMaximumWidth);
} else {