Bug 898797 - Use nsHTMLReflowState::ApplyRelativePositioning when placing floats. r=dbaron
This commit is contained in:
@@ -633,6 +633,7 @@ nsBlockReflowState::FlowAndPlaceFloat(nsIFrame* aFloat)
|
||||
aFloat, offsets);
|
||||
|
||||
nsMargin floatMargin; // computed margin
|
||||
nsMargin floatOffsets;
|
||||
nsReflowStatus reflowStatus;
|
||||
|
||||
// If it's a floating first-letter, we need to reflow it before we
|
||||
@@ -640,8 +641,8 @@ nsBlockReflowState::FlowAndPlaceFloat(nsIFrame* aFloat)
|
||||
// of the first letter until reflow!).
|
||||
bool isLetter = aFloat->GetType() == nsGkAtoms::letterFrame;
|
||||
if (isLetter) {
|
||||
mBlock->ReflowFloat(*this, adjustedAvailableSpace, aFloat,
|
||||
floatMargin, false, reflowStatus);
|
||||
mBlock->ReflowFloat(*this, adjustedAvailableSpace, aFloat, floatMargin,
|
||||
floatOffsets, false, reflowStatus);
|
||||
floatMarginWidth = aFloat->GetSize().width + floatMargin.LeftRight();
|
||||
NS_ASSERTION(NS_FRAME_IS_COMPLETE(reflowStatus),
|
||||
"letter frames shouldn't break, and if they do now, "
|
||||
@@ -770,8 +771,8 @@ nsBlockReflowState::FlowAndPlaceFloat(nsIFrame* aFloat)
|
||||
// where to break.
|
||||
if (!isLetter) {
|
||||
bool pushedDown = mY != saveY;
|
||||
mBlock->ReflowFloat(*this, adjustedAvailableSpace, aFloat,
|
||||
floatMargin, pushedDown, reflowStatus);
|
||||
mBlock->ReflowFloat(*this, adjustedAvailableSpace, aFloat, floatMargin,
|
||||
floatOffsets, pushedDown, reflowStatus);
|
||||
}
|
||||
if (aFloat->GetPrevInFlow())
|
||||
floatMargin.top = 0;
|
||||
@@ -817,7 +818,8 @@ nsBlockReflowState::FlowAndPlaceFloat(nsIFrame* aFloat)
|
||||
floatMargin.top + floatY);
|
||||
|
||||
// If float is relatively positioned, factor that in as well
|
||||
origin += aFloat->GetRelativeOffset(floatDisplay);
|
||||
nsHTMLReflowState::ApplyRelativePositioning(floatDisplay, floatOffsets,
|
||||
&origin);
|
||||
|
||||
// Position the float and make sure and views are properly
|
||||
// positioned. We need to explicitly position its child views as
|
||||
|
||||
Reference in New Issue
Block a user