From 7cdcfa0f8e10da43f28699da78f3ad36d678a0ae Mon Sep 17 00:00:00 2001 From: Manish Goregaokar Date: Tue, 25 Jul 2017 13:38:42 -0700 Subject: [PATCH] stylo: Use saturating ops for clip computation MozReview-Commit-ID: DYQRM4CJbAg --- components/style/properties/gecko.mako.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/style/properties/gecko.mako.rs b/components/style/properties/gecko.mako.rs index 0c71b82c841..b8c2b8860d1 100644 --- a/components/style/properties/gecko.mako.rs +++ b/components/style/properties/gecko.mako.rs @@ -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;