# HG changeset patch # Parent 1b79b0d255e5043e5eb333de85c2275e6bdab585 # User Mats Palmgren Bug 1102791 - Always return NS_FRAME_COMPLETE status from nsHTMLButtonControlFrame::Reflow. Don't create overflow container continuations unless the delegating frame has eCanContainOverflowContainers. r=roc diff --git a/layout/forms/crashtests/1102791.html b/layout/forms/crashtests/1102791.html new file mode 100644 --- /dev/null +++ b/layout/forms/crashtests/1102791.html @@ -0,0 +1,33 @@ + + + + Testcase for bug 1102791 + + + + + + + + diff --git a/layout/forms/crashtests/crashtests.list b/layout/forms/crashtests/crashtests.list --- a/layout/forms/crashtests/crashtests.list +++ b/layout/forms/crashtests/crashtests.list @@ -54,8 +54,9 @@ load 626014.xhtml load 639733.xhtml asserts(0-1) load 669767.html load 682684.xhtml load 865602.html load 944198.html load 949891.xhtml load 959311.html load 960277-2.html +load 1102791.html diff --git a/layout/forms/nsHTMLButtonControlFrame.cpp b/layout/forms/nsHTMLButtonControlFrame.cpp --- a/layout/forms/nsHTMLButtonControlFrame.cpp +++ b/layout/forms/nsHTMLButtonControlFrame.cpp @@ -198,16 +198,21 @@ nsHTMLButtonControlFrame::Reflow(nsPresC aReflowState, firstKid); ConsiderChildOverflow(aDesiredSize.mOverflowAreas, firstKid); aStatus = NS_FRAME_COMPLETE; FinishReflowWithAbsoluteFrames(aPresContext, aDesiredSize, aReflowState, aStatus); + // We're always complete and we don't support overflow containers + // so we shouldn't have a next-in-flow ever. + aStatus = NS_FRAME_COMPLETE; + MOZ_ASSERT(!GetNextInFlow()); + NS_FRAME_SET_TRUNCATION(aStatus, aReflowState, aDesiredSize); } // Helper-function that lets us clone the button's reflow state, but with its // ComputedWidth and ComputedHeight reduced by the amount of renderer-specific // focus border and padding that we're using. (This lets us provide a more // appropriate content-box size for descendents' percent sizes to resolve // against.) diff --git a/layout/generic/nsAbsoluteContainingBlock.cpp b/layout/generic/nsAbsoluteContainingBlock.cpp --- a/layout/generic/nsAbsoluteContainingBlock.cpp +++ b/layout/generic/nsAbsoluteContainingBlock.cpp @@ -127,17 +127,18 @@ nsAbsoluteContainingBlock::Reflow(nsCont if (kidNeedsReflow && !aPresContext->HasPendingInterrupt()) { // Reflow the frame nsReflowStatus kidStatus = NS_FRAME_COMPLETE; ReflowAbsoluteFrame(aDelegatingFrame, aPresContext, aReflowState, aContainingBlock, aConstrainHeight, kidFrame, kidStatus, aOverflowAreas); nsIFrame* nextFrame = kidFrame->GetNextInFlow(); - if (!NS_FRAME_IS_FULLY_COMPLETE(kidStatus)) { + if (!NS_FRAME_IS_FULLY_COMPLETE(kidStatus) && + aDelegatingFrame->IsFrameOfType(nsIFrame::eCanContainOverflowContainers)) { // Need a continuation if (!nextFrame) { nextFrame = aPresContext->PresShell()->FrameConstructor()-> CreateContinuingFrame(aPresContext, kidFrame, aDelegatingFrame); } // Add it as an overflow container. //XXXfr This is a hack to fix some of our printing dataloss.