Remove some unused impls.

This commit is contained in:
Simon Sapin 2017-03-07 15:19:41 +01:00
parent 7444be686c
commit 8160490272
5 changed files with 8 additions and 19 deletions

View file

@ -21,7 +21,7 @@ use values::specified::url::SpecifiedUrl;
/// A source for a font-face rule. /// A source for a font-face rule.
#[derive(Clone, Debug, PartialEq, Eq)] #[derive(Clone, Debug, PartialEq, Eq)]
#[cfg_attr(feature = "servo", derive(HeapSizeOf, Deserialize, Serialize))] #[cfg_attr(feature = "servo", derive(Deserialize, Serialize))]
pub enum Source { pub enum Source {
/// A `url()` source. /// A `url()` source.
Url(UrlSource), Url(UrlSource),
@ -54,7 +54,7 @@ impl OneOrMoreCommaSeparated for Source {}
/// ///
/// https://drafts.csswg.org/css-fonts/#src-desc /// https://drafts.csswg.org/css-fonts/#src-desc
#[derive(Clone, Debug, PartialEq, Eq)] #[derive(Clone, Debug, PartialEq, Eq)]
#[cfg_attr(feature = "servo", derive(HeapSizeOf, Deserialize, Serialize))] #[cfg_attr(feature = "servo", derive(Deserialize, Serialize))]
pub struct UrlSource { pub struct UrlSource {
/// The specified url. /// The specified url.
pub url: SpecifiedUrl, pub url: SpecifiedUrl,
@ -184,7 +184,6 @@ macro_rules! font_face_descriptors {
/// ///
/// https://drafts.csswg.org/css-fonts/#font-face-rule /// https://drafts.csswg.org/css-fonts/#font-face-rule
#[derive(Debug, PartialEq, Eq)] #[derive(Debug, PartialEq, Eq)]
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
pub struct FontFaceRule { pub struct FontFaceRule {
$( $(
#[$m_doc] #[$m_doc]

View file

@ -70,8 +70,7 @@ impl KeyframePercentage {
/// A keyframes selector is a list of percentages or from/to symbols, which are /// A keyframes selector is a list of percentages or from/to symbols, which are
/// converted at parse time to percentages. /// converted at parse time to percentages.
#[derive(Debug, Clone, PartialEq)] #[derive(Debug, PartialEq)]
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
pub struct KeyframeSelector(Vec<KeyframePercentage>); pub struct KeyframeSelector(Vec<KeyframePercentage>);
impl KeyframeSelector { impl KeyframeSelector {
/// Return the list of percentages this selector contains. /// Return the list of percentages this selector contains.
@ -93,8 +92,7 @@ impl KeyframeSelector {
} }
/// A keyframe. /// A keyframe.
#[derive(Debug, Clone)] #[derive(Debug)]
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
pub struct Keyframe { pub struct Keyframe {
/// The selector this keyframe was specified from. /// The selector this keyframe was specified from.
pub selector: KeyframeSelector, pub selector: KeyframeSelector,
@ -103,7 +101,6 @@ pub struct Keyframe {
/// ///
/// Note that `!important` rules in keyframes don't apply, but we keep this /// Note that `!important` rules in keyframes don't apply, but we keep this
/// `Arc` just for convenience. /// `Arc` just for convenience.
#[cfg_attr(feature = "servo", ignore_heap_size_of = "Arc")]
pub block: Arc<RwLock<PropertyDeclarationBlock>>, pub block: Arc<RwLock<PropertyDeclarationBlock>>,
} }
@ -148,7 +145,7 @@ impl Keyframe {
/// declarations to apply. /// declarations to apply.
/// ///
/// TODO: Find a better name for this? /// TODO: Find a better name for this?
#[derive(Debug, Clone)] #[derive(Debug)]
#[cfg_attr(feature = "servo", derive(HeapSizeOf))] #[cfg_attr(feature = "servo", derive(HeapSizeOf))]
pub enum KeyframesStepValue { pub enum KeyframesStepValue {
/// A step formed by a declaration block specified by the CSS. /// A step formed by a declaration block specified by the CSS.
@ -163,7 +160,7 @@ pub enum KeyframesStepValue {
} }
/// A single step from a keyframe animation. /// A single step from a keyframe animation.
#[derive(Debug, Clone)] #[derive(Debug)]
#[cfg_attr(feature = "servo", derive(HeapSizeOf))] #[cfg_attr(feature = "servo", derive(HeapSizeOf))]
pub struct KeyframesStep { pub struct KeyframesStep {
/// The percentage of the animation duration when this step starts. /// The percentage of the animation duration when this step starts.
@ -235,7 +232,7 @@ impl KeyframesStep {
/// of keyframes, in order. /// of keyframes, in order.
/// ///
/// It only takes into account animable properties. /// It only takes into account animable properties.
#[derive(Debug, Clone)] #[derive(Debug)]
#[cfg_attr(feature = "servo", derive(HeapSizeOf))] #[cfg_attr(feature = "servo", derive(HeapSizeOf))]
pub struct KeyframesAnimation { pub struct KeyframesAnimation {
/// The difference steps of the animation. /// The difference steps of the animation.

View file

@ -49,12 +49,10 @@ impl Default for Importance {
/// Overridden declarations are skipped. /// Overridden declarations are skipped.
#[derive(Debug, PartialEq, Clone)] #[derive(Debug, PartialEq, Clone)]
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
pub struct PropertyDeclarationBlock { pub struct PropertyDeclarationBlock {
/// The group of declarations, along with their importance. /// The group of declarations, along with their importance.
/// ///
/// Only deduplicated declarations appear here. /// Only deduplicated declarations appear here.
#[cfg_attr(feature = "servo", ignore_heap_size_of = "#7038")]
pub declarations: Vec<(PropertyDeclaration, Importance)>, pub declarations: Vec<(PropertyDeclaration, Importance)>,
/// The number of entries in `self.declaration` with `Importance::Important` /// The number of entries in `self.declaration` with `Importance::Important`

View file

@ -563,7 +563,6 @@ impl ShorthandId {
/// Servo's representation of a declared value for a given `T`, which is the /// Servo's representation of a declared value for a given `T`, which is the
/// declared value for that property. /// declared value for that property.
#[derive(Clone, PartialEq, Eq, Debug)] #[derive(Clone, PartialEq, Eq, Debug)]
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
pub enum DeclaredValue<T> { pub enum DeclaredValue<T> {
/// A known specified value from the stylesheet. /// A known specified value from the stylesheet.
Value(T), Value(T),
@ -574,8 +573,7 @@ pub enum DeclaredValue<T> {
} }
/// An unparsed property value that contains `var()` functions. /// An unparsed property value that contains `var()` functions.
#[derive(Clone, PartialEq, Eq, Debug)] #[derive(PartialEq, Eq, Debug)]
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
pub struct UnparsedValue { pub struct UnparsedValue {
/// The css serialization for this value. /// The css serialization for this value.
css: String, css: String,
@ -854,7 +852,6 @@ impl ParsedDeclaration {
/// Servo's representation for a property declaration. /// Servo's representation for a property declaration.
#[derive(PartialEq, Clone)] #[derive(PartialEq, Clone)]
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
pub enum PropertyDeclaration { pub enum PropertyDeclaration {
% for property in data.longhands: % for property in data.longhands:
/// ${property.name} /// ${property.name}

View file

@ -52,7 +52,6 @@ pub enum Origin {
/// A set of namespaces applying to a given stylesheet. /// A set of namespaces applying to a given stylesheet.
#[derive(Default, Debug)] #[derive(Default, Debug)]
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
#[allow(missing_docs)] #[allow(missing_docs)]
pub struct Namespaces { pub struct Namespaces {
pub default: Option<Namespace>, pub default: Option<Namespace>,
@ -389,7 +388,6 @@ impl ToCss for CssRule {
} }
#[derive(Debug, PartialEq)] #[derive(Debug, PartialEq)]
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
#[allow(missing_docs)] #[allow(missing_docs)]
pub struct NamespaceRule { pub struct NamespaceRule {
/// `None` for the default Namespace /// `None` for the default Namespace