Auto merge of #15175 - BorisChiou:animation/interpolate_and_cascade, r=heycam

Interpolate servo animation values and add them to the cascade

These are the servo-side changes for [bug 1317209](https://bugzilla.mozilla.org/show_bug.cgi?id=1317209). @Manishearth, @emilio, and @heycam have already reviewed them there. Please merge these patches until the gecko-side changes for [bug 1317209](https://bugzilla.mozilla.org/show_bug.cgi?id=1317209) is landed.

---
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix [bug 1317209](https://bugzilla.mozilla.org/show_bug.cgi?id=1317209).
- [X] These changes do not require tests because there are existing tests for this in mozilla-central

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/15175)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2017-01-25 23:36:33 -08:00 committed by GitHub
commit e4a1cb6f87
9 changed files with 133 additions and 7 deletions

View file

@ -3,11 +3,13 @@
pub use nsstring::{nsACString, nsAString};
type nsACString_internal = nsACString;
type nsAString_internal = nsAString;
use gecko_bindings::structs::EffectCompositor_CascadeLevel;
use gecko_bindings::structs::RawGeckoDocument;
use gecko_bindings::structs::RawGeckoElement;
use gecko_bindings::structs::RawGeckoNode;
use gecko_bindings::structs::RawGeckoAnimationValueList;
use gecko_bindings::structs::RawServoAnimationValue;
use gecko_bindings::structs::RawServoAnimationValueBorrowedList;
use gecko_bindings::structs::RawGeckoPresContext;
use gecko_bindings::structs::RawGeckoPresContextOwned;
use gecko_bindings::structs::ThreadSafeURIHolder;
@ -224,6 +226,8 @@ pub type RawGeckoAnimationValueListBorrowed<'a> = &'a RawGeckoAnimationValueList
pub type RawGeckoAnimationValueListBorrowedOrNull<'a> = Option<&'a RawGeckoAnimationValueList>;
pub type RawGeckoAnimationValueListBorrowedMut<'a> = &'a mut RawGeckoAnimationValueList;
pub type RawGeckoAnimationValueListBorrowedMutOrNull<'a> = Option<&'a mut RawGeckoAnimationValueList>;
pub type RawServoAnimationValueBorrowedListBorrowed<'a> = &'a RawServoAnimationValueBorrowedList;
pub type RawServoAnimationValueBorrowedListBorrowedOrNull<'a> = Option<&'a RawServoAnimationValueBorrowedList>;
extern "C" {
pub fn Gecko_EnsureTArrayCapacity(aArray: *mut ::std::os::raw::c_void,
@ -498,6 +502,12 @@ extern "C" {
pub fn Gecko_GetServoDeclarationBlock(element: RawGeckoElementBorrowed)
-> RawServoDeclarationBlockStrongBorrowedOrNull;
}
extern "C" {
pub fn Gecko_GetAnimationRule(element: RawGeckoElementBorrowed,
aAtom: *mut nsIAtom,
aCascadeLevel: EffectCompositor_CascadeLevel)
-> RawServoDeclarationBlockStrong;
}
extern "C" {
pub fn Gecko_Atomize(aString: *const ::std::os::raw::c_char, aLength: u32)
-> *mut nsIAtom;
@ -1217,6 +1227,16 @@ extern "C" {
ServoComputedValuesBorrowed)
-> ServoComputedValuesStrong;
}
extern "C" {
pub fn Servo_AnimationValues_Interpolate(from: RawServoAnimationValueBorrowed,
to: RawServoAnimationValueBorrowed,
progress: f64)
-> RawServoAnimationValueStrong;
}
extern "C" {
pub fn Servo_AnimationValues_Uncompute(value: RawServoAnimationValueBorrowedListBorrowed)
-> RawServoDeclarationBlockStrong;
}
extern "C" {
pub fn Servo_AnimationValues_Populate(arg1:
RawGeckoAnimationValueListBorrowedMut,

View file

@ -5273,6 +5273,12 @@ pub mod root {
impl Clone for StyleComplexColor {
fn clone(&self) -> Self { *self }
}
#[repr(u32)]
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub enum EffectCompositor_CascadeLevel {
Animations = 0,
Transitions = 1,
}
#[repr(C)]
#[derive(Debug)]
pub struct PropertyStyleAnimationValuePair {
@ -17953,6 +17959,10 @@ pub mod root {
pub type RawGeckoPresContextBorrowedMut = *mut root::RawGeckoPresContext;
pub type RawGeckoAnimationValueListBorrowedMut =
*mut root::RawGeckoAnimationValueList;
pub type RawServoAnimationValueBorrowedList =
root::nsTArray<*const root::RawServoAnimationValue>;
pub type RawServoAnimationValueBorrowedListBorrowed =
*const root::RawServoAnimationValueBorrowedList;
#[repr(u32)]
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub enum nsCSSTokenSerializationType {

View file

@ -5191,6 +5191,12 @@ pub mod root {
impl Clone for StyleComplexColor {
fn clone(&self) -> Self { *self }
}
#[repr(u32)]
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub enum EffectCompositor_CascadeLevel {
Animations = 0,
Transitions = 1,
}
#[repr(C)]
#[derive(Debug)]
pub struct PropertyStyleAnimationValuePair {
@ -17726,6 +17732,10 @@ pub mod root {
pub type RawGeckoPresContextBorrowedMut = *mut root::RawGeckoPresContext;
pub type RawGeckoAnimationValueListBorrowedMut =
*mut root::RawGeckoAnimationValueList;
pub type RawServoAnimationValueBorrowedList =
root::nsTArray<*const root::RawServoAnimationValue>;
pub type RawServoAnimationValueBorrowedListBorrowed =
*const root::RawServoAnimationValueBorrowedList;
#[repr(u32)]
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub enum nsCSSTokenSerializationType {