mirror of
https://github.com/servo/servo.git
synced 2025-08-04 21:20:23 +01:00
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:
commit
e0b834033d
1 changed files with 4 additions and 14 deletions
|
@ -4222,21 +4222,11 @@ fn static_assert() {
|
||||||
return Either::Second(Auto);
|
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 {
|
Either::First(ClipRect {
|
||||||
top: get_clip_rect_component(self.gecko.mImageRegion.y),
|
top: Some(Au(self.gecko.mImageRegion.y)),
|
||||||
right: get_clip_rect_component(self.gecko.mImageRegion.width).map(
|
right: Some(Au(self.gecko.mImageRegion.width) + Au(self.gecko.mImageRegion.x)),
|
||||||
|v| v + Au(self.gecko.mImageRegion.x)),
|
bottom: Some(Au(self.gecko.mImageRegion.height) + Au(self.gecko.mImageRegion.y)),
|
||||||
bottom: get_clip_rect_component(self.gecko.mImageRegion.height).map(
|
left: Some(Au(self.gecko.mImageRegion.x)),
|
||||||
|v| v + Au(self.gecko.mImageRegion.y)),
|
|
||||||
left: get_clip_rect_component(self.gecko.mImageRegion.x),
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue