mirror of
https://github.com/servo/servo.git
synced 2025-08-05 13:40:08 +01:00
Remove some uses of trivial_to_computed_value
This commit is contained in:
parent
491a79ee4e
commit
afaa00a344
7 changed files with 8 additions and 21 deletions
|
@ -121,7 +121,7 @@ impl MallocSizeOf for CssUrl {
|
|||
}
|
||||
|
||||
/// A specified url() value for general usage.
|
||||
#[derive(Clone, Debug, ToCss)]
|
||||
#[derive(Clone, Debug, ToComputedValue, ToCss)]
|
||||
pub struct SpecifiedUrl {
|
||||
/// The specified url value.
|
||||
pub url: CssUrl,
|
||||
|
@ -130,7 +130,6 @@ pub struct SpecifiedUrl {
|
|||
#[css(skip)]
|
||||
pub url_value: RefPtr<URLValue>,
|
||||
}
|
||||
trivial_to_computed_value!(SpecifiedUrl);
|
||||
|
||||
impl SpecifiedUrl {
|
||||
fn from_css_url(url: CssUrl) -> Self {
|
||||
|
@ -177,7 +176,7 @@ impl MallocSizeOf for SpecifiedUrl {
|
|||
/// A specified url() value for image.
|
||||
///
|
||||
/// This exists so that we can construct `ImageValue` and reuse it.
|
||||
#[derive(Clone, Debug, ToCss)]
|
||||
#[derive(Clone, Debug, ToComputedValue, ToCss)]
|
||||
pub struct SpecifiedImageUrl {
|
||||
/// The specified url value.
|
||||
pub url: CssUrl,
|
||||
|
@ -186,7 +185,6 @@ pub struct SpecifiedImageUrl {
|
|||
#[css(skip)]
|
||||
pub image_value: RefPtr<ImageValue>,
|
||||
}
|
||||
trivial_to_computed_value!(SpecifiedImageUrl);
|
||||
|
||||
impl SpecifiedImageUrl {
|
||||
fn from_css_url(url: CssUrl) -> Self {
|
||||
|
|
|
@ -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.
|
||||
// NB: This needs to be here because it needs all the longhands generated
|
||||
// beforehand.
|
||||
#[derive(Clone, Debug, Eq, Hash, MallocSizeOf, PartialEq, ToCss)]
|
||||
#[derive(Clone, Debug, Eq, Hash, MallocSizeOf, PartialEq, ToComputedValue, ToCss)]
|
||||
pub enum TransitionProperty {
|
||||
/// A shorthand.
|
||||
Shorthand(ShorthandId),
|
||||
|
@ -89,8 +89,6 @@ pub enum TransitionProperty {
|
|||
Unsupported(CustomIdent),
|
||||
}
|
||||
|
||||
trivial_to_computed_value!(TransitionProperty);
|
||||
|
||||
impl TransitionProperty {
|
||||
/// Returns `all`.
|
||||
#[inline]
|
||||
|
|
|
@ -428,7 +428,6 @@ trivial_to_computed_value!(u8);
|
|||
trivial_to_computed_value!(u16);
|
||||
trivial_to_computed_value!(u32);
|
||||
trivial_to_computed_value!(Atom);
|
||||
trivial_to_computed_value!(BorderStyle);
|
||||
trivial_to_computed_value!(CursorKind);
|
||||
#[cfg(feature = "servo")]
|
||||
trivial_to_computed_value!(Prefix);
|
||||
|
|
|
@ -566,7 +566,7 @@ 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)]
|
||||
#[derive(Clone, Debug, Default, MallocSizeOf, PartialEq, ToComputedValue)]
|
||||
pub struct LineNameList {
|
||||
/// The optional `<line-name-list>`
|
||||
pub names: Box<[Box<[CustomIdent]>]>,
|
||||
|
@ -574,8 +574,6 @@ pub struct LineNameList {
|
|||
pub fill_idx: Option<u32>,
|
||||
}
|
||||
|
||||
trivial_to_computed_value!(LineNameList);
|
||||
|
||||
impl Parse for LineNameList {
|
||||
fn parse<'i, 't>(context: &ParserContext, input: &mut Parser<'i, 't>) -> Result<Self, ParseError<'i>> {
|
||||
input.expect_ident_matching("subgrid")?;
|
||||
|
|
|
@ -132,8 +132,8 @@ pub struct ColorStop<Color, LengthOrPercentage> {
|
|||
|
||||
/// Specified values for a paint worklet.
|
||||
/// <https://drafts.css-houdini.org/css-paint-api/>
|
||||
#[derive(Clone, Debug, PartialEq)]
|
||||
#[cfg_attr(feature = "servo", derive(MallocSizeOf))]
|
||||
#[derive(Clone, Debug, PartialEq, ToComputedValue)]
|
||||
pub struct PaintWorklet {
|
||||
/// The name the worklet was registered with.
|
||||
pub name: Atom,
|
||||
|
@ -143,8 +143,6 @@ pub struct PaintWorklet {
|
|||
pub arguments: Vec<Arc<custom_properties::SpecifiedValue>>,
|
||||
}
|
||||
|
||||
trivial_to_computed_value!(PaintWorklet);
|
||||
|
||||
impl ToCss for PaintWorklet {
|
||||
fn to_css<W>(&self, dest: &mut CssWriter<W>) -> fmt::Result
|
||||
where
|
||||
|
|
|
@ -158,7 +158,7 @@ fn parse_number_with_clamping_mode<'i, 't>(
|
|||
#[allow(missing_docs)]
|
||||
#[cfg_attr(feature = "servo", derive(Deserialize, Serialize))]
|
||||
#[derive(Clone, Copy, Debug, Eq, MallocSizeOf, Ord, Parse, PartialEq)]
|
||||
#[derive(PartialOrd, ToCss)]
|
||||
#[derive(PartialOrd, ToComputedValue, ToCss)]
|
||||
pub enum BorderStyle {
|
||||
None = -1,
|
||||
Solid = 6,
|
||||
|
|
|
@ -509,7 +509,7 @@ impl From<GridAutoFlow> for u8 {
|
|||
}
|
||||
|
||||
#[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
|
||||
pub struct TemplateAreas {
|
||||
/// `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>`
|
||||
#[derive(Clone, Debug, MallocSizeOf, PartialEq, ToCss)]
|
||||
#[derive(Clone, Debug, MallocSizeOf, PartialEq, ToComputedValue, ToCss)]
|
||||
pub struct TemplateAreasArc(#[ignore_malloc_size_of = "Arc"] pub Arc<TemplateAreas>);
|
||||
|
||||
impl Parse for TemplateAreasArc {
|
||||
|
@ -631,8 +629,6 @@ impl Parse for TemplateAreasArc {
|
|||
}
|
||||
}
|
||||
|
||||
trivial_to_computed_value!(TemplateAreasArc);
|
||||
|
||||
#[cfg_attr(feature = "gecko", derive(MallocSizeOf))]
|
||||
#[derive(Clone, Debug, PartialEq)]
|
||||
/// Not associated with any particular grid item, but can
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue