Auto merge of #18079 - hiikezoe:moz-image-region, r=boris

Don't convert zero component value to 'auto' in clone__moz_image_region.

Currently Gecko treats 'auto' component value as zero for animation.

<!-- Please describe your changes on the following line: -->

https://bugzilla.mozilla.org/show_bug.cgi?id=1387951

---
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/18079)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2017-08-14 23:31:19 -05:00 committed by GitHub
commit e0b834033d

View file

@ -4222,21 +4222,11 @@ fn static_assert() {
return Either::Second(Auto);
}
let get_clip_rect_component = |value: structs::nscoord| -> Option<Au> {
if value == 0 {
None
} else {
Some(Au(value))
}
};
Either::First(ClipRect {
top: get_clip_rect_component(self.gecko.mImageRegion.y),
right: get_clip_rect_component(self.gecko.mImageRegion.width).map(
|v| v + Au(self.gecko.mImageRegion.x)),
bottom: get_clip_rect_component(self.gecko.mImageRegion.height).map(
|v| v + Au(self.gecko.mImageRegion.y)),
left: get_clip_rect_component(self.gecko.mImageRegion.x),
top: Some(Au(self.gecko.mImageRegion.y)),
right: Some(Au(self.gecko.mImageRegion.width) + Au(self.gecko.mImageRegion.x)),
bottom: Some(Au(self.gecko.mImageRegion.height) + Au(self.gecko.mImageRegion.y)),
left: Some(Au(self.gecko.mImageRegion.x)),
})
}