Bug 1374233 - Part 8: Apply restrictions to blur radius. draft
authorBoris Chiou <boris.chiou@gmail.com>
Thu, 22 Jun 2017 19:52:49 +0800
changeset 599432 a796142753e8339e6ca75131adc054b4414cdb7e
parent 599431 d75ed16afb4ed846a18e239b037250cbec9f406b
child 599433 cbffe03c12c27b5103bd30fcda80ab41e17f5ff7
push id65518
push userbmo:boris.chiou@gmail.com
push dateFri, 23 Jun 2017 04:39:24 +0000
bugs1374233
milestone56.0a1
Bug 1374233 - Part 8: Apply restrictions to blur radius. Only blur radius needs to be clamped, so we just call restrict_value while uncompute() (from IntermediateShadow into Shadow). MozReview-Commit-ID: 3ZdExn7kLs9
servo/components/style/properties/helpers/animated_properties.mako.rs
--- a/servo/components/style/properties/helpers/animated_properties.mako.rs
+++ b/servo/components/style/properties/helpers/animated_properties.mako.rs
@@ -3076,17 +3076,18 @@ impl From<${ty}ShadowList> for Intermedi
 }
 % endfor
 
 impl From<IntermediateShadow> for Shadow {
     fn from(shadow: IntermediateShadow) -> Shadow {
         Shadow {
             offset_x: shadow.offset_x,
             offset_y: shadow.offset_y,
-            blur_radius: shadow.blur_radius,
+            // blur-radius must be non-negative.
+            blur_radius: shadow.blur_radius.restrict_value(Restrictions::NonNegative),
             spread_radius: shadow.spread_radius,
             color: shadow.color.into(),
             inset: shadow.inset,
         }
     }
 }
 
 impl From<Shadow> for IntermediateShadow {