style: Atomize animation names.

This commit is contained in:
Emilio Cobos Álvarez 2016-06-19 16:51:02 +02:00
parent 0077eb147c
commit 5b27e46d04
No known key found for this signature in database
GPG key ID: 056B727BB9C1027C
4 changed files with 12 additions and 9 deletions

View file

@ -69,7 +69,7 @@ pub enum CSSRule<Impl: SelectorImpl> {
#[derive(Debug, HeapSizeOf, PartialEq)]
pub struct KeyframesRule {
pub name: String,
pub name: Atom,
pub keyframes: Vec<Keyframe>,
}
@ -405,7 +405,7 @@ enum AtRulePrelude {
/// A @viewport rule prelude.
Viewport,
/// A @keyframes rule, with its animation name.
Keyframes(String),
Keyframes(Atom),
}
@ -507,7 +507,7 @@ impl<'a, 'b, Impl: SelectorImpl> AtRuleParser for NestedRuleParser<'a, 'b, Impl>
},
"keyframes" => {
let name = try!(input.expect_ident());
Ok(AtRuleType::WithBlock(AtRulePrelude::Keyframes(name.into_owned())))
Ok(AtRuleType::WithBlock(AtRulePrelude::Keyframes(Atom::from(name))))
},
_ => Err(())
}