Bug 1431781 - Report at least OverflowIncomplete reflow status when we skip reflowing OverflowContainer children and have a next-in-flow. r=dholbert
authorMats Palmgren <mats@mozilla.com>
Tue, 23 Jan 2018 00:00:03 +0100
changeset 723403 cef7ac1c276ba50a6789ca916568434dbc6990ae
parent 723402 c67fb9e69640fa3070ae229ae5bd8295b687e60d
child 723404 54c8e64328ce77d5c2e4bd9702f22a49477764ee
push id96421
push userbmo:gps@mozilla.com
push dateTue, 23 Jan 2018 05:59:40 +0000
reviewersdholbert
bugs1431781
milestone60.0a1
Bug 1431781 - Report at least OverflowIncomplete reflow status when we skip reflowing OverflowContainer children and have a next-in-flow. r=dholbert
layout/generic/nsContainerFrame.cpp
--- a/layout/generic/nsContainerFrame.cpp
+++ b/layout/generic/nsContainerFrame.cpp
@@ -1155,16 +1155,23 @@ nsContainerFrame::ReflowOverflowContaine
 
   nsOverflowContinuationTracker tracker(this, false, false);
   bool shouldReflowAllKids = aReflowInput.ShouldReflowAllKids();
 
   for (nsIFrame* frame : *overflowContainers) {
     if (frame->GetPrevInFlow()->GetParent() != GetPrevInFlow()) {
       // frame's prevInFlow has moved, skip reflowing this frame;
       // it will get reflowed once it's been placed
+      if (GetNextInFlow()) {
+        // We report OverflowIncomplete status in this case to avoid our parent
+        // deleting our next-in-flows which might destroy non-empty frames.
+        nsReflowStatus status;
+        status.SetOverflowIncomplete();
+        aStatus.MergeCompletionStatusFrom(status);
+      }
       continue;
     }
     // If the available vertical height has changed, we need to reflow
     // even if the frame isn't dirty.
     if (shouldReflowAllKids || NS_SUBTREE_DIRTY(frame)) {
       // Get prev-in-flow
       nsIFrame* prevInFlow = frame->GetPrevInFlow();
       NS_ASSERTION(prevInFlow,