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

@ -80,6 +80,7 @@ macro_rules! define_keyword_type {
ToAnimatedZero, ToAnimatedZero,
ToComputedValue, ToComputedValue,
ToCss, ToCss,
ToResolvedValue,
ToShmem, ToShmem,
)] )]
pub struct $name; pub struct $name;

View file

@ -128,8 +128,15 @@
% if separator == "Comma": % if separator == "Comma":
#[css(comma)] #[css(comma)]
% endif % endif
#[derive(Clone, Debug, MallocSizeOf, PartialEq, ToAnimatedValue, #[derive(
ToCss)] Clone,
Debug,
MallocSizeOf,
PartialEq,
ToAnimatedValue,
ToResolvedValue,
ToCss,
)]
pub struct List<T>( pub struct List<T>(
% if not allow_empty: % if not allow_empty:
#[css(iterable)] #[css(iterable)]
@ -425,8 +432,20 @@
pub mod computed_value { pub mod computed_value {
#[cfg_attr(feature = "servo", derive(Deserialize, Serialize))] #[cfg_attr(feature = "servo", derive(Deserialize, Serialize))]
#[derive(Clone, Copy, Debug, Eq, Hash, MallocSizeOf, Parse, #[derive(
PartialEq, SpecifiedValueInfo, ToCss, ToShmem)] Clone,
Copy,
Debug,
Eq,
Hash,
MallocSizeOf,
Parse,
PartialEq,
SpecifiedValueInfo,
ToCss,
ToResolvedValue,
ToShmem,
)]
pub enum T { pub enum T {
% for value in keyword.values_for(product): % for value in keyword.values_for(product):
${to_camel_case(value)}, ${to_camel_case(value)},
@ -588,8 +607,18 @@
</%def> </%def>
% if extra_specified: % if extra_specified:
#[cfg_attr(feature = "servo", derive(Deserialize, Serialize))] #[cfg_attr(feature = "servo", derive(Deserialize, Serialize))]
#[derive(Clone, Copy, Debug, Eq, MallocSizeOf, Parse, PartialEq, #[derive(
SpecifiedValueInfo, ToCss, ToShmem)] Clone,
Copy,
Debug,
Eq,
MallocSizeOf,
Parse,
PartialEq,
SpecifiedValueInfo,
ToCss,
ToShmem,
)]
pub enum SpecifiedValue { pub enum SpecifiedValue {
${variants(keyword.values_for(product) + extra_specified.split(), bool(extra_specified))} ${variants(keyword.values_for(product) + extra_specified.split(), bool(extra_specified))}
} }
@ -598,7 +627,7 @@
% endif % endif
pub mod computed_value { pub mod computed_value {
#[cfg_attr(feature = "servo", derive(Deserialize, Serialize))] #[cfg_attr(feature = "servo", derive(Deserialize, Serialize))]
#[derive(Clone, Copy, Debug, Eq, MallocSizeOf, PartialEq, ToCss)] #[derive(Clone, Copy, Debug, Eq, MallocSizeOf, PartialEq, ToCss, ToResolvedValue)]
% if not extra_specified: % if not extra_specified:
#[derive(Parse, SpecifiedValueInfo, ToComputedValue, ToShmem)] #[derive(Parse, SpecifiedValueInfo, ToComputedValue, ToShmem)]
% endif % endif

View file

@ -33,7 +33,7 @@ pub use super::specified::{AlignSelf, JustifySelf};
/// sucks :(. /// sucks :(.
/// ///
/// See the discussion in https://bugzil.la/1384542. /// See the discussion in https://bugzil.la/1384542.
#[derive(Clone, Copy, Debug, Eq, PartialEq, ToCss)] #[derive(Clone, Copy, Debug, Eq, PartialEq, ToCss, ToResolvedValue)]
pub struct JustifyItems { pub struct JustifyItems {
/// The specified value for the property. Can contain the bare `legacy` /// The specified value for the property. Can contain the bare `legacy`
/// keyword. /// keyword.

View file

@ -14,7 +14,7 @@ use style_traits::{CssWriter, ToCss};
/// A computed angle in degrees. /// A computed angle in degrees.
#[cfg_attr(feature = "servo", derive(Deserialize, Serialize))] #[cfg_attr(feature = "servo", derive(Deserialize, Serialize))]
#[derive(Add, Animate, Clone, Copy, Debug, MallocSizeOf, PartialEq, PartialOrd, ToAnimatedZero)] #[derive(Add, Animate, Clone, Copy, Debug, MallocSizeOf, PartialEq, PartialOrd, ToAnimatedZero, ToResolvedValue)]
pub struct Angle(CSSFloat); pub struct Angle(CSSFloat);
impl ToCss for Angle { impl ToCss for Angle {

View file

@ -49,6 +49,7 @@ pub type Perspective = GenericPerspective<NonNegativeLength>;
PartialEq, PartialEq,
SpecifiedValueInfo, SpecifiedValueInfo,
ToCss, ToCss,
ToResolvedValue,
)] )]
#[repr(u8)] #[repr(u8)]
/// A computed value for the `float` property. /// A computed value for the `float` property.
@ -118,6 +119,7 @@ impl ToComputedValue for SpecifiedFloat {
PartialEq, PartialEq,
SpecifiedValueInfo, SpecifiedValueInfo,
ToCss, ToCss,
ToResolvedValue,
)] )]
/// A computed value for the `clear` property. /// A computed value for the `clear` property.
pub enum Clear { pub enum Clear {
@ -178,7 +180,7 @@ impl ToComputedValue for SpecifiedClear {
/// A computed value for the `resize` property. /// A computed value for the `resize` property.
#[allow(missing_docs)] #[allow(missing_docs)]
#[cfg_attr(feature = "servo", derive(Deserialize, Serialize))] #[cfg_attr(feature = "servo", derive(Deserialize, Serialize))]
#[derive(Clone, Copy, Debug, Eq, Hash, MallocSizeOf, Parse, PartialEq, ToCss)] #[derive(Clone, Copy, Debug, Eq, Hash, MallocSizeOf, Parse, PartialEq, ToCss, ToResolvedValue)]
#[repr(u8)] #[repr(u8)]
pub enum Resize { pub enum Resize {
None, None,

View file

@ -40,7 +40,7 @@ pub use crate::values::specified::font::{XLang, XTextZoom};
/// https://drafts.csswg.org/css-fonts-4/#propdef-font-weight /// https://drafts.csswg.org/css-fonts-4/#propdef-font-weight
/// ///
/// This is effectively just a `Number`. /// This is effectively just a `Number`.
#[derive(Clone, ComputeSquaredDistance, Copy, Debug, MallocSizeOf, PartialEq, ToCss)] #[derive(Clone, ComputeSquaredDistance, Copy, Debug, MallocSizeOf, PartialEq, ToCss, ToResolvedValue)]
#[cfg_attr(feature = "servo", derive(Deserialize, Serialize))] #[cfg_attr(feature = "servo", derive(Deserialize, Serialize))]
pub struct FontWeight(pub Number); pub struct FontWeight(pub Number);
@ -74,6 +74,7 @@ impl ToAnimatedValue for FontWeight {
PartialEq, PartialEq,
ToAnimatedZero, ToAnimatedZero,
ToCss, ToCss,
ToResolvedValue,
)] )]
/// The computed value of font-size /// The computed value of font-size
pub struct FontSize { pub struct FontSize {
@ -174,7 +175,7 @@ impl ToAnimatedValue for FontSize {
} }
} }
#[derive(Clone, Debug, Eq, PartialEq)] #[derive(Clone, Debug, Eq, PartialEq, ToResolvedValue)]
#[cfg_attr(feature = "servo", derive(Hash, MallocSizeOf))] #[cfg_attr(feature = "servo", derive(Hash, MallocSizeOf))]
/// Specifies a prioritized list of font family names or generic family names. /// Specifies a prioritized list of font family names or generic family names.
pub struct FontFamily { pub struct FontFamily {
@ -221,7 +222,7 @@ impl ToCss for FontFamily {
} }
} }
#[derive(Clone, Debug, Eq, Hash, MallocSizeOf, PartialEq, ToShmem)] #[derive(Clone, Debug, Eq, Hash, MallocSizeOf, PartialEq, ToResolvedValue, ToShmem)]
#[cfg_attr(feature = "servo", derive(Deserialize, Serialize))] #[cfg_attr(feature = "servo", derive(Deserialize, Serialize))]
/// The name of a font family of choice /// The name of a font family of choice
pub struct FamilyName { pub struct FamilyName {
@ -264,7 +265,7 @@ impl ToCss for FamilyName {
} }
} }
#[derive(Clone, Copy, Debug, Eq, Hash, MallocSizeOf, PartialEq, ToShmem)] #[derive(Clone, Copy, Debug, Eq, Hash, MallocSizeOf, PartialEq, ToResolvedValue, ToShmem)]
#[cfg_attr(feature = "servo", derive(Deserialize, Serialize))] #[cfg_attr(feature = "servo", derive(Deserialize, Serialize))]
/// Font family names must either be given quoted as strings, /// Font family names must either be given quoted as strings,
/// or unquoted as a sequence of one or more identifiers. /// or unquoted as a sequence of one or more identifiers.
@ -279,7 +280,7 @@ pub enum FontFamilyNameSyntax {
Identifiers, Identifiers,
} }
#[derive(Clone, Debug, Eq, MallocSizeOf, PartialEq, ToCss)] #[derive(Clone, Debug, Eq, MallocSizeOf, PartialEq, ToCss, ToResolvedValue)]
#[cfg_attr(feature = "servo", derive(Deserialize, Serialize, Hash))] #[cfg_attr(feature = "servo", derive(Deserialize, Serialize, Hash))]
/// A set of faces that vary in weight, width or slope. /// A set of faces that vary in weight, width or slope.
pub enum SingleFontFamily { pub enum SingleFontFamily {
@ -294,7 +295,7 @@ pub enum SingleFontFamily {
/// The order here is important, if you change it make sure that /// The order here is important, if you change it make sure that
/// `gfxPlatformFontList.h`s ranged array and `gfxFontFamilyList`'s /// `gfxPlatformFontList.h`s ranged array and `gfxFontFamilyList`'s
/// sSingleGenerics are updated as well. /// sSingleGenerics are updated as well.
#[derive(Clone, Copy, Debug, Eq, Hash, MallocSizeOf, PartialEq, Parse, ToCss)] #[derive(Clone, Copy, Debug, Eq, Hash, MallocSizeOf, PartialEq, Parse, ToCss, ToResolvedValue)]
#[repr(u8)] #[repr(u8)]
#[allow(missing_docs)] #[allow(missing_docs)]
pub enum GenericFontFamily { pub enum GenericFontFamily {
@ -384,7 +385,7 @@ impl SingleFontFamily {
} }
#[cfg(feature = "servo")] #[cfg(feature = "servo")]
#[derive(Clone, Debug, Eq, Hash, MallocSizeOf, PartialEq)] #[derive(Clone, Debug, Eq, Hash, MallocSizeOf, PartialEq, ToResolvedValue)]
/// A list of SingleFontFamily /// A list of SingleFontFamily
pub struct FontFamilyList(Box<[SingleFontFamily]>); pub struct FontFamilyList(Box<[SingleFontFamily]>);
@ -546,7 +547,7 @@ impl<'a> Iterator for FontFamilyNameIter<'a> {
} }
/// Preserve the readability of text when font fallback occurs /// Preserve the readability of text when font fallback occurs
#[derive(Animate, Clone, ComputeSquaredDistance, Copy, Debug, MallocSizeOf, PartialEq, ToCss)] #[derive(Animate, Clone, ComputeSquaredDistance, Copy, Debug, MallocSizeOf, PartialEq, ToCss, ToResolvedValue)]
pub enum FontSizeAdjust { pub enum FontSizeAdjust {
#[animation(error)] #[animation(error)]
/// None variant /// None variant
@ -627,7 +628,7 @@ pub type FontVariationSettings = FontSettings<VariationValue<Number>>;
/// OpenType "language system" tag, so we should be able to compute /// OpenType "language system" tag, so we should be able to compute
/// it and store it as a 32-bit integer /// it and store it as a 32-bit integer
/// (see http://www.microsoft.com/typography/otspec/languagetags.htm). /// (see http://www.microsoft.com/typography/otspec/languagetags.htm).
#[derive(Clone, Copy, Debug, Eq, MallocSizeOf, PartialEq)] #[derive(Clone, Copy, Debug, Eq, MallocSizeOf, PartialEq, ToResolvedValue)]
#[repr(C)] #[repr(C)]
pub struct FontLanguageOverride(pub u32); pub struct FontLanguageOverride(pub u32);
@ -733,7 +734,7 @@ impl ToComputedValue for specified::MozScriptLevel {
/// A wrapper over an `Angle`, that handles clamping to the appropriate range /// A wrapper over an `Angle`, that handles clamping to the appropriate range
/// for `font-style` animation. /// for `font-style` animation.
#[derive(Clone, Copy, Debug, MallocSizeOf, PartialEq, ToCss)] #[derive(Clone, Copy, Debug, MallocSizeOf, PartialEq, ToCss, ToResolvedValue)]
#[cfg_attr(feature = "servo", derive(Deserialize, Serialize))] #[cfg_attr(feature = "servo", derive(Deserialize, Serialize))]
pub struct FontStyleAngle(pub Angle); pub struct FontStyleAngle(pub Angle);
@ -830,7 +831,7 @@ impl ToCss for FontStyle {
/// A value for the font-stretch property per: /// A value for the font-stretch property per:
/// ///
/// https://drafts.csswg.org/css-fonts-4/#propdef-font-stretch /// https://drafts.csswg.org/css-fonts-4/#propdef-font-stretch
#[derive(Clone, ComputeSquaredDistance, Copy, Debug, MallocSizeOf, PartialEq, ToCss)] #[derive(Clone, ComputeSquaredDistance, Copy, Debug, MallocSizeOf, PartialEq, ToCss, ToResolvedValue)]
#[cfg_attr(feature = "servo", derive(Deserialize, Serialize))] #[cfg_attr(feature = "servo", derive(Deserialize, Serialize))]
pub struct FontStretch(pub NonNegativePercentage); pub struct FontStretch(pub NonNegativePercentage);

View file

@ -36,7 +36,7 @@ pub type GradientKind =
generic::GradientKind<LineDirection, Length, LengthPercentage, Position, Angle>; generic::GradientKind<LineDirection, Length, LengthPercentage, Position, Angle>;
/// A computed gradient line direction. /// A computed gradient line direction.
#[derive(Clone, Copy, Debug, MallocSizeOf, PartialEq)] #[derive(Clone, Copy, Debug, MallocSizeOf, PartialEq, ToResolvedValue)]
pub enum LineDirection { pub enum LineDirection {
/// An angle. /// An angle.
Angle(Angle), Angle(Angle),

View file

@ -75,7 +75,7 @@ impl ToComputedValue for specified::Length {
/// ///
/// https://drafts.csswg.org/css-values-4/#typedef-length-percentage /// https://drafts.csswg.org/css-values-4/#typedef-length-percentage
#[allow(missing_docs)] #[allow(missing_docs)]
#[derive(Clone, Copy, Debug, MallocSizeOf, ToAnimatedZero)] #[derive(Clone, Copy, Debug, MallocSizeOf, ToAnimatedZero, ToResolvedValue)]
#[repr(C)] #[repr(C)]
pub struct LengthPercentage { pub struct LengthPercentage {
length: Length, length: Length,
@ -608,6 +608,7 @@ impl Size {
PartialOrd, PartialOrd,
ToAnimatedValue, ToAnimatedValue,
ToAnimatedZero, ToAnimatedZero,
ToResolvedValue,
ToShmem, ToShmem,
)] )]
#[repr(C)] #[repr(C)]
@ -804,6 +805,7 @@ pub type NonNegativeLengthOrNumber = GenericLengthOrNumber<NonNegativeLength, No
ToAnimatedZero, ToAnimatedZero,
ToComputedValue, ToComputedValue,
ToCss, ToCss,
ToResolvedValue,
ToShmem, ToShmem,
)] )]
#[repr(u8)] #[repr(u8)]

View file

@ -534,7 +534,7 @@ impl From<GreaterThanOrEqualToOneNumber> for CSSFloat {
} }
#[allow(missing_docs)] #[allow(missing_docs)]
#[derive(Clone, ComputeSquaredDistance, Copy, Debug, MallocSizeOf, PartialEq, ToCss)] #[derive(Clone, ComputeSquaredDistance, Copy, Debug, MallocSizeOf, PartialEq, ToCss, ToResolvedValue)]
#[repr(C, u8)] #[repr(C, u8)]
pub enum NumberOrPercentage { pub enum NumberOrPercentage {
Percentage(Percentage), Percentage(Percentage),

View file

@ -27,6 +27,7 @@ use style_traits::{CssWriter, ToCss};
ToAnimatedValue, ToAnimatedValue,
ToAnimatedZero, ToAnimatedZero,
ToComputedValue, ToComputedValue,
ToResolvedValue,
ToShmem, ToShmem,
)] )]
#[repr(C)] #[repr(C)]

View file

@ -37,6 +37,7 @@ pub type InitialLetter = GenericInitialLetter<CSSFloat, CSSInteger>;
PartialEq, PartialEq,
ToAnimatedValue, ToAnimatedValue,
ToAnimatedZero, ToAnimatedZero,
ToResolvedValue,
)] )]
pub struct LetterSpacing(pub Length); pub struct LetterSpacing(pub Length);
@ -102,7 +103,7 @@ impl ToComputedValue for specified::WordSpacing {
/// A computed value for the `line-height` property. /// A computed value for the `line-height` property.
pub type LineHeight = GenericLineHeight<NonNegativeNumber, NonNegativeLength>; pub type LineHeight = GenericLineHeight<NonNegativeNumber, NonNegativeLength>;
#[derive(Clone, Debug, MallocSizeOf, PartialEq)] #[derive(Clone, Debug, MallocSizeOf, PartialEq, ToResolvedValue)]
/// text-overflow. /// text-overflow.
/// When the specified value only has one side, that's the "second" /// When the specified value only has one side, that's the "second"
/// side, and the sides are logical, so "second" means "end". The /// side, and the sides are logical, so "second" means "end". The
@ -155,7 +156,7 @@ impl ToCss for TextOverflow {
/// and similar stuff when we implement it. /// and similar stuff when we implement it.
/// ///
/// FIXME(emilio): Also, should be just a bitfield instead of three bytes. /// FIXME(emilio): Also, should be just a bitfield instead of three bytes.
#[derive(Clone, Copy, Debug, Default, MallocSizeOf, PartialEq)] #[derive(Clone, Copy, Debug, Default, MallocSizeOf, PartialEq, ToResolvedValue)]
pub struct TextDecorationsInEffect { pub struct TextDecorationsInEffect {
/// Whether an underline is in effect. /// Whether an underline is in effect.
pub underline: bool, pub underline: bool,
@ -193,7 +194,7 @@ impl TextDecorationsInEffect {
} }
/// computed value for the text-emphasis-style property /// computed value for the text-emphasis-style property
#[derive(Clone, Debug, MallocSizeOf, PartialEq, ToCss)] #[derive(Clone, Debug, MallocSizeOf, PartialEq, ToCss, ToResolvedValue)]
pub enum TextEmphasisStyle { pub enum TextEmphasisStyle {
/// Keyword value for the text-emphasis-style property (`filled` `open`) /// Keyword value for the text-emphasis-style property (`filled` `open`)
Keyword(TextEmphasisKeywordValue), Keyword(TextEmphasisKeywordValue),
@ -204,7 +205,7 @@ pub enum TextEmphasisStyle {
} }
/// Keyword value for the text-emphasis-style property /// Keyword value for the text-emphasis-style property
#[derive(Clone, Debug, MallocSizeOf, PartialEq, ToCss)] #[derive(Clone, Debug, MallocSizeOf, PartialEq, ToCss, ToResolvedValue)]
pub struct TextEmphasisKeywordValue { pub struct TextEmphasisKeywordValue {
/// fill for the text-emphasis-style property /// fill for the text-emphasis-style property
pub fill: TextEmphasisFillMode, pub fill: TextEmphasisFillMode,

View file

@ -9,7 +9,7 @@ use std::fmt::{self, Write};
use style_traits::{CssWriter, ToCss}; use style_traits::{CssWriter, ToCss};
/// A computed `<time>` value. /// A computed `<time>` value.
#[derive(Clone, Copy, Debug, MallocSizeOf, PartialEq, PartialOrd)] #[derive(Clone, Copy, Debug, MallocSizeOf, PartialEq, PartialOrd, ToResolvedValue)]
#[cfg_attr(feature = "servo", derive(Deserialize, Serialize))] #[cfg_attr(feature = "servo", derive(Deserialize, Serialize))]
pub struct Time { pub struct Time {
seconds: CSSFloat, seconds: CSSFloat,

View file

@ -27,6 +27,7 @@ fn width_and_height_are_auto<L>(
ToAnimatedZero, ToAnimatedZero,
ToComputedValue, ToComputedValue,
ToCss, ToCss,
ToResolvedValue,
ToShmem, ToShmem,
)] )]
#[repr(C, u8)] #[repr(C, u8)]

View file

@ -31,6 +31,7 @@ pub type ClippingShape<BasicShape, Url> = ShapeSource<BasicShape, GeometryBox, U
ToAnimatedValue, ToAnimatedValue,
ToComputedValue, ToComputedValue,
ToCss, ToCss,
ToResolvedValue,
ToShmem, ToShmem,
)] )]
pub enum GeometryBox { pub enum GeometryBox {
@ -59,6 +60,7 @@ pub type FloatAreaShape<BasicShape, Image> = ShapeSource<BasicShape, ShapeBox, I
ToAnimatedValue, ToAnimatedValue,
ToComputedValue, ToComputedValue,
ToCss, ToCss,
ToResolvedValue,
ToShmem, ToShmem,
)] )]
pub enum ShapeBox { pub enum ShapeBox {
@ -81,6 +83,7 @@ pub enum ShapeBox {
ToAnimatedValue, ToAnimatedValue,
ToComputedValue, ToComputedValue,
ToCss, ToCss,
ToResolvedValue,
ToShmem, ToShmem,
)] )]
pub enum ShapeSource<BasicShape, ReferenceBox, ImageOrUrl> { pub enum ShapeSource<BasicShape, ReferenceBox, ImageOrUrl> {
@ -107,6 +110,7 @@ pub enum ShapeSource<BasicShape, ReferenceBox, ImageOrUrl> {
ToAnimatedValue, ToAnimatedValue,
ToComputedValue, ToComputedValue,
ToCss, ToCss,
ToResolvedValue,
ToShmem, ToShmem,
)] )]
pub enum BasicShape<H, V, LengthPercentage, NonNegativeLengthPercentage> { pub enum BasicShape<H, V, LengthPercentage, NonNegativeLengthPercentage> {
@ -141,6 +145,7 @@ pub enum BasicShape<H, V, LengthPercentage, NonNegativeLengthPercentage> {
SpecifiedValueInfo, SpecifiedValueInfo,
ToAnimatedValue, ToAnimatedValue,
ToComputedValue, ToComputedValue,
ToResolvedValue,
ToShmem, ToShmem,
)] )]
pub struct InsetRect<LengthPercentage, NonNegativeLengthPercentage> { pub struct InsetRect<LengthPercentage, NonNegativeLengthPercentage> {
@ -163,6 +168,7 @@ pub struct InsetRect<LengthPercentage, NonNegativeLengthPercentage> {
SpecifiedValueInfo, SpecifiedValueInfo,
ToAnimatedValue, ToAnimatedValue,
ToComputedValue, ToComputedValue,
ToResolvedValue,
ToShmem, ToShmem,
)] )]
pub struct Circle<H, V, NonNegativeLengthPercentage> { pub struct Circle<H, V, NonNegativeLengthPercentage> {
@ -184,6 +190,7 @@ pub struct Circle<H, V, NonNegativeLengthPercentage> {
SpecifiedValueInfo, SpecifiedValueInfo,
ToAnimatedValue, ToAnimatedValue,
ToComputedValue, ToComputedValue,
ToResolvedValue,
ToShmem, ToShmem,
)] )]
pub struct Ellipse<H, V, NonNegativeLengthPercentage> { pub struct Ellipse<H, V, NonNegativeLengthPercentage> {
@ -206,6 +213,7 @@ pub struct Ellipse<H, V, NonNegativeLengthPercentage> {
ToAnimatedValue, ToAnimatedValue,
ToComputedValue, ToComputedValue,
ToCss, ToCss,
ToResolvedValue,
ToShmem, ToShmem,
)] )]
pub enum ShapeRadius<NonNegativeLengthPercentage> { pub enum ShapeRadius<NonNegativeLengthPercentage> {
@ -229,6 +237,7 @@ pub enum ShapeRadius<NonNegativeLengthPercentage> {
ToAnimatedValue, ToAnimatedValue,
ToComputedValue, ToComputedValue,
ToCss, ToCss,
ToResolvedValue,
ToShmem, ToShmem,
)] )]
pub struct Polygon<LengthPercentage> { pub struct Polygon<LengthPercentage> {
@ -250,6 +259,7 @@ pub struct Polygon<LengthPercentage> {
ToAnimatedValue, ToAnimatedValue,
ToComputedValue, ToComputedValue,
ToCss, ToCss,
ToResolvedValue,
ToShmem, ToShmem,
)] )]
pub struct PolygonCoord<LengthPercentage>(pub LengthPercentage, pub LengthPercentage); pub struct PolygonCoord<LengthPercentage>(pub LengthPercentage, pub LengthPercentage);
@ -272,6 +282,7 @@ pub struct PolygonCoord<LengthPercentage>(pub LengthPercentage, pub LengthPercen
ToAnimatedValue, ToAnimatedValue,
ToComputedValue, ToComputedValue,
ToCss, ToCss,
ToResolvedValue,
ToShmem, ToShmem,
)] )]
#[repr(u8)] #[repr(u8)]
@ -294,6 +305,7 @@ pub enum FillRule {
ToAnimatedValue, ToAnimatedValue,
ToComputedValue, ToComputedValue,
ToCss, ToCss,
ToResolvedValue,
ToShmem, ToShmem,
)] )]
pub struct Path { pub struct Path {

View file

@ -20,6 +20,7 @@ use style_traits::{CssWriter, ToCss};
SpecifiedValueInfo, SpecifiedValueInfo,
ToComputedValue, ToComputedValue,
ToCss, ToCss,
ToResolvedValue,
ToShmem, ToShmem,
)] )]
pub enum BorderImageSideWidth<LengthPercentage, Number> { pub enum BorderImageSideWidth<LengthPercentage, Number> {
@ -41,6 +42,7 @@ pub enum BorderImageSideWidth<LengthPercentage, Number> {
SpecifiedValueInfo, SpecifiedValueInfo,
ToComputedValue, ToComputedValue,
ToCss, ToCss,
ToResolvedValue,
ToShmem, ToShmem,
)] )]
#[repr(C)] #[repr(C)]
@ -69,6 +71,7 @@ pub use self::GenericBorderImageSlice as BorderImageSlice;
ToAnimatedZero, ToAnimatedZero,
ToComputedValue, ToComputedValue,
ToCss, ToCss,
ToResolvedValue,
ToShmem, ToShmem,
)] )]
#[repr(C)] #[repr(C)]
@ -107,6 +110,7 @@ impl<L: Zero> Zero for BorderCornerRadius<L> {
ToAnimatedZero, ToAnimatedZero,
ToComputedValue, ToComputedValue,
ToCss, ToCss,
ToResolvedValue,
ToShmem, ToShmem,
)] )]
#[repr(transparent)] #[repr(transparent)]
@ -133,6 +137,7 @@ impl<L> BorderSpacing<L> {
SpecifiedValueInfo, SpecifiedValueInfo,
ToAnimatedValue, ToAnimatedValue,
ToComputedValue, ToComputedValue,
ToResolvedValue,
ToShmem, ToShmem,
)] )]
#[repr(C)] #[repr(C)]

View file

@ -18,6 +18,7 @@ use crate::values::animated::ToAnimatedZero;
SpecifiedValueInfo, SpecifiedValueInfo,
ToComputedValue, ToComputedValue,
ToCss, ToCss,
ToResolvedValue,
ToShmem, ToShmem,
)] )]
pub enum VerticalAlign<LengthPercentage> { pub enum VerticalAlign<LengthPercentage> {
@ -60,7 +61,15 @@ impl<L> ToAnimatedZero for VerticalAlign<L> {
/// https://drafts.csswg.org/css-animations/#animation-iteration-count /// https://drafts.csswg.org/css-animations/#animation-iteration-count
#[derive( #[derive(
Clone, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToComputedValue, ToCss, ToShmem, Clone,
Debug,
MallocSizeOf,
PartialEq,
SpecifiedValueInfo,
ToComputedValue,
ToCss,
ToResolvedValue,
ToShmem,
)] )]
pub enum AnimationIterationCount<Number> { pub enum AnimationIterationCount<Number> {
/// A `<number>` value. /// A `<number>` value.
@ -84,6 +93,7 @@ pub enum AnimationIterationCount<Number> {
ToAnimatedZero, ToAnimatedZero,
ToComputedValue, ToComputedValue,
ToCss, ToCss,
ToResolvedValue,
ToShmem, ToShmem,
)] )]
#[repr(C, u8)] #[repr(C, u8)]

View file

@ -99,6 +99,7 @@ impl<RGBA> From<RGBA> for Color<RGBA> {
ToAnimatedZero, ToAnimatedZero,
ToComputedValue, ToComputedValue,
ToCss, ToCss,
ToResolvedValue,
ToShmem, ToShmem,
)] )]
#[repr(C, u8)] #[repr(C, u8)]

View file

@ -19,6 +19,7 @@
ToAnimatedZero, ToAnimatedZero,
ToComputedValue, ToComputedValue,
ToCss, ToCss,
ToResolvedValue,
ToShmem, ToShmem,
)] )]
pub enum ColumnCount<PositiveInteger> { pub enum ColumnCount<PositiveInteger> {

View file

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

View file

@ -18,6 +18,7 @@ use crate::values::CSSFloat;
SpecifiedValueInfo, SpecifiedValueInfo,
ToComputedValue, ToComputedValue,
ToCss, ToCss,
ToResolvedValue,
ToShmem, ToShmem,
)] )]
#[value_info(ty = "TIMING_FUNCTION")] #[value_info(ty = "TIMING_FUNCTION")]
@ -54,6 +55,7 @@ pub enum TimingFunction<Integer, Number> {
SpecifiedValueInfo, SpecifiedValueInfo,
ToComputedValue, ToComputedValue,
ToCss, ToCss,
ToResolvedValue,
ToShmem, ToShmem,
)] )]
#[repr(u8)] #[repr(u8)]
@ -79,7 +81,17 @@ fn step_position_jump_enabled(_context: &ParserContext) -> bool {
#[allow(missing_docs)] #[allow(missing_docs)]
#[cfg_attr(feature = "servo", derive(Deserialize, Serialize))] #[cfg_attr(feature = "servo", derive(Deserialize, Serialize))]
#[derive( #[derive(
Clone, Copy, Debug, Eq, MallocSizeOf, Parse, PartialEq, ToComputedValue, ToCss, ToShmem, Clone,
Copy,
Debug,
Eq,
MallocSizeOf,
Parse,
PartialEq,
ToComputedValue,
ToCss,
ToResolvedValue,
ToShmem,
)] )]
#[repr(u8)] #[repr(u8)]
pub enum StepPosition { pub enum StepPosition {

View file

@ -16,6 +16,7 @@
ToAnimatedValue, ToAnimatedValue,
ToAnimatedZero, ToAnimatedZero,
ToCss, ToCss,
ToResolvedValue,
ToShmem, ToShmem,
)] )]
pub struct BoxShadow<Color, SizeLength, BlurShapeLength, ShapeLength> { pub struct BoxShadow<Color, SizeLength, BlurShapeLength, ShapeLength> {
@ -42,6 +43,7 @@ pub struct BoxShadow<Color, SizeLength, BlurShapeLength, ShapeLength> {
ToAnimatedValue, ToAnimatedValue,
ToComputedValue, ToComputedValue,
ToCss, ToCss,
ToResolvedValue,
ToShmem, ToShmem,
)] )]
pub enum Filter<Angle, Factor, Length, DropShadow, Url> { pub enum Filter<Angle, Factor, Length, DropShadow, Url> {
@ -95,6 +97,7 @@ pub enum Filter<Angle, Factor, Length, DropShadow, Url> {
ToAnimatedValue, ToAnimatedValue,
ToAnimatedZero, ToAnimatedZero,
ToCss, ToCss,
ToResolvedValue,
ToShmem, ToShmem,
)] )]
pub struct SimpleShadow<Color, SizeLength, ShapeLength> { pub struct SimpleShadow<Color, SizeLength, ShapeLength> {

View file

@ -19,6 +19,7 @@
ToAnimatedZero, ToAnimatedZero,
ToComputedValue, ToComputedValue,
ToCss, ToCss,
ToResolvedValue,
ToShmem, ToShmem,
)] )]
#[repr(C)] #[repr(C)]

View file

@ -16,7 +16,15 @@ use style_traits::{SpecifiedValueInfo, StyleParseErrorKind, ToCss};
/// https://drafts.csswg.org/css-fonts-4/#feature-tag-value /// https://drafts.csswg.org/css-fonts-4/#feature-tag-value
#[derive( #[derive(
Clone, Debug, Eq, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToComputedValue, ToShmem, Clone,
Debug,
Eq,
MallocSizeOf,
PartialEq,
SpecifiedValueInfo,
ToComputedValue,
ToResolvedValue,
ToShmem,
)] )]
pub struct FeatureTagValue<Integer> { pub struct FeatureTagValue<Integer> {
/// A four-character tag, packed into a u32 (one byte per character). /// A four-character tag, packed into a u32 (one byte per character).
@ -58,6 +66,7 @@ where
SpecifiedValueInfo, SpecifiedValueInfo,
ToComputedValue, ToComputedValue,
ToCss, ToCss,
ToResolvedValue,
ToShmem, ToShmem,
)] )]
pub struct VariationValue<Number> { pub struct VariationValue<Number> {
@ -71,7 +80,16 @@ pub struct VariationValue<Number> {
/// A value both for font-variation-settings and font-feature-settings. /// A value both for font-variation-settings and font-feature-settings.
#[css(comma)] #[css(comma)]
#[derive( #[derive(
Clone, Debug, Eq, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToComputedValue, ToCss, ToShmem, Clone,
Debug,
Eq,
MallocSizeOf,
PartialEq,
SpecifiedValueInfo,
ToComputedValue,
ToCss,
ToResolvedValue,
ToShmem,
)] )]
pub struct FontSettings<T>(#[css(if_empty = "normal", iterable)] pub Box<[T]>); pub struct FontSettings<T>(#[css(if_empty = "normal", iterable)] pub Box<[T]>);
@ -109,7 +127,16 @@ impl<T: Parse> Parse for FontSettings<T> {
/// https://drafts.csswg.org/css-fonts-4/#descdef-font-face-font-feature-settings /// https://drafts.csswg.org/css-fonts-4/#descdef-font-face-font-feature-settings
/// ///
#[derive( #[derive(
Clone, Copy, Debug, Eq, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToComputedValue, ToShmem, Clone,
Copy,
Debug,
Eq,
MallocSizeOf,
PartialEq,
SpecifiedValueInfo,
ToComputedValue,
ToResolvedValue,
ToShmem,
)] )]
pub struct FontTag(pub u32); pub struct FontTag(pub u32);
@ -263,6 +290,7 @@ impl Default for KeywordSize {
SpecifiedValueInfo, SpecifiedValueInfo,
ToAnimatedValue, ToAnimatedValue,
ToAnimatedZero, ToAnimatedZero,
ToResolvedValue,
ToShmem, ToShmem,
)] )]
pub enum FontStyle<Angle> { pub enum FontStyle<Angle> {

View file

@ -3,11 +3,21 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */ * file, You can obtain one at https://mozilla.org/MPL/2.0/. */
//! Generic types for legacy Gecko-only properties that should probably be //! Generic types for legacy Gecko-only properties that should probably be
//! unshipped at some point in the future. //! un-shipped at some point in the future.
/// A generic value for scroll snap points. /// A generic value for scroll snap points.
#[cfg_attr(feature = "gecko", derive(MallocSizeOf))] #[cfg_attr(feature = "gecko", derive(MallocSizeOf))]
#[derive(Clone, Copy, Debug, PartialEq, SpecifiedValueInfo, ToComputedValue, ToCss, ToShmem)] #[derive(
Clone,
Copy,
Debug,
PartialEq,
SpecifiedValueInfo,
ToComputedValue,
ToCss,
ToResolvedValue,
ToShmem,
)]
pub enum ScrollSnapPoint<LengthPercentage> { pub enum ScrollSnapPoint<LengthPercentage> {
/// `none` /// `none`
None, None,

View file

@ -19,7 +19,15 @@ use style_traits::{CssWriter, ParseError, StyleParseErrorKind, ToCss};
/// ///
/// <https://drafts.csswg.org/css-grid/#typedef-grid-row-start-grid-line> /// <https://drafts.csswg.org/css-grid/#typedef-grid-row-start-grid-line>
#[derive( #[derive(
Clone, Debug, Default, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToComputedValue, ToShmem, Clone,
Debug,
Default,
MallocSizeOf,
PartialEq,
SpecifiedValueInfo,
ToComputedValue,
ToResolvedValue,
ToShmem,
)] )]
pub struct GridLine<Integer> { pub struct GridLine<Integer> {
/// Flag to check whether it's a `span` keyword. /// Flag to check whether it's a `span` keyword.
@ -164,6 +172,7 @@ impl Parse for GridLine<specified::Integer> {
SpecifiedValueInfo, SpecifiedValueInfo,
ToComputedValue, ToComputedValue,
ToCss, ToCss,
ToResolvedValue,
ToShmem, ToShmem,
)] )]
pub enum TrackKeyword { pub enum TrackKeyword {
@ -185,6 +194,7 @@ pub enum TrackKeyword {
SpecifiedValueInfo, SpecifiedValueInfo,
ToComputedValue, ToComputedValue,
ToCss, ToCss,
ToResolvedValue,
ToShmem, ToShmem,
)] )]
pub enum TrackBreadth<L> { pub enum TrackBreadth<L> {
@ -211,7 +221,7 @@ impl<L> TrackBreadth<L> {
/// generic only to avoid code bloat. It only takes `<length-percentage>` /// generic only to avoid code bloat. It only takes `<length-percentage>`
/// ///
/// <https://drafts.csswg.org/css-grid/#typedef-track-size> /// <https://drafts.csswg.org/css-grid/#typedef-track-size>
#[derive(Clone, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToShmem)] #[derive(Clone, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToResolvedValue, ToShmem)]
pub enum TrackSize<L> { pub enum TrackSize<L> {
/// A flexible `<track-breadth>` /// A flexible `<track-breadth>`
Breadth(TrackBreadth<L>), Breadth(TrackBreadth<L>),
@ -369,7 +379,7 @@ where
/// The initial argument of the `repeat` function. /// The initial argument of the `repeat` function.
/// ///
/// <https://drafts.csswg.org/css-grid/#typedef-track-repeat> /// <https://drafts.csswg.org/css-grid/#typedef-track-repeat>
#[derive(Clone, Copy, Debug, MallocSizeOf, PartialEq, ToComputedValue, ToCss, ToShmem)] #[derive(Clone, Copy, Debug, MallocSizeOf, PartialEq, ToComputedValue, ToCss, ToResolvedValue, ToShmem)]
pub enum RepeatCount<Integer> { pub enum RepeatCount<Integer> {
/// A positive integer. This is allowed only for `<track-repeat>` and `<fixed-repeat>` /// A positive integer. This is allowed only for `<track-repeat>` and `<fixed-repeat>`
Number(Integer), Number(Integer),
@ -404,7 +414,7 @@ impl Parse for RepeatCount<specified::Integer> {
/// ///
/// It can also hold `repeat()` function parameters, which expands into the respective /// It can also hold `repeat()` function parameters, which expands into the respective
/// values in its computed form. /// values in its computed form.
#[derive(Clone, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToComputedValue, ToShmem)] #[derive(Clone, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToComputedValue, ToResolvedValue, ToShmem)]
#[css(function = "repeat")] #[css(function = "repeat")]
pub struct TrackRepeat<L, I> { pub struct TrackRepeat<L, I> {
/// The number of times for the value to be repeated (could also be `auto-fit` or `auto-fill`) /// The number of times for the value to be repeated (could also be `auto-fit` or `auto-fill`)
@ -501,6 +511,7 @@ impl<L: Clone> TrackRepeat<L, specified::Integer> {
SpecifiedValueInfo, SpecifiedValueInfo,
ToComputedValue, ToComputedValue,
ToCss, ToCss,
ToResolvedValue,
ToShmem, ToShmem,
)] )]
pub enum TrackListValue<LengthPercentage, Integer> { pub enum TrackListValue<LengthPercentage, Integer> {
@ -513,7 +524,7 @@ pub enum TrackListValue<LengthPercentage, Integer> {
/// The type of a `<track-list>` as determined during parsing. /// The type of a `<track-list>` as determined during parsing.
/// ///
/// <https://drafts.csswg.org/css-grid/#typedef-track-list> /// <https://drafts.csswg.org/css-grid/#typedef-track-list>
#[derive(Clone, Copy, Debug, MallocSizeOf, PartialEq, ToComputedValue, ToShmem)] #[derive(Clone, Copy, Debug, MallocSizeOf, PartialEq, ToComputedValue, ToResolvedValue, ToShmem)]
pub enum TrackListType { pub enum TrackListType {
/// [`<auto-track-list>`](https://drafts.csswg.org/css-grid/#typedef-auto-track-list) /// [`<auto-track-list>`](https://drafts.csswg.org/css-grid/#typedef-auto-track-list)
/// ///
@ -535,7 +546,7 @@ pub enum TrackListType {
/// A grid `<track-list>` type. /// A grid `<track-list>` type.
/// ///
/// <https://drafts.csswg.org/css-grid/#typedef-track-list> /// <https://drafts.csswg.org/css-grid/#typedef-track-list>
#[derive(Clone, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToShmem)] #[derive(Clone, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToShmem, ToResolvedValue)]
pub struct TrackList<LengthPercentage, Integer> { pub struct TrackList<LengthPercentage, Integer> {
/// The type of this `<track-list>` (auto, explicit or general). /// The type of this `<track-list>` (auto, explicit or general).
/// ///
@ -609,7 +620,15 @@ impl<L: ToCss, I: ToCss> ToCss for TrackList<L, I> {
/// `subgrid [ <line-names> | repeat(<positive-integer> | auto-fill, <line-names>+) ]+` /// `subgrid [ <line-names> | repeat(<positive-integer> | auto-fill, <line-names>+) ]+`
/// Old spec: https://www.w3.org/TR/2015/WD-css-grid-1-20150917/#typedef-line-name-list /// Old spec: https://www.w3.org/TR/2015/WD-css-grid-1-20150917/#typedef-line-name-list
#[derive( #[derive(
Clone, Debug, Default, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToComputedValue, ToShmem, Clone,
Debug,
Default,
MallocSizeOf,
PartialEq,
SpecifiedValueInfo,
ToComputedValue,
ToResolvedValue,
ToShmem,
)] )]
pub struct LineNameList { pub struct LineNameList {
/// The optional `<line-name-list>` /// The optional `<line-name-list>`
@ -724,6 +743,7 @@ impl ToCss for LineNameList {
SpecifiedValueInfo, SpecifiedValueInfo,
ToComputedValue, ToComputedValue,
ToCss, ToCss,
ToResolvedValue,
ToShmem, ToShmem,
)] )]
pub enum GridTemplateComponent<L, I> { pub enum GridTemplateComponent<L, I> {
@ -733,6 +753,7 @@ pub enum GridTemplateComponent<L, I> {
TrackList( TrackList(
#[animation(field_bound)] #[animation(field_bound)]
#[compute(field_bound)] #[compute(field_bound)]
#[resolve(field_bound)]
#[shmem(field_bound)] #[shmem(field_bound)]
TrackList<L, I>, TrackList<L, I>,
), ),

View file

@ -16,7 +16,7 @@ use style_traits::{CssWriter, ToCss};
/// An [image]. /// An [image].
/// ///
/// [image]: https://drafts.csswg.org/css-images/#image-values /// [image]: https://drafts.csswg.org/css-images/#image-values
#[derive(Clone, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToComputedValue, ToShmem)] #[derive(Clone, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToComputedValue, ToResolvedValue, ToShmem)]
pub enum Image<Gradient, MozImageRect, ImageUrl> { pub enum Image<Gradient, MozImageRect, ImageUrl> {
/// A `<url()>` image. /// A `<url()>` image.
Url(ImageUrl), Url(ImageUrl),
@ -36,7 +36,7 @@ pub enum Image<Gradient, MozImageRect, ImageUrl> {
/// A CSS gradient. /// A CSS gradient.
/// <https://drafts.csswg.org/css-images/#gradients> /// <https://drafts.csswg.org/css-images/#gradients>
#[derive(Clone, Debug, MallocSizeOf, PartialEq, ToComputedValue, ToShmem)] #[derive(Clone, Debug, MallocSizeOf, PartialEq, ToComputedValue, ToResolvedValue, ToShmem)]
pub struct Gradient<LineDirection, Length, LengthPercentage, Position, Color, Angle> { pub struct Gradient<LineDirection, Length, LengthPercentage, Position, Color, Angle> {
/// Gradients can be linear or radial. /// Gradients can be linear or radial.
pub kind: GradientKind<LineDirection, Length, LengthPercentage, Position, Angle>, pub kind: GradientKind<LineDirection, Length, LengthPercentage, Position, Angle>,
@ -48,7 +48,7 @@ pub struct Gradient<LineDirection, Length, LengthPercentage, Position, Color, An
pub compat_mode: CompatMode, pub compat_mode: CompatMode,
} }
#[derive(Clone, Copy, Debug, MallocSizeOf, PartialEq, ToComputedValue, ToShmem)] #[derive(Clone, Copy, Debug, MallocSizeOf, PartialEq, ToComputedValue, ToResolvedValue, ToShmem)]
/// Whether we used the modern notation or the compatibility `-webkit`, `-moz` prefixes. /// Whether we used the modern notation or the compatibility `-webkit`, `-moz` prefixes.
pub enum CompatMode { pub enum CompatMode {
/// Modern syntax. /// Modern syntax.
@ -60,7 +60,7 @@ pub enum CompatMode {
} }
/// A gradient kind. /// A gradient kind.
#[derive(Clone, Copy, Debug, MallocSizeOf, PartialEq, ToComputedValue, ToShmem)] #[derive(Clone, Copy, Debug, MallocSizeOf, PartialEq, ToComputedValue, ToResolvedValue, ToShmem)]
pub enum GradientKind<LineDirection, Length, LengthPercentage, Position, Angle> { pub enum GradientKind<LineDirection, Length, LengthPercentage, Position, Angle> {
/// A linear gradient. /// A linear gradient.
Linear(LineDirection), Linear(LineDirection),
@ -73,7 +73,7 @@ pub enum GradientKind<LineDirection, Length, LengthPercentage, Position, Angle>
} }
/// A radial gradient's ending shape. /// A radial gradient's ending shape.
#[derive(Clone, Copy, Debug, MallocSizeOf, PartialEq, ToComputedValue, ToCss, ToShmem)] #[derive(Clone, Copy, Debug, MallocSizeOf, PartialEq, ToComputedValue, ToCss, ToResolvedValue, ToShmem)]
pub enum EndingShape<Length, LengthPercentage> { pub enum EndingShape<Length, LengthPercentage> {
/// A circular gradient. /// A circular gradient.
Circle(Circle<Length>), Circle(Circle<Length>),
@ -82,7 +82,7 @@ pub enum EndingShape<Length, LengthPercentage> {
} }
/// A circle shape. /// A circle shape.
#[derive(Clone, Copy, Debug, MallocSizeOf, PartialEq, ToComputedValue, ToShmem)] #[derive(Clone, Copy, Debug, MallocSizeOf, PartialEq, ToComputedValue, ToResolvedValue, ToShmem)]
pub enum Circle<Length> { pub enum Circle<Length> {
/// A circle radius. /// A circle radius.
Radius(Length), Radius(Length),
@ -91,7 +91,7 @@ pub enum Circle<Length> {
} }
/// An ellipse shape. /// An ellipse shape.
#[derive(Clone, Copy, Debug, MallocSizeOf, PartialEq, ToComputedValue, ToCss, ToShmem)] #[derive(Clone, Copy, Debug, MallocSizeOf, PartialEq, ToComputedValue, ToCss, ToResolvedValue, ToShmem)]
pub enum Ellipse<LengthPercentage> { pub enum Ellipse<LengthPercentage> {
/// An ellipse pair of radii. /// An ellipse pair of radii.
Radii(LengthPercentage, LengthPercentage), Radii(LengthPercentage, LengthPercentage),
@ -103,7 +103,7 @@ pub enum Ellipse<LengthPercentage> {
#[allow(missing_docs)] #[allow(missing_docs)]
#[cfg_attr(feature = "servo", derive(Deserialize, Serialize))] #[cfg_attr(feature = "servo", derive(Deserialize, Serialize))]
#[derive( #[derive(
Clone, Copy, Debug, Eq, MallocSizeOf, Parse, PartialEq, ToComputedValue, ToCss, ToShmem, Clone, Copy, Debug, Eq, MallocSizeOf, Parse, PartialEq, ToComputedValue, ToCss, ToResolvedValue, ToShmem,
)] )]
pub enum ShapeExtent { pub enum ShapeExtent {
ClosestSide, ClosestSide,
@ -116,7 +116,7 @@ pub enum ShapeExtent {
/// A gradient item. /// A gradient item.
/// <https://drafts.csswg.org/css-images-4/#color-stop-syntax> /// <https://drafts.csswg.org/css-images-4/#color-stop-syntax>
#[derive(Clone, Copy, Debug, MallocSizeOf, PartialEq, ToComputedValue, ToCss, ToShmem)] #[derive(Clone, Copy, Debug, MallocSizeOf, PartialEq, ToComputedValue, ToCss, ToResolvedValue, ToShmem)]
pub enum GradientItem<Color, LengthPercentage> { pub enum GradientItem<Color, LengthPercentage> {
/// A color stop. /// A color stop.
ColorStop(ColorStop<Color, LengthPercentage>), ColorStop(ColorStop<Color, LengthPercentage>),
@ -126,7 +126,7 @@ pub enum GradientItem<Color, LengthPercentage> {
/// A color stop. /// A color stop.
/// <https://drafts.csswg.org/css-images/#typedef-color-stop-list> /// <https://drafts.csswg.org/css-images/#typedef-color-stop-list>
#[derive(Clone, Copy, Debug, MallocSizeOf, PartialEq, ToComputedValue, ToCss, ToShmem)] #[derive(Clone, Copy, Debug, MallocSizeOf, PartialEq, ToComputedValue, ToCss, ToResolvedValue, ToShmem)]
pub struct ColorStop<Color, LengthPercentage> { pub struct ColorStop<Color, LengthPercentage> {
/// The color of this stop. /// The color of this stop.
pub color: Color, pub color: Color,
@ -170,7 +170,7 @@ impl ToCss for PaintWorklet {
#[allow(missing_docs)] #[allow(missing_docs)]
#[css(comma, function)] #[css(comma, function)]
#[derive( #[derive(
Clone, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToComputedValue, ToCss, ToShmem, Clone, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToComputedValue, ToCss, ToResolvedValue, ToShmem,
)] )]
pub struct MozImageRect<NumberOrPercentage, MozImageRectUrl> { pub struct MozImageRect<NumberOrPercentage, MozImageRectUrl> {
pub url: MozImageRectUrl, pub url: MozImageRectUrl,

View file

@ -26,6 +26,7 @@ use style_traits::ParseError;
ToAnimatedZero, ToAnimatedZero,
ToComputedValue, ToComputedValue,
ToCss, ToCss,
ToResolvedValue,
ToShmem, ToShmem,
)] )]
#[repr(C, u8)] #[repr(C, u8)]
@ -110,6 +111,7 @@ impl<LengthPercentage: Parse> Parse for LengthPercentageOrAuto<LengthPercentage>
ToAnimatedZero, ToAnimatedZero,
ToComputedValue, ToComputedValue,
ToCss, ToCss,
ToResolvedValue,
ToShmem, ToShmem,
)] )]
#[repr(C, u8)] #[repr(C, u8)]
@ -152,6 +154,7 @@ impl<LengthPercentage> Size<LengthPercentage> {
ToAnimatedZero, ToAnimatedZero,
ToComputedValue, ToComputedValue,
ToCss, ToCss,
ToResolvedValue,
ToShmem, ToShmem,
)] )]
#[repr(C, u8)] #[repr(C, u8)]
@ -188,6 +191,7 @@ impl<LengthPercentage> MaxSize<LengthPercentage> {
ToAnimatedZero, ToAnimatedZero,
ToComputedValue, ToComputedValue,
ToCss, ToCss,
ToResolvedValue,
ToShmem, ToShmem,
)] )]
#[repr(C, u8)] #[repr(C, u8)]

View file

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

View file

@ -18,6 +18,7 @@
ToAnimatedValue, ToAnimatedValue,
ToAnimatedZero, ToAnimatedZero,
ToComputedValue, ToComputedValue,
ToResolvedValue,
ToShmem, ToShmem,
)] )]
#[repr(C)] #[repr(C)]
@ -54,6 +55,7 @@ impl<H, V> Position<H, V> {
ToAnimatedZero, ToAnimatedZero,
ToComputedValue, ToComputedValue,
ToCss, ToCss,
ToResolvedValue,
ToShmem, ToShmem,
)] )]
#[repr(C, u8)] #[repr(C, u8)]

View file

@ -22,6 +22,7 @@ use style_traits::{CssWriter, ParseError, ToCss};
SpecifiedValueInfo, SpecifiedValueInfo,
ToAnimatedValue, ToAnimatedValue,
ToComputedValue, ToComputedValue,
ToResolvedValue,
ToShmem, ToShmem,
)] )]
#[repr(C)] #[repr(C)]

View file

@ -24,6 +24,7 @@ use style_traits::{CssWriter, ParseError, ToCss};
ToAnimatedZero, ToAnimatedZero,
ToAnimatedValue, ToAnimatedValue,
ToComputedValue, ToComputedValue,
ToResolvedValue,
ToShmem, ToShmem,
)] )]
#[allow(missing_docs)] #[allow(missing_docs)]

View file

@ -24,6 +24,7 @@ use style_traits::{ParseError, StyleParseErrorKind};
ToAnimatedValue, ToAnimatedValue,
ToComputedValue, ToComputedValue,
ToCss, ToCss,
ToResolvedValue,
ToShmem, ToShmem,
)] )]
pub struct SVGPaint<ColorType, UrlPaintServer> { pub struct SVGPaint<ColorType, UrlPaintServer> {
@ -51,6 +52,7 @@ pub struct SVGPaint<ColorType, UrlPaintServer> {
ToAnimatedZero, ToAnimatedZero,
ToComputedValue, ToComputedValue,
ToCss, ToCss,
ToResolvedValue,
ToShmem, ToShmem,
)] )]
pub enum SVGPaintKind<ColorType, UrlPaintServer> { pub enum SVGPaintKind<ColorType, UrlPaintServer> {
@ -144,6 +146,7 @@ impl<ColorType: Parse, UrlPaintServer: Parse> Parse for SVGPaint<ColorType, UrlP
ToAnimatedZero, ToAnimatedZero,
ToComputedValue, ToComputedValue,
ToCss, ToCss,
ToResolvedValue,
ToShmem, ToShmem,
)] )]
pub enum SVGLength<L> { pub enum SVGLength<L> {
@ -165,6 +168,7 @@ pub enum SVGLength<L> {
ToAnimatedZero, ToAnimatedZero,
ToComputedValue, ToComputedValue,
ToCss, ToCss,
ToResolvedValue,
ToShmem, ToShmem,
)] )]
pub enum SVGStrokeDashArray<L> { pub enum SVGStrokeDashArray<L> {
@ -190,6 +194,7 @@ pub enum SVGStrokeDashArray<L> {
ToAnimatedZero, ToAnimatedZero,
ToComputedValue, ToComputedValue,
ToCss, ToCss,
ToResolvedValue,
ToShmem, ToShmem,
)] )]
pub enum SVGOpacity<OpacityType> { pub enum SVGOpacity<OpacityType> {

View file

@ -19,6 +19,7 @@ use style_traits::ParseError;
SpecifiedValueInfo, SpecifiedValueInfo,
ToComputedValue, ToComputedValue,
ToCss, ToCss,
ToResolvedValue,
ToShmem, ToShmem,
)] )]
pub enum InitialLetter<Number, Integer> { pub enum InitialLetter<Number, Integer> {
@ -92,6 +93,7 @@ fn line_height_moz_block_height_enabled(context: &ParserContext) -> bool {
ToAnimatedValue, ToAnimatedValue,
ToCss, ToCss,
ToShmem, ToShmem,
ToResolvedValue,
Parse, Parse,
)] )]
#[repr(C, u8)] #[repr(C, u8)]

View file

@ -27,6 +27,7 @@ use style_traits::{CssWriter, ToCss};
SpecifiedValueInfo, SpecifiedValueInfo,
ToComputedValue, ToComputedValue,
ToCss, ToCss,
ToResolvedValue,
ToShmem, ToShmem,
)] )]
#[css(comma, function)] #[css(comma, function)]
@ -42,8 +43,18 @@ pub struct Matrix<T> {
#[allow(missing_docs)] #[allow(missing_docs)]
#[cfg_attr(rustfmt, rustfmt_skip)] #[cfg_attr(rustfmt, rustfmt_skip)]
#[css(comma, function = "matrix3d")] #[css(comma, function = "matrix3d")]
#[derive(Clone, Copy, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo, #[derive(
ToComputedValue, ToCss, ToShmem)] Clone,
Copy,
Debug,
MallocSizeOf,
PartialEq,
SpecifiedValueInfo,
ToComputedValue,
ToCss,
ToResolvedValue,
ToShmem,
)]
pub struct Matrix3D<T> { pub struct Matrix3D<T> {
pub m11: T, pub m12: T, pub m13: T, pub m14: T, pub m11: T, pub m12: T, pub m13: T, pub m14: T,
pub m21: T, pub m22: T, pub m23: T, pub m24: T, pub m21: T, pub m22: T, pub m23: T, pub m24: T,
@ -90,6 +101,7 @@ impl<T: Into<f64>> From<Matrix3D<T>> for Transform3D<f64> {
ToAnimatedZero, ToAnimatedZero,
ToComputedValue, ToComputedValue,
ToCss, ToCss,
ToResolvedValue,
ToShmem, ToShmem,
)] )]
#[repr(C)] #[repr(C)]
@ -120,7 +132,7 @@ fn is_same<N: PartialEq>(x: &N, y: &N) -> bool {
} }
#[derive( #[derive(
Clone, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToComputedValue, ToCss, ToShmem, Clone, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToComputedValue, ToCss, ToResolvedValue, ToShmem,
)] )]
/// A single operation in the list of a `transform` value /// A single operation in the list of a `transform` value
pub enum TransformOperation<Angle, Number, Length, Integer, LengthPercentage> pub enum TransformOperation<Angle, Number, Length, Integer, LengthPercentage>
@ -227,7 +239,7 @@ where
} }
#[derive( #[derive(
Clone, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToComputedValue, ToCss, ToShmem, Clone, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToComputedValue, ToCss, ToResolvedValue, ToShmem,
)] )]
/// A value of the `transform` property /// A value of the `transform` property
pub struct Transform<T>(#[css(if_empty = "none", iterable)] pub Vec<T>); pub struct Transform<T>(#[css(if_empty = "none", iterable)] pub Vec<T>);
@ -558,6 +570,7 @@ pub fn get_normalized_vector_and_angle<T: Zero>(
SpecifiedValueInfo, SpecifiedValueInfo,
ToAnimatedZero, ToAnimatedZero,
ToComputedValue, ToComputedValue,
ToResolvedValue,
ToShmem, ToShmem,
)] )]
/// A value of the `Rotate` property /// A value of the `Rotate` property
@ -628,6 +641,7 @@ where
SpecifiedValueInfo, SpecifiedValueInfo,
ToAnimatedZero, ToAnimatedZero,
ToComputedValue, ToComputedValue,
ToResolvedValue,
ToShmem, ToShmem,
)] )]
/// A value of the `Scale` property /// A value of the `Scale` property
@ -677,6 +691,7 @@ impl<Number: ToCss + PartialEq> ToCss for Scale<Number> {
ToAnimatedZero, ToAnimatedZero,
ToComputedValue, ToComputedValue,
ToCss, ToCss,
ToResolvedValue,
ToShmem, ToShmem,
)] )]
/// A value of the `translate` property /// A value of the `translate` property
@ -719,6 +734,7 @@ where
SpecifiedValueInfo, SpecifiedValueInfo,
ToComputedValue, ToComputedValue,
ToCss, ToCss,
ToResolvedValue,
ToShmem, ToShmem,
)] )]
pub enum TransformStyle { pub enum TransformStyle {

View file

@ -11,7 +11,7 @@ use values::specified::ui::CursorKind;
/// A generic value for the `cursor` property. /// A generic value for the `cursor` property.
/// ///
/// https://drafts.csswg.org/css-ui/#cursor /// https://drafts.csswg.org/css-ui/#cursor
#[derive(Clone, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToComputedValue, ToShmem)] #[derive(Clone, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToComputedValue, ToResolvedValue, ToShmem)]
pub struct Cursor<Image> { pub struct Cursor<Image> {
/// The parsed images for the cursor. /// The parsed images for the cursor.
pub images: Box<[Image]>, pub images: Box<[Image]>,
@ -44,7 +44,7 @@ impl<Image: ToCss> ToCss for Cursor<Image> {
} }
/// A generic value for item of `image cursors`. /// A generic value for item of `image cursors`.
#[derive(Clone, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToComputedValue, ToShmem)] #[derive(Clone, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToComputedValue, ToResolvedValue, ToShmem)]
pub struct CursorImage<ImageUrl, Number> { pub struct CursorImage<ImageUrl, Number> {
/// The url to parse images from. /// The url to parse images from.
pub url: ImageUrl, pub url: ImageUrl,
@ -84,6 +84,7 @@ impl<ImageUrl: ToCss, Number: ToCss> ToCss for CursorImage<ImageUrl, Number> {
ToAnimatedZero, ToAnimatedZero,
ToComputedValue, ToComputedValue,
ToCss, ToCss,
ToResolvedValue,
ToShmem, ToShmem,
)] )]
#[repr(C, u8)] #[repr(C, u8)]

View file

@ -18,6 +18,7 @@
ToAnimatedZero, ToAnimatedZero,
ToComputedValue, ToComputedValue,
ToCss, ToCss,
ToResolvedValue,
ToShmem, ToShmem,
)] )]
pub enum UrlOrNone<Url> { pub enum UrlOrNone<Url> {

View file

@ -28,6 +28,7 @@ pub mod animated;
pub mod computed; pub mod computed;
pub mod distance; pub mod distance;
pub mod generics; pub mod generics;
pub mod resolved;
pub mod specified; pub mod specified;
/// A CSS float value. /// A CSS float value.
@ -96,7 +97,7 @@ where
/// Convenience void type to disable some properties and values through types. /// Convenience void type to disable some properties and values through types.
#[cfg_attr(feature = "servo", derive(Deserialize, MallocSizeOf, Serialize))] #[cfg_attr(feature = "servo", derive(Deserialize, MallocSizeOf, Serialize))]
#[derive( #[derive(
Clone, Copy, Debug, PartialEq, SpecifiedValueInfo, ToAnimatedValue, ToComputedValue, ToCss, Clone, Copy, Debug, PartialEq, SpecifiedValueInfo, ToAnimatedValue, ToComputedValue, ToCss, ToResolvedValue,
)] )]
pub enum Impossible {} pub enum Impossible {}
@ -134,6 +135,7 @@ impl Parse for Impossible {
ToAnimatedZero, ToAnimatedZero,
ToComputedValue, ToComputedValue,
ToCss, ToCss,
ToResolvedValue,
ToShmem, ToShmem,
)] )]
pub enum Either<A, B> { pub enum Either<A, B> {
@ -154,7 +156,7 @@ impl<A: Debug, B: Debug> Debug for Either<A, B> {
/// <https://drafts.csswg.org/css-values-4/#custom-idents> /// <https://drafts.csswg.org/css-values-4/#custom-idents>
#[derive( #[derive(
Clone, Debug, Eq, Hash, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToComputedValue, ToShmem, Clone, Debug, Eq, Hash, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToComputedValue, ToResolvedValue, ToShmem,
)] )]
pub struct CustomIdent(pub Atom); pub struct CustomIdent(pub Atom);
@ -192,7 +194,7 @@ impl ToCss for CustomIdent {
} }
/// <https://drafts.csswg.org/css-animations/#typedef-keyframes-name> /// <https://drafts.csswg.org/css-animations/#typedef-keyframes-name>
#[derive(Clone, Debug, MallocSizeOf, SpecifiedValueInfo, ToComputedValue, ToShmem)] #[derive(Clone, Debug, MallocSizeOf, SpecifiedValueInfo, ToComputedValue, ToResolvedValue, ToShmem)]
pub enum KeyframesName { pub enum KeyframesName {
/// <custom-ident> /// <custom-ident>
Ident(CustomIdent), Ident(CustomIdent),

View file

@ -16,7 +16,7 @@ bitflags! {
/// Constants shared by multiple CSS Box Alignment properties /// Constants shared by multiple CSS Box Alignment properties
/// ///
/// These constants match Gecko's `NS_STYLE_ALIGN_*` constants. /// These constants match Gecko's `NS_STYLE_ALIGN_*` constants.
#[derive(MallocSizeOf, ToComputedValue, ToShmem)] #[derive(MallocSizeOf, ToComputedValue, ToResolvedValue, ToShmem)]
pub struct AlignFlags: u8 { pub struct AlignFlags: u8 {
// Enumeration stored in the lower 5 bits: // Enumeration stored in the lower 5 bits:
/// 'auto' /// 'auto'
@ -134,7 +134,7 @@ pub enum AxisDirection {
/// Shared value for the `align-content` and `justify-content` properties. /// Shared value for the `align-content` and `justify-content` properties.
/// ///
/// <https://drafts.csswg.org/css-align/#content-distribution> /// <https://drafts.csswg.org/css-align/#content-distribution>
#[derive(Clone, Copy, Debug, Eq, MallocSizeOf, PartialEq, ToComputedValue, ToCss, ToShmem)] #[derive(Clone, Copy, Debug, Eq, MallocSizeOf, PartialEq, ToComputedValue, ToCss, ToResolvedValue, ToShmem)]
#[cfg_attr(feature = "servo", derive(Deserialize, Serialize))] #[cfg_attr(feature = "servo", derive(Deserialize, Serialize))]
pub struct ContentDistribution { pub struct ContentDistribution {
primary: AlignFlags, primary: AlignFlags,
@ -247,7 +247,7 @@ impl ContentDistribution {
/// Value for the `align-content` property. /// Value for the `align-content` property.
/// ///
/// <https://drafts.csswg.org/css-align/#propdef-align-content> /// <https://drafts.csswg.org/css-align/#propdef-align-content>
#[derive(Clone, Copy, Debug, Eq, MallocSizeOf, PartialEq, ToComputedValue, ToCss, ToShmem)] #[derive(Clone, Copy, Debug, Eq, MallocSizeOf, PartialEq, ToComputedValue, ToCss, ToResolvedValue, ToShmem)]
pub struct AlignContent(pub ContentDistribution); pub struct AlignContent(pub ContentDistribution);
impl Parse for AlignContent { impl Parse for AlignContent {
@ -287,7 +287,7 @@ impl From<AlignContent> for u16 {
/// Value for the `justify-content` property. /// Value for the `justify-content` property.
/// ///
/// <https://drafts.csswg.org/css-align/#propdef-justify-content> /// <https://drafts.csswg.org/css-align/#propdef-justify-content>
#[derive(Clone, Copy, Debug, Eq, MallocSizeOf, PartialEq, ToComputedValue, ToCss, ToShmem)] #[derive(Clone, Copy, Debug, Eq, MallocSizeOf, PartialEq, ToComputedValue, ToCss, ToResolvedValue, ToShmem)]
pub struct JustifyContent(pub ContentDistribution); pub struct JustifyContent(pub ContentDistribution);
impl Parse for JustifyContent { impl Parse for JustifyContent {
@ -325,7 +325,7 @@ impl From<JustifyContent> for u16 {
} }
/// <https://drafts.csswg.org/css-align/#self-alignment> /// <https://drafts.csswg.org/css-align/#self-alignment>
#[derive(Clone, Copy, Debug, Eq, MallocSizeOf, PartialEq, ToComputedValue, ToCss, ToShmem)] #[derive(Clone, Copy, Debug, Eq, MallocSizeOf, PartialEq, ToComputedValue, ToCss, ToResolvedValue, ToShmem)]
pub struct SelfAlignment(pub AlignFlags); pub struct SelfAlignment(pub AlignFlags);
impl SelfAlignment { impl SelfAlignment {
@ -385,7 +385,7 @@ impl SelfAlignment {
/// The specified value of the align-self property. /// The specified value of the align-self property.
/// ///
/// <https://drafts.csswg.org/css-align/#propdef-align-self> /// <https://drafts.csswg.org/css-align/#propdef-align-self>
#[derive(Clone, Copy, Debug, Eq, MallocSizeOf, PartialEq, ToComputedValue, ToCss, ToShmem)] #[derive(Clone, Copy, Debug, Eq, MallocSizeOf, PartialEq, ToComputedValue, ToCss, ToResolvedValue, ToShmem)]
pub struct AlignSelf(pub SelfAlignment); pub struct AlignSelf(pub SelfAlignment);
impl Parse for AlignSelf { impl Parse for AlignSelf {
@ -423,7 +423,7 @@ impl From<AlignSelf> for u8 {
/// The specified value of the justify-self property. /// The specified value of the justify-self property.
/// ///
/// <https://drafts.csswg.org/css-align/#propdef-justify-self> /// <https://drafts.csswg.org/css-align/#propdef-justify-self>
#[derive(Clone, Copy, Debug, Eq, MallocSizeOf, PartialEq, ToComputedValue, ToCss, ToShmem)] #[derive(Clone, Copy, Debug, Eq, MallocSizeOf, PartialEq, ToComputedValue, ToCss, ToResolvedValue, ToShmem)]
pub struct JustifySelf(pub SelfAlignment); pub struct JustifySelf(pub SelfAlignment);
impl Parse for JustifySelf { impl Parse for JustifySelf {
@ -461,7 +461,7 @@ impl From<JustifySelf> for u8 {
/// Value of the `align-items` property /// Value of the `align-items` property
/// ///
/// <https://drafts.csswg.org/css-align/#propdef-align-items> /// <https://drafts.csswg.org/css-align/#propdef-align-items>
#[derive(Clone, Copy, Debug, Eq, MallocSizeOf, PartialEq, ToComputedValue, ToCss, ToShmem)] #[derive(Clone, Copy, Debug, Eq, MallocSizeOf, PartialEq, ToComputedValue, ToCss, ToResolvedValue, ToShmem)]
pub struct AlignItems(pub AlignFlags); pub struct AlignItems(pub AlignFlags);
impl AlignItems { impl AlignItems {

View file

@ -47,6 +47,7 @@ impl Parse for BackgroundSize {
SpecifiedValueInfo, SpecifiedValueInfo,
ToComputedValue, ToComputedValue,
ToCss, ToCss,
ToResolvedValue,
ToShmem, ToShmem,
)] )]
#[allow(missing_docs)] #[allow(missing_docs)]
@ -63,7 +64,7 @@ pub enum BackgroundRepeatKeyword {
/// axes. /// axes.
/// ///
/// https://drafts.csswg.org/css-backgrounds/#the-background-repeat /// https://drafts.csswg.org/css-backgrounds/#the-background-repeat
#[derive(Clone, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToComputedValue, ToShmem)] #[derive(Clone, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToComputedValue, ToResolvedValue, ToShmem)]
pub struct BackgroundRepeat(pub BackgroundRepeatKeyword, pub BackgroundRepeatKeyword); pub struct BackgroundRepeat(pub BackgroundRepeatKeyword, pub BackgroundRepeatKeyword);
impl BackgroundRepeat { impl BackgroundRepeat {

View file

@ -40,6 +40,7 @@ use style_traits::{CssWriter, ParseError, ToCss};
SpecifiedValueInfo, SpecifiedValueInfo,
ToComputedValue, ToComputedValue,
ToCss, ToCss,
ToResolvedValue,
ToShmem, ToShmem,
)] )]
#[repr(u8)] #[repr(u8)]
@ -264,7 +265,7 @@ pub enum BorderImageRepeatKeyword {
/// ///
/// https://drafts.csswg.org/css-backgrounds/#the-border-image-repeat /// https://drafts.csswg.org/css-backgrounds/#the-border-image-repeat
#[derive( #[derive(
Clone, Copy, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToComputedValue, ToShmem, Clone, Copy, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToComputedValue, ToResolvedValue, ToShmem,
)] )]
pub struct BorderImageRepeat(pub BorderImageRepeatKeyword, pub BorderImageRepeatKeyword); pub struct BorderImageRepeat(pub BorderImageRepeatKeyword, pub BorderImageRepeatKeyword);

View file

@ -61,6 +61,7 @@ fn moz_box_display_values_enabled(context: &ParserContext) -> bool {
SpecifiedValueInfo, SpecifiedValueInfo,
ToComputedValue, ToComputedValue,
ToCss, ToCss,
ToResolvedValue,
ToShmem, ToShmem,
)] )]
#[cfg_attr(feature = "servo", derive(Deserialize, Serialize))] #[cfg_attr(feature = "servo", derive(Deserialize, Serialize))]
@ -326,7 +327,16 @@ impl AnimationIterationCount {
/// A value for the `animation-name` property. /// A value for the `animation-name` property.
#[derive( #[derive(
Clone, Debug, Eq, Hash, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToComputedValue, ToShmem, Clone,
Debug,
Eq,
Hash,
MallocSizeOf,
PartialEq,
SpecifiedValueInfo,
ToComputedValue,
ToResolvedValue,
ToShmem,
)] )]
#[value_info(other_values = "none")] #[value_info(other_values = "none")]
pub struct AnimationName(pub Option<KeyframesName>); pub struct AnimationName(pub Option<KeyframesName>);
@ -382,6 +392,7 @@ impl Parse for AnimationName {
SpecifiedValueInfo, SpecifiedValueInfo,
ToComputedValue, ToComputedValue,
ToCss, ToCss,
ToResolvedValue,
ToShmem, ToShmem,
)] )]
#[repr(u8)] #[repr(u8)]
@ -406,6 +417,7 @@ pub enum ScrollSnapType {
SpecifiedValueInfo, SpecifiedValueInfo,
ToComputedValue, ToComputedValue,
ToCss, ToCss,
ToResolvedValue,
ToShmem, ToShmem,
)] )]
#[repr(u8)] #[repr(u8)]
@ -419,7 +431,7 @@ pub enum ScrollSnapAlignKeyword {
/// https://drafts.csswg.org/css-scroll-snap-1/#scroll-snap-align /// https://drafts.csswg.org/css-scroll-snap-1/#scroll-snap-align
#[allow(missing_docs)] #[allow(missing_docs)]
#[derive( #[derive(
Clone, Copy, Debug, Eq, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToComputedValue, ToShmem, Clone, Copy, Debug, Eq, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToComputedValue, ToResolvedValue, ToShmem,
)] )]
#[repr(C)] #[repr(C)]
pub struct ScrollSnapAlign { pub struct ScrollSnapAlign {
@ -477,6 +489,7 @@ impl ToCss for ScrollSnapAlign {
SpecifiedValueInfo, SpecifiedValueInfo,
ToComputedValue, ToComputedValue,
ToCss, ToCss,
ToResolvedValue,
ToShmem, ToShmem,
)] )]
#[repr(u8)] #[repr(u8)]
@ -499,6 +512,7 @@ pub enum OverscrollBehavior {
SpecifiedValueInfo, SpecifiedValueInfo,
ToComputedValue, ToComputedValue,
ToCss, ToCss,
ToResolvedValue,
ToShmem, ToShmem,
)] )]
#[repr(u8)] #[repr(u8)]
@ -520,6 +534,7 @@ pub enum OverflowAnchor {
SpecifiedValueInfo, SpecifiedValueInfo,
ToComputedValue, ToComputedValue,
ToCss, ToCss,
ToResolvedValue,
ToShmem, ToShmem,
)] )]
#[repr(u8)] #[repr(u8)]
@ -529,7 +544,7 @@ pub enum OverflowClipBox {
} }
#[derive( #[derive(
Clone, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToComputedValue, ToCss, ToShmem, Clone, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToComputedValue, ToCss, ToResolvedValue, ToShmem,
)] )]
/// Provides a rendering hint to the user agent, /// Provides a rendering hint to the user agent,
/// stating what kinds of changes the author expects /// stating what kinds of changes the author expects
@ -562,7 +577,7 @@ impl WillChange {
bitflags! { bitflags! {
/// The change bits that we care about. /// The change bits that we care about.
#[derive(MallocSizeOf, SpecifiedValueInfo, ToComputedValue, ToShmem)] #[derive(MallocSizeOf, SpecifiedValueInfo, ToComputedValue, ToResolvedValue, ToShmem)]
#[repr(C)] #[repr(C)]
pub struct WillChangeBits: u8 { pub struct WillChangeBits: u8 {
/// Whether the stacking context will change. /// Whether the stacking context will change.
@ -657,8 +672,7 @@ impl Parse for WillChange {
bitflags! { bitflags! {
/// Values for the `touch-action` property. /// Values for the `touch-action` property.
#[cfg_attr(feature = "gecko", derive(MallocSizeOf))] #[derive(MallocSizeOf, SpecifiedValueInfo, ToComputedValue, ToResolvedValue, ToShmem)]
#[derive(SpecifiedValueInfo, ToComputedValue, ToShmem)]
/// These constants match Gecko's `NS_STYLE_TOUCH_ACTION_*` constants. /// These constants match Gecko's `NS_STYLE_TOUCH_ACTION_*` constants.
#[value_info(other_values = "auto,none,manipulation,pan-x,pan-y")] #[value_info(other_values = "auto,none,manipulation,pan-x,pan-y")]
#[repr(C)] #[repr(C)]
@ -731,7 +745,7 @@ impl Parse for TouchAction {
} }
bitflags! { bitflags! {
#[derive(MallocSizeOf, SpecifiedValueInfo, ToComputedValue, ToShmem)] #[derive(MallocSizeOf, SpecifiedValueInfo, ToComputedValue, ToResolvedValue, ToShmem)]
#[value_info(other_values = "none,strict,content,size,layout,paint")] #[value_info(other_values = "none,strict,content,size,layout,paint")]
#[repr(C)] #[repr(C)]
/// Constants for contain: https://drafts.csswg.org/css-contain/#contain-property /// Constants for contain: https://drafts.csswg.org/css-contain/#contain-property
@ -833,7 +847,7 @@ pub type Perspective = GenericPerspective<NonNegativeLength>;
/// A given transition property, that is either `All`, a longhand or shorthand /// A given transition property, that is either `All`, a longhand or shorthand
/// property, or an unsupported or custom property. /// property, or an unsupported or custom property.
#[derive(Clone, Debug, Eq, Hash, MallocSizeOf, PartialEq, ToComputedValue, ToShmem)] #[derive(Clone, Debug, Eq, Hash, MallocSizeOf, PartialEq, ToComputedValue, ToResolvedValue, ToShmem)]
pub enum TransitionProperty { pub enum TransitionProperty {
/// A shorthand. /// A shorthand.
Shorthand(ShorthandId), Shorthand(ShorthandId),
@ -1018,6 +1032,7 @@ pub enum Resize {
SpecifiedValueInfo, SpecifiedValueInfo,
ToCss, ToCss,
ToComputedValue, ToComputedValue,
ToResolvedValue,
ToShmem, ToShmem,
)] )]
#[repr(u8)] #[repr(u8)]
@ -1370,6 +1385,7 @@ pub enum Appearance {
SpecifiedValueInfo, SpecifiedValueInfo,
ToCss, ToCss,
ToComputedValue, ToComputedValue,
ToResolvedValue,
ToShmem, ToShmem,
)] )]
#[repr(u8)] #[repr(u8)]
@ -1442,6 +1458,7 @@ impl BreakBetween {
SpecifiedValueInfo, SpecifiedValueInfo,
ToCss, ToCss,
ToComputedValue, ToComputedValue,
ToResolvedValue,
ToShmem, ToShmem,
)] )]
#[repr(u8)] #[repr(u8)]
@ -1464,6 +1481,7 @@ pub enum BreakWithin {
SpecifiedValueInfo, SpecifiedValueInfo,
ToCss, ToCss,
ToComputedValue, ToComputedValue,
ToResolvedValue,
ToShmem, ToShmem,
)] )]
#[repr(u8)] #[repr(u8)]

View file

@ -995,7 +995,7 @@ bitflags! {
} }
} }
#[derive(Clone, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToCss, ToShmem)] #[derive(Clone, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToCss, ToResolvedValue, ToShmem)]
/// Set of variant alternates /// Set of variant alternates
pub enum VariantAlternates { pub enum VariantAlternates {
/// Enables display of stylistic alternates /// Enables display of stylistic alternates
@ -1020,7 +1020,7 @@ pub enum VariantAlternates {
HistoricalForms, HistoricalForms,
} }
#[derive(Clone, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToCss, ToShmem)] #[derive(Clone, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToCss, ToResolvedValue, ToShmem)]
/// List of Variant Alternates /// List of Variant Alternates
pub struct VariantAlternatesList( pub struct VariantAlternatesList(
#[css(if_empty = "normal", iterable)] pub Box<[VariantAlternates]>, #[css(if_empty = "normal", iterable)] pub Box<[VariantAlternates]>,
@ -1188,7 +1188,7 @@ macro_rules! impl_variant_east_asian {
)+ )+
} => { } => {
bitflags! { bitflags! {
#[derive(MallocSizeOf, ToShmem)] #[derive(MallocSizeOf, ToShmem, ToResolvedValue)]
/// Vairants for east asian variant /// Vairants for east asian variant
pub struct VariantEastAsian: u16 { pub struct VariantEastAsian: u16 {
/// None of the features /// None of the features
@ -1395,7 +1395,7 @@ macro_rules! impl_variant_ligatures {
)+ )+
} => { } => {
bitflags! { bitflags! {
#[derive(MallocSizeOf, ToShmem)] #[derive(MallocSizeOf, ToResolvedValue, ToShmem)]
/// Variants of ligatures /// Variants of ligatures
pub struct VariantLigatures: u16 { pub struct VariantLigatures: u16 {
/// Specifies that common default features are enabled /// Specifies that common default features are enabled
@ -1617,7 +1617,7 @@ macro_rules! impl_variant_numeric {
)+ )+
} => { } => {
bitflags! { bitflags! {
#[derive(MallocSizeOf, ToShmem)] #[derive(MallocSizeOf, ToResolvedValue, ToShmem)]
/// Vairants of numeric values /// Vairants of numeric values
pub struct VariantNumeric: u8 { pub struct VariantNumeric: u8 {
/// None of other variants are enabled. /// None of other variants are enabled.
@ -1858,7 +1858,7 @@ impl Parse for FontFeatureSettings {
} }
#[derive( #[derive(
Clone, Copy, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToComputedValue, ToShmem, Clone, Copy, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToComputedValue, ToResolvedValue, ToShmem,
)] )]
/// Whether user agents are allowed to synthesize bold or oblique font faces /// Whether user agents are allowed to synthesize bold or oblique font faces
/// when a font family lacks bold or italic faces /// when a font family lacks bold or italic faces
@ -2158,6 +2158,7 @@ impl Parse for VariationValue<Number> {
SpecifiedValueInfo, SpecifiedValueInfo,
ToComputedValue, ToComputedValue,
ToCss, ToCss,
ToResolvedValue,
ToShmem, ToShmem,
)] )]
/// text-zoom. Enable if true, disable if false /// text-zoom. Enable if true, disable if false
@ -2177,7 +2178,7 @@ impl Parse for XTextZoom {
} }
#[derive( #[derive(
Clone, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToComputedValue, ToCss, ToShmem, Clone, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToComputedValue, ToCss, ToResolvedValue, ToShmem,
)] )]
/// Internal property that reflects the lang attribute /// Internal property that reflects the lang attribute
pub struct XLang(#[css(skip)] pub Atom); pub struct XLang(#[css(skip)] pub Atom);
@ -2266,7 +2267,7 @@ impl Parse for MozScriptLevel {
} }
#[cfg_attr(feature = "gecko", derive(MallocSizeOf))] #[cfg_attr(feature = "gecko", derive(MallocSizeOf))]
#[derive(Clone, Copy, Debug, PartialEq, SpecifiedValueInfo, ToComputedValue, ToCss, ToShmem)] #[derive(Clone, Copy, Debug, PartialEq, SpecifiedValueInfo, ToComputedValue, ToCss, ToResolvedValue, ToShmem)]
/// Specifies the multiplier to be used to adjust font size /// Specifies the multiplier to be used to adjust font size
/// due to changes in scriptlevel. /// due to changes in scriptlevel.
/// ///

View file

@ -16,7 +16,7 @@ use style_traits::{ParseError, StyleParseErrorKind};
/// Specified and computed `list-style-type` property. /// Specified and computed `list-style-type` property.
#[cfg(feature = "gecko")] #[cfg(feature = "gecko")]
#[derive( #[derive(
Clone, Debug, Eq, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToComputedValue, ToCss, ToShmem, Clone, Debug, Eq, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToComputedValue, ToCss, ToResolvedValue, ToShmem,
)] )]
pub enum ListStyleType { pub enum ListStyleType {
/// <counter-style> | none /// <counter-style> | none
@ -77,7 +77,7 @@ impl Parse for ListStyleType {
/// A quote pair. /// A quote pair.
#[derive( #[derive(
Clone, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToComputedValue, ToCss, ToShmem, Clone, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToComputedValue, ToCss, ToResolvedValue, ToShmem,
)] )]
pub struct QuotePair { pub struct QuotePair {
/// The opening quote. /// The opening quote.
@ -89,7 +89,7 @@ pub struct QuotePair {
/// Specified and computed `quotes` property. /// Specified and computed `quotes` property.
#[derive( #[derive(
Clone, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToComputedValue, ToCss, ToShmem, Clone, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToComputedValue, ToCss, ToResolvedValue, ToShmem,
)] )]
pub struct Quotes( pub struct Quotes(
#[css(iterable, if_empty = "none")] #[css(iterable, if_empty = "none")]
@ -143,6 +143,7 @@ impl Parse for Quotes {
SpecifiedValueInfo, SpecifiedValueInfo,
ToComputedValue, ToComputedValue,
ToCss, ToCss,
ToResolvedValue,
ToShmem, ToShmem,
)] )]
#[repr(u8)] #[repr(u8)]

View file

@ -709,7 +709,7 @@ impl AllowQuirks {
/// ///
/// `[namespace? `|`]? ident` /// `[namespace? `|`]? ident`
#[derive( #[derive(
Clone, Debug, Eq, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToComputedValue, ToShmem, Clone, Debug, Eq, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToComputedValue, ToResolvedValue, ToShmem,
)] )]
#[css(function)] #[css(function)]
pub struct Attr { pub struct Attr {

View file

@ -23,6 +23,7 @@ use style_traits::{ParseError, StyleParseErrorKind};
ToAnimatedZero, ToAnimatedZero,
ToComputedValue, ToComputedValue,
ToCss, ToCss,
ToResolvedValue,
ToShmem, ToShmem,
)] )]
pub enum OffsetPath { pub enum OffsetPath {

View file

@ -22,6 +22,7 @@ use style_traits::ParseError;
SpecifiedValueInfo, SpecifiedValueInfo,
ToComputedValue, ToComputedValue,
ToCss, ToCss,
ToResolvedValue,
ToShmem, ToShmem,
)] )]
#[repr(C, u8)] #[repr(C, u8)]

View file

@ -58,6 +58,7 @@ pub enum PositionComponent<S> {
SpecifiedValueInfo, SpecifiedValueInfo,
ToComputedValue, ToComputedValue,
ToCss, ToCss,
ToResolvedValue,
ToShmem, ToShmem,
)] )]
#[allow(missing_docs)] #[allow(missing_docs)]
@ -79,6 +80,7 @@ pub enum X {
SpecifiedValueInfo, SpecifiedValueInfo,
ToComputedValue, ToComputedValue,
ToCss, ToCss,
ToResolvedValue,
ToShmem, ToShmem,
)] )]
#[allow(missing_docs)] #[allow(missing_docs)]
@ -445,6 +447,7 @@ impl ToCss for LegacyPosition {
SpecifiedValueInfo, SpecifiedValueInfo,
ToComputedValue, ToComputedValue,
ToCss, ToCss,
ToResolvedValue,
ToShmem, ToShmem,
)] )]
/// Auto-placement algorithm Option /// Auto-placement algorithm Option
@ -467,6 +470,7 @@ pub enum AutoFlow {
SpecifiedValueInfo, SpecifiedValueInfo,
ToComputedValue, ToComputedValue,
ToCss, ToCss,
ToResolvedValue,
ToShmem, ToShmem,
)] )]
/// Controls how the auto-placement algorithm works /// Controls how the auto-placement algorithm works
@ -567,8 +571,7 @@ impl From<GridAutoFlow> for u8 {
} }
} }
#[cfg_attr(feature = "gecko", derive(MallocSizeOf))] #[derive(Clone, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToComputedValue, ToCss, ToResolvedValue, ToShmem)]
#[derive(Clone, Debug, PartialEq, SpecifiedValueInfo, ToComputedValue, ToCss, ToShmem)]
/// https://drafts.csswg.org/css-grid/#named-grid-area /// https://drafts.csswg.org/css-grid/#named-grid-area
pub struct TemplateAreas { pub struct TemplateAreas {
/// `named area` containing for each template area /// `named area` containing for each template area
@ -675,7 +678,7 @@ impl Parse for TemplateAreas {
/// Arc type for `Arc<TemplateAreas>` /// Arc type for `Arc<TemplateAreas>`
#[derive( #[derive(
Clone, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToComputedValue, ToCss, ToShmem, Clone, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToComputedValue, ToCss, ToResolvedValue, ToShmem,
)] )]
pub struct TemplateAreasArc(#[ignore_malloc_size_of = "Arc"] pub Arc<TemplateAreas>); pub struct TemplateAreasArc(#[ignore_malloc_size_of = "Arc"] pub Arc<TemplateAreas>);
@ -690,8 +693,7 @@ impl Parse for TemplateAreasArc {
} }
} }
#[cfg_attr(feature = "gecko", derive(MallocSizeOf))] #[derive(Clone, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToShmem)]
#[derive(Clone, Debug, PartialEq, SpecifiedValueInfo, ToShmem)]
/// Not associated with any particular grid item, but can /// Not associated with any particular grid item, but can
/// be referenced from the grid-placement properties. /// be referenced from the grid-placement properties.
pub struct NamedArea { pub struct NamedArea {

View file

@ -129,7 +129,7 @@ const PAINT_ORDER_MASK: u8 = 0b11;
/// Higher priority values, i.e. the values specified first, /// Higher priority values, i.e. the values specified first,
/// will be painted first (and may be covered by paintings of lower priority) /// will be painted first (and may be covered by paintings of lower priority)
#[derive( #[derive(
Clone, Copy, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToComputedValue, ToShmem, Clone, Copy, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToComputedValue, ToResolvedValue, ToShmem,
)] )]
pub struct SVGPaintOrder(pub u8); pub struct SVGPaintOrder(pub u8);
@ -238,7 +238,7 @@ impl ToCss for SVGPaintOrder {
/// Specified MozContextProperties value. /// Specified MozContextProperties value.
/// Nonstandard (https://developer.mozilla.org/en-US/docs/Web/CSS/-moz-context-properties) /// Nonstandard (https://developer.mozilla.org/en-US/docs/Web/CSS/-moz-context-properties)
#[derive( #[derive(
Clone, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToComputedValue, ToCss, ToShmem, Clone, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToComputedValue, ToCss, ToResolvedValue, ToShmem,
)] )]
pub struct MozContextProperties(pub CustomIdent); pub struct MozContextProperties(pub CustomIdent);

View file

@ -26,6 +26,7 @@ use style_traits::{CssWriter, ParseError, StyleParseErrorKind, ToCss};
SpecifiedValueInfo, SpecifiedValueInfo,
ToAnimatedZero, ToAnimatedZero,
ToComputedValue, ToComputedValue,
ToResolvedValue,
ToShmem, ToShmem,
)] )]
pub struct SVGPathData(Box<[PathCommand]>); pub struct SVGPathData(Box<[PathCommand]>);

View file

@ -17,6 +17,7 @@ use style_traits::{ParseError, StyleParseErrorKind};
SpecifiedValueInfo, SpecifiedValueInfo,
ToComputedValue, ToComputedValue,
ToCss, ToCss,
ToResolvedValue,
ToShmem, ToShmem,
)] )]
/// span. for `<col span>` pres attr /// span. for `<col span>` pres attr

View file

@ -228,7 +228,7 @@ impl ToComputedValue for TextOverflow {
} }
bitflags! { bitflags! {
#[derive(MallocSizeOf, SpecifiedValueInfo, ToComputedValue, ToShmem)] #[derive(MallocSizeOf, SpecifiedValueInfo, ToComputedValue, ToResolvedValue, ToShmem)]
#[value_info(other_values = "none,underline,overline,line-through,blink")] #[value_info(other_values = "none,underline,overline,line-through,blink")]
#[repr(C)] #[repr(C)]
/// Specified keyword values for the text-decoration-line property. /// Specified keyword values for the text-decoration-line property.
@ -365,6 +365,7 @@ impl TextDecorationLine {
SpecifiedValueInfo, SpecifiedValueInfo,
ToComputedValue, ToComputedValue,
ToCss, ToCss,
ToResolvedValue,
ToShmem, ToShmem,
)] )]
#[allow(missing_docs)] #[allow(missing_docs)]
@ -674,6 +675,7 @@ impl Parse for TextEmphasisStyle {
SpecifiedValueInfo, SpecifiedValueInfo,
ToComputedValue, ToComputedValue,
ToCss, ToCss,
ToResolvedValue,
ToShmem, ToShmem,
)] )]
pub enum TextEmphasisHorizontalWritingModeValue { pub enum TextEmphasisHorizontalWritingModeValue {
@ -695,6 +697,7 @@ pub enum TextEmphasisHorizontalWritingModeValue {
SpecifiedValueInfo, SpecifiedValueInfo,
ToComputedValue, ToComputedValue,
ToCss, ToCss,
ToResolvedValue,
ToShmem, ToShmem,
)] )]
pub enum TextEmphasisVerticalWritingModeValue { pub enum TextEmphasisVerticalWritingModeValue {
@ -714,6 +717,7 @@ pub enum TextEmphasisVerticalWritingModeValue {
SpecifiedValueInfo, SpecifiedValueInfo,
ToComputedValue, ToComputedValue,
ToCss, ToCss,
ToResolvedValue,
ToShmem, ToShmem,
)] )]
pub struct TextEmphasisPosition( pub struct TextEmphasisPosition(
@ -815,6 +819,7 @@ impl From<TextEmphasisPosition> for u8 {
SpecifiedValueInfo, SpecifiedValueInfo,
ToComputedValue, ToComputedValue,
ToCss, ToCss,
ToResolvedValue,
ToShmem, ToShmem,
)] )]
#[allow(missing_docs)] #[allow(missing_docs)]
@ -843,6 +848,7 @@ pub enum WordBreak {
SpecifiedValueInfo, SpecifiedValueInfo,
ToComputedValue, ToComputedValue,
ToCss, ToCss,
ToResolvedValue,
ToShmem, ToShmem,
)] )]
#[allow(missing_docs)] #[allow(missing_docs)]

View file

@ -57,7 +57,7 @@ impl Parse for CursorImage {
/// Specified value of `-moz-force-broken-image-icon` /// Specified value of `-moz-force-broken-image-icon`
#[derive( #[derive(
Clone, Copy, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToComputedValue, ToShmem, Clone, Copy, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToComputedValue, ToResolvedValue, ToShmem,
)] )]
pub struct MozForceBrokenImageIcon(pub bool); pub struct MozForceBrokenImageIcon(pub bool);
@ -141,6 +141,7 @@ impl Parse for ScrollbarColor {
SpecifiedValueInfo, SpecifiedValueInfo,
ToComputedValue, ToComputedValue,
ToCss, ToCss,
ToResolvedValue,
ToShmem, ToShmem,
)] )]
#[repr(u8)] #[repr(u8)]
@ -169,6 +170,7 @@ pub enum UserSelect {
SpecifiedValueInfo, SpecifiedValueInfo,
ToComputedValue, ToComputedValue,
ToCss, ToCss,
ToResolvedValue,
ToShmem, ToShmem,
)] )]
#[repr(u8)] #[repr(u8)]

View file

@ -25,6 +25,7 @@ mod to_animated_value;
mod to_animated_zero; mod to_animated_zero;
mod to_computed_value; mod to_computed_value;
mod to_css; mod to_css;
mod to_resolved_value;
#[proc_macro_derive(Animate, attributes(animate, animation))] #[proc_macro_derive(Animate, attributes(animate, animation))]
pub fn derive_animate(stream: TokenStream) -> TokenStream { pub fn derive_animate(stream: TokenStream) -> TokenStream {
@ -62,6 +63,12 @@ pub fn derive_to_computed_value(stream: TokenStream) -> TokenStream {
to_computed_value::derive(input).into() to_computed_value::derive(input).into()
} }
#[proc_macro_derive(ToResolvedValue, attributes(resolve))]
pub fn derive_to_resolved_value(stream: TokenStream) -> TokenStream {
let input = syn::parse(stream).unwrap();
to_resolved_value::derive(input).into()
}
#[proc_macro_derive(ToCss, attributes(css))] #[proc_macro_derive(ToCss, attributes(css))]
pub fn derive_to_css(stream: TokenStream) -> TokenStream { pub fn derive_to_css(stream: TokenStream) -> TokenStream {
let input = syn::parse(stream).unwrap(); let input = syn::parse(stream).unwrap();