constant: Add support for associated constant expressions.
These are useful for bitflags.
This commit is contained in:
@@ -2,7 +2,7 @@ bitflags! {
|
||||
/// Constants shared by multiple CSS Box Alignment properties
|
||||
///
|
||||
/// These constants match Gecko's `NS_STYLE_ALIGN_*` constants.
|
||||
#[derive(MallocSizeOf, ToComputedValue)]
|
||||
#[derive(MallocSizeOf)]
|
||||
#[repr(C)]
|
||||
pub struct AlignFlags: u8 {
|
||||
/// 'auto'
|
||||
@@ -13,8 +13,11 @@ bitflags! {
|
||||
const START = 1 << 1;
|
||||
/// 'end'
|
||||
const END = 1 << 2;
|
||||
const ALIAS = Self::END.bits;
|
||||
/// 'flex-start'
|
||||
const FLEX_START = 1 << 3;
|
||||
const MIXED = 1 << 4 | AlignFlags::FLEX_START.bits | AlignFlags::END.bits;
|
||||
const MIXED_SELF = 1 << 5 | AlignFlags::FLEX_START.bits | AlignFlags::END.bits;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ bitflags! {
|
||||
/// Constants shared by multiple CSS Box Alignment properties
|
||||
///
|
||||
/// These constants match Gecko's `NS_STYLE_ALIGN_*` constants.
|
||||
#[derive(MallocSizeOf, ToComputedValue)]
|
||||
#[derive(MallocSizeOf)]
|
||||
#[repr(C)]
|
||||
pub struct AlignFlags: u8 {
|
||||
/// 'auto'
|
||||
@@ -13,8 +13,11 @@ bitflags! {
|
||||
const START = 1 << 1;
|
||||
/// 'end'
|
||||
const END = 1 << 2;
|
||||
const ALIAS = Self::END.bits;
|
||||
/// 'flex-start'
|
||||
const FLEX_START = 1 << 3;
|
||||
const MIXED = 1 << 4 | AlignFlags::FLEX_START.bits | AlignFlags::END.bits;
|
||||
const MIXED_SELF = 1 << 5 | AlignFlags::FLEX_START.bits | AlignFlags::END.bits;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user