Bug 1464967 - Part 2: Fix nsReflowStatus dumping when REALLY_NOISY_REFLOW is defined. r?gerald
MozReview-Commit-ID: JPN7i5z5IeX
--- a/layout/generic/nsBlockFrame.cpp
+++ b/layout/generic/nsBlockFrame.cpp
@@ -4158,17 +4158,17 @@ nsBlockFrame::ReflowInlineFrame(BlockRef
aLineLayout.ReflowFrame(aFrame, frameReflowStatus, nullptr, pushedFrame);
if (frameReflowStatus.NextInFlowNeedsReflow()) {
aLineLayout.SetDirtyNextLine();
}
#ifdef REALLY_NOISY_REFLOW
nsFrame::ListTag(stdout, aFrame);
- printf(": status=%x\n", frameReflowStatus);
+ printf(": status=%s\n", frameReflowStatus.ToString().get());
#endif
#if defined(REFLOW_STATUS_COVERAGE)
RecordReflowStatus(false, frameReflowStatus);
#endif
// Send post-reflow notification
aState.mPrevChild = aFrame;
--- a/layout/generic/nsFrame.cpp
+++ b/layout/generic/nsFrame.cpp
@@ -278,16 +278,26 @@ std::ostream& operator<<(std::ostream& a
<< "NIF=" << (aStatus.NextInFlowNeedsReflow() ? 'Y' : 'N') << ","
<< "Truncated=" << (aStatus.IsTruncated() ? 'Y' : 'N') << ","
<< "Break=" << brk << ","
<< "FirstLetter=" << (aStatus.FirstLetterComplete() ? 'Y' : 'N')
<< "]";
return aStream;
}
+nsCString
+nsReflowStatus::ToString() const
+{
+ nsCString result;
+ std::stringstream ss;
+ ss << *this;
+ result.Append(ss.str().c_str());
+ return result;
+}
+
static bool gShowFrameBorders = false;
void nsFrame::ShowFrameBorders(bool aEnable)
{
gShowFrameBorders = aEnable;
}
bool nsFrame::GetShowFrameBorders()
--- a/layout/generic/nsIFrame.h
+++ b/layout/generic/nsIFrame.h
@@ -351,16 +351,20 @@ public:
mInlineBreak = InlineBreak::After;
}
// mFirstLetterComplete bit flag means the break was induced by
// completion of a first-letter.
bool FirstLetterComplete() const { return mFirstLetterComplete; }
void SetFirstLetterComplete() { mFirstLetterComplete = true; }
+#ifdef DEBUG
+ nsCString ToString() const;
+#endif
+
private:
StyleClear mBreakType;
InlineBreak mInlineBreak;
Completion mCompletion;
bool mNextInFlowNeedsReflow : 1;
bool mTruncated : 1;
bool mFirstLetterComplete : 1;
};