diff --git a/components/style/properties/gecko.mako.rs b/components/style/properties/gecko.mako.rs index 346d4b38853..1b8a373afcc 100644 --- a/components/style/properties/gecko.mako.rs +++ b/components/style/properties/gecko.mako.rs @@ -1319,10 +1319,11 @@ fn static_assert() { let ident = v.ident.as_ref().map_or(&[] as &[_], |ident| ident.0.as_slice()); self.gecko.${value.gecko}.mLineName.assign(ident); self.gecko.${value.gecko}.mHasSpan = v.is_span; - self.gecko.${value.gecko}.mInteger = v.line_num.map(|i| { + if let Some(integer) = v.line_num { // clamping the integer between a range - cmp::max(nsStyleGridLine_kMinLine, cmp::min(i.value(), nsStyleGridLine_kMaxLine)) - }).unwrap_or(0); + self.gecko.${value.gecko}.mInteger = cmp::max(nsStyleGridLine_kMinLine, + cmp::min(integer.value(), nsStyleGridLine_kMaxLine)); + } } pub fn copy_${value.name}_from(&mut self, other: &Self) { diff --git a/components/style/values/generics/grid.rs b/components/style/values/generics/grid.rs index 2b20269ecae..00049814482 100644 --- a/components/style/values/generics/grid.rs +++ b/components/style/values/generics/grid.rs @@ -119,9 +119,7 @@ impl Parse for GridLine { if i.value() <= 0 { // disallow negative integers for grid spans return Err(StyleParseError::UnspecifiedError.into()) } - } else if grid_line.ident.is_some() { // integer could be omitted - grid_line.line_num = Some(Integer::new(1)); - } else { + } else if grid_line.ident.is_none() { // integer could be omitted return Err(StyleParseError::UnspecifiedError.into()) } }