Use CustomIdent for transition-property

This commit is contained in:
Anthony Ramine 2017-06-15 11:45:05 +02:00
parent cdcc8157c6
commit 51a4481388
3 changed files with 31 additions and 32 deletions

View file

@ -7,6 +7,7 @@ use servo_atoms::Atom;
use style::properties::animated_properties::TransitionProperty;
use style::properties::longhands::transition_property;
use style::properties::shorthands::transition;
use style::values::CustomIdent;
use style_traits::ToCss;
#[test]
@ -19,12 +20,15 @@ fn test_longhand_properties() {
assert_roundtrip_with_context!(transition_property::parse, "-other-unsupported-property");
assert_roundtrip_with_context!(transition_property::parse, "--var");
assert_eq!(parse_longhand!(transition_property, "margin-left, transition-delay, width, --var"),
transition_property::SpecifiedValue(
vec![TransitionProperty::MarginLeft,
TransitionProperty::Unsupported(Atom::from("transition-delay")),
TransitionProperty::Width,
TransitionProperty::Unsupported(Atom::from("--var"))]));
assert_eq!(
parse_longhand!(transition_property, "margin-left, transition-delay, width, --var"),
transition_property::SpecifiedValue(vec![
TransitionProperty::MarginLeft,
TransitionProperty::Unsupported(CustomIdent(Atom::from("transition-delay"))),
TransitionProperty::Width,
TransitionProperty::Unsupported(CustomIdent(Atom::from("--var"))),
])
);
assert!(parse(transition_property::parse, ".width").is_err());
assert!(parse(transition_property::parse, "1width").is_err());