mirror of
https://github.com/servo/servo.git
synced 2025-08-09 23:45:35 +01:00
Auto merge of #19529 - DonatJR:counter-reset-out-of-mako, r=emilio
style: moved css longhand counter-reset out of mako <!-- Please describe your changes on the following line: --> This is a sub-PR of #19015 Code does not yet compile with `build-geckolib`. r? emilio --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [x] These changes fix #19387 <!-- Either: --> - [x] These changes do not require tests <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/19529) <!-- Reviewable:end -->
This commit is contained in:
commit
38ef515463
11 changed files with 240 additions and 151 deletions
|
@ -5675,11 +5675,14 @@ clip-path
|
|||
}
|
||||
|
||||
% for counter_property in ["Increment", "Reset"]:
|
||||
pub fn set_counter_${counter_property.lower()}(&mut self, v: longhands::counter_increment::computed_value::T) {
|
||||
pub fn set_counter_${counter_property.lower()}(
|
||||
&mut self,
|
||||
v: longhands::counter_${counter_property.lower()}::computed_value::T
|
||||
) {
|
||||
unsafe {
|
||||
bindings::Gecko_ClearAndResizeCounter${counter_property}s(&mut self.gecko,
|
||||
v.0.len() as u32);
|
||||
for (i, (name, value)) in v.0.into_iter().enumerate() {
|
||||
v.get_values().len() as u32);
|
||||
for (i, &(ref name, value)) in v.get_values().into_iter().enumerate() {
|
||||
self.gecko.m${counter_property}s[i].mCounter.assign(name.0.as_slice());
|
||||
self.gecko.m${counter_property}s[i].mValue = value;
|
||||
}
|
||||
|
@ -5696,11 +5699,13 @@ clip-path
|
|||
self.copy_counter_${counter_property.lower()}_from(other)
|
||||
}
|
||||
|
||||
pub fn clone_counter_${counter_property.lower()}(&self) -> longhands::counter_increment::computed_value::T {
|
||||
pub fn clone_counter_${counter_property.lower()}(
|
||||
&self
|
||||
) -> longhands::counter_${counter_property.lower()}::computed_value::T {
|
||||
use values::CustomIdent;
|
||||
use gecko_string_cache::Atom;
|
||||
|
||||
longhands::counter_increment::computed_value::T(
|
||||
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)
|
||||
}).collect()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue