style: Add derived ToShmem implementations.

Differential Revision: https://phabricator.services.mozilla.com/D17197
This commit is contained in:
Cameron McCormack 2019-03-30 00:16:25 +00:00 committed by Emilio Cobos Álvarez
parent 128c6ae94a
commit 40248ae5fd
93 changed files with 649 additions and 267 deletions

View file

@ -43,7 +43,9 @@ pub mod url;
// https://drafts.csswg.org/css-counter-styles/#typedef-symbols-type
#[allow(missing_docs)]
#[cfg_attr(feature = "servo", derive(Deserialize, Serialize))]
#[derive(Clone, Copy, Debug, Eq, MallocSizeOf, Parse, PartialEq, ToComputedValue, ToCss)]
#[derive(
Clone, Copy, Debug, Eq, MallocSizeOf, Parse, PartialEq, ToComputedValue, ToCss, ToShmem,
)]
pub enum SymbolsType {
Cyclic,
Numeric,
@ -85,7 +87,7 @@ impl SymbolsType {
/// Since wherever <counter-style> is used, 'none' is a valid value as
/// well, we combine them into one type to make code simpler.
#[cfg_attr(feature = "gecko", derive(MallocSizeOf))]
#[derive(Clone, Debug, Eq, PartialEq, ToComputedValue, ToCss)]
#[derive(Clone, Debug, Eq, PartialEq, ToComputedValue, ToCss, ToShmem)]
pub enum CounterStyleOrNone {
/// `none`
None,
@ -173,6 +175,7 @@ impl SpecifiedValueInfo for CounterStyleOrNone {
ToAnimatedZero,
ToComputedValue,
ToCss,
ToShmem,
)]
#[repr(transparent)]
pub struct NonNegative<T>(pub T);
@ -210,6 +213,7 @@ impl<T: Zero> Zero for NonNegative<T> {
ToAnimatedZero,
ToComputedValue,
ToCss,
ToShmem,
)]
pub struct GreaterThanOrEqualToOne<T>(pub T);
@ -227,6 +231,7 @@ pub struct GreaterThanOrEqualToOne<T>(pub T);
ToAnimatedZero,
ToComputedValue,
ToCss,
ToShmem,
)]
#[css(function = "rect", comma)]
pub struct ClipRect<LengthOrAuto> {