From 6316b7aeb8b5a5be20cb1f8580dffbbe3a00f111 Mon Sep 17 00:00:00 2001 From: Daisuke Akatsuka Date: Wed, 5 Jul 2017 12:58:10 +0900 Subject: [PATCH] implements nsStyleCounterData type properties animatable --- components/style/properties/gecko.mako.rs | 11 +++++++++++ components/style/properties/longhand/counters.mako.rs | 4 ++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/components/style/properties/gecko.mako.rs b/components/style/properties/gecko.mako.rs index 73dbf480591..053e1cdd49a 100644 --- a/components/style/properties/gecko.mako.rs +++ b/components/style/properties/gecko.mako.rs @@ -4511,6 +4511,17 @@ clip-path bindings::Gecko_CopyCounter${counter_property}sFrom(&mut self.gecko, &other.gecko) } } + + pub fn clone_counter_${counter_property.lower()}(&self) -> longhands::counter_increment::computed_value::T { + use values::CustomIdent; + use gecko_string_cache::Atom; + + longhands::counter_increment::computed_value::T( + self.gecko.m${counter_property}s.iter().map(|ref gecko_counter| { + (CustomIdent(Atom::from(gecko_counter.mCounter.to_string())), gecko_counter.mValue) + }).collect() + ) + } % endfor diff --git a/components/style/properties/longhand/counters.mako.rs b/components/style/properties/longhand/counters.mako.rs index 463eafefba4..0a079fd277a 100644 --- a/components/style/properties/longhand/counters.mako.rs +++ b/components/style/properties/longhand/counters.mako.rs @@ -233,7 +233,7 @@ } -<%helpers:longhand name="counter-increment" animation_value_type="none" +<%helpers:longhand name="counter-increment" animation_value_type="discrete" spec="https://drafts.csswg.org/css-lists/#propdef-counter-increment"> use std::fmt; use style_traits::ToCss; @@ -350,7 +350,7 @@ } -<%helpers:longhand name="counter-reset" animation_value_type="none" +<%helpers:longhand name="counter-reset" animation_value_type="discrete" spec="https://drafts.csswg.org/css-lists-3/#propdef-counter-reset"> pub use super::counter_increment::{SpecifiedValue, computed_value, get_initial_value}; use super::counter_increment::parse_common;