From e4de8d10a65a51333f76b1b57f8d89e33fb01661 Mon Sep 17 00:00:00 2001 From: Manish Goregaokar Date: Wed, 6 Sep 2017 14:49:09 -0700 Subject: [PATCH] stylo: Use saturating subtraction for script level --- components/style/properties/gecko.mako.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/style/properties/gecko.mako.rs b/components/style/properties/gecko.mako.rs index 1a35d2f41c3..e45fcb6a23c 100644 --- a/components/style/properties/gecko.mako.rs +++ b/components/style/properties/gecko.mako.rs @@ -2341,7 +2341,7 @@ fn static_assert() { pub fn calculate_script_level_size(&self, parent: &Self, device: &Device) -> (Au, Au) { use std::cmp; - let delta = self.gecko.mScriptLevel - parent.gecko.mScriptLevel; + let delta = self.gecko.mScriptLevel.saturating_sub(parent.gecko.mScriptLevel); let parent_size = Au(parent.gecko.mSize); let parent_unconstrained_size = Au(parent.gecko.mScriptUnconstrainedSize);