Bug 775624 Part 17 - Convert NS_INLINE_IS_BREAK_AFTER to a method. r?dholbert
MozReview-Commit-ID: CD9uuOC3CzP
--- a/layout/generic/nsBlockFrame.cpp
+++ b/layout/generic/nsBlockFrame.cpp
@@ -4229,17 +4229,17 @@ nsBlockFrame::ReflowInlineFrame(BlockRef
breakType = StyleClear::None;
}
}
aLine->SetBreakTypeAfter(breakType);
if (frameReflowStatus.IsComplete()) {
// Split line, but after the frame just reflowed
SplitLine(aState, aLineLayout, aLine, aFrame->GetNextSibling(), aLineReflowStatus);
- if (NS_INLINE_IS_BREAK_AFTER(frameReflowStatus) &&
+ if (frameReflowStatus.IsInlineBreakAfter() &&
!aLineLayout.GetLineEndsInBR()) {
aLineLayout.SetDirtyNextLine();
}
}
}
}
if (!frameReflowStatus.IsFullyComplete()) {
--- a/layout/generic/nsGridContainerFrame.cpp
+++ b/layout/generic/nsGridContainerFrame.cpp
@@ -5674,17 +5674,17 @@ nsGridContainerFrame::ReflowRowsInFragme
continue;
}
NS_ERROR("got BREAK_BEFORE at top-of-page");
childStatus = NS_FRAME_COMPLETE;
} else {
NS_ERROR("got BREAK_BEFORE again after growing the row?");
childStatus.SetIncomplete();
}
- } else if (NS_INLINE_IS_BREAK_AFTER(childStatus)) {
+ } else if (childStatus.IsInlineBreakAfter()) {
MOZ_ASSERT_UNREACHABLE("unexpected child reflow status");
}
if (childStatus.IsIncomplete()) {
incompleteItems.PutEntry(child);
} else if (!childStatus.IsFullyComplete()) {
overflowIncompleteItems.PutEntry(child);
}
--- a/layout/generic/nsIFrame.h
+++ b/layout/generic/nsIFrame.h
@@ -318,16 +318,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.
bool IsInlineBreakBefore() const { return mInlineBreak && !mInlineBreakAfter; }
+ bool IsInlineBreakAfter() const { return mInlineBreak && mInlineBreakAfter; }
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;
@@ -359,30 +360,26 @@ private:
bool mInlineBreakAfter : 1;
};
#define NS_FRAME_COMPLETE 0 // Note: not a bit!
#define NS_FRAME_NOT_COMPLETE 0x1
#define NS_FRAME_OVERFLOW_INCOMPLETE 0x4
#define NS_INLINE_BREAK 0x0100
-#define NS_INLINE_BREAK_AFTER 0x0200
// Set when a break was induced by completion of a first-letter
#define NS_INLINE_BREAK_FIRST_LETTER_COMPLETE 0x10000
//----------------------------------------
// Macros that use those bits
#define NS_INLINE_IS_BREAK(_status) \
(0 != ((_status) & NS_INLINE_BREAK))
-#define NS_INLINE_IS_BREAK_AFTER(_status) \
- (0 != ((_status) & NS_INLINE_BREAK_AFTER))
-
#define NS_FRAME_SET_TRUNCATION(aStatus, aReflowInput, aMetrics) \
aStatus.UpdateTruncated(aReflowInput, aMetrics);
//----------------------------------------------------------------------
/**
* DidReflow status values.
*/
--- a/layout/generic/nsInlineFrame.cpp
+++ b/layout/generic/nsInlineFrame.cpp
@@ -822,17 +822,17 @@ nsInlineFrame::ReflowInlineFrame(nsPresC
return;
}
// Create a next-in-flow if needed.
if (!aStatus.IsFullyComplete()) {
CreateNextInFlow(aFrame);
}
- if (NS_INLINE_IS_BREAK_AFTER(aStatus)) {
+ if (aStatus.IsInlineBreakAfter()) {
nsIFrame* nextFrame = aFrame->GetNextSibling();
if (nextFrame) {
aStatus.SetIncomplete();
PushFrames(aPresContext, nextFrame, aFrame, irs);
}
else {
// We must return an incomplete status if there are more child
// frames remaining in a next-in-flow that follows this frame.
--- a/layout/generic/nsRubyBaseContainerFrame.cpp
+++ b/layout/generic/nsRubyBaseContainerFrame.cpp
@@ -504,17 +504,17 @@ nsRubyBaseContainerFrame::ReflowColumns(
break;
}
icoord += ReflowOneColumn(aReflowInput, columnIndex, column, reflowStatus);
if (!reflowStatus.IsInlineBreakBefore()) {
columnIndex++;
}
}
- if (!e.AtEnd() && NS_INLINE_IS_BREAK_AFTER(reflowStatus)) {
+ if (!e.AtEnd() && reflowStatus.IsInlineBreakAfter()) {
// The current column has been successfully placed.
// Skip to the next column and mark break before.
e.Next();
e.GetColumn(column);
reflowStatus.SetInlineLineBreakBeforeAndReset();
}
if (!e.AtEnd() || (GetNextInFlow() && !isComplete)) {
aStatus.SetIncomplete();
@@ -554,17 +554,17 @@ nsRubyBaseContainerFrame::ReflowColumns(
if (!textFrame && nextColumn.isSome()) {
textFrame = nextColumn->mTextFrames[i];
}
if (textFrame) {
aReflowInput.mTextContainers[i]->PushChildren(
textFrame, textFrame->GetPrevSibling());
}
}
- } else if (NS_INLINE_IS_BREAK_AFTER(reflowStatus)) {
+ } else if (reflowStatus.IsInlineBreakAfter()) {
// |reflowStatus| being break after here may only happen when
// there is a break after the column just pulled, or the whole
// segment has been completely reflowed. In those cases, we do
// not need to push anything.
MOZ_ASSERT(e.AtEnd());
aStatus.SetInlineLineBreakAfter();
}
--- a/layout/generic/nsRubyFrame.cpp
+++ b/layout/generic/nsRubyFrame.cpp
@@ -219,17 +219,17 @@ nsRubyFrame::ReflowSegment(nsPresContext
// text containers paired with it.
return;
}
if (aStatus.IsIncomplete()) {
// It always promise that if the status is incomplete, there is a
// break occurs. Break before has been processed above. However,
// it is possible that break after happens with the frame reflow
// completed. It happens if there is a force break at the end.
- MOZ_ASSERT(NS_INLINE_IS_BREAK_AFTER(aStatus));
+ MOZ_ASSERT(aStatus.IsInlineBreakAfter());
// Find the previous sibling which we will
// insert new continuations after.
nsIFrame* lastChild;
if (rtcCount > 0) {
lastChild = textContainers.LastElement();
} else {
lastChild = aBaseContainer;
}