Implement Gecko_StyleAnimationsEquals for checking nsStyleAutoArray<StyleAnimation> equality in servo side.

Later we update CSS animations if this function returns false.
This commit is contained in:
Hiroyuki Ikezoe 2017-03-10 11:07:03 +09:00
parent 95b73b979e
commit d8f08b80e0
5 changed files with 24 additions and 0 deletions

View file

@ -539,6 +539,7 @@ mod bindings {
"RawServoDeclarationBlock",
"RawGeckoPresContext",
"RawGeckoPresContextOwned",
"RawGeckoStyleAnimationList",
"GeckoParserExtraData",
"RefPtr",
"ThreadSafeURIHolder",
@ -636,6 +637,7 @@ mod bindings {
"RawGeckoDocument",
"RawServoDeclarationBlockStrong",
"RawGeckoPresContext",
"RawGeckoStyleAnimationList",
];
let servo_borrow_types = [
"nsCSSValue",

View file

@ -14,6 +14,7 @@ use gecko_bindings::structs::RawServoAnimationValue;
use gecko_bindings::structs::RawServoDeclarationBlock;
use gecko_bindings::structs::RawGeckoPresContext;
use gecko_bindings::structs::RawGeckoPresContextOwned;
use gecko_bindings::structs::RawGeckoStyleAnimationList;
use gecko_bindings::structs::GeckoParserExtraData;
use gecko_bindings::structs::RefPtr;
use gecko_bindings::structs::ThreadSafeURIHolder;
@ -232,6 +233,8 @@ pub type RawServoDeclarationBlockStrongBorrowed<'a> = &'a RawServoDeclarationBlo
pub type RawServoDeclarationBlockStrongBorrowedOrNull<'a> = Option<&'a RawServoDeclarationBlockStrong>;
pub type RawGeckoPresContextBorrowed<'a> = &'a RawGeckoPresContext;
pub type RawGeckoPresContextBorrowedOrNull<'a> = Option<&'a RawGeckoPresContext>;
pub type RawGeckoStyleAnimationListBorrowed<'a> = &'a RawGeckoStyleAnimationList;
pub type RawGeckoStyleAnimationListBorrowedOrNull<'a> = Option<&'a RawGeckoStyleAnimationList>;
pub type nsCSSValueBorrowed<'a> = &'a nsCSSValue;
pub type nsCSSValueBorrowedOrNull<'a> = Option<&'a nsCSSValue>;
pub type nsCSSValueBorrowedMut<'a> = &'a mut nsCSSValue;
@ -531,6 +534,13 @@ extern "C" {
EffectCompositor_CascadeLevel)
-> RawServoDeclarationBlockStrong;
}
extern "C" {
pub fn Gecko_StyleAnimationsEquals(arg1:
RawGeckoStyleAnimationListBorrowed,
arg2:
RawGeckoStyleAnimationListBorrowed)
-> bool;
}
extern "C" {
pub fn Gecko_Atomize(aString: *const ::std::os::raw::c_char, aLength: u32)
-> *mut nsIAtom;

View file

@ -25490,6 +25490,8 @@ pub mod root {
root::nsTArray<root::mozilla::PropertyStyleAnimationValuePair>;
pub type RawServoAnimationValueBorrowedList =
root::nsTArray<*const root::RawServoAnimationValue>;
pub type RawGeckoStyleAnimationList =
root::nsStyleAutoArray<root::mozilla::StyleAnimation>;
pub type RawGeckoNodeBorrowed = *const root::RawGeckoNode;
pub type RawGeckoNodeBorrowedOrNull = *const root::RawGeckoNode;
pub type RawGeckoElementBorrowed = *const root::RawGeckoElement;
@ -25508,6 +25510,8 @@ pub mod root {
pub type RawGeckoKeyframeListBorrowed = *const root::RawGeckoKeyframeList;
pub type RawGeckoComputedKeyframeValuesListBorrowedMut =
*mut root::RawGeckoComputedKeyframeValuesList;
pub type RawGeckoStyleAnimationListBorrowed =
*const root::RawGeckoStyleAnimationList;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct ElementRuleProcessorData([u8; 0]);

View file

@ -24848,6 +24848,8 @@ pub mod root {
root::nsTArray<root::mozilla::PropertyStyleAnimationValuePair>;
pub type RawServoAnimationValueBorrowedList =
root::nsTArray<*const root::RawServoAnimationValue>;
pub type RawGeckoStyleAnimationList =
root::nsStyleAutoArray<root::mozilla::StyleAnimation>;
pub type RawGeckoNodeBorrowed = *const root::RawGeckoNode;
pub type RawGeckoNodeBorrowedOrNull = *const root::RawGeckoNode;
pub type RawGeckoElementBorrowed = *const root::RawGeckoElement;
@ -24866,6 +24868,8 @@ pub mod root {
pub type RawGeckoKeyframeListBorrowed = *const root::RawGeckoKeyframeList;
pub type RawGeckoComputedKeyframeValuesListBorrowedMut =
*mut root::RawGeckoComputedKeyframeValuesList;
pub type RawGeckoStyleAnimationListBorrowed =
*const root::RawGeckoStyleAnimationList;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct ElementRuleProcessorData([u8; 0]);

View file

@ -1801,6 +1801,10 @@ fn static_assert() {
}
${impl_transition_count('property', 'Property')}
pub fn animations_equals(&self, other: &Self) -> bool {
unsafe { bindings::Gecko_StyleAnimationsEquals(&self.gecko.mAnimations, &other.gecko.mAnimations) }
}
pub fn set_animation_name(&mut self, v: longhands::animation_name::computed_value::T) {
use nsstring::nsCString;