Bug 775624 Part 14 - Convert NS_INLINE_GET_BREAK_TYPE to a method. r?dholbert
MozReview-Commit-ID: CAYlv21gPpR
--- a/layout/generic/nsBlockFrame.cpp
+++ b/layout/generic/nsBlockFrame.cpp
@@ -4183,17 +4183,17 @@ nsBlockFrame::ReflowInlineFrame(BlockRef
aLine->SetBreakTypeAfter(StyleClear::None);
if (NS_INLINE_IS_BREAK(frameReflowStatus) ||
StyleClear::None != aState.mFloatBreakType) {
// Always abort the line reflow (because a line break is the
// minimal amount of break we do).
*aLineReflowStatus = LineReflowStatus::Stop;
// XXX what should aLine's break-type be set to in all these cases?
- StyleClear breakType = NS_INLINE_GET_BREAK_TYPE(frameReflowStatus);
+ StyleClear breakType = frameReflowStatus.BreakType();
MOZ_ASSERT(StyleClear::None != breakType ||
StyleClear::None != aState.mFloatBreakType, "bad break type");
if (NS_INLINE_IS_BREAK_BEFORE(frameReflowStatus)) {
// Break-before cases.
if (aFrame == aLine->mFirstChild) {
// If we break before the first frame on the line then we must
// be trying to place content where there's no room (e.g. on a
--- a/layout/generic/nsIFrame.h
+++ b/layout/generic/nsIFrame.h
@@ -317,16 +317,17 @@ public:
}
}
// mInlineBreak bit flag means a break is requested.
// Suppose a break is requested. When mInlineBreakAfter is set, the break
// should occur after the frame just reflowed; when mInlineBreakAfter is
// clear, the break should occur before the frame just reflowed.
+ StyleClear BreakType() const { return mBreakType; }
// Set the inline line-break-before status, and reset other bit flags. The
// break type is StyleClear::Line. Note that other frame completion status
// isn't expected to matter after calling this method.
void SetInlineLineBreakBeforeAndReset() {
Reset();
mBreakType = StyleClear::Line;
mInlineBreak = true;
@@ -377,19 +378,16 @@ private:
(0 != ((_status) & NS_INLINE_BREAK))
#define NS_INLINE_IS_BREAK_AFTER(_status) \
(0 != ((_status) & NS_INLINE_BREAK_AFTER))
#define NS_INLINE_IS_BREAK_BEFORE(_status) \
(NS_INLINE_BREAK == ((_status) & (NS_INLINE_BREAK|NS_INLINE_BREAK_AFTER)))
-#define NS_INLINE_GET_BREAK_TYPE(_status) \
- (static_cast<StyleClear>(((_status) >> 12) & 0xF))
-
#define NS_FRAME_SET_TRUNCATION(aStatus, aReflowInput, aMetrics) \
aStatus.UpdateTruncated(aReflowInput, aMetrics);
//----------------------------------------------------------------------
/**
* DidReflow status values.
*/