mirror of
https://github.com/servo/servo.git
synced 2025-08-09 15:35:34 +01:00
style: Properly use integers on grid properties, and derive ToComputedValue.
This commit is contained in:
parent
02d24061e7
commit
64ab73eabd
7 changed files with 112 additions and 91 deletions
|
@ -1700,7 +1700,7 @@ fn static_assert() {
|
|||
if let Some(integer) = v.line_num {
|
||||
// clamping the integer between a range
|
||||
self.gecko.${value.gecko}.mInteger = cmp::max(nsStyleGridLine_kMinLine,
|
||||
cmp::min(integer.value(), nsStyleGridLine_kMaxLine));
|
||||
cmp::min(integer, nsStyleGridLine_kMaxLine));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1717,7 +1717,6 @@ fn static_assert() {
|
|||
pub fn clone_${value.name}(&self) -> longhands::${value.name}::computed_value::T {
|
||||
use gecko_bindings::structs::{nsStyleGridLine_kMinLine, nsStyleGridLine_kMaxLine};
|
||||
use string_cache::Atom;
|
||||
use values::specified::Integer;
|
||||
|
||||
longhands::${value.name}::computed_value::T {
|
||||
is_span: self.gecko.${value.gecko}.mHasSpan,
|
||||
|
@ -1735,7 +1734,7 @@ fn static_assert() {
|
|||
} else {
|
||||
debug_assert!(nsStyleGridLine_kMinLine <= self.gecko.${value.gecko}.mInteger);
|
||||
debug_assert!(self.gecko.${value.gecko}.mInteger <= nsStyleGridLine_kMaxLine);
|
||||
Some(Integer::new(self.gecko.${value.gecko}.mInteger))
|
||||
Some(self.gecko.${value.gecko}.mInteger)
|
||||
},
|
||||
}
|
||||
}
|
||||
|
|
|
@ -147,7 +147,7 @@
|
|||
let end = if input.try(|i| i.expect_delim('/')).is_ok() {
|
||||
GridLine::parse(context, input)?
|
||||
} else {
|
||||
let mut line = GridLine::default();
|
||||
let mut line = GridLine::auto();
|
||||
if start.line_num.is_none() && !start.is_span {
|
||||
line.ident = start.ident.clone(); // ident from start value should be taken
|
||||
}
|
||||
|
@ -182,7 +182,7 @@
|
|||
pub fn parse_value<'i, 't>(context: &ParserContext, input: &mut Parser<'i, 't>)
|
||||
-> Result<Longhands, ParseError<'i>> {
|
||||
fn line_with_ident_from(other: &GridLine) -> GridLine {
|
||||
let mut this = GridLine::default();
|
||||
let mut this = GridLine::auto();
|
||||
if other.line_num.is_none() && !other.is_span {
|
||||
this.ident = other.ident.clone();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue