Bug 1431781 - Report at least OverflowIncomplete reflow status when we skip reflowing OverflowContainer children and have a next-in-flow. r=dholbert a=lizzard
authorMats Palmgren <mats@mozilla.com>
Tue, 23 Jan 2018 00:00:03 +0100
changeset 454498 68e0f9396d9001cf65639f1bf972cc8f0cf7e3e5
parent 454497 f060ec4706236bff27dc966f79532fbde2a4dc94
child 454499 0c63b98288a77bfc046b17ce357cb6385a97cf7f
push id1648
push usermtabara@mozilla.com
push dateThu, 01 Mar 2018 12:45:47 +0000
treeherdermozilla-release@cbb9688c2eeb [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdholbert, lizzard
bugs1431781
milestone59.0
Bug 1431781 - Report at least OverflowIncomplete reflow status when we skip reflowing OverflowContainer children and have a next-in-flow. r=dholbert a=lizzard
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,