From 19d498f01e9d7c6711ce86379e4c1b454d13562e Mon Sep 17 00:00:00 2001 From: Hiroyuki Ikezoe Date: Tue, 15 Aug 2017 13:03:32 +0900 Subject: [PATCH] Make assertion for colum-count more accurate. column-count should be greater than or equal to 1. Also it should be less than or equal to nsStyleColumn_kMaxColumnCount since we limit it in set_column_count(). --- components/style/properties/gecko.mako.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/components/style/properties/gecko.mako.rs b/components/style/properties/gecko.mako.rs index e7f9db30b9e..666f94e8850 100644 --- a/components/style/properties/gecko.mako.rs +++ b/components/style/properties/gecko.mako.rs @@ -5444,10 +5444,10 @@ clip-path ${impl_simple_copy('column_count', 'mColumnCount')} pub fn clone_column_count(&self) -> longhands::column_count::computed_value::T { - use gecko_bindings::structs::NS_STYLE_COLUMN_COUNT_AUTO; + use gecko_bindings::structs::{NS_STYLE_COLUMN_COUNT_AUTO, nsStyleColumn_kMaxColumnCount}; if self.gecko.mColumnCount != NS_STYLE_COLUMN_COUNT_AUTO { - debug_assert!((self.gecko.mColumnCount as i32) >= 0 && - (self.gecko.mColumnCount as i32) < i32::max_value()); + debug_assert!(self.gecko.mColumnCount >= 1 && + self.gecko.mColumnCount <= nsStyleColumn_kMaxColumnCount); Either::First((self.gecko.mColumnCount as i32).into()) } else { Either::Second(Auto)