mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
Use boolean instead of float to avoid nightly warning
This commit is contained in:
parent
a42df6dd30
commit
7f1794bb5c
1 changed files with 10 additions and 9 deletions
|
@ -2197,16 +2197,18 @@ fn append_computed_property_value(keyframe: *mut structs::Keyframe,
|
|||
}
|
||||
}
|
||||
|
||||
enum Offset {
|
||||
Zero,
|
||||
One
|
||||
}
|
||||
|
||||
fn fill_in_missing_keyframe_values(all_properties: &[TransitionProperty],
|
||||
timing_function: nsTimingFunctionBorrowed,
|
||||
style: &ComputedValues,
|
||||
properties_set_at_offset: &LonghandIdSet,
|
||||
offset: f32,
|
||||
offset: Offset,
|
||||
keyframes: RawGeckoKeyframeListBorrowedMut,
|
||||
shared_lock: &SharedRwLock) {
|
||||
debug_assert!(offset == 0. || offset == 1.,
|
||||
"offset should be 0. or 1.");
|
||||
|
||||
let needs_filling = all_properties.iter().any(|ref property| {
|
||||
!properties_set_at_offset.has_transition_property_bit(property)
|
||||
});
|
||||
|
@ -2217,13 +2219,12 @@ fn fill_in_missing_keyframe_values(all_properties: &[TransitionProperty],
|
|||
}
|
||||
|
||||
let keyframe = match offset {
|
||||
0. => unsafe {
|
||||
Offset::Zero => unsafe {
|
||||
Gecko_GetOrCreateInitialKeyframe(keyframes, timing_function)
|
||||
},
|
||||
1. => unsafe {
|
||||
Offset::One => unsafe {
|
||||
Gecko_GetOrCreateFinalKeyframe(keyframes, timing_function)
|
||||
},
|
||||
_ => unreachable!("offset should be 0. or 1."),
|
||||
};
|
||||
|
||||
// Append properties that have not been set at this offset.
|
||||
|
@ -2352,7 +2353,7 @@ pub extern "C" fn Servo_StyleSet_GetKeyframesForName(raw_data: RawServoStyleSetB
|
|||
inherited_timing_function,
|
||||
style,
|
||||
&properties_set_at_start,
|
||||
0.,
|
||||
Offset::Zero,
|
||||
keyframes,
|
||||
&global_style_data.shared_lock);
|
||||
}
|
||||
|
@ -2361,7 +2362,7 @@ pub extern "C" fn Servo_StyleSet_GetKeyframesForName(raw_data: RawServoStyleSetB
|
|||
inherited_timing_function,
|
||||
style,
|
||||
&properties_set_at_end,
|
||||
1.,
|
||||
Offset::One,
|
||||
keyframes,
|
||||
&global_style_data.shared_lock);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue