Bug 775624 Part 14 - Convert NS_INLINE_GET_BREAK_TYPE to a method. r=dholbert
authorTing-Yu Lin <tlin@mozilla.com>
Tue, 14 Feb 2017 15:58:03 +0800
changeset 373405 985eb1c0435550a30bc4630eada13f7426c4c5c7
parent 373404 b39fdda36636395fefd8a671ced01fa4eee9f154
child 373406 4be99f9271740378328e373f20b938d769725394
push id10863
push userjlorenzo@mozilla.com
push dateMon, 06 Mar 2017 23:02:23 +0000
treeherdermozilla-aurora@0931190cd725 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
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.
  */