mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
Add 'range' descriptor to @counter-style
This commit is contained in:
parent
29bcb5b636
commit
6f79684468
2 changed files with 93 additions and 0 deletions
|
@ -187,3 +187,26 @@ impl ToNsCssValue for counter_style::Symbol {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl ToNsCssValue for counter_style::Ranges {
|
||||
fn convert(&self, _nscssvalue: &mut nsCSSValue) {
|
||||
if self.0.is_empty() {
|
||||
//nscssvalue.set_auto(); // FIXME: add bindings for nsCSSValue::SetAutoValue
|
||||
} else {
|
||||
for range in &self.0 {
|
||||
fn set_bound(bound: Option<i32>, nscssvalue: &mut nsCSSValue) {
|
||||
if let Some(finite) = bound {
|
||||
nscssvalue.set_integer(finite)
|
||||
} else {
|
||||
nscssvalue.set_enum(structs::NS_STYLE_COUNTER_RANGE_INFINITE as i32)
|
||||
}
|
||||
}
|
||||
let mut start = nsCSSValue::null();
|
||||
let mut end = nsCSSValue::null();
|
||||
set_bound(range.start, &mut start);
|
||||
set_bound(range.end, &mut end);
|
||||
// FIXME: add bindings for nsCSSValuePairList
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue