mirror of
https://github.com/servo/servo.git
synced 2025-08-05 13:40:08 +01:00
style: Don't make visibility additive.
As per discussion here: https://github.com/web-platform-tests/wpt/pull/19160 This property type does not have a procedure for addition defined so it should not be additive. Differential Revision: https://phabricator.services.mozilla.com/D48454
This commit is contained in:
parent
38e5897353
commit
f6b587051d
1 changed files with 13 additions and 8 deletions
|
@ -768,17 +768,22 @@ animated_list_impl!(<T> for crate::OwnedSlice<T>);
|
||||||
animated_list_impl!(<T> for SmallVec<[T; 1]>);
|
animated_list_impl!(<T> for SmallVec<[T; 1]>);
|
||||||
animated_list_impl!(<T> for Vec<T>);
|
animated_list_impl!(<T> for Vec<T>);
|
||||||
|
|
||||||
/// <https://drafts.csswg.org/css-transitions/#animtype-visibility>
|
/// <https://drafts.csswg.org/web-animations-1/#animating-visibility>
|
||||||
impl Animate for Visibility {
|
impl Animate for Visibility {
|
||||||
#[inline]
|
#[inline]
|
||||||
fn animate(&self, other: &Self, procedure: Procedure) -> Result<Self, ()> {
|
fn animate(&self, other: &Self, procedure: Procedure) -> Result<Self, ()> {
|
||||||
let (this_weight, other_weight) = procedure.weights();
|
match procedure {
|
||||||
match (*self, *other) {
|
Procedure::Interpolate { .. } => {
|
||||||
(Visibility::Visible, _) => {
|
let (this_weight, other_weight) = procedure.weights();
|
||||||
Ok(if this_weight > 0.0 { *self } else { *other })
|
match (*self, *other) {
|
||||||
},
|
(Visibility::Visible, _) => {
|
||||||
(_, Visibility::Visible) => {
|
Ok(if this_weight > 0.0 { *self } else { *other })
|
||||||
Ok(if other_weight > 0.0 { *other } else { *self })
|
},
|
||||||
|
(_, Visibility::Visible) => {
|
||||||
|
Ok(if other_weight > 0.0 { *other } else { *self })
|
||||||
|
},
|
||||||
|
_ => Err(()),
|
||||||
|
}
|
||||||
},
|
},
|
||||||
_ => Err(()),
|
_ => Err(()),
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue