diff options
Diffstat (limited to 'ports/geckolib/glue.rs')
-rw-r--r-- | ports/geckolib/glue.rs | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/ports/geckolib/glue.rs b/ports/geckolib/glue.rs index ccdd19b1bf6..69ea011a979 100644 --- a/ports/geckolib/glue.rs +++ b/ports/geckolib/glue.rs @@ -3552,6 +3552,8 @@ pub extern "C" fn Servo_StyleSet_GetKeyframesForName(raw_data: RawServoStyleSetB name: *const nsACString, inherited_timing_function: nsTimingFunctionBorrowed, keyframes: RawGeckoKeyframeListBorrowedMut) -> bool { + use smallvec::SmallVec; + debug_assert!(keyframes.len() == 0, "keyframes should be initially empty"); @@ -3623,6 +3625,25 @@ pub extern "C" fn Servo_StyleSet_GetKeyframesForName(raw_data: RawServoStyleSetB guard.normal_declaration_iter() .filter(|declaration| declaration.is_animatable()); + let custom_properties: SmallVec<[&PropertyDeclaration; 1]> = + guard.normal_declaration_iter() + .filter(|declaration| declaration.is_custom()) + .collect(); + + if custom_properties.len() > 0 { + let mut pdb = PropertyDeclarationBlock::new(); + for custom in custom_properties.iter() { + pdb.push((*custom).clone(), Importance::Normal); + } + unsafe { + let pair = + Gecko_AppendPropertyValuePair(&mut (*keyframe).mPropertyValues, + nsCSSPropertyID::eCSSPropertyExtra_variable); + (*pair).mServoDeclarationBlock.set_arc_leaky( + Arc::new(global_style_data.shared_lock.wrap(pdb))); + } + } + for declaration in animatable { let property = AnimatableLonghand::from_declaration(declaration).unwrap(); // Skip the 'display' property because although it is animatable from SMIL, |