Bug 1340966 Part 1 - Fix assertion in nsBlockFrame::ReflowFloat(). draft
authorTing-Yu Lin <tlin@mozilla.com>
Fri, 08 Sep 2017 00:31:12 +0800
changeset 662131 e2e36214ed6e6ac3e36b7e22f87ad47ac6d8d996
parent 661103 b4c1ad9565ee9d00d96501c4a83083daf25c1413
child 662132 d4dc0b022c145c272993c154bf2d88800d625dc2
push id78960
push userbmo:tlin@mozilla.com
push dateMon, 11 Sep 2017 03:46:33 +0000
bugs1340966
milestone57.0a1
Bug 1340966 Part 1 - Fix assertion in nsBlockFrame::ReflowFloat(). After adding Part 3, aState.mReflowStatus.SetNextInFlowNeedsReflow() will assert, so fix it beforehand. This is fixed by using MergeCompletionStatusFrom() to properly merging the mCompletion status from aReflowStatus to aState.mReflowStatus. Because aReflowStatus is either OverflowIncomplete or Incomplete, aState.mReflowStatus won't violate the assertion that will be added in nsReflowStatus::SetNextInFlowNeedsReflow(). MozReview-Commit-ID: DDWbGqwO1CL
layout/generic/nsBlockFrame.cpp
--- a/layout/generic/nsBlockFrame.cpp
+++ b/layout/generic/nsBlockFrame.cpp
@@ -6400,17 +6400,17 @@ nsBlockFrame::ReflowFloat(BlockReflowInp
   } else if (aReflowStatus.IsIncomplete() &&
              (NS_UNCONSTRAINEDSIZE == aAdjustedAvailableSpace.BSize(wm))) {
     // An incomplete reflow status means we should split the float
     // if the height is constrained (bug 145305).
     aReflowStatus.Reset();
   }
 
   if (aReflowStatus.NextInFlowNeedsReflow()) {
-    aState.mReflowStatus.SetNextInFlowNeedsReflow();
+    aState.mReflowStatus.MergeCompletionStatusFrom(aReflowStatus);
   }
 
   if (aFloat->IsLetterFrame()) {
     // We never split floating first letters; an incomplete state for
     // such frames simply means that there is more content to be
     // reflowed on the line.
     if (aReflowStatus.IsIncomplete())
       aReflowStatus.Reset();