mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
style: Share custom property declarations if they don't contain variable references.
This commit is contained in:
parent
7e143372bd
commit
a6eaa0812a
8 changed files with 180 additions and 135 deletions
|
@ -9,6 +9,7 @@
|
|||
use Atom;
|
||||
use cssparser::serialize_identifier;
|
||||
use custom_properties;
|
||||
use servo_arc::Arc;
|
||||
use std::fmt;
|
||||
use style_traits::ToCss;
|
||||
|
||||
|
@ -153,7 +154,8 @@ pub struct PaintWorklet {
|
|||
pub name: Atom,
|
||||
/// The arguments for the worklet.
|
||||
/// TODO: store a parsed representation of the arguments.
|
||||
pub arguments: Vec<custom_properties::SpecifiedValue>,
|
||||
#[cfg_attr(feature = "servo", ignore_heap_size_of = "Arc")]
|
||||
pub arguments: Vec<Arc<custom_properties::SpecifiedValue>>,
|
||||
}
|
||||
|
||||
trivial_to_computed_value!(PaintWorklet);
|
||||
|
|
|
@ -917,7 +917,7 @@ impl Parse for PaintWorklet {
|
|||
let name = Atom::from(&**input.expect_ident()?);
|
||||
let arguments = input.try(|input| {
|
||||
input.expect_comma()?;
|
||||
input.parse_comma_separated(|input| Ok(*SpecifiedValue::parse(input)?))
|
||||
input.parse_comma_separated(|input| SpecifiedValue::parse(input))
|
||||
}).unwrap_or(vec![]);
|
||||
Ok(PaintWorklet { name, arguments })
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue