Remove some uses of trivial_to_computed_value

This commit is contained in:
Anthony Ramine 2018-03-09 11:35:46 +01:00
parent 491a79ee4e
commit afaa00a344
7 changed files with 8 additions and 21 deletions

View file

@ -121,7 +121,7 @@ impl MallocSizeOf for CssUrl {
} }
/// A specified url() value for general usage. /// A specified url() value for general usage.
#[derive(Clone, Debug, ToCss)] #[derive(Clone, Debug, ToComputedValue, ToCss)]
pub struct SpecifiedUrl { pub struct SpecifiedUrl {
/// The specified url value. /// The specified url value.
pub url: CssUrl, pub url: CssUrl,
@ -130,7 +130,6 @@ pub struct SpecifiedUrl {
#[css(skip)] #[css(skip)]
pub url_value: RefPtr<URLValue>, pub url_value: RefPtr<URLValue>,
} }
trivial_to_computed_value!(SpecifiedUrl);
impl SpecifiedUrl { impl SpecifiedUrl {
fn from_css_url(url: CssUrl) -> Self { fn from_css_url(url: CssUrl) -> Self {
@ -177,7 +176,7 @@ impl MallocSizeOf for SpecifiedUrl {
/// A specified url() value for image. /// A specified url() value for image.
/// ///
/// This exists so that we can construct `ImageValue` and reuse it. /// This exists so that we can construct `ImageValue` and reuse it.
#[derive(Clone, Debug, ToCss)] #[derive(Clone, Debug, ToComputedValue, ToCss)]
pub struct SpecifiedImageUrl { pub struct SpecifiedImageUrl {
/// The specified url value. /// The specified url value.
pub url: CssUrl, pub url: CssUrl,
@ -186,7 +185,6 @@ pub struct SpecifiedImageUrl {
#[css(skip)] #[css(skip)]
pub image_value: RefPtr<ImageValue>, pub image_value: RefPtr<ImageValue>,
} }
trivial_to_computed_value!(SpecifiedImageUrl);
impl SpecifiedImageUrl { impl SpecifiedImageUrl {
fn from_css_url(url: CssUrl) -> Self { fn from_css_url(url: CssUrl) -> Self {

View file

@ -78,7 +78,7 @@ pub fn nscsspropertyid_is_animatable(property: nsCSSPropertyID) -> bool {
/// a shorthand with at least one transitionable longhand component, or an unsupported property. /// a shorthand with at least one transitionable longhand component, or an unsupported property.
// NB: This needs to be here because it needs all the longhands generated // NB: This needs to be here because it needs all the longhands generated
// beforehand. // beforehand.
#[derive(Clone, Debug, Eq, Hash, MallocSizeOf, PartialEq, ToCss)] #[derive(Clone, Debug, Eq, Hash, MallocSizeOf, PartialEq, ToComputedValue, ToCss)]
pub enum TransitionProperty { pub enum TransitionProperty {
/// A shorthand. /// A shorthand.
Shorthand(ShorthandId), Shorthand(ShorthandId),
@ -89,8 +89,6 @@ pub enum TransitionProperty {
Unsupported(CustomIdent), Unsupported(CustomIdent),
} }
trivial_to_computed_value!(TransitionProperty);
impl TransitionProperty { impl TransitionProperty {
/// Returns `all`. /// Returns `all`.
#[inline] #[inline]

View file

@ -428,7 +428,6 @@ trivial_to_computed_value!(u8);
trivial_to_computed_value!(u16); trivial_to_computed_value!(u16);
trivial_to_computed_value!(u32); trivial_to_computed_value!(u32);
trivial_to_computed_value!(Atom); trivial_to_computed_value!(Atom);
trivial_to_computed_value!(BorderStyle);
trivial_to_computed_value!(CursorKind); trivial_to_computed_value!(CursorKind);
#[cfg(feature = "servo")] #[cfg(feature = "servo")]
trivial_to_computed_value!(Prefix); trivial_to_computed_value!(Prefix);

View file

@ -566,7 +566,7 @@ 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(Clone, Debug, Default, MallocSizeOf, PartialEq)] #[derive(Clone, Debug, Default, MallocSizeOf, PartialEq, ToComputedValue)]
pub struct LineNameList { pub struct LineNameList {
/// The optional `<line-name-list>` /// The optional `<line-name-list>`
pub names: Box<[Box<[CustomIdent]>]>, pub names: Box<[Box<[CustomIdent]>]>,
@ -574,8 +574,6 @@ pub struct LineNameList {
pub fill_idx: Option<u32>, pub fill_idx: Option<u32>,
} }
trivial_to_computed_value!(LineNameList);
impl Parse for LineNameList { impl Parse for LineNameList {
fn parse<'i, 't>(context: &ParserContext, input: &mut Parser<'i, 't>) -> Result<Self, ParseError<'i>> { fn parse<'i, 't>(context: &ParserContext, input: &mut Parser<'i, 't>) -> Result<Self, ParseError<'i>> {
input.expect_ident_matching("subgrid")?; input.expect_ident_matching("subgrid")?;

View file

@ -132,8 +132,8 @@ pub struct ColorStop<Color, LengthOrPercentage> {
/// Specified values for a paint worklet. /// Specified values for a paint worklet.
/// <https://drafts.css-houdini.org/css-paint-api/> /// <https://drafts.css-houdini.org/css-paint-api/>
#[derive(Clone, Debug, PartialEq)]
#[cfg_attr(feature = "servo", derive(MallocSizeOf))] #[cfg_attr(feature = "servo", derive(MallocSizeOf))]
#[derive(Clone, Debug, PartialEq, ToComputedValue)]
pub struct PaintWorklet { pub struct PaintWorklet {
/// The name the worklet was registered with. /// The name the worklet was registered with.
pub name: Atom, pub name: Atom,
@ -143,8 +143,6 @@ pub struct PaintWorklet {
pub arguments: Vec<Arc<custom_properties::SpecifiedValue>>, pub arguments: Vec<Arc<custom_properties::SpecifiedValue>>,
} }
trivial_to_computed_value!(PaintWorklet);
impl ToCss for PaintWorklet { impl ToCss for PaintWorklet {
fn to_css<W>(&self, dest: &mut CssWriter<W>) -> fmt::Result fn to_css<W>(&self, dest: &mut CssWriter<W>) -> fmt::Result
where where

View file

@ -158,7 +158,7 @@ fn parse_number_with_clamping_mode<'i, 't>(
#[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, MallocSizeOf, Ord, Parse, PartialEq)] #[derive(Clone, Copy, Debug, Eq, MallocSizeOf, Ord, Parse, PartialEq)]
#[derive(PartialOrd, ToCss)] #[derive(PartialOrd, ToComputedValue, ToCss)]
pub enum BorderStyle { pub enum BorderStyle {
None = -1, None = -1,
Solid = 6, Solid = 6,

View file

@ -509,7 +509,7 @@ impl From<GridAutoFlow> for u8 {
} }
#[cfg_attr(feature = "gecko", derive(MallocSizeOf))] #[cfg_attr(feature = "gecko", derive(MallocSizeOf))]
#[derive(Clone, Debug, PartialEq, ToCss)] #[derive(Clone, Debug, PartialEq, ToComputedValue, ToCss)]
/// 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
@ -614,10 +614,8 @@ impl Parse for TemplateAreas {
} }
} }
trivial_to_computed_value!(TemplateAreas);
/// Arc type for `Arc<TemplateAreas>` /// Arc type for `Arc<TemplateAreas>`
#[derive(Clone, Debug, MallocSizeOf, PartialEq, ToCss)] #[derive(Clone, Debug, MallocSizeOf, PartialEq, ToComputedValue, ToCss)]
pub struct TemplateAreasArc(#[ignore_malloc_size_of = "Arc"] pub Arc<TemplateAreas>); pub struct TemplateAreasArc(#[ignore_malloc_size_of = "Arc"] pub Arc<TemplateAreas>);
impl Parse for TemplateAreasArc { impl Parse for TemplateAreasArc {
@ -631,8 +629,6 @@ impl Parse for TemplateAreasArc {
} }
} }
trivial_to_computed_value!(TemplateAreasArc);
#[cfg_attr(feature = "gecko", derive(MallocSizeOf))] #[cfg_attr(feature = "gecko", derive(MallocSizeOf))]
#[derive(Clone, Debug, PartialEq)] #[derive(Clone, Debug, PartialEq)]
/// Not associated with any particular grid item, but can /// Not associated with any particular grid item, but can