Bug 775624 Part 15 - Remove NS_INLINE_BREAK_TYPE_MASK. r?dholbert draft
authorTing-Yu Lin <tlin@mozilla.com>
Tue, 14 Feb 2017 16:05:24 +0800
changeset 488478 901a780c62a8a39cac80ed831c55707cff360444
parent 488477 4a7511625d7b6b47e01221ff3a82e9920f00e519
child 488479 1d53e1475846e798666f8e5d863cdbf9cb6acd1a
push id46538
push userbmo:tlin@mozilla.com
push dateThu, 23 Feb 2017 05:39:06 +0000
reviewersdholbert
bugs775624
milestone54.0a1
Bug 775624 Part 15 - Remove NS_INLINE_BREAK_TYPE_MASK. r?dholbert MozReview-Commit-ID: BjDou96ojUd
layout/generic/nsIFrame.h
layout/generic/nsInlineFrame.cpp
--- a/layout/generic/nsIFrame.h
+++ b/layout/generic/nsIFrame.h
@@ -360,19 +360,16 @@ private:
 
 #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
 
-// The type of break requested can be found in these bits.
-#define NS_INLINE_BREAK_TYPE_MASK    0xF000
-
 // 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))
--- a/layout/generic/nsInlineFrame.cpp
+++ b/layout/generic/nsInlineFrame.cpp
@@ -804,19 +804,20 @@ nsInlineFrame::ReflowInlineFrame(nsPresC
   bool pushedFrame;
   lineLayout->ReflowFrame(aFrame, aStatus, nullptr, pushedFrame);
   
   if (NS_INLINE_IS_BREAK_BEFORE(aStatus)) {
     if (aFrame != mFrames.FirstChild()) {
       // Change break-before status into break-after since we have
       // already placed at least one child frame. This preserves the
       // break-type so that it can be propagated upward.
-      aStatus = NS_FRAME_NOT_COMPLETE |
-        NS_INLINE_BREAK | NS_INLINE_BREAK_AFTER |
-        (aStatus & NS_INLINE_BREAK_TYPE_MASK);
+      StyleClear oldBreakType = aStatus.BreakType();
+      aStatus.Reset();
+      aStatus.SetIncomplete();
+      aStatus.SetInlineLineBreakAfter(oldBreakType);
       PushFrames(aPresContext, aFrame, irs.mPrevFrame, irs);
     }
     else {
       // Preserve reflow status when breaking-before our first child
       // and propagate it upward without modification.
     }
     return;
   }