mirror of
https://github.com/servo/servo.git
synced 2025-08-05 13:40:08 +01:00
style: Use rust types for vertical-align.
The previous commit removed the dependence on the discriminant value, so we don't need to keep discriminants different from text-align anymore. Differential Revision: https://phabricator.services.mozilla.com/D29361
This commit is contained in:
parent
8123007717
commit
c990c9623d
5 changed files with 43 additions and 102 deletions
|
@ -10,7 +10,7 @@ use crate::properties::{LonghandId, PropertyDeclarationId, PropertyFlags};
|
|||
use crate::properties::{PropertyId, ShorthandId};
|
||||
use crate::values::generics::box_::AnimationIterationCount as GenericAnimationIterationCount;
|
||||
use crate::values::generics::box_::Perspective as GenericPerspective;
|
||||
use crate::values::generics::box_::VerticalAlign as GenericVerticalAlign;
|
||||
use crate::values::generics::box_::{GenericVerticalAlign, VerticalAlignKeyword};
|
||||
use crate::values::specified::length::{LengthPercentage, NonNegativeLength};
|
||||
use crate::values::specified::{AllowQuirks, Number};
|
||||
use crate::values::{CustomIdent, KeyframesName};
|
||||
|
@ -280,20 +280,7 @@ impl Parse for VerticalAlign {
|
|||
return Ok(GenericVerticalAlign::Length(lp));
|
||||
}
|
||||
|
||||
try_match_ident_ignore_ascii_case! { input,
|
||||
"baseline" => Ok(GenericVerticalAlign::Baseline),
|
||||
"sub" => Ok(GenericVerticalAlign::Sub),
|
||||
"super" => Ok(GenericVerticalAlign::Super),
|
||||
"top" => Ok(GenericVerticalAlign::Top),
|
||||
"text-top" => Ok(GenericVerticalAlign::TextTop),
|
||||
"middle" => Ok(GenericVerticalAlign::Middle),
|
||||
"bottom" => Ok(GenericVerticalAlign::Bottom),
|
||||
"text-bottom" => Ok(GenericVerticalAlign::TextBottom),
|
||||
#[cfg(feature = "gecko")]
|
||||
"-moz-middle-with-baseline" => {
|
||||
Ok(GenericVerticalAlign::MozMiddleWithBaseline)
|
||||
},
|
||||
}
|
||||
Ok(GenericVerticalAlign::Keyword(VerticalAlignKeyword::parse(input)?))
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -563,8 +563,7 @@ pub enum TextAlignKeyword {
|
|||
}
|
||||
|
||||
/// Specified value of text-align property.
|
||||
#[cfg_attr(feature = "gecko", derive(MallocSizeOf))]
|
||||
#[derive(Clone, Copy, Debug, Eq, Hash, Parse, PartialEq, SpecifiedValueInfo, ToCss, ToShmem)]
|
||||
#[derive(Clone, Copy, Debug, Eq, Hash, MallocSizeOf, Parse, PartialEq, SpecifiedValueInfo, ToCss, ToShmem)]
|
||||
pub enum TextAlign {
|
||||
/// Keyword value of text-align property.
|
||||
Keyword(TextAlignKeyword),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue