From 9ecb0aa7fa890bf872c0310d213efb0587721c7e Mon Sep 17 00:00:00 2001 From: Brian Birtles Date: Wed, 16 Aug 2017 15:01:44 +0900 Subject: [PATCH] Don't allow interpolating 'fill:none' with 'fill:none' In SMIL we don't expect the 'none' value of the 'fill' property to be additive and hence the following animation should have no effect: Although SMIL doesn't make this entirely clear, [1] says that "by animation" and "from-by animation" may only be used "with attributes that support addition (e.g. most numeric attributes)" and [2] says that s are "only additive if each value can be converted to an RGB color". As a result, the animation above should have no effect. By extrapolation, animating from 'none' by 'none' should also have no effect: However, in Servo's interpolation of s we special case the interpolation and addition of 'none' such that if both values are 'none' it is allowed. We should disallow this in order to produce the expected behavior and in order to match Gecko's behavior. [1] https://www.w3.org/TR/smil-animation/#AnimFuncValues [2] https://www.w3.org/TR/SVG11/animate.html#AnimationAttributesAndProperties --- components/style/properties/helpers/animated_properties.mako.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/components/style/properties/helpers/animated_properties.mako.rs b/components/style/properties/helpers/animated_properties.mako.rs index 64d29252ddc..cfc7947f23d 100644 --- a/components/style/properties/helpers/animated_properties.mako.rs +++ b/components/style/properties/helpers/animated_properties.mako.rs @@ -2478,7 +2478,6 @@ impl Animatable for IntermediateSVGPaintKind { } // FIXME context values should be interpolable with colors // Gecko doesn't implement this behavior either. - (&SVGPaintKind::None, &SVGPaintKind::None) => Ok(SVGPaintKind::None), (&SVGPaintKind::ContextFill, &SVGPaintKind::ContextFill) => Ok(SVGPaintKind::ContextFill), (&SVGPaintKind::ContextStroke, &SVGPaintKind::ContextStroke) => Ok(SVGPaintKind::ContextStroke), _ => Err(())