Bug 1356941 - ComputedDistance for IntermediateTextShadow. r?boris
MozReview-Commit-ID: JUorj3PFNAX
--- 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))