Auto merge of #14851 - hiikezoe:float-iteration-count-rebased, r=emilio

animation-iteration-count property is a number instead of integer.

<!-- Please describe your changes on the following line: -->
This is a revised PR  for #14732.
@emilio?
---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors

<!-- Either: -->
- [X] There are tests for these changes

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/14851)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2017-01-05 03:44:20 -08:00 committed by GitHub
commit 1d9bbfa07b
4 changed files with 31 additions and 8 deletions

View file

@ -828,10 +828,11 @@ ${helpers.single_keyword("overflow-x", "visible hidden scroll auto",
pub use self::AnimationIterationCount as SingleComputedValue;
// https://drafts.csswg.org/css-animations/#animation-iteration-count
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
pub enum AnimationIterationCount {
Number(u32),
Number(f32),
Infinite,
}
@ -841,12 +842,12 @@ ${helpers.single_keyword("overflow-x", "visible hidden scroll auto",
return Ok(AnimationIterationCount::Infinite)
}
let number = try!(input.expect_integer());
if number < 0 {
let number = try!(input.expect_number());
if number < 0.0 {
return Err(());
}
Ok(AnimationIterationCount::Number(number as u32))
Ok(AnimationIterationCount::Number(number))
}
}
@ -886,7 +887,7 @@ ${helpers.single_keyword("overflow-x", "visible hidden scroll auto",
#[inline]
pub fn get_initial_single_value() -> AnimationIterationCount {
AnimationIterationCount::Number(1)
AnimationIterationCount::Number(1.0)
}
#[inline]