mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +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 Vec<T>);
|
||||
|
||||
/// <https://drafts.csswg.org/css-transitions/#animtype-visibility>
|
||||
/// <https://drafts.csswg.org/web-animations-1/#animating-visibility>
|
||||
impl Animate for Visibility {
|
||||
#[inline]
|
||||
fn animate(&self, other: &Self, procedure: Procedure) -> Result<Self, ()> {
|
||||
let (this_weight, other_weight) = procedure.weights();
|
||||
match (*self, *other) {
|
||||
(Visibility::Visible, _) => {
|
||||
Ok(if this_weight > 0.0 { *self } else { *other })
|
||||
},
|
||||
(_, Visibility::Visible) => {
|
||||
Ok(if other_weight > 0.0 { *other } else { *self })
|
||||
match procedure {
|
||||
Procedure::Interpolate { .. } => {
|
||||
let (this_weight, other_weight) = procedure.weights();
|
||||
match (*self, *other) {
|
||||
(Visibility::Visible, _) => {
|
||||
Ok(if this_weight > 0.0 { *self } else { *other })
|
||||
},
|
||||
(_, Visibility::Visible) => {
|
||||
Ok(if other_weight > 0.0 { *other } else { *self })
|
||||
},
|
||||
_ => Err(()),
|
||||
}
|
||||
},
|
||||
_ => Err(()),
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue