зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1477533 - Convert NS_STYLE_COLUMN_FILL_* to an enum class. r=heycam
I put Balance as the first item in StyleColumnFill because it is the default value. MozReview-Commit-ID: A4DVMLL6XBa --HG-- extra : rebase_source : 8c8d07b724bcd49dd4f4057fcbf0ccd46ed591ff
This commit is contained in:
Родитель
582327218e
Коммит
a6015f5b37
|
@ -333,7 +333,7 @@ nsColumnSetFrame::ChooseColumnStrategy(const ReflowInput& aReflowInput,
|
|||
int32_t numColumns = colStyle->mColumnCount;
|
||||
|
||||
// If column-fill is set to 'balance', then we want to balance the columns.
|
||||
const bool isBalancing = colStyle->mColumnFill == NS_STYLE_COLUMN_FILL_BALANCE
|
||||
const bool isBalancing = colStyle->mColumnFill == StyleColumnFill::Balance
|
||||
&& !aForceAuto;
|
||||
if (isBalancing) {
|
||||
const uint32_t MAX_NESTED_COLUMN_BALANCING = 2;
|
||||
|
@ -663,7 +663,7 @@ nsColumnSetFrame::ReflowChildren(ReflowOutput& aDesiredSize,
|
|||
// If column-fill is auto (not the default), then we might need to
|
||||
// move content between columns for any change in column block-size.
|
||||
if (skipIncremental && changingBSize &&
|
||||
StyleColumn()->mColumnFill == NS_STYLE_COLUMN_FILL_AUTO) {
|
||||
StyleColumn()->mColumnFill == StyleColumnFill::Auto) {
|
||||
skipIncremental = false;
|
||||
}
|
||||
// If we need to pull up content from the prev-in-flow then this is not just
|
||||
|
|
|
@ -153,6 +153,7 @@ rusty-enums = [
|
|||
"mozilla::StyleOrient",
|
||||
"mozilla::StyleBoxSizing",
|
||||
"mozilla::StyleClear",
|
||||
"mozilla::StyleColumnFill",
|
||||
"mozilla::StyleComplexColor_Tag",
|
||||
"mozilla::StyleFloat",
|
||||
"mozilla::StyleImageOrientation",
|
||||
|
|
|
@ -87,6 +87,11 @@ enum class StyleClear : uint8_t {
|
|||
Max = 13 // Max = (Both | Line)
|
||||
};
|
||||
|
||||
enum class StyleColumnFill : uint8_t {
|
||||
Balance,
|
||||
Auto,
|
||||
};
|
||||
|
||||
// Counters and generated content.
|
||||
enum class StyleContentType : uint8_t {
|
||||
String = 1,
|
||||
|
@ -979,9 +984,6 @@ enum class StyleWhiteSpace : uint8_t {
|
|||
#define NS_STYLE_PAGE_BREAK_LEFT 3
|
||||
#define NS_STYLE_PAGE_BREAK_RIGHT 4
|
||||
|
||||
#define NS_STYLE_COLUMN_FILL_AUTO 0
|
||||
#define NS_STYLE_COLUMN_FILL_BALANCE 1
|
||||
|
||||
#define NS_STYLE_COLUMN_SPAN_NONE 0
|
||||
#define NS_STYLE_COLUMN_SPAN_ALL 1
|
||||
|
||||
|
|
|
@ -759,7 +759,6 @@ nsStyleColumn::nsStyleColumn(const nsPresContext* aContext)
|
|||
: mColumnWidth(eStyleUnit_Auto)
|
||||
, mColumnRuleColor(StyleComplexColor::CurrentColor())
|
||||
, mColumnRuleStyle(NS_STYLE_BORDER_STYLE_NONE)
|
||||
, mColumnFill(NS_STYLE_COLUMN_FILL_BALANCE)
|
||||
, mColumnSpan(NS_STYLE_COLUMN_SPAN_NONE)
|
||||
, mColumnRuleWidth((StaticPresData::Get()
|
||||
->GetBorderWidthTable())[NS_STYLE_BORDER_WIDTH_MEDIUM])
|
||||
|
|
|
@ -2818,7 +2818,7 @@ struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsStyleColumn
|
|||
|
||||
mozilla::StyleComplexColor mColumnRuleColor;
|
||||
uint8_t mColumnRuleStyle; // NS_STYLE_BORDER_STYLE_*
|
||||
uint8_t mColumnFill; // NS_STYLE_COLUMN_FILL_*
|
||||
mozilla::StyleColumnFill mColumnFill = mozilla::StyleColumnFill::Balance;
|
||||
uint8_t mColumnSpan; // NS_STYLE_COLUMN_SPAN_*
|
||||
|
||||
void SetColumnRuleWidth(nscoord aWidth) {
|
||||
|
|
|
@ -33,6 +33,7 @@ ${helpers.predefined_type(
|
|||
|
||||
${helpers.single_keyword("column-fill", "balance auto", extra_prefixes="moz",
|
||||
products="gecko", animation_value_type="discrete",
|
||||
gecko_enum_prefix="StyleColumnFill",
|
||||
spec="https://drafts.csswg.org/css-multicol/#propdef-column-fill")}
|
||||
|
||||
${helpers.predefined_type("column-rule-width",
|
||||
|
|
Загрузка…
Ссылка в новой задаче