servo: Merge #17856 - Use saturating ops when passing computed clip value to gecko (fix bug 1384150) (from Manishearth:stylo-clip-overflow); r=emilio
authorManish Goregaokar <manishearth@gmail.com>
Tue, 25 Jul 2017 14:33:19 -0700
changeset 419641 7ad0f4024a8a779622fa79db42a9423c0150696e
parent 419640 72c7fc10d21aea0a5bf41b3958ddf3ad57a257b3
child 419642 6a49ccfbabeba32d0fefa53c95bf7478d1b4a206
push id7566
push usermtabara@mozilla.com
push dateWed, 02 Aug 2017 08:25:16 +0000
treeherdermozilla-beta@86913f512c3c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersemilio
bugs1384150
milestone56.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
servo: Merge #17856 - Use saturating ops when passing computed clip value to gecko (fix bug 1384150) (from Manishearth:stylo-clip-overflow); r=emilio https://bugzilla.mozilla.org/show_bug.cgi?id=1384150 Source-Repo: https://github.com/servo/servo Source-Revision: 002ea74a713860be5e537f0113f4cfbb1925cb33
servo/components/style/properties/gecko.mako.rs
--- a/servo/components/style/properties/gecko.mako.rs
+++ b/servo/components/style/properties/gecko.mako.rs
@@ -3718,24 +3718,24 @@ fn static_assert() {
                 if let Some(top) = rect.top {
                     self.gecko.mClip.y = top.0;
                 } else {
                     self.gecko.mClip.y = 0;
                     self.gecko.mClipFlags |= NS_STYLE_CLIP_TOP_AUTO as u8;
                 }
 
                 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;
                 }
             },
             Either::Second(_auto) => {
                 self.gecko.mClipFlags = NS_STYLE_CLIP_AUTO as u8;
                 self.gecko.mClip.x = 0;