Bug 1340966 Part 3 - Add assertion in SetNextInFlowNeedsReflow(), to verify that it's never called on fully-complete frames
The original version of the comment [1] "you wouldn't set
mNextInFlowNeedsReflow when IsComplete() is true" was written before
OverflowIncomplete was introduced in
bug 379349.
So I believe we should assert !IsFullyComplete() in
SetNextInFlowNeedsReflow() rather than assert !IsComplete() (as the old
comment implies we could).
[1] https://hg.mozilla.org/mozilla-central/annotate/9b2a99adc05e/layout/generic/nsIFrame.h#l288
MozReview-Commit-ID: 2yrL79jOV8A
--- a/layout/generic/nsIFrame.h
+++ b/layout/generic/nsIFrame.h
@@ -284,20 +284,24 @@ public:
mCompletion = Completion::Incomplete;
}
void SetOverflowIncomplete() {
mCompletion = Completion::OverflowIncomplete;
}
// mNextInFlowNeedsReflow bit flag means that the next-in-flow is dirty,
// and also needs to be reflowed. This status only makes sense for a frame
- // that is not complete, i.e. you wouldn't set mNextInFlowNeedsReflow when
- // IsComplete() is true.
+ // that is not complete, i.e. you wouldn't call SetNextInFlowNeedsReflow()
+ // when IsFullyComplete() is true.
bool NextInFlowNeedsReflow() const { return mNextInFlowNeedsReflow; }
- void SetNextInFlowNeedsReflow() { mNextInFlowNeedsReflow = true; }
+ void SetNextInFlowNeedsReflow() {
+ MOZ_ASSERT(!IsFullyComplete(),
+ "A fully complete frame shouldn't set this bit.");
+ mNextInFlowNeedsReflow = true;
+ }
// mTruncated bit flag means that the part of the frame before the first
// possible break point was unable to fit in the available space.
// Therefore, the entire frame should be moved to the next continuation of
// the parent frame. A frame that begins at the top of the page must never
// be truncated. Doing so would likely cause an infinite loop.
bool IsTruncated() const { return mTruncated; }
void UpdateTruncated(const mozilla::ReflowInput& aReflowInput,