style: Implement the counter-set property.

Bug: 1518201
Reviewed-by: emilio
This commit is contained in:
Mats Palmgren 2019-03-24 23:13:52 +01:00 committed by Emilio Cobos Álvarez
parent 14b176019c
commit 4b4b5b6a1d
7 changed files with 27 additions and 18 deletions

View file

@ -4559,7 +4559,7 @@ clip-path
</%self:impl_trait>
<%self:impl_trait style_struct_name="Counters"
skip_longhands="content counter-increment counter-reset">
skip_longhands="content counter-increment counter-reset counter-set">
pub fn ineffective_content_property(&self) -> bool {
self.gecko.mContents.is_empty()
}
@ -4788,7 +4788,7 @@ clip-path
)
}
% for counter_property in ["Increment", "Reset"]:
% for counter_property in ["Increment", "Reset", "Set"]:
pub fn set_counter_${counter_property.lower()}(
&mut self,
v: longhands::counter_${counter_property.lower()}::computed_value::T

View file

@ -27,9 +27,18 @@ ${helpers.predefined_type(
${helpers.predefined_type(
"counter-reset",
"CounterReset",
"CounterSetOrReset",
initial_value="Default::default()",
animation_value_type="discrete",
spec="https://drafts.csswg.org/css-lists-3/#propdef-counter-reset",
servo_restyle_damage="rebuild_and_reflow",
)}
${helpers.predefined_type(
"counter-set",
"CounterSetOrReset",
initial_value="Default::default()",
animation_value_type="discrete",
spec="https://drafts.csswg.org/css-lists-3/#propdef-counter-set",
servo_restyle_damage="rebuild_and_reflow",
)}