Fix the integer setting of the GridLine struct

GridLine line_num shouldn't be set if it's not parsed. So we can determine if it's set or not for serialization.
This commit is contained in:
Nazım Can Altınova 2017-07-17 23:18:21 -07:00
parent 46780ceb0d
commit 638a306168
2 changed files with 5 additions and 6 deletions

View file

@ -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) {