From ee65ddbae1f0830e6437d6724e0b188937da3910 Mon Sep 17 00:00:00 2001 From: Mats Palmgren Date: Sat, 1 Mar 2014 10:36:39 +0000 Subject: [PATCH] Bug 513110 - Adjust the maximum break type (only used in assertions) to reflect reality. r=dholbert --- layout/generic/nsBlockFrame.cpp | 2 +- layout/generic/nsLineBox.cpp | 2 +- layout/style/nsStyleConsts.h | 4 +++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/layout/generic/nsBlockFrame.cpp b/layout/generic/nsBlockFrame.cpp index c2c57ad904ec..70f70f6b8fca 100644 --- a/layout/generic/nsBlockFrame.cpp +++ b/layout/generic/nsBlockFrame.cpp @@ -3756,7 +3756,7 @@ nsBlockFrame::ReflowInlineFrame(nsBlockReflowState& aState, uint8_t breakType = NS_INLINE_GET_BREAK_TYPE(frameReflowStatus); NS_ASSERTION((NS_STYLE_CLEAR_NONE != breakType) || (NS_STYLE_CLEAR_NONE != aState.mFloatBreakType), "bad break type"); - NS_ASSERTION(NS_STYLE_CLEAR_LAST_VALUE >= breakType, "invalid break type"); + NS_ASSERTION(NS_STYLE_CLEAR_MAX >= breakType, "invalid break type"); if (NS_INLINE_IS_BREAK_BEFORE(frameReflowStatus)) { // Break-before cases. diff --git a/layout/generic/nsLineBox.cpp b/layout/generic/nsLineBox.cpp index f1b553a27bd4..00d103dfd419 100644 --- a/layout/generic/nsLineBox.cpp +++ b/layout/generic/nsLineBox.cpp @@ -43,7 +43,7 @@ nsLineBox::nsLineBox(nsIFrame* aFrame, int32_t aCount, bool aIsBlock) } #endif - static_assert(NS_STYLE_CLEAR_LAST_VALUE <= 15, + static_assert(NS_STYLE_CLEAR_MAX <= 15, "FlagBits needs more bits to store the full range of " "break type ('clear') values"); #if NS_STYLE_CLEAR_NONE > 0 diff --git a/layout/style/nsStyleConsts.h b/layout/style/nsStyleConsts.h index e97ff4f06b70..445b195f4e95 100644 --- a/layout/style/nsStyleConsts.h +++ b/layout/style/nsStyleConsts.h @@ -319,7 +319,9 @@ static inline mozilla::css::Side operator++(mozilla::css::Side& side, int) { #define NS_STYLE_CLEAR_RIGHT 2 #define NS_STYLE_CLEAR_LEFT_AND_RIGHT 3 #define NS_STYLE_CLEAR_LINE 4 -#define NS_STYLE_CLEAR_LAST_VALUE NS_STYLE_CLEAR_LINE +// @note NS_STYLE_CLEAR_LINE can be added to one of the other values in layout +// so it needs to use a bit value that none of the other values can have. +#define NS_STYLE_CLEAR_MAX (NS_STYLE_CLEAR_LINE | NS_STYLE_CLEAR_LEFT_AND_RIGHT) // See nsStyleContent #define NS_STYLE_CONTENT_OPEN_QUOTE 0