Bug 1356941 - ComputedDistance for IntermediateTextShadow. r?boris draft
authorHiroyuki Ikezoe <hikezoe@mozilla.com>
Mon, 24 Apr 2017 15:03:44 +0900
changeset 566931 d6af8590663ea9d2b48bee4c0a6a64226168aa77
parent 566930 2edec88b684efb6f5fb3dfdcc1fe8d5a46321366
child 625463 38914ea1ae5d90893ab5bc278689eef544df3ec8
push id55379
push userhikezoe@mozilla.com
push dateMon, 24 Apr 2017 06:04:15 +0000
reviewersboris
bugs1356941
milestone55.0a1
Bug 1356941 - ComputedDistance for IntermediateTextShadow. r?boris MozReview-Commit-ID: JUorj3PFNAX
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
@@ -2774,45 +2774,45 @@ impl ComputeDistance for ClipRect {
         let list = [ try!(self.top.compute_distance(&other.top)),
                      try!(self.right.compute_distance(&other.right)),
                      try!(self.bottom.compute_distance(&other.bottom)),
                      try!(self.left.compute_distance(&other.left)) ];
         Ok(list.iter().fold(0.0f64, |sum, diff| sum + diff * diff))
     }
 }
 
-impl ComputeDistance for TextShadow {
+impl ComputeDistance for IntermediateTextShadow {
     #[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, ()> {
         let list = [ try!(self.offset_x.compute_distance(&other.offset_x)),
                      try!(self.offset_y.compute_distance(&other.offset_y)),
                      try!(self.blur_radius.compute_distance(&other.blur_radius)),
                      try!(self.color.compute_distance(&other.color)) ];
         Ok(list.iter().fold(0.0f64, |sum, diff| sum + diff * diff))
     }
 }
 
-impl ComputeDistance for TextShadowList {
+impl ComputeDistance for IntermediateTextShadowList {
     #[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, ()> {
-        let zero = TextShadow {
+        let zero = IntermediateTextShadow {
             offset_x: Au(0),
             offset_y: Au(0),
             blur_radius: Au(0),
-            color: CSSParserColor::RGBA(RGBA::transparent()),
+            color: IntermediateColor::IntermediateRGBA(IntermediateRGBA::transparent()),
         };
 
         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)) => {
                     try!(shadow.compute_squared_distance(other))