Auto merge of #17856 - Manishearth:stylo-clip-overflow, r=emilio

Use saturating ops when passing computed clip value to gecko (fix bug 1384150)

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

<!-- 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/17856)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2017-07-25 14:33:19 -07:00 committed by GitHub
commit 002ea74a71

View file

@ -3723,14 +3723,14 @@ fn static_assert() {
}
if let Some(bottom) = rect.bottom {
self.gecko.mClip.height = bottom.0 - self.gecko.mClip.y;
self.gecko.mClip.height = (bottom - Au(self.gecko.mClip.y)).0;
} else {
self.gecko.mClip.height = 1 << 30; // NS_MAXSIZE
self.gecko.mClipFlags |= NS_STYLE_CLIP_BOTTOM_AUTO as u8;
}
if let Some(right) = rect.right {
self.gecko.mClip.width = right.0 - self.gecko.mClip.x;
self.gecko.mClip.width = (right - Au(self.gecko.mClip.x)).0;
} else {
self.gecko.mClip.width = 1 << 30; // NS_MAXSIZE
self.gecko.mClipFlags |= NS_STYLE_CLIP_RIGHT_AUTO as u8;