Bug 447660 part 2 - Mark an existing next-in-flow of a float that is split due to it being NOT_COMPLETE as NOT being an overflow container. r=roc
authorMats Palmgren <mats@mozilla.com>
Fri, 19 Dec 2014 16:28:43 +0000
changeset 220553 b9c248025d37c5b71c8c59a257cdb044577dfb0f
parent 220552 3c8aa35169bfeb835ec925b0e9e0ae6df621c5df
child 220554 56d432ad6ed6039bbb128e78774e23774b128f08
push id53135
push usermpalmgren@mozilla.com
push dateFri, 19 Dec 2014 16:28:56 +0000
treeherdermozilla-inbound@4d886cc6c0b3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersroc
bugs447660
milestone37.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 447660 part 2 - Mark an existing next-in-flow of a float that is split due to it being NOT_COMPLETE as NOT being an overflow container. r=roc
layout/generic/nsBlockFrame.cpp
--- a/layout/generic/nsBlockFrame.cpp
+++ b/layout/generic/nsBlockFrame.cpp
@@ -4061,16 +4061,19 @@ nsBlockFrame::SplitFloat(nsBlockReflowSt
   nsIFrame* nextInFlow = aFloat->GetNextInFlow();
   if (nextInFlow) {
     nsContainerFrame *oldParent = nextInFlow->GetParent();
     DebugOnly<nsresult> rv = oldParent->StealFrame(nextInFlow);
     NS_ASSERTION(NS_SUCCEEDED(rv), "StealFrame failed");
     if (oldParent != this) {
       ReparentFrame(nextInFlow, oldParent, this);
     }
+    if (!NS_FRAME_OVERFLOW_IS_INCOMPLETE(aFloatStatus)) {
+      nextInFlow->RemoveStateBits(NS_FRAME_IS_OVERFLOW_CONTAINER);
+    }
   } else {
     nextInFlow = aState.mPresContext->PresShell()->FrameConstructor()->
       CreateContinuingFrame(aState.mPresContext, aFloat, this);
   }
   if (NS_FRAME_OVERFLOW_IS_INCOMPLETE(aFloatStatus))
     aFloat->GetNextInFlow()->AddStateBits(NS_FRAME_IS_OVERFLOW_CONTAINER);
 
   // The containing block is now overflow-incomplete.
@@ -7218,20 +7221,21 @@ nsBlockFrame::ComputeFinalBSize(const ns
                   && computedBSizeLeftOver ),
                "overflow container must not have computedBSizeLeftOver");
 
   aFinalSize.BSize(wm) =
     NSCoordSaturatingAdd(NSCoordSaturatingAdd(aBorderPadding.BStart(wm),
                                               computedBSizeLeftOver),
                          aBorderPadding.BEnd(wm));
 
-  if (NS_FRAME_IS_NOT_COMPLETE(*aStatus)
-      && aFinalSize.BSize(wm) < aReflowState.AvailableBSize()) {
-    // We ran out of height on this page but we're incomplete
-    // Set status to complete except for overflow
+  if (NS_FRAME_IS_NOT_COMPLETE(*aStatus) &&
+      aFinalSize.BSize(wm) < aReflowState.AvailableBSize()) {
+    // We fit in the available space - change status to OVERFLOW_INCOMPLETE.
+    // XXXmats why didn't Reflow report OVERFLOW_INCOMPLETE in the first place?
+    // XXXmats and why exclude the case when our size == AvailableBSize?
     NS_FRAME_SET_OVERFLOW_INCOMPLETE(*aStatus);
   }
 
   if (NS_FRAME_IS_COMPLETE(*aStatus)) {
     if (computedBSizeLeftOver > 0 &&
         NS_UNCONSTRAINEDSIZE != aReflowState.AvailableBSize() &&
         aFinalSize.BSize(wm) > aReflowState.AvailableBSize()) {
       if (ShouldAvoidBreakInside(aReflowState)) {