style: Use the same computed time representation between Servo and Gecko

Same as above.

Differential Revision: https://phabricator.services.mozilla.com/D167126
This commit is contained in:
Emilio Cobos Álvarez 2023-01-19 10:06:38 +00:00 committed by Martin Robinson
parent b96f8f748c
commit fe8cdbe328
3 changed files with 14 additions and 13 deletions

View file

@ -11,6 +11,7 @@ use style_traits::{CssWriter, ToCss};
/// A computed `<time>` value.
#[derive(Clone, Copy, Debug, MallocSizeOf, PartialEq, PartialOrd, ToResolvedValue)]
#[cfg_attr(feature = "servo", derive(Deserialize, Serialize))]
#[repr(C)]
pub struct Time {
seconds: CSSFloat,
}
@ -18,7 +19,7 @@ pub struct Time {
impl Time {
/// Creates a time value from a seconds amount.
pub fn from_seconds(seconds: CSSFloat) -> Self {
Time { seconds: seconds }
Time { seconds }
}
/// Returns `0s`.