mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-10 03:45:46 +00:00
Bug 898797 - Use nsHTMLReflowState::ApplyRelativePositioning when placing floats. r=dbaron
This commit is contained in:
parent
6f4e72b203
commit
8a75e63592
@ -5740,6 +5740,7 @@ nsBlockFrame::ReflowFloat(nsBlockReflowState& aState,
|
||||
const nsRect& aAdjustedAvailableSpace,
|
||||
nsIFrame* aFloat,
|
||||
nsMargin& aFloatMargin,
|
||||
nsMargin& aFloatOffsets,
|
||||
bool aFloatPushedDown,
|
||||
nsReflowStatus& aReflowStatus)
|
||||
{
|
||||
@ -5830,8 +5831,9 @@ nsBlockFrame::ReflowFloat(nsBlockReflowState& aState,
|
||||
return rv;
|
||||
}
|
||||
|
||||
// Capture the margin information for the caller
|
||||
// Capture the margin and offsets information for the caller
|
||||
aFloatMargin = floatRS.mComputedMargin; // float margins don't collapse
|
||||
aFloatOffsets = floatRS.mComputedOffsets;
|
||||
|
||||
const nsHTMLReflowMetrics& metrics = brc.GetMetrics();
|
||||
|
||||
|
@ -706,6 +706,7 @@ protected:
|
||||
const nsRect& aAdjustedAvailableSpace,
|
||||
nsIFrame* aFloat,
|
||||
nsMargin& aFloatMargin,
|
||||
nsMargin& aFloatOffsets,
|
||||
// Whether the float's position
|
||||
// (aAdjustedAvailableSpace) has been pushed down
|
||||
// due to the presence of other floats.
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user