Bug 1356941 - ComputedDistance for IntermediateBoxShadow. r?boris draft
authorHiroyuki Ikezoe <hikezoe@mozilla.com>
Mon, 24 Apr 2017 15:03:44 +0900
changeset 566929 78085384a8926b2e7b4e0731da4c333599059157
parent 566928 172daca0e71f9379a550b1b0e7434dc08d508850
child 566930 2edec88b684efb6f5fb3dfdcc1fe8d5a46321366
push id55379
push userhikezoe@mozilla.com
push dateMon, 24 Apr 2017 06:04:15 +0000
reviewersboris
bugs1356941
milestone55.0a1
Bug 1356941 - ComputedDistance for IntermediateBoxShadow. r?boris MozReview-Commit-ID: 1ZOIXCkkcQ3
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
@@ -2822,17 +2822,17 @@ impl ComputeDistance for TextShadowList 
                 },
                 (None, None) => unreachable!(),
             };
         }
         Ok(diff_squared)
     }
 }
 
-impl ComputeDistance for BoxShadow {
+impl ComputeDistance for IntermediateBoxShadow {
     #[inline]
     fn compute_distance(&self, other: &Self) -> Result<f64, ()> {
         self.compute_squared_distance(other).map(|sd| sd.sqrt())
     }
 
     #[inline]
     fn compute_squared_distance(&self, other: &Self) -> Result<f64, ()> {
         if self.inset != other.inset {
@@ -2842,31 +2842,31 @@ impl ComputeDistance for BoxShadow {
                      try!(self.offset_y.compute_distance(&other.offset_y)),
                      try!(self.color.compute_distance(&other.color)),
                      try!(self.spread_radius.compute_distance(&other.spread_radius)),
                      try!(self.blur_radius.compute_distance(&other.blur_radius)) ];
         Ok(list.iter().fold(0.0f64, |sum, diff| sum + diff * diff))
     }
 }
 
-impl ComputeDistance for BoxShadowList {
+impl ComputeDistance for IntermediateBoxShadowList {
     #[inline]
     fn compute_distance(&self, other: &Self) -> Result<f64, ()> {
         self.compute_squared_distance(other).map(|sd| sd.sqrt())
     }
 
     #[inline]
     fn compute_squared_distance(&self, other: &Self) -> Result<f64, ()> {
         // The inset value must change
-        let mut zero = BoxShadow {
+        let mut zero = IntermediateBoxShadow {
             offset_x: Au(0),
             offset_y: Au(0),
             spread_radius: Au(0),
             blur_radius: Au(0),
-            color: CSSParserColor::RGBA(RGBA::transparent()),
+            color: IntermediateColor::IntermediateRGBA(IntermediateRGBA::transparent()),
             inset: false,
         };
 
         let max_len = cmp::max(self.0.len(), other.0.len());
         let mut diff_squared = 0.0f64;
         for i in 0..max_len {
             diff_squared += match (self.0.get(i), other.0.get(i)) {
                 (Some(shadow), Some(other)) => {