mirror of
https://github.com/servo/servo.git
synced 2025-08-05 05:30:08 +01:00
Derive ToCss for KeyframeSelector
This commit is contained in:
parent
be820092ad
commit
6e19fe6a8f
1 changed files with 2 additions and 16 deletions
|
@ -145,24 +145,10 @@ impl KeyframePercentage {
|
|||
|
||||
/// A keyframes selector is a list of percentages or from/to symbols, which are
|
||||
/// converted at parse time to percentages.
|
||||
#[derive(Clone, Debug, Eq, PartialEq)]
|
||||
#[css(comma, iterable)]
|
||||
#[derive(Clone, Debug, Eq, PartialEq, ToCss)]
|
||||
pub struct KeyframeSelector(Vec<KeyframePercentage>);
|
||||
|
||||
impl ToCss for KeyframeSelector {
|
||||
fn to_css<W>(&self, dest: &mut CssWriter<W>) -> fmt::Result
|
||||
where
|
||||
W: Write,
|
||||
{
|
||||
let mut iter = self.0.iter();
|
||||
iter.next().unwrap().to_css(dest)?;
|
||||
for percentage in iter {
|
||||
dest.write_str(", ")?;
|
||||
percentage.to_css(dest)?;
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
||||
impl KeyframeSelector {
|
||||
/// Return the list of percentages this selector contains.
|
||||
#[inline]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue