mirror of
https://github.com/servo/servo.git
synced 2025-07-02 13:03:43 +01:00
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 -->
This commit is contained in:
commit
a3b55d68a8
5 changed files with 192 additions and 18 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue