Skip to content

Commit

Permalink
Don't convert zero component value to 'auto' in clone__moz_image_region.
Browse files Browse the repository at this point in the history
Currently Gecko treats 'auto' component value as zero for animation.
  • Loading branch information
Hiroyuki Ikezoe committed Aug 15, 2017
1 parent 4771e6e commit 6d49d81
Showing 1 changed file with 4 additions and 14 deletions.
18 changes: 4 additions & 14 deletions components/style/properties/gecko.mako.rs
Expand Up @@ -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)),
})
}

Expand Down

0 comments on commit 6d49d81

Please sign in to comment.