Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] svg: support <circle> element #17681

Closed
wants to merge 10 commits into from

style: Derive HeapSizeOf for PropertyDeclarationBlock

  • Loading branch information
stshine committed Sep 11, 2017
commit cee18c1d808744bea82c181a771ad385945bff08
@@ -71,6 +71,7 @@ impl Importance {

/// Overridden declarations are skipped.
#[derive(Clone)]
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
pub struct PropertyDeclarationBlock {
/// The group of declarations, along with their importance.
///
@@ -440,6 +440,7 @@
}

#[derive(Clone, Copy, Debug, Eq, PartialEq, ToCss)]
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
pub enum SpecifiedValue {
Keyword(computed_value::T),
System(SystemFont),
@@ -240,6 +240,7 @@
use values::CustomIdent;

#[derive(Clone, Debug, PartialEq)]
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
pub struct SpecifiedValue(pub Vec<(CustomIdent, specified::Integer)>);

pub mod computed_value {
@@ -314,6 +314,7 @@ macro_rules! impl_gecko_keyword_conversions {
}

#[derive(Clone, Debug, Eq, Hash, PartialEq)]
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
pub enum SpecifiedValue {
Values(Vec<FontFamily>),
System(SystemFont),
@@ -293,6 +293,7 @@ static ${name}: LonghandIdSet = LonghandIdSet {

/// A set of longhand properties
#[derive(Clone, PartialEq)]
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
pub struct LonghandIdSet {
storage: [u32; (${len(data.longhands)} - 1 + 32) / 32]
}
@@ -786,11 +787,14 @@ pub enum DeclaredValue<'a, T: 'a> {
/// extra discriminant word) and synthesize dependent DeclaredValues for
/// PropertyDeclaration instances as needed.
#[derive(Clone, Debug, Eq, PartialEq)]
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
pub enum DeclaredValueOwned<T> {
/// A known specified value from the stylesheet.
Value(T),
/// An unparsed value that contains `var()` functions.
WithVariables(Arc<UnparsedValue>),
WithVariables(

This comment has been minimized.

Copy link
@emilio

emilio Jul 12, 2017

Member

nit: I think this would look nicer changing it to:

WithVariables {
    #[cfg_attr(feature = "servo", ...)]
    value: Arc<UnparsedValue>,
}

This comment has been minimized.

Copy link
@stshine

stshine Jul 18, 2017

Author Contributor

Will do.

#[cfg_attr(feature = "servo", ignore_heap_size_of = "Arc")]
Arc<UnparsedValue>),
/// An CSS-wide keyword.
CSSWideKeyword(CSSWideKeyword),
}
@@ -807,7 +811,12 @@ impl<T> DeclaredValueOwned<T> {
}

/// An unparsed property value that contains `var()` functions.
<<<<<<< 433b0ba3bfba657b9544a09ab338f21591bf5333
#[derive(Debug, Eq, PartialEq)]
=======
#[derive(PartialEq, Eq, Debug)]
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
>>>>>>> style: Derive HeapSizeOf for PropertyDeclarationBlock
pub struct UnparsedValue {
/// The css serialization for this value.
css: String,
@@ -1269,7 +1278,12 @@ impl PropertyParserContext {
}

/// Servo's representation for a property declaration.
<<<<<<< 433b0ba3bfba657b9544a09ab338f21591bf5333
#[derive(Clone, PartialEq)]
=======
#[derive(PartialEq, Clone)]
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
>>>>>>> style: Derive HeapSizeOf for PropertyDeclarationBlock
pub enum PropertyDeclaration {
% for property in data.longhands:
/// ${property.name}
@@ -1282,7 +1296,9 @@ pub enum PropertyDeclaration {
/// A css-wide keyword.
CSSWideKeyword(LonghandId, CSSWideKeyword),
/// An unparsed value that contains `var()` functions.
WithVariables(LonghandId, Arc<UnparsedValue>),
WithVariables(LonghandId,
#[cfg_attr(feature = "servo", ignore_heap_size_of = "Arc")]

This comment has been minimized.

Copy link
@emilio

emilio Jul 12, 2017

Member

ditto

Arc<UnparsedValue>),
/// A custom property declaration, with the property name and the declared
/// value.
Custom(::custom_properties::Name, DeclaredValueOwned<Box<::custom_properties::SpecifiedValue>>),
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.