diff options
author | bors-servo <lbergstrom+bors@mozilla.com> | 2016-04-04 20:11:29 +0530 |
---|---|---|
committer | bors-servo <lbergstrom+bors@mozilla.com> | 2016-04-04 20:11:29 +0530 |
commit | a3b55d68a84dac301b3bc40d2444934b7df8e167 (patch) | |
tree | 6af50c1da4d24753e0d9563f802f070f2505a664 /components | |
parent | ca3d120f4abaa40c9377ac450420372fd00cf668 (diff) | |
parent | 43e49705be1f762088b506e0a746393a79731b7a (diff) | |
download | servo-a3b55d68a84dac301b3bc40d2444934b7df8e167.tar.gz servo-a3b55d68a84dac301b3bc40d2444934b7df8e167.zip |
Auto merge of #10359 - bholley:style_struct_management, r=SimonSapin
Implement construction, destruction, and copying of gecko style structs
This requires some new machinery on the gecko side, which I'll get up in bugzilla shortly.
<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/10359)
<!-- Reviewable:end -->
Diffstat (limited to 'components')
-rw-r--r-- | components/style/properties.mako.rs | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/components/style/properties.mako.rs b/components/style/properties.mako.rs index ce285c4d71b..0b9dcd11217 100644 --- a/components/style/properties.mako.rs +++ b/components/style/properties.mako.rs @@ -6722,10 +6722,8 @@ pub type CascadePropertyFn<C /*: ComputedValues */> = cacheable: &mut bool, error_reporter: &mut Box<ParseErrorReporter + Send>); -// This is a thread-local rather than a lazy static to avoid atomic operations when cascading -// properties. -thread_local!(static CASCADE_PROPERTY: Vec<Option<CascadePropertyFn<ServoComputedValues>>> = { - let mut result: Vec<Option<CascadePropertyFn<ServoComputedValues>>> = Vec::new(); +pub fn make_cascade_vec<C: ComputedValues>() -> Vec<Option<CascadePropertyFn<C>>> { + let mut result: Vec<Option<CascadePropertyFn<C>>> = Vec::new(); % for style_struct in STYLE_STRUCTS: % for property in style_struct.longhands: let discriminant; @@ -6741,6 +6739,12 @@ thread_local!(static CASCADE_PROPERTY: Vec<Option<CascadePropertyFn<ServoCompute % endfor % endfor result +} + +// This is a thread-local rather than a lazy static to avoid atomic operations when cascading +// properties. +thread_local!(static CASCADE_PROPERTY: Vec<Option<CascadePropertyFn<ServoComputedValues>>> = { + make_cascade_vec::<ServoComputedValues>() }); /// Performs the CSS cascade, computing new styles for an element from its parent style and |