mirror of
https://github.com/servo/servo.git
synced 2025-08-14 09:55:35 +01:00
style: Derive ToCss for Counters.
Bug: 1457332 Reviewed-by: xidorn MozReview-Commit-ID: 1jOglcqt1Dd
This commit is contained in:
parent
8c322b9c1e
commit
a375baf84b
3 changed files with 29 additions and 44 deletions
|
@ -5697,9 +5697,9 @@ clip-path
|
|||
) {
|
||||
unsafe {
|
||||
bindings::Gecko_ClearAndResizeCounter${counter_property}s(&mut self.gecko, v.len() as u32);
|
||||
for (i, &(ref name, value)) in v.iter().enumerate() {
|
||||
self.gecko.m${counter_property}s[i].mCounter.assign(name.0.as_slice());
|
||||
self.gecko.m${counter_property}s[i].mValue = value;
|
||||
for (i, ref pair) in v.iter().enumerate() {
|
||||
self.gecko.m${counter_property}s[i].mCounter.assign(pair.name.0.as_slice());
|
||||
self.gecko.m${counter_property}s[i].mValue = pair.value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -5717,12 +5717,16 @@ clip-path
|
|||
pub fn clone_counter_${counter_property.lower()}(
|
||||
&self
|
||||
) -> longhands::counter_${counter_property.lower()}::computed_value::T {
|
||||
use values::generics::counters::CounterPair;
|
||||
use values::CustomIdent;
|
||||
use gecko_string_cache::Atom;
|
||||
|
||||
longhands::counter_${counter_property.lower()}::computed_value::T::new(
|
||||
self.gecko.m${counter_property}s.iter().map(|ref gecko_counter| {
|
||||
(CustomIdent(Atom::from(gecko_counter.mCounter.to_string())), gecko_counter.mValue)
|
||||
CounterPair {
|
||||
name: CustomIdent(Atom::from(gecko_counter.mCounter.to_string())),
|
||||
value: gecko_counter.mValue,
|
||||
}
|
||||
}).collect()
|
||||
)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue