Make animation-name parse none

This commit is contained in:
Xidorn Quan 2017-03-06 22:00:04 +11:00
parent 4bc0cac395
commit 6273fa0305
6 changed files with 53 additions and 12 deletions

View file

@ -5,11 +5,27 @@
use cssparser::Parser;
use media_queries::CSSErrorReporterTest;
use parsing::parse;
use servo_atoms::Atom;
use style::parser::{Parse, ParserContext};
use style::properties::longhands::animation_iteration_count::single_value::computed_value::T as AnimationIterationCount;
use style::properties::longhands::animation_name;
use style::stylesheets::Origin;
use style_traits::ToCss;
#[test]
fn test_animation_name() {
use self::animation_name::single_value::SpecifiedValue as SingleValue;
let other_name = Atom::from("other-name");
assert_eq!(parse_longhand!(animation_name, "none"),
animation_name::SpecifiedValue(vec![SingleValue(atom!(""))]));
assert_eq!(parse_longhand!(animation_name, "other-name, none, 'other-name', \"other-name\""),
animation_name::SpecifiedValue(
vec![SingleValue(other_name.clone()),
SingleValue(atom!("")),
SingleValue(other_name.clone()),
SingleValue(other_name.clone())]));
}
#[test]
fn test_animation_iteration() {
assert_roundtrip_with_context!(AnimationIterationCount::parse, "0", "0");