style: Remove HasArcFFI for AnimationValue

See previous patches for context.

Differential Revision: https://phabricator.services.mozilla.com/D177622
This commit is contained in:
Emilio Cobos Álvarez 2023-05-11 08:25:36 +00:00 committed by Martin Robinson
parent 779aa9d30e
commit 9370172552
3 changed files with 56 additions and 71 deletions

View file

@ -10,12 +10,12 @@
use crate::gecko::url::CssUrlData;
use crate::gecko_bindings::structs::{
RawServoAnimationValue, RawServoContainerRule, RawServoCounterStyleRule,
RawServoDeclarationBlock, RawServoFontFaceRule, RawServoFontFeatureValuesRule,
RawServoFontPaletteValuesRule, RawServoImportRule, RawServoKeyframe, RawServoKeyframesRule,
RawServoLayerBlockRule, RawServoLayerStatementRule, RawServoMediaList, RawServoMediaRule,
RawServoMozDocumentRule, RawServoNamespaceRule, RawServoPageRule, RawServoStyleRule,
RawServoSupportsRule, ServoCssRules,
RawServoContainerRule, RawServoCounterStyleRule, RawServoDeclarationBlock,
RawServoFontFaceRule, RawServoFontFeatureValuesRule, RawServoFontPaletteValuesRule,
RawServoImportRule, RawServoKeyframe, RawServoKeyframesRule, RawServoLayerBlockRule,
RawServoLayerStatementRule, RawServoMediaList, RawServoMediaRule, RawServoMozDocumentRule,
RawServoNamespaceRule, RawServoPageRule, RawServoStyleRule, RawServoSupportsRule,
ServoCssRules,
};
use crate::gecko_bindings::sugar::ownership::HasArcFFI;
use crate::media_queries::MediaList;
@ -60,9 +60,6 @@ impl_arc_ffi!(Locked<StyleRule> => RawServoStyleRule
impl_arc_ffi!(Locked<ImportRule> => RawServoImportRule
[Servo_ImportRule_AddRef, Servo_ImportRule_Release]);
impl_arc_ffi!(AnimationValue => RawServoAnimationValue
[Servo_AnimationValue_AddRef, Servo_AnimationValue_Release]);
impl_arc_ffi!(Locked<Keyframe> => RawServoKeyframe
[Servo_Keyframe_AddRef, Servo_Keyframe_Release]);
@ -137,3 +134,8 @@ impl_simple_arc_ffi!(
Servo_ComputedStyle_AddRef,
Servo_ComputedStyle_Release
);
impl_simple_arc_ffi!(
AnimationValue,
Servo_AnimationValue_AddRef,
Servo_AnimationValue_Release
);

View file

@ -825,14 +825,12 @@ impl<'le> GeckoElement<'le> {
let mut map = FxHashMap::with_capacity_and_hasher(collection_length, Default::default());
for i in 0..collection_length {
let raw_end_value = unsafe { Gecko_ElementTransitions_EndValueAt(self.0, i).as_ref() };
let end_value = AnimationValue::arc_from_borrowed(&raw_end_value)
.expect("AnimationValue not found in ElementTransitions");
let end_value = unsafe {
Arc::from_raw_addrefed(Gecko_ElementTransitions_EndValueAt(self.0, i))
};
let property = end_value.id();
debug_assert!(!property.is_logical());
map.insert(property, end_value.clone_arc());
map.insert(property, end_value);
}
map
}