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,
ToComputedValue,
ToCss,
ToResolvedValue,
ToShmem,
)]
pub struct $name;

View file

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

View file

@ -33,7 +33,7 @@ pub use super::specified::{AlignSelf, JustifySelf};
/// sucks :(.
///
/// 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 {
/// The specified value for the property. Can contain the bare `legacy`
/// keyword.

View file

@ -14,7 +14,7 @@ use style_traits::{CssWriter, ToCss};
/// A computed angle in degrees.
#[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);
impl ToCss for Angle {

View file

@ -49,6 +49,7 @@ pub type Perspective = GenericPerspective<NonNegativeLength>;
PartialEq,
SpecifiedValueInfo,
ToCss,
ToResolvedValue,
)]
#[repr(u8)]
/// A computed value for the `float` property.
@ -118,6 +119,7 @@ impl ToComputedValue for SpecifiedFloat {
PartialEq,
SpecifiedValueInfo,
ToCss,
ToResolvedValue,
)]
/// A computed value for the `clear` property.
pub enum Clear {
@ -178,7 +180,7 @@ impl ToComputedValue for SpecifiedClear {
/// A computed value for the `resize` property.
#[allow(missing_docs)]
#[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)]
pub enum Resize {
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
///
/// 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))]
pub struct FontWeight(pub Number);
@ -74,6 +74,7 @@ impl ToAnimatedValue for FontWeight {
PartialEq,
ToAnimatedZero,
ToCss,
ToResolvedValue,
)]
/// The computed value of font-size
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))]
/// Specifies a prioritized list of font family names or generic family names.
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))]
/// The name of a font family of choice
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))]
/// Font family names must either be given quoted as strings,
/// or unquoted as a sequence of one or more identifiers.
@ -279,7 +280,7 @@ pub enum FontFamilyNameSyntax {
Identifiers,
}
#[derive(Clone, Debug, Eq, MallocSizeOf, PartialEq, ToCss)]
#[derive(Clone, Debug, Eq, MallocSizeOf, PartialEq, ToCss, ToResolvedValue)]
#[cfg_attr(feature = "servo", derive(Deserialize, Serialize, Hash))]
/// A set of faces that vary in weight, width or slope.
pub enum SingleFontFamily {
@ -294,7 +295,7 @@ pub enum SingleFontFamily {
/// The order here is important, if you change it make sure that
/// `gfxPlatformFontList.h`s ranged array and `gfxFontFamilyList`'s
/// 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)]
#[allow(missing_docs)]
pub enum GenericFontFamily {
@ -384,7 +385,7 @@ impl SingleFontFamily {
}
#[cfg(feature = "servo")]
#[derive(Clone, Debug, Eq, Hash, MallocSizeOf, PartialEq)]
#[derive(Clone, Debug, Eq, Hash, MallocSizeOf, PartialEq, ToResolvedValue)]
/// A list of 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
#[derive(Animate, Clone, ComputeSquaredDistance, Copy, Debug, MallocSizeOf, PartialEq, ToCss)]
#[derive(Animate, Clone, ComputeSquaredDistance, Copy, Debug, MallocSizeOf, PartialEq, ToCss, ToResolvedValue)]
pub enum FontSizeAdjust {
#[animation(error)]
/// None variant
@ -627,7 +628,7 @@ pub type FontVariationSettings = FontSettings<VariationValue<Number>>;
/// OpenType "language system" tag, so we should be able to compute
/// it and store it as a 32-bit integer
/// (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)]
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
/// 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))]
pub struct FontStyleAngle(pub Angle);
@ -830,7 +831,7 @@ impl ToCss for FontStyle {
/// A value for the font-stretch property per:
///
/// 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))]
pub struct FontStretch(pub NonNegativePercentage);

View file

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

View file

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

View file

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

View file

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

View file

@ -37,6 +37,7 @@ pub type InitialLetter = GenericInitialLetter<CSSFloat, CSSInteger>;
PartialEq,
ToAnimatedValue,
ToAnimatedZero,
ToResolvedValue,
)]
pub struct LetterSpacing(pub Length);
@ -102,7 +103,7 @@ impl ToComputedValue for specified::WordSpacing {
/// A computed value for the `line-height` property.
pub type LineHeight = GenericLineHeight<NonNegativeNumber, NonNegativeLength>;
#[derive(Clone, Debug, MallocSizeOf, PartialEq)]
#[derive(Clone, Debug, MallocSizeOf, PartialEq, ToResolvedValue)]
/// text-overflow.
/// When the specified value only has one side, that's the "second"
/// 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.
///
/// 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 {
/// Whether an underline is in effect.
pub underline: bool,
@ -193,7 +194,7 @@ impl TextDecorationsInEffect {
}
/// computed value for the text-emphasis-style property
#[derive(Clone, Debug, MallocSizeOf, PartialEq, ToCss)]
#[derive(Clone, Debug, MallocSizeOf, PartialEq, ToCss, ToResolvedValue)]
pub enum TextEmphasisStyle {
/// Keyword value for the text-emphasis-style property (`filled` `open`)
Keyword(TextEmphasisKeywordValue),
@ -204,7 +205,7 @@ pub enum TextEmphasisStyle {
}
/// Keyword value for the text-emphasis-style property
#[derive(Clone, Debug, MallocSizeOf, PartialEq, ToCss)]
#[derive(Clone, Debug, MallocSizeOf, PartialEq, ToCss, ToResolvedValue)]
pub struct TextEmphasisKeywordValue {
/// fill for the text-emphasis-style property
pub fill: TextEmphasisFillMode,

View file

@ -9,7 +9,7 @@ use std::fmt::{self, Write};
use style_traits::{CssWriter, ToCss};
/// 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))]
pub struct Time {
seconds: CSSFloat,

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

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.

View file

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

View file

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

View file

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

View file

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

View file

@ -3,11 +3,21 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
//! 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.
#[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> {
/// `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>
#[derive(
Clone, Debug, Default, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToComputedValue, ToShmem,
Clone,
Debug,
Default,
MallocSizeOf,
PartialEq,
SpecifiedValueInfo,
ToComputedValue,
ToResolvedValue,
ToShmem,
)]
pub struct GridLine<Integer> {
/// Flag to check whether it's a `span` keyword.
@ -164,6 +172,7 @@ impl Parse for GridLine<specified::Integer> {
SpecifiedValueInfo,
ToComputedValue,
ToCss,
ToResolvedValue,
ToShmem,
)]
pub enum TrackKeyword {
@ -185,6 +194,7 @@ pub enum TrackKeyword {
SpecifiedValueInfo,
ToComputedValue,
ToCss,
ToResolvedValue,
ToShmem,
)]
pub enum TrackBreadth<L> {
@ -211,7 +221,7 @@ impl<L> TrackBreadth<L> {
/// generic only to avoid code bloat. It only takes `<length-percentage>`
///
/// <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> {
/// A flexible `<track-breadth>`
Breadth(TrackBreadth<L>),
@ -369,7 +379,7 @@ where
/// The initial argument of the `repeat` function.
///
/// <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> {
/// A positive integer. This is allowed only for `<track-repeat>` and `<fixed-repeat>`
Number(Integer),
@ -404,7 +414,7 @@ impl Parse for RepeatCount<specified::Integer> {
///
/// It can also hold `repeat()` function parameters, which expands into the respective
/// 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")]
pub struct TrackRepeat<L, I> {
/// 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,
ToComputedValue,
ToCss,
ToResolvedValue,
ToShmem,
)]
pub enum TrackListValue<LengthPercentage, Integer> {
@ -513,7 +524,7 @@ pub enum TrackListValue<LengthPercentage, Integer> {
/// The type of a `<track-list>` as determined during parsing.
///
/// <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 {
/// [`<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.
///
/// <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> {
/// 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>+) ]+`
/// Old spec: https://www.w3.org/TR/2015/WD-css-grid-1-20150917/#typedef-line-name-list
#[derive(
Clone, Debug, Default, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToComputedValue, ToShmem,
Clone,
Debug,
Default,
MallocSizeOf,
PartialEq,
SpecifiedValueInfo,
ToComputedValue,
ToResolvedValue,
ToShmem,
)]
pub struct LineNameList {
/// The optional `<line-name-list>`
@ -724,6 +743,7 @@ impl ToCss for LineNameList {
SpecifiedValueInfo,
ToComputedValue,
ToCss,
ToResolvedValue,
ToShmem,
)]
pub enum GridTemplateComponent<L, I> {
@ -733,6 +753,7 @@ pub enum GridTemplateComponent<L, I> {
TrackList(
#[animation(field_bound)]
#[compute(field_bound)]
#[resolve(field_bound)]
#[shmem(field_bound)]
TrackList<L, I>,
),

View file

@ -16,7 +16,7 @@ use style_traits::{CssWriter, ToCss};
/// An [image].
///
/// [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> {
/// A `<url()>` image.
Url(ImageUrl),
@ -36,7 +36,7 @@ pub enum Image<Gradient, MozImageRect, ImageUrl> {
/// A CSS gradient.
/// <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> {
/// Gradients can be linear or radial.
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,
}
#[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.
pub enum CompatMode {
/// Modern syntax.
@ -60,7 +60,7 @@ pub enum CompatMode {
}
/// 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> {
/// A linear gradient.
Linear(LineDirection),
@ -73,7 +73,7 @@ pub enum GradientKind<LineDirection, Length, LengthPercentage, Position, Angle>
}
/// 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> {
/// A circular gradient.
Circle(Circle<Length>),
@ -82,7 +82,7 @@ pub enum EndingShape<Length, LengthPercentage> {
}
/// A circle shape.
#[derive(Clone, Copy, Debug, MallocSizeOf, PartialEq, ToComputedValue, ToShmem)]
#[derive(Clone, Copy, Debug, MallocSizeOf, PartialEq, ToComputedValue, ToResolvedValue, ToShmem)]
pub enum Circle<Length> {
/// A circle radius.
Radius(Length),
@ -91,7 +91,7 @@ pub enum Circle<Length> {
}
/// 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> {
/// An ellipse pair of radii.
Radii(LengthPercentage, LengthPercentage),
@ -103,7 +103,7 @@ pub enum Ellipse<LengthPercentage> {
#[allow(missing_docs)]
#[cfg_attr(feature = "servo", derive(Deserialize, Serialize))]
#[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 {
ClosestSide,
@ -116,7 +116,7 @@ pub enum ShapeExtent {
/// A gradient item.
/// <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> {
/// A color stop.
ColorStop(ColorStop<Color, LengthPercentage>),
@ -126,7 +126,7 @@ pub enum GradientItem<Color, LengthPercentage> {
/// A color stop.
/// <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> {
/// The color of this stop.
pub color: Color,
@ -170,7 +170,7 @@ impl ToCss for PaintWorklet {
#[allow(missing_docs)]
#[css(comma, function)]
#[derive(
Clone, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToComputedValue, ToCss, ToShmem,
Clone, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToComputedValue, ToCss, ToResolvedValue, ToShmem,
)]
pub struct MozImageRect<NumberOrPercentage, MozImageRectUrl> {
pub url: MozImageRectUrl,

View file

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

View file

@ -44,7 +44,7 @@ pub mod url;
#[allow(missing_docs)]
#[cfg_attr(feature = "servo", derive(Deserialize, Serialize))]
#[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 {
Cyclic,
@ -87,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, ToShmem)]
#[derive(Clone, Debug, Eq, PartialEq, ToComputedValue, ToCss, ToResolvedValue, ToShmem)]
pub enum CounterStyleOrNone {
/// `none`
None,
@ -175,6 +175,7 @@ impl SpecifiedValueInfo for CounterStyleOrNone {
ToAnimatedZero,
ToComputedValue,
ToCss,
ToResolvedValue,
ToShmem,
)]
#[repr(transparent)]
@ -213,6 +214,7 @@ impl<T: Zero> Zero for NonNegative<T> {
ToAnimatedZero,
ToComputedValue,
ToCss,
ToResolvedValue,
ToShmem,
)]
pub struct GreaterThanOrEqualToOne<T>(pub T);
@ -231,6 +233,7 @@ pub struct GreaterThanOrEqualToOne<T>(pub T);
ToAnimatedZero,
ToComputedValue,
ToCss,
ToResolvedValue,
ToShmem,
)]
#[css(function = "rect", comma)]

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -27,6 +27,7 @@ use style_traits::{CssWriter, ToCss};
SpecifiedValueInfo,
ToComputedValue,
ToCss,
ToResolvedValue,
ToShmem,
)]
#[css(comma, function)]
@ -42,8 +43,18 @@ pub struct Matrix<T> {
#[allow(missing_docs)]
#[cfg_attr(rustfmt, rustfmt_skip)]
#[css(comma, function = "matrix3d")]
#[derive(Clone, Copy, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo,
ToComputedValue, ToCss, ToShmem)]
#[derive(
Clone,
Copy,
Debug,
MallocSizeOf,
PartialEq,
SpecifiedValueInfo,
ToComputedValue,
ToCss,
ToResolvedValue,
ToShmem,
)]
pub struct Matrix3D<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,
@ -90,6 +101,7 @@ impl<T: Into<f64>> From<Matrix3D<T>> for Transform3D<f64> {
ToAnimatedZero,
ToComputedValue,
ToCss,
ToResolvedValue,
ToShmem,
)]
#[repr(C)]
@ -120,7 +132,7 @@ fn is_same<N: PartialEq>(x: &N, y: &N) -> bool {
}
#[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
pub enum TransformOperation<Angle, Number, Length, Integer, LengthPercentage>
@ -227,7 +239,7 @@ where
}
#[derive(
Clone, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToComputedValue, ToCss, ToShmem,
Clone, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToComputedValue, ToCss, ToResolvedValue, ToShmem,
)]
/// A value of the `transform` property
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,
ToAnimatedZero,
ToComputedValue,
ToResolvedValue,
ToShmem,
)]
/// A value of the `Rotate` property
@ -628,6 +641,7 @@ where
SpecifiedValueInfo,
ToAnimatedZero,
ToComputedValue,
ToResolvedValue,
ToShmem,
)]
/// A value of the `Scale` property
@ -677,6 +691,7 @@ impl<Number: ToCss + PartialEq> ToCss for Scale<Number> {
ToAnimatedZero,
ToComputedValue,
ToCss,
ToResolvedValue,
ToShmem,
)]
/// A value of the `translate` property
@ -719,6 +734,7 @@ where
SpecifiedValueInfo,
ToComputedValue,
ToCss,
ToResolvedValue,
ToShmem,
)]
pub enum TransformStyle {

View file

@ -11,7 +11,7 @@ use values::specified::ui::CursorKind;
/// A generic value for the `cursor` property.
///
/// 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> {
/// The parsed images for the cursor.
pub images: Box<[Image]>,
@ -44,7 +44,7 @@ impl<Image: ToCss> ToCss for Cursor<Image> {
}
/// 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> {
/// The url to parse images from.
pub url: ImageUrl,
@ -84,6 +84,7 @@ impl<ImageUrl: ToCss, Number: ToCss> ToCss for CursorImage<ImageUrl, Number> {
ToAnimatedZero,
ToComputedValue,
ToCss,
ToResolvedValue,
ToShmem,
)]
#[repr(C, u8)]

View file

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

View file

@ -28,6 +28,7 @@ pub mod animated;
pub mod computed;
pub mod distance;
pub mod generics;
pub mod resolved;
pub mod specified;
/// A CSS float value.
@ -96,7 +97,7 @@ where
/// Convenience void type to disable some properties and values through types.
#[cfg_attr(feature = "servo", derive(Deserialize, MallocSizeOf, Serialize))]
#[derive(
Clone, Copy, Debug, PartialEq, SpecifiedValueInfo, ToAnimatedValue, ToComputedValue, ToCss,
Clone, Copy, Debug, PartialEq, SpecifiedValueInfo, ToAnimatedValue, ToComputedValue, ToCss, ToResolvedValue,
)]
pub enum Impossible {}
@ -134,6 +135,7 @@ impl Parse for Impossible {
ToAnimatedZero,
ToComputedValue,
ToCss,
ToResolvedValue,
ToShmem,
)]
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>
#[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);
@ -192,7 +194,7 @@ impl ToCss for CustomIdent {
}
/// <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 {
/// <custom-ident>
Ident(CustomIdent),

View file

@ -16,7 +16,7 @@ bitflags! {
/// Constants shared by multiple CSS Box Alignment properties
///
/// These constants match Gecko's `NS_STYLE_ALIGN_*` constants.
#[derive(MallocSizeOf, ToComputedValue, ToShmem)]
#[derive(MallocSizeOf, ToComputedValue, ToResolvedValue, ToShmem)]
pub struct AlignFlags: u8 {
// Enumeration stored in the lower 5 bits:
/// 'auto'
@ -134,7 +134,7 @@ pub enum AxisDirection {
/// Shared value for the `align-content` and `justify-content` properties.
///
/// <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))]
pub struct ContentDistribution {
primary: AlignFlags,
@ -247,7 +247,7 @@ impl ContentDistribution {
/// Value for the `align-content` property.
///
/// <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);
impl Parse for AlignContent {
@ -287,7 +287,7 @@ impl From<AlignContent> for u16 {
/// Value for the `justify-content` property.
///
/// <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);
impl Parse for JustifyContent {
@ -325,7 +325,7 @@ impl From<JustifyContent> for u16 {
}
/// <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);
impl SelfAlignment {
@ -385,7 +385,7 @@ impl SelfAlignment {
/// The specified value of the align-self property.
///
/// <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);
impl Parse for AlignSelf {
@ -423,7 +423,7 @@ impl From<AlignSelf> for u8 {
/// The specified value of the justify-self property.
///
/// <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);
impl Parse for JustifySelf {
@ -461,7 +461,7 @@ impl From<JustifySelf> for u8 {
/// Value of the `align-items` property
///
/// <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);
impl AlignItems {

View file

@ -47,6 +47,7 @@ impl Parse for BackgroundSize {
SpecifiedValueInfo,
ToComputedValue,
ToCss,
ToResolvedValue,
ToShmem,
)]
#[allow(missing_docs)]
@ -63,7 +64,7 @@ pub enum BackgroundRepeatKeyword {
/// axes.
///
/// 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);
impl BackgroundRepeat {

View file

@ -40,6 +40,7 @@ use style_traits::{CssWriter, ParseError, ToCss};
SpecifiedValueInfo,
ToComputedValue,
ToCss,
ToResolvedValue,
ToShmem,
)]
#[repr(u8)]
@ -264,7 +265,7 @@ pub enum BorderImageRepeatKeyword {
///
/// https://drafts.csswg.org/css-backgrounds/#the-border-image-repeat
#[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);

View file

@ -61,6 +61,7 @@ fn moz_box_display_values_enabled(context: &ParserContext) -> bool {
SpecifiedValueInfo,
ToComputedValue,
ToCss,
ToResolvedValue,
ToShmem,
)]
#[cfg_attr(feature = "servo", derive(Deserialize, Serialize))]
@ -326,7 +327,16 @@ impl AnimationIterationCount {
/// A value for the `animation-name` property.
#[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")]
pub struct AnimationName(pub Option<KeyframesName>);
@ -382,6 +392,7 @@ impl Parse for AnimationName {
SpecifiedValueInfo,
ToComputedValue,
ToCss,
ToResolvedValue,
ToShmem,
)]
#[repr(u8)]
@ -406,6 +417,7 @@ pub enum ScrollSnapType {
SpecifiedValueInfo,
ToComputedValue,
ToCss,
ToResolvedValue,
ToShmem,
)]
#[repr(u8)]
@ -419,7 +431,7 @@ pub enum ScrollSnapAlignKeyword {
/// https://drafts.csswg.org/css-scroll-snap-1/#scroll-snap-align
#[allow(missing_docs)]
#[derive(
Clone, Copy, Debug, Eq, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToComputedValue, ToShmem,
Clone, Copy, Debug, Eq, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToComputedValue, ToResolvedValue, ToShmem,
)]
#[repr(C)]
pub struct ScrollSnapAlign {
@ -477,6 +489,7 @@ impl ToCss for ScrollSnapAlign {
SpecifiedValueInfo,
ToComputedValue,
ToCss,
ToResolvedValue,
ToShmem,
)]
#[repr(u8)]
@ -499,6 +512,7 @@ pub enum OverscrollBehavior {
SpecifiedValueInfo,
ToComputedValue,
ToCss,
ToResolvedValue,
ToShmem,
)]
#[repr(u8)]
@ -520,6 +534,7 @@ pub enum OverflowAnchor {
SpecifiedValueInfo,
ToComputedValue,
ToCss,
ToResolvedValue,
ToShmem,
)]
#[repr(u8)]
@ -529,7 +544,7 @@ pub enum OverflowClipBox {
}
#[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,
/// stating what kinds of changes the author expects
@ -562,7 +577,7 @@ impl WillChange {
bitflags! {
/// The change bits that we care about.
#[derive(MallocSizeOf, SpecifiedValueInfo, ToComputedValue, ToShmem)]
#[derive(MallocSizeOf, SpecifiedValueInfo, ToComputedValue, ToResolvedValue, ToShmem)]
#[repr(C)]
pub struct WillChangeBits: u8 {
/// Whether the stacking context will change.
@ -657,8 +672,7 @@ impl Parse for WillChange {
bitflags! {
/// Values for the `touch-action` property.
#[cfg_attr(feature = "gecko", derive(MallocSizeOf))]
#[derive(SpecifiedValueInfo, ToComputedValue, ToShmem)]
#[derive(MallocSizeOf, SpecifiedValueInfo, ToComputedValue, ToResolvedValue, ToShmem)]
/// These constants match Gecko's `NS_STYLE_TOUCH_ACTION_*` constants.
#[value_info(other_values = "auto,none,manipulation,pan-x,pan-y")]
#[repr(C)]
@ -731,7 +745,7 @@ impl Parse for TouchAction {
}
bitflags! {
#[derive(MallocSizeOf, SpecifiedValueInfo, ToComputedValue, ToShmem)]
#[derive(MallocSizeOf, SpecifiedValueInfo, ToComputedValue, ToResolvedValue, ToShmem)]
#[value_info(other_values = "none,strict,content,size,layout,paint")]
#[repr(C)]
/// 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
/// 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 {
/// A shorthand.
Shorthand(ShorthandId),
@ -1018,6 +1032,7 @@ pub enum Resize {
SpecifiedValueInfo,
ToCss,
ToComputedValue,
ToResolvedValue,
ToShmem,
)]
#[repr(u8)]
@ -1370,6 +1385,7 @@ pub enum Appearance {
SpecifiedValueInfo,
ToCss,
ToComputedValue,
ToResolvedValue,
ToShmem,
)]
#[repr(u8)]
@ -1442,6 +1458,7 @@ impl BreakBetween {
SpecifiedValueInfo,
ToCss,
ToComputedValue,
ToResolvedValue,
ToShmem,
)]
#[repr(u8)]
@ -1464,6 +1481,7 @@ pub enum BreakWithin {
SpecifiedValueInfo,
ToCss,
ToComputedValue,
ToResolvedValue,
ToShmem,
)]
#[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
pub enum VariantAlternates {
/// Enables display of stylistic alternates
@ -1020,7 +1020,7 @@ pub enum VariantAlternates {
HistoricalForms,
}
#[derive(Clone, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToCss, ToShmem)]
#[derive(Clone, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToCss, ToResolvedValue, ToShmem)]
/// List of Variant Alternates
pub struct VariantAlternatesList(
#[css(if_empty = "normal", iterable)] pub Box<[VariantAlternates]>,
@ -1188,7 +1188,7 @@ macro_rules! impl_variant_east_asian {
)+
} => {
bitflags! {
#[derive(MallocSizeOf, ToShmem)]
#[derive(MallocSizeOf, ToShmem, ToResolvedValue)]
/// Vairants for east asian variant
pub struct VariantEastAsian: u16 {
/// None of the features
@ -1395,7 +1395,7 @@ macro_rules! impl_variant_ligatures {
)+
} => {
bitflags! {
#[derive(MallocSizeOf, ToShmem)]
#[derive(MallocSizeOf, ToResolvedValue, ToShmem)]
/// Variants of ligatures
pub struct VariantLigatures: u16 {
/// Specifies that common default features are enabled
@ -1617,7 +1617,7 @@ macro_rules! impl_variant_numeric {
)+
} => {
bitflags! {
#[derive(MallocSizeOf, ToShmem)]
#[derive(MallocSizeOf, ToResolvedValue, ToShmem)]
/// Vairants of numeric values
pub struct VariantNumeric: u8 {
/// None of other variants are enabled.
@ -1858,7 +1858,7 @@ impl Parse for FontFeatureSettings {
}
#[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
/// when a font family lacks bold or italic faces
@ -2158,6 +2158,7 @@ impl Parse for VariationValue<Number> {
SpecifiedValueInfo,
ToComputedValue,
ToCss,
ToResolvedValue,
ToShmem,
)]
/// text-zoom. Enable if true, disable if false
@ -2177,7 +2178,7 @@ impl Parse for XTextZoom {
}
#[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
pub struct XLang(#[css(skip)] pub Atom);
@ -2266,7 +2267,7 @@ impl Parse for MozScriptLevel {
}
#[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
/// due to changes in scriptlevel.
///

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -25,6 +25,7 @@ mod to_animated_value;
mod to_animated_zero;
mod to_computed_value;
mod to_css;
mod to_resolved_value;
#[proc_macro_derive(Animate, attributes(animate, animation))]
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()
}
#[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))]
pub fn derive_to_css(stream: TokenStream) -> TokenStream {
let input = syn::parse(stream).unwrap();