mirror of
https://github.com/servo/servo.git
synced 2025-08-07 06:25:32 +01:00
Auto merge of #16381 - BorisChiou:stylo/transition/use_computed_values, r=manishearth
stylo: Bug 1343753 - Use ComputedValues while updating transitions in Gecko These are interdependent patches of Bug 1343753. We want to use ComputedValues and AnimationValues to start/update/stop the transitions. --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [X] `./mach build -d` does not report any errors - [X] `./mach test-tidy` does not report any errors - [X] These changes fix Bug 1343753. - [X] These changes do not require tests because we have tests in Gecko already. <!-- 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/16381) <!-- Reviewable:end -->
This commit is contained in:
commit
e817666859
4 changed files with 77 additions and 0 deletions
|
@ -678,6 +678,7 @@ impl<'le> TElement for GeckoElement<'le> {
|
|||
let atom_ptr = PseudoElement::ns_atom_or_null_from_opt(pseudo);
|
||||
unsafe {
|
||||
Gecko_UpdateAnimations(self.0, atom_ptr,
|
||||
None,
|
||||
computed_values_opt,
|
||||
parent_values_opt,
|
||||
tasks.bits());
|
||||
|
|
|
@ -630,6 +630,8 @@ extern "C" {
|
|||
extern "C" {
|
||||
pub fn Gecko_UpdateAnimations(aElement: RawGeckoElementBorrowed,
|
||||
aPseudoTagOrNull: *mut nsIAtom,
|
||||
aOldComputedValues:
|
||||
ServoComputedValuesBorrowedOrNull,
|
||||
aComputedValues:
|
||||
ServoComputedValuesBorrowedOrNull,
|
||||
aParentComputedValues:
|
||||
|
@ -1684,6 +1686,13 @@ extern "C" {
|
|||
nsCSSPropertyID)
|
||||
-> RawServoAnimationValueStrong;
|
||||
}
|
||||
extern "C" {
|
||||
pub fn Servo_Property_IsAnimatable(property: nsCSSPropertyID) -> bool;
|
||||
}
|
||||
extern "C" {
|
||||
pub fn Servo_Property_IsDiscreteAnimatable(property: nsCSSPropertyID)
|
||||
-> bool;
|
||||
}
|
||||
extern "C" {
|
||||
pub fn Servo_AnimationValues_Interpolate(from:
|
||||
RawServoAnimationValueBorrowed,
|
||||
|
@ -1692,6 +1701,13 @@ extern "C" {
|
|||
progress: f64)
|
||||
-> RawServoAnimationValueStrong;
|
||||
}
|
||||
extern "C" {
|
||||
pub fn Servo_AnimationValues_IsInterpolable(from:
|
||||
RawServoAnimationValueBorrowed,
|
||||
to:
|
||||
RawServoAnimationValueBorrowed)
|
||||
-> bool;
|
||||
}
|
||||
extern "C" {
|
||||
pub fn Servo_AnimationValue_Serialize(value:
|
||||
RawServoAnimationValueBorrowed,
|
||||
|
@ -1716,6 +1732,11 @@ extern "C" {
|
|||
RawServoAnimationValueBorrowed)
|
||||
-> bool;
|
||||
}
|
||||
extern "C" {
|
||||
pub fn Servo_AnimationValue_Uncompute(value:
|
||||
RawServoAnimationValueBorrowed)
|
||||
-> RawServoDeclarationBlockStrong;
|
||||
}
|
||||
extern "C" {
|
||||
pub fn Servo_ParseStyleAttribute(data: *const nsACString,
|
||||
extra_data: *mut RawGeckoURLExtraData)
|
||||
|
|
|
@ -104,6 +104,31 @@ impl TransitionProperty {
|
|||
_ => None,
|
||||
}
|
||||
}
|
||||
|
||||
/// Returns true if this TransitionProperty is one of the discrete animatable properties.
|
||||
pub fn is_discrete(&self) -> bool {
|
||||
match *self {
|
||||
% for prop in data.longhands:
|
||||
% if prop.animation_type == "discrete":
|
||||
TransitionProperty::${prop.camel_case} => true,
|
||||
% endif
|
||||
% endfor
|
||||
_ => false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Returns true if this nsCSSPropertyID is one of the animatable properties.
|
||||
#[cfg(feature = "gecko")]
|
||||
pub fn nscsspropertyid_is_animatable(property: nsCSSPropertyID) -> bool {
|
||||
match property {
|
||||
% for prop in data.longhands:
|
||||
% if prop.animatable:
|
||||
${helpers.to_nscsspropertyid(prop.ident)} => true,
|
||||
% endif
|
||||
% endfor
|
||||
_ => false
|
||||
}
|
||||
}
|
||||
|
||||
impl ToCss for TransitionProperty {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue