mirror of
https://github.com/servo/servo.git
synced 2025-08-07 06:25:32 +01:00
style: Implement the counter-set property.
Bug: 1518201 Reviewed-by: emilio
This commit is contained in:
parent
14b176019c
commit
4b4b5b6a1d
7 changed files with 27 additions and 18 deletions
|
@ -45,21 +45,21 @@ impl<I> Deref for CounterIncrement<I> {
|
|||
}
|
||||
}
|
||||
|
||||
/// A generic value for the `counter-reset` property.
|
||||
/// A generic value for the `counter-set` and `counter-reset` properties.
|
||||
#[derive(
|
||||
Clone, Debug, Default, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToComputedValue, ToCss,
|
||||
)]
|
||||
pub struct CounterReset<I>(Counters<I>);
|
||||
pub struct CounterSetOrReset<I>(Counters<I>);
|
||||
|
||||
impl<I> CounterReset<I> {
|
||||
/// Returns a new value for `counter-reset`.
|
||||
impl<I> CounterSetOrReset<I> {
|
||||
/// Returns a new value for `counter-set` / `counter-reset`.
|
||||
#[inline]
|
||||
pub fn new(counters: Vec<CounterPair<I>>) -> Self {
|
||||
CounterReset(Counters(counters.into_boxed_slice()))
|
||||
CounterSetOrReset(Counters(counters.into_boxed_slice()))
|
||||
}
|
||||
}
|
||||
|
||||
impl<I> Deref for CounterReset<I> {
|
||||
impl<I> Deref for CounterSetOrReset<I> {
|
||||
type Target = [CounterPair<I>];
|
||||
|
||||
#[inline]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue