mirror of
https://github.com/servo/servo.git
synced 2025-08-07 06:25:32 +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
|
@ -218,8 +218,7 @@ fn fmt_with_data_and_primary_values<N: TNode>(f: &mut fmt::Formatter, n: N) -> f
|
|||
if let Some(el) = n.as_element() {
|
||||
let dd = el.has_dirty_descendants();
|
||||
let data = el.borrow_data();
|
||||
let styles = data.as_ref().and_then(|d| d.get_styles());
|
||||
let values = styles.map(|s| s.primary.values());
|
||||
let values = data.as_ref().and_then(|d| d.styles.get_primary());
|
||||
write!(f, "{:?} dd={} data={:?} values={:?}", el, dd, &data, values)
|
||||
} else {
|
||||
write!(f, "{:?}", n)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue