Bug 1341009 - Add nsReflowStatus::IsEmpty() assertion to nsAbsoluteContainingBlock::ReflowAbsoluteFrame(). draft
authorTing-Yu Lin <tlin@mozilla.com>
Thu, 14 Sep 2017 11:33:36 +0800
changeset 666702 1395c28ced5de8f4872e09841d76da1a06d173c8
parent 666701 57ac3ebc4bbab946cace1d3c1c73387357b5eea2
child 666703 346cbb78fcca4aec86f1536be38610ff72a560ef
push id80486
push userbmo:tlin@mozilla.com
push dateTue, 19 Sep 2017 03:52:30 +0000
bugs1341009
milestone57.0a1
Bug 1341009 - Add nsReflowStatus::IsEmpty() assertion to nsAbsoluteContainingBlock::ReflowAbsoluteFrame(). The only caller (nsAbsoluteContainingBlock::Reflow()) declares nsReflowStatus before passing it in. Add an assertion to record this knowledge. MozReview-Commit-ID: 8M3Oi38nDyG
layout/generic/nsAbsoluteContainingBlock.cpp
--- a/layout/generic/nsAbsoluteContainingBlock.cpp
+++ b/layout/generic/nsAbsoluteContainingBlock.cpp
@@ -625,16 +625,18 @@ nsAbsoluteContainingBlock::ReflowAbsolut
                                                nsPresContext*           aPresContext,
                                                const ReflowInput& aReflowInput,
                                                const nsRect&            aContainingBlock,
                                                AbsPosReflowFlags        aFlags,
                                                nsIFrame*                aKidFrame,
                                                nsReflowStatus&          aStatus,
                                                nsOverflowAreas*         aOverflowAreas)
 {
+  MOZ_ASSERT(aStatus.IsEmpty(), "Caller should pass a fresh reflow status!");
+
 #ifdef DEBUG
   if (nsBlockFrame::gNoisyReflow) {
     nsFrame::IndentBy(stdout,nsBlockFrame::gNoiseIndent);
     printf("abs pos ");
     nsAutoString name;
     aKidFrame->GetFrameName(name);
     printf("%s ", NS_LossyConvertUTF16toASCII(name).get());