style: Derive ToResolvedValue.

Differential Revision: https://phabricator.services.mozilla.com/D26783
This commit is contained in:
Emilio Cobos Álvarez 2019-04-10 12:10:26 +00:00
parent 6ac777ebf2
commit a47dcb5707
53 changed files with 359 additions and 108 deletions

View file

@ -15,7 +15,7 @@ use std::ops::Deref;
/// A name / value pair for counters.
#[derive(
Clone, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToComputedValue, ToCss, ToShmem,
Clone, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToComputedValue, ToCss, ToResolvedValue, ToShmem,
)]
pub struct CounterPair<Integer> {
/// The name of the counter.
@ -34,6 +34,7 @@ pub struct CounterPair<Integer> {
SpecifiedValueInfo,
ToComputedValue,
ToCss,
ToResolvedValue,
ToShmem,
)]
pub struct CounterIncrement<I>(Counters<I>);
@ -65,6 +66,7 @@ impl<I> Deref for CounterIncrement<I> {
SpecifiedValueInfo,
ToComputedValue,
ToCss,
ToResolvedValue,
ToShmem,
)]
pub struct CounterSetOrReset<I>(Counters<I>);
@ -90,7 +92,15 @@ impl<I> Deref for CounterSetOrReset<I> {
///
/// Keyword `none` is represented by an empty vector.
#[derive(
Clone, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToComputedValue, ToCss, ToShmem,
Clone,
Debug,
MallocSizeOf,
PartialEq,
SpecifiedValueInfo,
ToComputedValue,
ToCss,
ToResolvedValue,
ToShmem,
)]
pub struct Counters<I>(#[css(iterable, if_empty = "none")] Box<[CounterPair<I>]>);
@ -123,7 +133,16 @@ fn is_decimal(counter_type: &CounterStyleType) -> bool {
///
/// https://drafts.csswg.org/css-content/#propdef-content
#[derive(
Clone, Debug, Eq, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToComputedValue, ToCss, ToShmem,
Clone,
Debug,
Eq,
MallocSizeOf,
PartialEq,
SpecifiedValueInfo,
ToComputedValue,
ToCss,
ToResolvedValue,
ToShmem,
)]
pub enum Content<ImageUrl> {
/// `normal` reserved keyword.
@ -147,7 +166,16 @@ impl<ImageUrl> Content<ImageUrl> {
/// Items for the `content` property.
#[derive(
Clone, Debug, Eq, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToComputedValue, ToCss, ToShmem,
Clone,
Debug,
Eq,
MallocSizeOf,
PartialEq,
SpecifiedValueInfo,
ToComputedValue,
ToCss,
ToResolvedValue,
ToShmem,
)]
pub enum ContentItem<ImageUrl> {
/// Literal string content.