Stop transitioning properties with a discrete animation type (#30565)

They are not transitionable:
https://drafts.csswg.org/css-transitions-1/#transitionable

There are some new failures in background-image-interpolation.html,
but I think the test is wrong, because it expects background-image
to be transitionable, even though the spec defines it with a discrete
animation type.
This commit is contained in:
Oriol Brufau 2023-10-20 14:55:33 +02:00 committed by GitHub
parent 9af3495d8a
commit 111716d458
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
39 changed files with 410 additions and 1280 deletions

View file

@ -1028,6 +1028,10 @@ impl ElementAnimationSet {
old_style: &ComputedValues,
new_style: &Arc<ComputedValues>,
) {
if !longhand_id.is_transitionable() {
return;
}
let style = new_style.get_ui();
let timing_function = style.transition_timing_function_mod(index);
let duration = style.transition_duration_mod(index);

View file

@ -981,6 +981,12 @@ impl LonghandIdSet {
&DISCRETE_ANIMATABLE
}
#[inline]
fn transitionable() -> &'static Self {
${static_longhand_id_set("TRANSITIONABLE", lambda p: p.transitionable)}
&TRANSITIONABLE
}
#[inline]
fn logical() -> &'static Self {
${static_longhand_id_set("LOGICAL", lambda p: p.logical)}
@ -1360,6 +1366,12 @@ impl LonghandId {
LonghandIdSet::discrete_animatable().contains(self)
}
/// Returns whether this property is transitionable.
#[inline]
pub fn is_transitionable(self) -> bool {
LonghandIdSet::transitionable().contains(self)
}
/// Converts from a LonghandId to an adequate nsCSSPropertyID.
#[cfg(feature = "gecko")]
#[inline]