style: Refactor the @keyframes parsing and add adequate computation for it.

This commit is contained in:
Emilio Cobos Álvarez 2016-06-18 15:04:16 +02:00
parent 6a362ae8e8
commit 058bfb39ae
No known key found for this signature in database
GPG key ID: 056B727BB9C1027C
4 changed files with 103 additions and 43 deletions

View file

@ -156,24 +156,18 @@ fn test_parse_stylesheet() {
Keyframe {
selector: KeyframeSelector::new_for_unit_testing(
vec![KeyframePercentage::new(0.)]),
declarations: PropertyDeclarationBlock {
normal: Arc::new(vec![
PropertyDeclaration::Width(DeclaredValue::Value(
LengthOrPercentageOrAuto::Percentage(Percentage(0.)))),
]),
important: Arc::new(vec![]),
}
declarations: Arc::new(vec![
PropertyDeclaration::Width(DeclaredValue::Value(
LengthOrPercentageOrAuto::Percentage(Percentage(0.)))),
]),
},
Keyframe {
selector: KeyframeSelector::new_for_unit_testing(
vec![KeyframePercentage::new(1.)]),
declarations: PropertyDeclarationBlock {
normal: Arc::new(vec![
PropertyDeclaration::Width(DeclaredValue::Value(
LengthOrPercentageOrAuto::Percentage(Percentage(1.)))),
]),
important: Arc::new(vec![]),
}
declarations: Arc::new(vec![
PropertyDeclaration::Width(DeclaredValue::Value(
LengthOrPercentageOrAuto::Percentage(Percentage(1.)))),
]),
},
]
})