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);