diff --git a/mozilla/layout/base/nsPresShell.cpp b/mozilla/layout/base/nsPresShell.cpp index a450a039b8c..05e859ea64a 100644 --- a/mozilla/layout/base/nsPresShell.cpp +++ b/mozilla/layout/base/nsPresShell.cpp @@ -2660,16 +2660,14 @@ PresShell::InitialReflow(nscoord aWidth, nscoord aHeight) nsHTMLReflowState reflowState(mPresContext, rootFrame, eReflowReason_Initial, rcx, maxSize); - nsIView* view; - rootFrame->WillReflow(mPresContext); - rootFrame->GetView(mPresContext, &view); - if (view) { - nsContainerFrame::PositionFrameView(mPresContext, rootFrame, view); - } + nsContainerFrame::PositionFrameView(mPresContext, rootFrame); rootFrame->Reflow(mPresContext, desiredSize, reflowState, status); rootFrame->SizeTo(mPresContext, desiredSize.width, desiredSize.height); mPresContext->SetVisibleArea(nsRect(0,0,desiredSize.width,desiredSize.height)); + + nsIView* view; + rootFrame->GetView(mPresContext, &view); if (view) { nsContainerFrame::SyncFrameViewAfterReflow(mPresContext, rootFrame, view, nsnull); @@ -2798,15 +2796,13 @@ PresShell::ResizeReflow(nscoord aWidth, nscoord aHeight) nsHTMLReflowState reflowState(mPresContext, rootFrame, eReflowReason_Resize, rcx, maxSize); - nsIView* view; rootFrame->WillReflow(mPresContext); - rootFrame->GetView(mPresContext, &view); - if (view) { - nsContainerFrame::PositionFrameView(mPresContext, rootFrame, view); - } + nsContainerFrame::PositionFrameView(mPresContext, rootFrame); rootFrame->Reflow(mPresContext, desiredSize, reflowState, status); rootFrame->SizeTo(mPresContext, desiredSize.width, desiredSize.height); + nsIView* view; + rootFrame->GetView(mPresContext, &view); if (view) { nsContainerFrame::SyncFrameViewAfterReflow(mPresContext, rootFrame, view, nsnull); @@ -3335,16 +3331,14 @@ PresShell::StyleChangeReflow() nsHTMLReflowState reflowState(mPresContext, rootFrame, eReflowReason_StyleChange, rcx, maxSize); - nsIView* view; rootFrame->WillReflow(mPresContext); - rootFrame->GetView(mPresContext, &view); - if (view) { - nsContainerFrame::PositionFrameView(mPresContext, rootFrame, view); - } + nsContainerFrame::PositionFrameView(mPresContext, rootFrame); rootFrame->Reflow(mPresContext, desiredSize, reflowState, status); rootFrame->SizeTo(mPresContext, desiredSize.width, desiredSize.height); mPresContext->SetVisibleArea(nsRect(0,0,desiredSize.width,desiredSize.height)); + nsIView* view; + rootFrame->GetView(mPresContext, &view); if (view) { nsContainerFrame::SyncFrameViewAfterReflow(mPresContext, rootFrame, view, nsnull); diff --git a/mozilla/layout/base/public/nsHTMLReflowState.h b/mozilla/layout/base/public/nsHTMLReflowState.h index 383d51acc40..d8c2813d1c7 100644 --- a/mozilla/layout/base/public/nsHTMLReflowState.h +++ b/mozilla/layout/base/public/nsHTMLReflowState.h @@ -231,6 +231,8 @@ struct nsHTMLReflowState { #ifdef DEBUG // hook for attaching debug info (e.g. tables may attach a timer during reflow) void* mDebugHook; + + static const char* ReasonToString(nsReflowReason aReason); #endif // Note: The copy constructor is written by the compiler diff --git a/mozilla/layout/forms/nsComboboxControlFrame.cpp b/mozilla/layout/forms/nsComboboxControlFrame.cpp index 7b1018a0d24..62be4c11a29 100644 --- a/mozilla/layout/forms/nsComboboxControlFrame.cpp +++ b/mozilla/layout/forms/nsComboboxControlFrame.cpp @@ -1080,11 +1080,7 @@ nsComboboxControlFrame::ReflowCombobox(nsIPresContext * aPresContext, aDisplayFrame->WillReflow(aPresContext); //aDisplayFrame->MoveTo(aPresContext, dspBorderPadding.left + aBorderPadding.left, dspBorderPadding.top + aBorderPadding.top); aDisplayFrame->MoveTo(aPresContext, aBorderPadding.left, aBorderPadding.top); - nsIView* view; - aDisplayFrame->GetView(aPresContext, &view); - if (view) { - nsAreaFrame::PositionFrameView(aPresContext, aDisplayFrame, view); - } + nsAreaFrame::PositionFrameView(aPresContext, aDisplayFrame); nsReflowStatus status; nsresult rv = aDisplayFrame->Reflow(aPresContext, txtKidSize, txtKidReflowState, status); if (NS_FAILED(rv)) return; diff --git a/mozilla/layout/forms/nsFieldSetFrame.cpp b/mozilla/layout/forms/nsFieldSetFrame.cpp index 975fddb24cb..fc1998f81a1 100644 --- a/mozilla/layout/forms/nsFieldSetFrame.cpp +++ b/mozilla/layout/forms/nsFieldSetFrame.cpp @@ -517,15 +517,8 @@ nsFieldSetFrame::Reflow(nsIPresContext* aPresContext, // only if the origin changed if ((curOrigin.x != mLegendRect.x) || (curOrigin.y != mLegendRect.y)) { - mLegendFrame->MoveTo(aPresContext, actualLegendRect.x , actualLegendRect.y); - - nsIView* view; - mLegendFrame->GetView(aPresContext, &view); - if (view) - nsContainerFrame::PositionFrameView(aPresContext, mLegendFrame, view); - else - nsContainerFrame::PositionChildViews(aPresContext, mLegendFrame); + nsContainerFrame::PositionFrameView(aPresContext, mLegendFrame); } } diff --git a/mozilla/layout/generic/nsAbsoluteContainingBlock.cpp b/mozilla/layout/generic/nsAbsoluteContainingBlock.cpp index e0ed0c67f9d..34f93704913 100644 --- a/mozilla/layout/generic/nsAbsoluteContainingBlock.cpp +++ b/mozilla/layout/generic/nsAbsoluteContainingBlock.cpp @@ -409,12 +409,10 @@ nsAbsoluteContainingBlock::ReflowAbsoluteFrame(nsIFrame* aDelegat aKidFrame->MoveTo(aPresContext, x, border.top + kidReflowState.mComputedOffsets.top + kidReflowState.mComputedMargin.top); - // Position its view - nsIView* kidView; - aKidFrame->GetView(aPresContext, &kidView); - // Don't bother it doing it now if we haven't yet determined the left offset + // Position its view, but don't bother it doing it now if we haven't + // yet determined the left offset if (NS_AUTOOFFSET != kidReflowState.mComputedOffsets.left) { - nsContainerFrame::PositionFrameView(aPresContext, aKidFrame, kidView); + nsContainerFrame::PositionFrameView(aPresContext, aKidFrame); } // Do the reflow @@ -454,6 +452,8 @@ nsAbsoluteContainingBlock::ReflowAbsoluteFrame(nsIFrame* aDelegat // Size and position the view and set its opacity, visibility, content // transparency, and clip + nsIView* kidView; + aKidFrame->GetView(aPresContext, &kidView); nsContainerFrame::SyncFrameViewAfterReflow(aPresContext, aKidFrame, kidView, &kidDesiredSize.mOverflowArea); aKidFrame->DidReflow(aPresContext, NS_FRAME_REFLOW_FINISHED); diff --git a/mozilla/layout/generic/nsBlockFrame.cpp b/mozilla/layout/generic/nsBlockFrame.cpp index 6ae247189f0..f28a2d141be 100644 --- a/mozilla/layout/generic/nsBlockFrame.cpp +++ b/mozilla/layout/generic/nsBlockFrame.cpp @@ -583,8 +583,9 @@ nsBlockFrame::Reflow(nsIPresContext* aPresContext, if (gNoisyReflow) { IndentBy(stdout, gNoiseIndent); ListTag(stdout); - printf(": begin reflow type %d availSize=%d,%d computedSize=%d,%d\n", - aReflowState.reason, aReflowState.availableWidth, aReflowState.availableHeight, + printf(": begin %s reflow availSize=%d,%d computedSize=%d,%d\n", + nsHTMLReflowState::ReasonToString(aReflowState.reason), + aReflowState.availableWidth, aReflowState.availableHeight, aReflowState.mComputedWidth, aReflowState.mComputedHeight); } if (gNoisy) { @@ -2103,7 +2104,8 @@ nsBlockFrame::ReflowDirtyLines(nsBlockReflowState& aState) aState.AdvanceToNextLine(); } - // Pull data from a next-in-flow if we can + // Pull data from a next-in-flow if there's still room for more + // content here. while (keepGoing && (nsnull != aState.mNextInFlow)) { // Grab first line from our next-in-flow line = aState.mNextInFlow->mLines; @@ -2153,8 +2155,7 @@ nsBlockFrame::ReflowDirtyLines(nsBlockReflowState& aState) // line to be created; see SplitLine's callers for examples of // when this happens). while (nsnull != line) { - rv = ReflowLine(aState, line, &keepGoing, incrementalReflow ? - PR_TRUE : PR_FALSE); + rv = ReflowLine(aState, line, &keepGoing, incrementalReflow /* force invalidate */); if (NS_FAILED(rv)) { return rv; } @@ -2537,7 +2538,6 @@ PlaceFrameView(nsIPresContext* aPresContext, aFrame->GetView(aPresContext, &view); if (view) { nsContainerFrame::SyncFrameViewAfterReflow(aPresContext, aFrame, view, nsnull); - } else { nsContainerFrame::PositionChildViews(aPresContext, aFrame); } @@ -5507,7 +5507,22 @@ nsBlockFrame::GetFrameForPoint(nsIPresContext* aPresContext, NS_IMETHODIMP nsBlockFrame::ReflowDirtyChild(nsIPresShell* aPresShell, nsIFrame* aChild) -{ +{ +#ifdef DEBUG + if (gNoisyReflow) { + IndentBy(stdout, gNoiseIndent); + ListTag(stdout); + printf(": ReflowDirtyChild ("); + if (aChild) + nsFrame::ListTag(stdout, aChild); + else + printf("null"); + printf(")\n"); + + gNoiseIndent++; + } +#endif + if (aChild) { // See if the child is absolutely positioned nsFrameState childState; @@ -5531,6 +5546,15 @@ nsBlockFrame::ReflowDirtyChild(nsIPresShell* aPresShell, nsIFrame* aChild) aPresShell->AppendReflowCommand(reflowCmd); NS_RELEASE(reflowCmd); } + +#ifdef DEBUG + if (gNoisyReflow) { + IndentBy(stdout, gNoiseIndent); + printf("scheduled reflow command for absolutely positioned frame\n"); + --gNoiseIndent; + } +#endif + return rv; } } @@ -5562,6 +5586,13 @@ nsBlockFrame::ReflowDirtyChild(nsIPresShell* aPresShell, nsIFrame* aChild) nsFrame::CreateAndPostReflowCommand(aPresShell, this, nsIReflowCommand::ReflowDirty, nsnull, nsnull, nsnull); + +#ifdef DEBUG + if (gNoisyReflow) { + IndentBy(stdout, gNoiseIndent); + printf("scheduled reflow command targeted at self\n"); + } +#endif } else { if (!(mState & NS_FRAME_IS_DIRTY)) { @@ -5572,10 +5603,23 @@ nsBlockFrame::ReflowDirtyChild(nsIPresShell* aPresShell, nsIFrame* aChild) nsIReflowCommand::ReflowType type = nsIReflowCommand::ReflowDirty; aPresShell->CancelReflowCommand(this, &type); +#ifdef DEBUG + if (gNoisyReflow) { + IndentBy(stdout, gNoiseIndent); + printf("cancelled reflow targeted at self\n"); + } +#endif + // Pass up the reflow request to the parent frame. mParent->ReflowDirtyChild(aPresShell, this); } } + +#ifdef DEBUG + if (gNoisyReflow) { + --gNoiseIndent; + } +#endif return NS_OK; } diff --git a/mozilla/layout/generic/nsBlockReflowContext.cpp b/mozilla/layout/generic/nsBlockReflowContext.cpp index a60842a2eba..deccc721040 100644 --- a/mozilla/layout/generic/nsBlockReflowContext.cpp +++ b/mozilla/layout/generic/nsBlockReflowContext.cpp @@ -521,14 +521,7 @@ nsBlockReflowContext::DoReflowBlock(nsHTMLReflowState &aReflowState, // Note: Use "x" and "y" and not "mX" and "mY" because they more accurately // represents where we think the block will be placed aFrame->MoveTo(mPresContext, x, y); - nsIView* view; - aFrame->GetView(mPresContext, &view); - if (view) { - nsContainerFrame::PositionFrameView(mPresContext, aFrame, view); - } - else { - nsContainerFrame::PositionChildViews(mPresContext, aFrame); - } + nsContainerFrame::PositionFrameView(mPresContext, aFrame); #ifdef DEBUG mMetrics.width = nscoord(0xdeadbeef); diff --git a/mozilla/layout/generic/nsBlockReflowState.cpp b/mozilla/layout/generic/nsBlockReflowState.cpp index 2cd4192e21b..05cd251b368 100644 --- a/mozilla/layout/generic/nsBlockReflowState.cpp +++ b/mozilla/layout/generic/nsBlockReflowState.cpp @@ -1014,14 +1014,8 @@ nsBlockReflowState::FlowAndPlaceFloater(nsFloaterCache* aFloaterCache, } // Position the floater and make sure and views are properly positioned - nsIView* view; floater->MoveTo(mPresContext, x, y); - floater->GetView(mPresContext, &view); - if (view) { - nsContainerFrame::PositionFrameView(mPresContext, floater, view); - } else { - nsContainerFrame::PositionChildViews(mPresContext, floater); - } + nsContainerFrame::PositionFrameView(mPresContext, floater); // Update the floater combined area state nsRect combinedArea = aFloaterCache->mCombinedArea; diff --git a/mozilla/layout/generic/nsContainerFrame.cpp b/mozilla/layout/generic/nsContainerFrame.cpp index b220e2b28e4..61926a561c5 100644 --- a/mozilla/layout/generic/nsContainerFrame.cpp +++ b/mozilla/layout/generic/nsContainerFrame.cpp @@ -356,23 +356,24 @@ TranslatePointTo(nsPoint& aPoint, nsIView* aChildView, nsIView* aParentView) void nsContainerFrame::PositionFrameView(nsIPresContext* aPresContext, - nsIFrame* aKidFrame, - nsIView* aView) + nsIFrame* aKidFrame) { - if (aView) { + nsIView* view; + aKidFrame->GetView(aPresContext, &view); + if (view) { // Position view relative to its parent, not relative to aKidFrame's // frame which may not have a view + nsIView* parentView; + view->GetParent(parentView); + nsIView* containingView; nsPoint origin; - nsIView* parentView; - nsIViewManager *vm; - - aView->GetParent(parentView); aKidFrame->GetOffsetFromView(aPresContext, origin, &containingView); - aView->GetViewManager(vm); - if (containingView != parentView) - { + nsCOMPtr vm; + view->GetViewManager(*getter_AddRefs(vm)); + + if (containingView != parentView) { // it is possible for parent view not to have a frame attached to it // kind of an anonymous view. This happens with native scrollbars and // the clip view. To fix this we need to go up and parentView chain @@ -405,9 +406,10 @@ nsContainerFrame::PositionFrameView(nsIPresContext* aPresContext, } } - vm->MoveViewTo(aView, origin.x, origin.y); - - NS_RELEASE(vm); + vm->MoveViewTo(view, origin.x, origin.y); + } + else { + PositionChildViews(aPresContext, aKidFrame); } } @@ -714,11 +716,7 @@ nsContainerFrame::ReflowChild(nsIFrame* aKidFrame, } if (0 == (aFlags & NS_FRAME_NO_MOVE_VIEW)) { - nsIView* view; - aKidFrame->GetView(aPresContext, &view); - if (view) { - PositionFrameView(aPresContext, aKidFrame, view); - } + PositionFrameView(aPresContext, aKidFrame); } // Reflow the child frame @@ -781,20 +779,8 @@ nsContainerFrame::PositionChildViews(nsIPresContext* aPresContext, nsIFrame* childFrame; aFrame->FirstChild(aPresContext, childListName, &childFrame); while (childFrame) { - nsIView* view; - - // See if the child frame has a view - childFrame->GetView(aPresContext, &view); - - if (view) { - // Position the view. Because any child views are relative to their - // parent, there's no need to recurse - PositionFrameView(aPresContext, childFrame, view); - - } else { - // Recursively examine its child frames - PositionChildViews(aPresContext, childFrame); - } + // Position the frame's view, if it has one. + PositionFrameView(aPresContext, childFrame); // Get the next sibling child frame childFrame->GetNextSibling(&childFrame); @@ -821,11 +807,7 @@ nsContainerFrame::PositionChildViews(nsIPresContext* aPresContext, * NS_FRAME_NO_MOVE_VIEW - don't position the frame's view. Set this if you * don't want to automatically sync the frame and view * NS_FRAME_NO_SIZE_VIEW - don't size the frame's view - * NS_FRAME_NO_MOVE_CHILD_VIEWS - don't move child views. This is for the case - * where the frame's new position differs from its current position and the - * frame itself doesn't have a view, so moving the frame would cause any child - * views to be out of sync -*/ + */ nsresult nsContainerFrame::FinishReflowChild(nsIFrame* aKidFrame, nsIPresContext* aPresContext, @@ -849,12 +831,12 @@ nsContainerFrame::FinishReflowChild(nsIFrame* aKidFrame, &aDesiredSize.mOverflowArea, aFlags); - } else if (0 == (aFlags & NS_FRAME_NO_MOVE_CHILD_VIEWS)) { + } + else if (0 == (aFlags & NS_FRAME_NO_MOVE_VIEW) && + ((curOrigin.x != aX) || (curOrigin.y != aY))) { // If the frame has moved, then we need to make sure any child views are // correctly positioned - if ((curOrigin.x != aX) || (curOrigin.y != aY)) { - PositionChildViews(aPresContext, aKidFrame); - } + PositionChildViews(aPresContext, aKidFrame); } return aKidFrame->DidReflow(aPresContext, NS_FRAME_REFLOW_FINISHED); diff --git a/mozilla/layout/generic/nsContainerFrame.h b/mozilla/layout/generic/nsContainerFrame.h index d9bb1943cdc..0baa4849bef 100644 --- a/mozilla/layout/generic/nsContainerFrame.h +++ b/mozilla/layout/generic/nsContainerFrame.h @@ -30,8 +30,7 @@ #define NS_FRAME_NO_MOVE_VIEW 0x0001 #define NS_FRAME_NO_MOVE_FRAME (0x0002 | NS_FRAME_NO_MOVE_VIEW) #define NS_FRAME_NO_SIZE_VIEW 0x0004 -#define NS_FRAME_NO_MOVE_CHILD_VIEWS 0x0008 -#define NS_FRAME_NO_VISIBILITY 0x0010 +#define NS_FRAME_NO_VISIBILITY 0x0008 /** * Implementation of a container frame. @@ -83,8 +82,7 @@ public: // Positions the frame's view based on the frame's origin static void PositionFrameView(nsIPresContext* aPresContext, - nsIFrame* aKidFrame, - nsIView* aView); + nsIFrame* aKidFrame); // Sets several view attributes: // - if requested sizes the frame's view based on the current size and origin. @@ -141,10 +139,6 @@ public: * NS_FRAME_NO_MOVE_VIEW - don't position the frame's view. Set this if you * don't want to automatically sync the frame and view * NS_FRAME_NO_SIZE_VIEW - don't size the frame's view - * NS_FRAME_NO_MOVE_CHILD_VIEWS - don't move child views. This is for the case - * where the frame's new position differs from its current position and the - * frame itself doesn't have a view, so moving the frame would cause any child - * views to be out of sync */ static nsresult FinishReflowChild(nsIFrame* aKidFrame, nsIPresContext* aPresContext, diff --git a/mozilla/layout/generic/nsHTMLReflowCommand.cpp b/mozilla/layout/generic/nsHTMLReflowCommand.cpp index 2e511283b22..68dd8880e67 100644 --- a/mozilla/layout/generic/nsHTMLReflowCommand.cpp +++ b/mozilla/layout/generic/nsHTMLReflowCommand.cpp @@ -134,15 +134,13 @@ NS_IMETHODIMP nsHTMLReflowCommand::Dispatch(nsIPresContext* aPresContext, nsHTMLReflowState reflowState(aPresContext, root, *this, &aRendContext, aMaxSize); nsReflowStatus status; - nsIView* view; root->WillReflow(aPresContext); - root->GetView(aPresContext, &view); - if (view) { - nsContainerFrame::PositionFrameView(aPresContext, root, view); - } + nsContainerFrame::PositionFrameView(aPresContext, root); root->Reflow(aPresContext, aDesiredSize, reflowState, status); root->SizeTo(aPresContext, aDesiredSize.width, aDesiredSize.height); + nsIView* view; + root->GetView(aPresContext, &view); if (view) { nsContainerFrame::SyncFrameViewAfterReflow(aPresContext, root, view, nsnull); diff --git a/mozilla/layout/generic/nsHTMLReflowState.cpp b/mozilla/layout/generic/nsHTMLReflowState.cpp index ce8dab5911e..5d981e126f7 100644 --- a/mozilla/layout/generic/nsHTMLReflowState.cpp +++ b/mozilla/layout/generic/nsHTMLReflowState.cpp @@ -44,6 +44,18 @@ // hack for bug 50695 #include "nsIFormManager.h" +#ifdef DEBUG +const char* +nsHTMLReflowState::ReasonToString(nsReflowReason aReason) +{ + static const char* reasons[] = { + "initial", "incremental", "resize", "style-change", "dirty" + }; + + return reasons[aReason]; +} +#endif + // Initialize a root reflow state with a rendering context to // use for measuring things. nsHTMLReflowState::nsHTMLReflowState(nsIPresContext* aPresContext, diff --git a/mozilla/layout/generic/nsHTMLReflowState.h b/mozilla/layout/generic/nsHTMLReflowState.h index 383d51acc40..d8c2813d1c7 100644 --- a/mozilla/layout/generic/nsHTMLReflowState.h +++ b/mozilla/layout/generic/nsHTMLReflowState.h @@ -231,6 +231,8 @@ struct nsHTMLReflowState { #ifdef DEBUG // hook for attaching debug info (e.g. tables may attach a timer during reflow) void* mDebugHook; + + static const char* ReasonToString(nsReflowReason aReason); #endif // Note: The copy constructor is written by the compiler diff --git a/mozilla/layout/generic/nsViewportFrame.cpp b/mozilla/layout/generic/nsViewportFrame.cpp index 2851a47d95d..de52ce2fffe 100644 --- a/mozilla/layout/generic/nsViewportFrame.cpp +++ b/mozilla/layout/generic/nsViewportFrame.cpp @@ -354,9 +354,7 @@ ViewportFrame::ReflowFixedFrame(nsIPresContext* aPresContext, kidReflowState.mComputedOffsets.top + kidReflowState.mComputedMargin.top); // Position its view - nsIView* kidView; - aKidFrame->GetView(aPresContext, &kidView); - nsContainerFrame::PositionFrameView(aPresContext, aKidFrame, kidView); + nsContainerFrame::PositionFrameView(aPresContext, aKidFrame); // Do the reflow rv = aKidFrame->Reflow(aPresContext, kidDesiredSize, kidReflowState, aStatus); @@ -378,6 +376,8 @@ ViewportFrame::ReflowFixedFrame(nsIPresContext* aPresContext, // Size and position the view and set its opacity, visibility, content // transparency, and clip + nsIView* kidView; + aKidFrame->GetView(aPresContext, &kidView); nsContainerFrame::SyncFrameViewAfterReflow(aPresContext, aKidFrame, kidView, &kidDesiredSize.mOverflowArea); aKidFrame->DidReflow(aPresContext, NS_FRAME_REFLOW_FINISHED); diff --git a/mozilla/layout/html/base/src/nsAbsoluteContainingBlock.cpp b/mozilla/layout/html/base/src/nsAbsoluteContainingBlock.cpp index e0ed0c67f9d..34f93704913 100644 --- a/mozilla/layout/html/base/src/nsAbsoluteContainingBlock.cpp +++ b/mozilla/layout/html/base/src/nsAbsoluteContainingBlock.cpp @@ -409,12 +409,10 @@ nsAbsoluteContainingBlock::ReflowAbsoluteFrame(nsIFrame* aDelegat aKidFrame->MoveTo(aPresContext, x, border.top + kidReflowState.mComputedOffsets.top + kidReflowState.mComputedMargin.top); - // Position its view - nsIView* kidView; - aKidFrame->GetView(aPresContext, &kidView); - // Don't bother it doing it now if we haven't yet determined the left offset + // Position its view, but don't bother it doing it now if we haven't + // yet determined the left offset if (NS_AUTOOFFSET != kidReflowState.mComputedOffsets.left) { - nsContainerFrame::PositionFrameView(aPresContext, aKidFrame, kidView); + nsContainerFrame::PositionFrameView(aPresContext, aKidFrame); } // Do the reflow @@ -454,6 +452,8 @@ nsAbsoluteContainingBlock::ReflowAbsoluteFrame(nsIFrame* aDelegat // Size and position the view and set its opacity, visibility, content // transparency, and clip + nsIView* kidView; + aKidFrame->GetView(aPresContext, &kidView); nsContainerFrame::SyncFrameViewAfterReflow(aPresContext, aKidFrame, kidView, &kidDesiredSize.mOverflowArea); aKidFrame->DidReflow(aPresContext, NS_FRAME_REFLOW_FINISHED); diff --git a/mozilla/layout/html/base/src/nsBlockFrame.cpp b/mozilla/layout/html/base/src/nsBlockFrame.cpp index 6ae247189f0..f28a2d141be 100644 --- a/mozilla/layout/html/base/src/nsBlockFrame.cpp +++ b/mozilla/layout/html/base/src/nsBlockFrame.cpp @@ -583,8 +583,9 @@ nsBlockFrame::Reflow(nsIPresContext* aPresContext, if (gNoisyReflow) { IndentBy(stdout, gNoiseIndent); ListTag(stdout); - printf(": begin reflow type %d availSize=%d,%d computedSize=%d,%d\n", - aReflowState.reason, aReflowState.availableWidth, aReflowState.availableHeight, + printf(": begin %s reflow availSize=%d,%d computedSize=%d,%d\n", + nsHTMLReflowState::ReasonToString(aReflowState.reason), + aReflowState.availableWidth, aReflowState.availableHeight, aReflowState.mComputedWidth, aReflowState.mComputedHeight); } if (gNoisy) { @@ -2103,7 +2104,8 @@ nsBlockFrame::ReflowDirtyLines(nsBlockReflowState& aState) aState.AdvanceToNextLine(); } - // Pull data from a next-in-flow if we can + // Pull data from a next-in-flow if there's still room for more + // content here. while (keepGoing && (nsnull != aState.mNextInFlow)) { // Grab first line from our next-in-flow line = aState.mNextInFlow->mLines; @@ -2153,8 +2155,7 @@ nsBlockFrame::ReflowDirtyLines(nsBlockReflowState& aState) // line to be created; see SplitLine's callers for examples of // when this happens). while (nsnull != line) { - rv = ReflowLine(aState, line, &keepGoing, incrementalReflow ? - PR_TRUE : PR_FALSE); + rv = ReflowLine(aState, line, &keepGoing, incrementalReflow /* force invalidate */); if (NS_FAILED(rv)) { return rv; } @@ -2537,7 +2538,6 @@ PlaceFrameView(nsIPresContext* aPresContext, aFrame->GetView(aPresContext, &view); if (view) { nsContainerFrame::SyncFrameViewAfterReflow(aPresContext, aFrame, view, nsnull); - } else { nsContainerFrame::PositionChildViews(aPresContext, aFrame); } @@ -5507,7 +5507,22 @@ nsBlockFrame::GetFrameForPoint(nsIPresContext* aPresContext, NS_IMETHODIMP nsBlockFrame::ReflowDirtyChild(nsIPresShell* aPresShell, nsIFrame* aChild) -{ +{ +#ifdef DEBUG + if (gNoisyReflow) { + IndentBy(stdout, gNoiseIndent); + ListTag(stdout); + printf(": ReflowDirtyChild ("); + if (aChild) + nsFrame::ListTag(stdout, aChild); + else + printf("null"); + printf(")\n"); + + gNoiseIndent++; + } +#endif + if (aChild) { // See if the child is absolutely positioned nsFrameState childState; @@ -5531,6 +5546,15 @@ nsBlockFrame::ReflowDirtyChild(nsIPresShell* aPresShell, nsIFrame* aChild) aPresShell->AppendReflowCommand(reflowCmd); NS_RELEASE(reflowCmd); } + +#ifdef DEBUG + if (gNoisyReflow) { + IndentBy(stdout, gNoiseIndent); + printf("scheduled reflow command for absolutely positioned frame\n"); + --gNoiseIndent; + } +#endif + return rv; } } @@ -5562,6 +5586,13 @@ nsBlockFrame::ReflowDirtyChild(nsIPresShell* aPresShell, nsIFrame* aChild) nsFrame::CreateAndPostReflowCommand(aPresShell, this, nsIReflowCommand::ReflowDirty, nsnull, nsnull, nsnull); + +#ifdef DEBUG + if (gNoisyReflow) { + IndentBy(stdout, gNoiseIndent); + printf("scheduled reflow command targeted at self\n"); + } +#endif } else { if (!(mState & NS_FRAME_IS_DIRTY)) { @@ -5572,10 +5603,23 @@ nsBlockFrame::ReflowDirtyChild(nsIPresShell* aPresShell, nsIFrame* aChild) nsIReflowCommand::ReflowType type = nsIReflowCommand::ReflowDirty; aPresShell->CancelReflowCommand(this, &type); +#ifdef DEBUG + if (gNoisyReflow) { + IndentBy(stdout, gNoiseIndent); + printf("cancelled reflow targeted at self\n"); + } +#endif + // Pass up the reflow request to the parent frame. mParent->ReflowDirtyChild(aPresShell, this); } } + +#ifdef DEBUG + if (gNoisyReflow) { + --gNoiseIndent; + } +#endif return NS_OK; } diff --git a/mozilla/layout/html/base/src/nsBlockReflowContext.cpp b/mozilla/layout/html/base/src/nsBlockReflowContext.cpp index a60842a2eba..deccc721040 100644 --- a/mozilla/layout/html/base/src/nsBlockReflowContext.cpp +++ b/mozilla/layout/html/base/src/nsBlockReflowContext.cpp @@ -521,14 +521,7 @@ nsBlockReflowContext::DoReflowBlock(nsHTMLReflowState &aReflowState, // Note: Use "x" and "y" and not "mX" and "mY" because they more accurately // represents where we think the block will be placed aFrame->MoveTo(mPresContext, x, y); - nsIView* view; - aFrame->GetView(mPresContext, &view); - if (view) { - nsContainerFrame::PositionFrameView(mPresContext, aFrame, view); - } - else { - nsContainerFrame::PositionChildViews(mPresContext, aFrame); - } + nsContainerFrame::PositionFrameView(mPresContext, aFrame); #ifdef DEBUG mMetrics.width = nscoord(0xdeadbeef); diff --git a/mozilla/layout/html/base/src/nsBlockReflowState.cpp b/mozilla/layout/html/base/src/nsBlockReflowState.cpp index 2cd4192e21b..05cd251b368 100644 --- a/mozilla/layout/html/base/src/nsBlockReflowState.cpp +++ b/mozilla/layout/html/base/src/nsBlockReflowState.cpp @@ -1014,14 +1014,8 @@ nsBlockReflowState::FlowAndPlaceFloater(nsFloaterCache* aFloaterCache, } // Position the floater and make sure and views are properly positioned - nsIView* view; floater->MoveTo(mPresContext, x, y); - floater->GetView(mPresContext, &view); - if (view) { - nsContainerFrame::PositionFrameView(mPresContext, floater, view); - } else { - nsContainerFrame::PositionChildViews(mPresContext, floater); - } + nsContainerFrame::PositionFrameView(mPresContext, floater); // Update the floater combined area state nsRect combinedArea = aFloaterCache->mCombinedArea; diff --git a/mozilla/layout/html/base/src/nsContainerFrame.cpp b/mozilla/layout/html/base/src/nsContainerFrame.cpp index b220e2b28e4..61926a561c5 100644 --- a/mozilla/layout/html/base/src/nsContainerFrame.cpp +++ b/mozilla/layout/html/base/src/nsContainerFrame.cpp @@ -356,23 +356,24 @@ TranslatePointTo(nsPoint& aPoint, nsIView* aChildView, nsIView* aParentView) void nsContainerFrame::PositionFrameView(nsIPresContext* aPresContext, - nsIFrame* aKidFrame, - nsIView* aView) + nsIFrame* aKidFrame) { - if (aView) { + nsIView* view; + aKidFrame->GetView(aPresContext, &view); + if (view) { // Position view relative to its parent, not relative to aKidFrame's // frame which may not have a view + nsIView* parentView; + view->GetParent(parentView); + nsIView* containingView; nsPoint origin; - nsIView* parentView; - nsIViewManager *vm; - - aView->GetParent(parentView); aKidFrame->GetOffsetFromView(aPresContext, origin, &containingView); - aView->GetViewManager(vm); - if (containingView != parentView) - { + nsCOMPtr vm; + view->GetViewManager(*getter_AddRefs(vm)); + + if (containingView != parentView) { // it is possible for parent view not to have a frame attached to it // kind of an anonymous view. This happens with native scrollbars and // the clip view. To fix this we need to go up and parentView chain @@ -405,9 +406,10 @@ nsContainerFrame::PositionFrameView(nsIPresContext* aPresContext, } } - vm->MoveViewTo(aView, origin.x, origin.y); - - NS_RELEASE(vm); + vm->MoveViewTo(view, origin.x, origin.y); + } + else { + PositionChildViews(aPresContext, aKidFrame); } } @@ -714,11 +716,7 @@ nsContainerFrame::ReflowChild(nsIFrame* aKidFrame, } if (0 == (aFlags & NS_FRAME_NO_MOVE_VIEW)) { - nsIView* view; - aKidFrame->GetView(aPresContext, &view); - if (view) { - PositionFrameView(aPresContext, aKidFrame, view); - } + PositionFrameView(aPresContext, aKidFrame); } // Reflow the child frame @@ -781,20 +779,8 @@ nsContainerFrame::PositionChildViews(nsIPresContext* aPresContext, nsIFrame* childFrame; aFrame->FirstChild(aPresContext, childListName, &childFrame); while (childFrame) { - nsIView* view; - - // See if the child frame has a view - childFrame->GetView(aPresContext, &view); - - if (view) { - // Position the view. Because any child views are relative to their - // parent, there's no need to recurse - PositionFrameView(aPresContext, childFrame, view); - - } else { - // Recursively examine its child frames - PositionChildViews(aPresContext, childFrame); - } + // Position the frame's view, if it has one. + PositionFrameView(aPresContext, childFrame); // Get the next sibling child frame childFrame->GetNextSibling(&childFrame); @@ -821,11 +807,7 @@ nsContainerFrame::PositionChildViews(nsIPresContext* aPresContext, * NS_FRAME_NO_MOVE_VIEW - don't position the frame's view. Set this if you * don't want to automatically sync the frame and view * NS_FRAME_NO_SIZE_VIEW - don't size the frame's view - * NS_FRAME_NO_MOVE_CHILD_VIEWS - don't move child views. This is for the case - * where the frame's new position differs from its current position and the - * frame itself doesn't have a view, so moving the frame would cause any child - * views to be out of sync -*/ + */ nsresult nsContainerFrame::FinishReflowChild(nsIFrame* aKidFrame, nsIPresContext* aPresContext, @@ -849,12 +831,12 @@ nsContainerFrame::FinishReflowChild(nsIFrame* aKidFrame, &aDesiredSize.mOverflowArea, aFlags); - } else if (0 == (aFlags & NS_FRAME_NO_MOVE_CHILD_VIEWS)) { + } + else if (0 == (aFlags & NS_FRAME_NO_MOVE_VIEW) && + ((curOrigin.x != aX) || (curOrigin.y != aY))) { // If the frame has moved, then we need to make sure any child views are // correctly positioned - if ((curOrigin.x != aX) || (curOrigin.y != aY)) { - PositionChildViews(aPresContext, aKidFrame); - } + PositionChildViews(aPresContext, aKidFrame); } return aKidFrame->DidReflow(aPresContext, NS_FRAME_REFLOW_FINISHED); diff --git a/mozilla/layout/html/base/src/nsContainerFrame.h b/mozilla/layout/html/base/src/nsContainerFrame.h index d9bb1943cdc..0baa4849bef 100644 --- a/mozilla/layout/html/base/src/nsContainerFrame.h +++ b/mozilla/layout/html/base/src/nsContainerFrame.h @@ -30,8 +30,7 @@ #define NS_FRAME_NO_MOVE_VIEW 0x0001 #define NS_FRAME_NO_MOVE_FRAME (0x0002 | NS_FRAME_NO_MOVE_VIEW) #define NS_FRAME_NO_SIZE_VIEW 0x0004 -#define NS_FRAME_NO_MOVE_CHILD_VIEWS 0x0008 -#define NS_FRAME_NO_VISIBILITY 0x0010 +#define NS_FRAME_NO_VISIBILITY 0x0008 /** * Implementation of a container frame. @@ -83,8 +82,7 @@ public: // Positions the frame's view based on the frame's origin static void PositionFrameView(nsIPresContext* aPresContext, - nsIFrame* aKidFrame, - nsIView* aView); + nsIFrame* aKidFrame); // Sets several view attributes: // - if requested sizes the frame's view based on the current size and origin. @@ -141,10 +139,6 @@ public: * NS_FRAME_NO_MOVE_VIEW - don't position the frame's view. Set this if you * don't want to automatically sync the frame and view * NS_FRAME_NO_SIZE_VIEW - don't size the frame's view - * NS_FRAME_NO_MOVE_CHILD_VIEWS - don't move child views. This is for the case - * where the frame's new position differs from its current position and the - * frame itself doesn't have a view, so moving the frame would cause any child - * views to be out of sync */ static nsresult FinishReflowChild(nsIFrame* aKidFrame, nsIPresContext* aPresContext, diff --git a/mozilla/layout/html/base/src/nsHTMLReflowCommand.cpp b/mozilla/layout/html/base/src/nsHTMLReflowCommand.cpp index 2e511283b22..68dd8880e67 100644 --- a/mozilla/layout/html/base/src/nsHTMLReflowCommand.cpp +++ b/mozilla/layout/html/base/src/nsHTMLReflowCommand.cpp @@ -134,15 +134,13 @@ NS_IMETHODIMP nsHTMLReflowCommand::Dispatch(nsIPresContext* aPresContext, nsHTMLReflowState reflowState(aPresContext, root, *this, &aRendContext, aMaxSize); nsReflowStatus status; - nsIView* view; root->WillReflow(aPresContext); - root->GetView(aPresContext, &view); - if (view) { - nsContainerFrame::PositionFrameView(aPresContext, root, view); - } + nsContainerFrame::PositionFrameView(aPresContext, root); root->Reflow(aPresContext, aDesiredSize, reflowState, status); root->SizeTo(aPresContext, aDesiredSize.width, aDesiredSize.height); + nsIView* view; + root->GetView(aPresContext, &view); if (view) { nsContainerFrame::SyncFrameViewAfterReflow(aPresContext, root, view, nsnull); diff --git a/mozilla/layout/html/base/src/nsHTMLReflowState.cpp b/mozilla/layout/html/base/src/nsHTMLReflowState.cpp index ce8dab5911e..5d981e126f7 100644 --- a/mozilla/layout/html/base/src/nsHTMLReflowState.cpp +++ b/mozilla/layout/html/base/src/nsHTMLReflowState.cpp @@ -44,6 +44,18 @@ // hack for bug 50695 #include "nsIFormManager.h" +#ifdef DEBUG +const char* +nsHTMLReflowState::ReasonToString(nsReflowReason aReason) +{ + static const char* reasons[] = { + "initial", "incremental", "resize", "style-change", "dirty" + }; + + return reasons[aReason]; +} +#endif + // Initialize a root reflow state with a rendering context to // use for measuring things. nsHTMLReflowState::nsHTMLReflowState(nsIPresContext* aPresContext, diff --git a/mozilla/layout/html/base/src/nsPresShell.cpp b/mozilla/layout/html/base/src/nsPresShell.cpp index a450a039b8c..05e859ea64a 100644 --- a/mozilla/layout/html/base/src/nsPresShell.cpp +++ b/mozilla/layout/html/base/src/nsPresShell.cpp @@ -2660,16 +2660,14 @@ PresShell::InitialReflow(nscoord aWidth, nscoord aHeight) nsHTMLReflowState reflowState(mPresContext, rootFrame, eReflowReason_Initial, rcx, maxSize); - nsIView* view; - rootFrame->WillReflow(mPresContext); - rootFrame->GetView(mPresContext, &view); - if (view) { - nsContainerFrame::PositionFrameView(mPresContext, rootFrame, view); - } + nsContainerFrame::PositionFrameView(mPresContext, rootFrame); rootFrame->Reflow(mPresContext, desiredSize, reflowState, status); rootFrame->SizeTo(mPresContext, desiredSize.width, desiredSize.height); mPresContext->SetVisibleArea(nsRect(0,0,desiredSize.width,desiredSize.height)); + + nsIView* view; + rootFrame->GetView(mPresContext, &view); if (view) { nsContainerFrame::SyncFrameViewAfterReflow(mPresContext, rootFrame, view, nsnull); @@ -2798,15 +2796,13 @@ PresShell::ResizeReflow(nscoord aWidth, nscoord aHeight) nsHTMLReflowState reflowState(mPresContext, rootFrame, eReflowReason_Resize, rcx, maxSize); - nsIView* view; rootFrame->WillReflow(mPresContext); - rootFrame->GetView(mPresContext, &view); - if (view) { - nsContainerFrame::PositionFrameView(mPresContext, rootFrame, view); - } + nsContainerFrame::PositionFrameView(mPresContext, rootFrame); rootFrame->Reflow(mPresContext, desiredSize, reflowState, status); rootFrame->SizeTo(mPresContext, desiredSize.width, desiredSize.height); + nsIView* view; + rootFrame->GetView(mPresContext, &view); if (view) { nsContainerFrame::SyncFrameViewAfterReflow(mPresContext, rootFrame, view, nsnull); @@ -3335,16 +3331,14 @@ PresShell::StyleChangeReflow() nsHTMLReflowState reflowState(mPresContext, rootFrame, eReflowReason_StyleChange, rcx, maxSize); - nsIView* view; rootFrame->WillReflow(mPresContext); - rootFrame->GetView(mPresContext, &view); - if (view) { - nsContainerFrame::PositionFrameView(mPresContext, rootFrame, view); - } + nsContainerFrame::PositionFrameView(mPresContext, rootFrame); rootFrame->Reflow(mPresContext, desiredSize, reflowState, status); rootFrame->SizeTo(mPresContext, desiredSize.width, desiredSize.height); mPresContext->SetVisibleArea(nsRect(0,0,desiredSize.width,desiredSize.height)); + nsIView* view; + rootFrame->GetView(mPresContext, &view); if (view) { nsContainerFrame::SyncFrameViewAfterReflow(mPresContext, rootFrame, view, nsnull); diff --git a/mozilla/layout/html/base/src/nsViewportFrame.cpp b/mozilla/layout/html/base/src/nsViewportFrame.cpp index 2851a47d95d..de52ce2fffe 100644 --- a/mozilla/layout/html/base/src/nsViewportFrame.cpp +++ b/mozilla/layout/html/base/src/nsViewportFrame.cpp @@ -354,9 +354,7 @@ ViewportFrame::ReflowFixedFrame(nsIPresContext* aPresContext, kidReflowState.mComputedOffsets.top + kidReflowState.mComputedMargin.top); // Position its view - nsIView* kidView; - aKidFrame->GetView(aPresContext, &kidView); - nsContainerFrame::PositionFrameView(aPresContext, aKidFrame, kidView); + nsContainerFrame::PositionFrameView(aPresContext, aKidFrame); // Do the reflow rv = aKidFrame->Reflow(aPresContext, kidDesiredSize, kidReflowState, aStatus); @@ -378,6 +376,8 @@ ViewportFrame::ReflowFixedFrame(nsIPresContext* aPresContext, // Size and position the view and set its opacity, visibility, content // transparency, and clip + nsIView* kidView; + aKidFrame->GetView(aPresContext, &kidView); nsContainerFrame::SyncFrameViewAfterReflow(aPresContext, aKidFrame, kidView, &kidDesiredSize.mOverflowArea); aKidFrame->DidReflow(aPresContext, NS_FRAME_REFLOW_FINISHED); diff --git a/mozilla/layout/html/forms/src/nsComboboxControlFrame.cpp b/mozilla/layout/html/forms/src/nsComboboxControlFrame.cpp index 7b1018a0d24..62be4c11a29 100644 --- a/mozilla/layout/html/forms/src/nsComboboxControlFrame.cpp +++ b/mozilla/layout/html/forms/src/nsComboboxControlFrame.cpp @@ -1080,11 +1080,7 @@ nsComboboxControlFrame::ReflowCombobox(nsIPresContext * aPresContext, aDisplayFrame->WillReflow(aPresContext); //aDisplayFrame->MoveTo(aPresContext, dspBorderPadding.left + aBorderPadding.left, dspBorderPadding.top + aBorderPadding.top); aDisplayFrame->MoveTo(aPresContext, aBorderPadding.left, aBorderPadding.top); - nsIView* view; - aDisplayFrame->GetView(aPresContext, &view); - if (view) { - nsAreaFrame::PositionFrameView(aPresContext, aDisplayFrame, view); - } + nsAreaFrame::PositionFrameView(aPresContext, aDisplayFrame); nsReflowStatus status; nsresult rv = aDisplayFrame->Reflow(aPresContext, txtKidSize, txtKidReflowState, status); if (NS_FAILED(rv)) return; diff --git a/mozilla/layout/html/forms/src/nsFieldSetFrame.cpp b/mozilla/layout/html/forms/src/nsFieldSetFrame.cpp index 975fddb24cb..fc1998f81a1 100644 --- a/mozilla/layout/html/forms/src/nsFieldSetFrame.cpp +++ b/mozilla/layout/html/forms/src/nsFieldSetFrame.cpp @@ -517,15 +517,8 @@ nsFieldSetFrame::Reflow(nsIPresContext* aPresContext, // only if the origin changed if ((curOrigin.x != mLegendRect.x) || (curOrigin.y != mLegendRect.y)) { - mLegendFrame->MoveTo(aPresContext, actualLegendRect.x , actualLegendRect.y); - - nsIView* view; - mLegendFrame->GetView(aPresContext, &view); - if (view) - nsContainerFrame::PositionFrameView(aPresContext, mLegendFrame, view); - else - nsContainerFrame::PositionChildViews(aPresContext, mLegendFrame); + nsContainerFrame::PositionFrameView(aPresContext, mLegendFrame); } } diff --git a/mozilla/layout/html/table/src/nsTableFrame.cpp b/mozilla/layout/html/table/src/nsTableFrame.cpp index fd72b32113b..3d1d1a0f66a 100644 --- a/mozilla/layout/html/table/src/nsTableFrame.cpp +++ b/mozilla/layout/html/table/src/nsTableFrame.cpp @@ -385,13 +385,7 @@ void nsTableFrame::RePositionViews(nsIPresContext* aPresContext, nsIFrame* aFrame) { - nsIView* view; - aFrame->GetView(aPresContext, &view); - if (view) { - nsContainerFrame::PositionFrameView(aPresContext, aFrame, view); - } else { - nsContainerFrame::PositionChildViews(aPresContext, aFrame); - } + nsContainerFrame::PositionFrameView(aPresContext, aFrame); } nsIPresShell* diff --git a/mozilla/layout/tables/nsTableFrame.cpp b/mozilla/layout/tables/nsTableFrame.cpp index fd72b32113b..3d1d1a0f66a 100644 --- a/mozilla/layout/tables/nsTableFrame.cpp +++ b/mozilla/layout/tables/nsTableFrame.cpp @@ -385,13 +385,7 @@ void nsTableFrame::RePositionViews(nsIPresContext* aPresContext, nsIFrame* aFrame) { - nsIView* view; - aFrame->GetView(aPresContext, &view); - if (view) { - nsContainerFrame::PositionFrameView(aPresContext, aFrame, view); - } else { - nsContainerFrame::PositionChildViews(aPresContext, aFrame); - } + nsContainerFrame::PositionFrameView(aPresContext, aFrame); } nsIPresShell* diff --git a/mozilla/layout/xul/base/src/nsBox.cpp b/mozilla/layout/xul/base/src/nsBox.cpp index 79d424b60b7..f8b3fe67054 100644 --- a/mozilla/layout/xul/base/src/nsBox.cpp +++ b/mozilla/layout/xul/base/src/nsBox.cpp @@ -549,22 +549,9 @@ nsBox::SetBounds(nsBoxLayoutState& aState, const nsRect& aRect) frame->SetRect(presContext, aRect); - if (!(flags & NS_FRAME_NO_MOVE_VIEW) || !(flags & NS_FRAME_NO_MOVE_CHILD_VIEWS)) + if (!(flags & NS_FRAME_NO_MOVE_VIEW)) { - nsIView* view; - frame->GetView(presContext, &view); - if (view) { - if (!(flags & NS_FRAME_NO_MOVE_VIEW)) { - nsContainerFrame::PositionFrameView(presContext, frame, view); - } - } else { - if (!(flags & NS_FRAME_NO_MOVE_CHILD_VIEWS)) { - // only if the origin changed - if ((rect.x != aRect.x) || (rect.y != aRect.y)) { - nsContainerFrame::PositionChildViews(presContext, frame); - } - } - } + nsContainerFrame::PositionFrameView(presContext, frame); } diff --git a/mozilla/layout/xul/base/src/nsBoxToBlockAdaptor.cpp b/mozilla/layout/xul/base/src/nsBoxToBlockAdaptor.cpp index 129183b0dde..358d0c3aa8e 100644 --- a/mozilla/layout/xul/base/src/nsBoxToBlockAdaptor.cpp +++ b/mozilla/layout/xul/base/src/nsBoxToBlockAdaptor.cpp @@ -1002,13 +1002,7 @@ nsBoxToBlockAdaptor::PlaceChild(nsIPresContext* aPresContext, nsIFrame* aFrame, // only if the origin changed if ((curOrigin.x != aX) || (curOrigin.y != aY)) { aFrame->MoveTo(aPresContext, aX, aY); - - nsIView* view; - aFrame->GetView(aPresContext, &view); - if (view) { - nsContainerFrame::PositionFrameView(aPresContext, aFrame, view); - } else - nsContainerFrame::PositionChildViews(aPresContext, aFrame); + nsContainerFrame::PositionFrameView(aPresContext, aFrame); } }