mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Format style component.
This commit is contained in:
parent
31fc6cd565
commit
8dab4d659a
120 changed files with 2207 additions and 1417 deletions
|
@ -92,8 +92,13 @@ where
|
|||
}
|
||||
|
||||
/// Convenience void type to disable some properties and values through types.
|
||||
#[cfg_attr(feature = "servo", derive(Deserialize, MallocSizeOf, Serialize))]
|
||||
#[derive(Clone, Copy, Debug, PartialEq, SpecifiedValueInfo, ToAnimatedValue, ToComputedValue, ToCss)]
|
||||
#[cfg_attr(
|
||||
feature = "servo",
|
||||
derive(Deserialize, MallocSizeOf, Serialize)
|
||||
)]
|
||||
#[derive(
|
||||
Clone, Copy, Debug, PartialEq, SpecifiedValueInfo, ToAnimatedValue, ToComputedValue, ToCss,
|
||||
)]
|
||||
pub enum Impossible {}
|
||||
|
||||
// FIXME(nox): This should be derived but the derive code cannot cope
|
||||
|
@ -115,9 +120,19 @@ impl Parse for Impossible {
|
|||
}
|
||||
|
||||
/// A struct representing one of two kinds of values.
|
||||
#[derive(Animate, Clone, ComputeSquaredDistance, Copy, MallocSizeOf, PartialEq,
|
||||
SpecifiedValueInfo, ToAnimatedValue, ToAnimatedZero, ToComputedValue,
|
||||
ToCss)]
|
||||
#[derive(
|
||||
Animate,
|
||||
Clone,
|
||||
ComputeSquaredDistance,
|
||||
Copy,
|
||||
MallocSizeOf,
|
||||
PartialEq,
|
||||
SpecifiedValueInfo,
|
||||
ToAnimatedValue,
|
||||
ToAnimatedZero,
|
||||
ToComputedValue,
|
||||
ToCss,
|
||||
)]
|
||||
pub enum Either<A, B> {
|
||||
/// The first value.
|
||||
First(A),
|
||||
|
@ -148,8 +163,7 @@ impl<A: Parse, B: Parse> Parse for Either<A, B> {
|
|||
}
|
||||
|
||||
/// <https://drafts.csswg.org/css-values-4/#custom-idents>
|
||||
#[derive(Clone, Debug, Eq, Hash, MallocSizeOf, PartialEq, SpecifiedValueInfo,
|
||||
ToComputedValue)]
|
||||
#[derive(Clone, Debug, Eq, Hash, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToComputedValue)]
|
||||
pub struct CustomIdent(pub Atom);
|
||||
|
||||
impl CustomIdent {
|
||||
|
@ -164,7 +178,9 @@ impl CustomIdent {
|
|||
_ => true
|
||||
};
|
||||
if !valid {
|
||||
return Err(location.new_custom_error(SelectorParseErrorKind::UnexpectedIdent(ident.clone())));
|
||||
return Err(
|
||||
location.new_custom_error(SelectorParseErrorKind::UnexpectedIdent(ident.clone()))
|
||||
);
|
||||
}
|
||||
if excluding.iter().any(|s| ident.eq_ignore_ascii_case(s)) {
|
||||
Err(location.new_custom_error(StyleParseErrorKind::UnspecifiedError))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue