mirror of
https://github.com/servo/servo.git
synced 2025-08-11 16:35:33 +01:00
Move match and cascade temporaries to CurrentElementInfo
Before this change, the `ComputedStyle` struct that is part of permanent style data per element holds 2 `StrongRuleNode`s (unvisited and visited) and 2 `Arc<ComputedValues>` (unvisited and visited). Both rule nodes and the visited values don't actually need to be here. This patch moves these 3 to new temporary storage in `CascadeInputs` on `CurrentElementInfo` during the match and cascade process. Rule nodes are pushed down inside the `ComputedValues` for later access after the cascade. (Visited values were already available there.) The permanent style data per element now has just the `Arc<ComputedValues>` for itself and eager pseudo-elements (plus the `RestyleHint`). MozReview-Commit-ID: 3wq52ERMpdi
This commit is contained in:
parent
c3b2a2f4de
commit
2b5c56e6a8
19 changed files with 738 additions and 746 deletions
|
@ -7,7 +7,7 @@ use servo_arc::Arc;
|
|||
use std::mem::{size_of, align_of};
|
||||
use style;
|
||||
use style::applicable_declarations::ApplicableDeclarationBlock;
|
||||
use style::data::{ComputedStyle, ElementData, ElementStyles, RestyleData};
|
||||
use style::data::{ElementData, ElementStyles, RestyleData};
|
||||
use style::gecko::selector_parser as real;
|
||||
use style::properties::ComputedValues;
|
||||
use style::rule_tree::{RuleNode, StrongRuleNode};
|
||||
|
@ -31,10 +31,10 @@ size_of_test!(test_size_of_rule, style::stylist::Rule, 32);
|
|||
|
||||
size_of_test!(test_size_of_option_arc_cv, Option<Arc<ComputedValues>>, 8);
|
||||
size_of_test!(test_size_of_option_rule_node, Option<StrongRuleNode>, 8);
|
||||
size_of_test!(test_size_of_computed_style, ComputedStyle, 32);
|
||||
size_of_test!(test_size_of_element_styles, ElementStyles, 48);
|
||||
size_of_test!(test_size_of_element_data, ElementData, 56);
|
||||
|
||||
size_of_test!(test_size_of_element_styles, ElementStyles, 24);
|
||||
size_of_test!(test_size_of_restyle_data, RestyleData, 8);
|
||||
size_of_test!(test_size_of_element_data, ElementData, 32);
|
||||
|
||||
size_of_test!(test_size_of_property_declaration, style::properties::PropertyDeclaration, 32);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue