mirror of
https://github.com/servo/servo.git
synced 2025-07-19 05:13:55 +01:00
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:
parent
77f47eea34
commit
9f5237b87c
1 changed files with 4 additions and 4 deletions
|
@ -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())
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue