mirror of
https://github.com/servo/servo.git
synced 2025-06-29 03:23:41 +01:00
style: Use derive(Parse) for X and Y.
This commit is contained in:
parent
4abd1dc819
commit
8fbdbc8f95
1 changed files with 12 additions and 8 deletions
|
@ -42,17 +42,21 @@ pub enum PositionComponent<S> {
|
|||
Side(S, Option<LengthOrPercentage>),
|
||||
}
|
||||
|
||||
define_css_keyword_enum! { X:
|
||||
"left" => Left,
|
||||
"right" => Right,
|
||||
/// A keyword for the X direction.
|
||||
#[derive(Clone, Copy, Debug, Eq, Hash, MallocSizeOf, Parse, PartialEq, ToComputedValue, ToCss)]
|
||||
#[allow(missing_docs)]
|
||||
pub enum X {
|
||||
Left,
|
||||
Right,
|
||||
}
|
||||
add_impls_for_keyword_enum!(X);
|
||||
|
||||
define_css_keyword_enum! { Y:
|
||||
"top" => Top,
|
||||
"bottom" => Bottom,
|
||||
/// A keyword for the Y direction.
|
||||
#[derive(Clone, Copy, Debug, Eq, Hash, MallocSizeOf, Parse, PartialEq, ToComputedValue, ToCss)]
|
||||
#[allow(missing_docs)]
|
||||
pub enum Y {
|
||||
Top,
|
||||
Bottom,
|
||||
}
|
||||
add_impls_for_keyword_enum!(Y);
|
||||
|
||||
impl Parse for Position {
|
||||
fn parse<'i, 't>(context: &ParserContext, input: &mut Parser<'i, 't>) -> Result<Self, ParseError<'i>> {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue