mirror of
https://github.com/servo/servo.git
synced 2025-08-09 07:25:35 +01:00
Implements bitflags properties animatable
This commit is contained in:
parent
969047bb7c
commit
21b7b256c2
6 changed files with 97 additions and 92 deletions
|
@ -137,10 +137,6 @@ impl AlignJustifyContent {
|
|||
AlignJustifyContent(flags.bits() as u16 | ((fallback.bits() as u16) << ALIGN_ALL_SHIFT))
|
||||
}
|
||||
|
||||
/// The combined 16-bit flags, for copying into a Gecko style struct.
|
||||
#[inline]
|
||||
pub fn bits(self) -> u16 { self.0 }
|
||||
|
||||
/// The primary alignment
|
||||
#[inline]
|
||||
pub fn primary(self) -> AlignFlags {
|
||||
|
@ -325,6 +321,20 @@ impl Parse for JustifyItems {
|
|||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "gecko")]
|
||||
impl From<u16> for AlignJustifyContent {
|
||||
fn from(bits: u16) -> AlignJustifyContent {
|
||||
AlignJustifyContent(bits)
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "gecko")]
|
||||
impl From<AlignJustifyContent> for u16 {
|
||||
fn from(v: AlignJustifyContent) -> u16 {
|
||||
v.0
|
||||
}
|
||||
}
|
||||
|
||||
// auto | normal | stretch | <baseline-position>
|
||||
fn parse_auto_normal_stretch_baseline(input: &mut Parser) -> Result<AlignFlags, ()> {
|
||||
if let Ok(baseline) = input.try(parse_baseline) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue