style: Use static const class variable to represent column-count: auto.

NS_STYLE_COLUMN_COUNT_UNLIMITED is unused, so I remove it.

Bug: 1477533
Reviewed-by: heycam
MozReview-Commit-ID: HLHLn9ZbkUY
This commit is contained in:
Ting-Yu Lin 2018-07-20 17:09:31 -07:00 committed by Emilio Cobos Álvarez
parent 77f47eea34
commit 9f5237b87c
No known key found for this signature in database
GPG key ID: 056B727BB9C1027C

View file

@ -5379,21 +5379,21 @@ clip-path
#[allow(unused_unsafe)] #[allow(unused_unsafe)]
pub fn set_column_count(&mut self, v: longhands::column_count::computed_value::T) { pub fn set_column_count(&mut self, v: longhands::column_count::computed_value::T) {
use gecko_bindings::structs::{NS_STYLE_COLUMN_COUNT_AUTO, nsStyleColumn_kMaxColumnCount}; use gecko_bindings::structs::{nsStyleColumn_kColumnCountAuto, nsStyleColumn_kMaxColumnCount};
self.gecko.mColumnCount = match v { self.gecko.mColumnCount = match v {
ColumnCount::Integer(integer) => { ColumnCount::Integer(integer) => {
cmp::min(integer.0 as u32, unsafe { nsStyleColumn_kMaxColumnCount }) cmp::min(integer.0 as u32, unsafe { nsStyleColumn_kMaxColumnCount })
}, },
ColumnCount::Auto => NS_STYLE_COLUMN_COUNT_AUTO ColumnCount::Auto => nsStyleColumn_kColumnCountAuto
}; };
} }
${impl_simple_copy('column_count', 'mColumnCount')} ${impl_simple_copy('column_count', 'mColumnCount')}
pub fn clone_column_count(&self) -> longhands::column_count::computed_value::T { pub fn clone_column_count(&self) -> longhands::column_count::computed_value::T {
use gecko_bindings::structs::{NS_STYLE_COLUMN_COUNT_AUTO, nsStyleColumn_kMaxColumnCount}; use gecko_bindings::structs::{nsStyleColumn_kColumnCountAuto, nsStyleColumn_kMaxColumnCount};
if self.gecko.mColumnCount != NS_STYLE_COLUMN_COUNT_AUTO { if self.gecko.mColumnCount != nsStyleColumn_kColumnCountAuto {
debug_assert!(self.gecko.mColumnCount >= 1 && debug_assert!(self.gecko.mColumnCount >= 1 &&
self.gecko.mColumnCount <= nsStyleColumn_kMaxColumnCount); self.gecko.mColumnCount <= nsStyleColumn_kMaxColumnCount);
ColumnCount::Integer((self.gecko.mColumnCount as i32).into()) ColumnCount::Integer((self.gecko.mColumnCount as i32).into())