mirror of
https://github.com/servo/servo.git
synced 2025-08-05 21:50:18 +01:00
Derive ToCss for DeclaredValue
This commit is contained in:
parent
1937f594ac
commit
886554dba5
1 changed files with 1 additions and 14 deletions
|
@ -1308,7 +1308,7 @@ impl ShorthandId {
|
||||||
|
|
||||||
/// Servo's representation of a declared value for a given `T`, which is the
|
/// Servo's representation of a declared value for a given `T`, which is the
|
||||||
/// declared value for that property.
|
/// declared value for that property.
|
||||||
#[derive(Clone, Debug, Eq, PartialEq)]
|
#[derive(Clone, Debug, Eq, PartialEq, ToCss)]
|
||||||
pub enum DeclaredValue<'a, T: 'a> {
|
pub enum DeclaredValue<'a, T: 'a> {
|
||||||
/// A known specified value from the stylesheet.
|
/// A known specified value from the stylesheet.
|
||||||
Value(&'a T),
|
Value(&'a T),
|
||||||
|
@ -1438,19 +1438,6 @@ impl UnparsedValue {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'a, T: ToCss> ToCss for DeclaredValue<'a, T> {
|
|
||||||
fn to_css<W>(&self, dest: &mut CssWriter<W>) -> fmt::Result
|
|
||||||
where
|
|
||||||
W: Write,
|
|
||||||
{
|
|
||||||
match *self {
|
|
||||||
DeclaredValue::Value(ref inner) => inner.to_css(dest),
|
|
||||||
DeclaredValue::WithVariables(ref with_variables) => with_variables.to_css(dest),
|
|
||||||
DeclaredValue::CSSWideKeyword(ref keyword) => keyword.to_css(dest),
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// An identifier for a given property declaration, which can be either a
|
/// An identifier for a given property declaration, which can be either a
|
||||||
/// longhand or a custom property.
|
/// longhand or a custom property.
|
||||||
#[derive(Clone, Copy, PartialEq)]
|
#[derive(Clone, Copy, PartialEq)]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue