$OpenBSD$ index 1f6d24a..113aae2 100644 --- layout/base/RestyleManager.cpp.orig Fri Feb 20 15:40:37 2015 +++ layout/base/RestyleManager.cpp Fri Feb 20 15:40:37 2015 @@ -475,11 +475,6 @@ RestyleManager::RecomputePosition(nsIFrame* aFrame) nsresult RestyleManager::StyleChangeReflow(nsIFrame* aFrame, nsChangeHint aHint) { - // If the frame hasn't even received an initial reflow, then don't - // send it a style-change reflow! - if (aFrame->GetStateBits() & NS_FRAME_FIRST_REFLOW) - return NS_OK; - nsIPresShell::IntrinsicDirty dirtyType; if (aHint & nsChangeHint_ClearDescendantIntrinsics) { NS_ASSERTION(aHint & nsChangeHint_ClearAncestorIntrinsics, @@ -492,12 +487,19 @@ RestyleManager::StyleChangeReflow(nsIFrame* aFrame, nsChangeHint aHint) } nsFrameState dirtyBits; - if (aHint & nsChangeHint_NeedDirtyReflow) { + if (aFrame->GetStateBits() & NS_FRAME_FIRST_REFLOW) { + dirtyBits = nsFrameState(0); + } else if (aHint & nsChangeHint_NeedDirtyReflow) { dirtyBits = NS_FRAME_IS_DIRTY; } else { dirtyBits = NS_FRAME_HAS_DIRTY_CHILDREN; } + // If we're not going to clear any intrinsic sizes on the frames, and + // there are no dirty bits to set, then there's nothing to do. + if (dirtyType == nsIPresShell::eResize && !dirtyBits) + return NS_OK; + do { mPresContext->PresShell()->FrameNeedsReflow(aFrame, dirtyType, dirtyBits); aFrame = nsLayoutUtils::GetNextContinuationOrIBSplitSibling(aFrame);