Bug 1586643 - Don't make visibility additive; r=boris
authorBrian Birtles <birtles@gmail.com>
Tue, 08 Oct 2019 01:27:29 +0000
changeset 496694 7cff74234ad4850e01a18431d9c40ea47469f676
parent 496693 bb30c0d750556c4db5163efe7f00c3067b1d955c
child 496695 58e59d29e72aa7bc864d279e199d5a31e59164eb
push id36665
push userapavel@mozilla.com
push dateTue, 08 Oct 2019 09:34:20 +0000
treeherdermozilla-central@035f52aed442 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersboris
bugs1586643, 19160
milestone71.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1586643 - Don't make visibility additive; r=boris 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
servo/components/style/properties/helpers/animated_properties.mako.rs
testing/web-platform/meta/web-animations/animation-model/animation-types/accumulation-per-property.html.ini
testing/web-platform/meta/web-animations/animation-model/animation-types/addition-per-property.html.ini
--- a/servo/components/style/properties/helpers/animated_properties.mako.rs
+++ b/servo/components/style/properties/helpers/animated_properties.mako.rs
@@ -763,27 +763,32 @@ macro_rules! animated_list_impl {
         }
     }
 }
 
 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(()),
         }
     }
 }
 
 impl ComputeSquaredDistance for Visibility {
     #[inline]
--- a/testing/web-platform/meta/web-animations/animation-model/animation-types/accumulation-per-property.html.ini
+++ b/testing/web-platform/meta/web-animations/animation-model/animation-types/accumulation-per-property.html.ini
@@ -1,5 +1,1 @@
 prefs: [layout.css.font-variations.enabled:true, layout.css.overflow-clip-box.enabled:true, layout.css.individual-transform.enabled:true]
-[accumulation-per-property.html]
-  [visibility: onto "visible"]
-    expected: FAIL
-
--- a/testing/web-platform/meta/web-animations/animation-model/animation-types/addition-per-property.html.ini
+++ b/testing/web-platform/meta/web-animations/animation-model/animation-types/addition-per-property.html.ini
@@ -1,5 +1,1 @@
 prefs: [layout.css.font-variations.enabled:true, layout.css.overflow-clip-box.enabled:true, layout.css.individual-transform.enabled:true]
-[addition-per-property.html]
-  [visibility: onto "visible"]
-    expected: FAIL
-