Bug 775624 Part 14 - Convert NS_INLINE_GET_BREAK_TYPE to a method. r?dholbert draft
authorTing-Yu Lin <tlin@mozilla.com>
Tue, 14 Feb 2017 15:58:03 +0800
changeset 488477 4a7511625d7b6b47e01221ff3a82e9920f00e519
parent 488476 b59c013935618822900b26b36cb7cbf702d59011
child 488478 901a780c62a8a39cac80ed831c55707cff360444
push id46538
push userbmo:tlin@mozilla.com
push dateThu, 23 Feb 2017 05:39:06 +0000
reviewersdholbert
bugs775624
milestone54.0a1
Bug 775624 Part 14 - Convert NS_INLINE_GET_BREAK_TYPE to a method. r?dholbert MozReview-Commit-ID: CAYlv21gPpR
layout/generic/nsBlockFrame.cpp
layout/generic/nsIFrame.h
--- 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.
  */