animation.rs (854B)
1 /* This Source Code Form is subject to the terms of the Mozilla Public 2 * License, v. 2.0. If a copy of the MPL was not distributed with this 3 * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ 4 5 use parsing::parse; 6 use style::parser::Parse; 7 use style::properties::longhands::animation_name; 8 use style::values::specified::AnimationIterationCount; 9 use style::values::{CustomIdent, KeyframesName}; 10 use style_traits::ToCss; 11 use stylo_atoms::Atom; 12 13 #[test] 14 fn test_animation_iteration() { 15 assert_roundtrip_with_context!(AnimationIterationCount::parse, "0", "0"); 16 assert_roundtrip_with_context!(AnimationIterationCount::parse, "0.1", "0.1"); 17 assert_roundtrip_with_context!(AnimationIterationCount::parse, "infinite", "infinite"); 18 19 // Negative numbers are invalid 20 assert!(parse(AnimationIterationCount::parse, "-1").is_err()); 21 }