aboutsummaryrefslogtreecommitdiffstats
path: root/components/style/context.rs
diff options
context:
space:
mode:
Diffstat (limited to 'components/style/context.rs')
-rw-r--r--components/style/context.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/components/style/context.rs b/components/style/context.rs
index a7fe03ad70c..5ed3f06c6bc 100644
--- a/components/style/context.rs
+++ b/components/style/context.rs
@@ -322,6 +322,8 @@ pub struct TraversalStatistics {
pub selectors: u32,
/// The number of revalidation selectors.
pub revalidation_selectors: u32,
+ /// The number of state/attr dependencies in the dependency set.
+ pub dependency_selectors: u32,
/// The number of declarations in the stylist.
pub declarations: u32,
/// The number of times the stylist was rebuilt.
@@ -342,6 +344,7 @@ impl<'a> ops::Add for &'a TraversalStatistics {
"traversal_time_ms should be set at the end by the caller");
debug_assert!(self.selectors == 0, "set at the end");
debug_assert!(self.revalidation_selectors == 0, "set at the end");
+ debug_assert!(self.dependency_selectors == 0, "set at the end");
debug_assert!(self.declarations == 0, "set at the end");
debug_assert!(self.stylist_rebuilds == 0, "set at the end");
TraversalStatistics {
@@ -352,6 +355,7 @@ impl<'a> ops::Add for &'a TraversalStatistics {
styles_reused: self.styles_reused + other.styles_reused,
selectors: 0,
revalidation_selectors: 0,
+ dependency_selectors: 0,
declarations: 0,
stylist_rebuilds: 0,
traversal_time_ms: 0.0,
@@ -379,6 +383,7 @@ impl fmt::Display for TraversalStatistics {
writeln!(f, "[PERF],styles_reused,{}", self.styles_reused)?;
writeln!(f, "[PERF],selectors,{}", self.selectors)?;
writeln!(f, "[PERF],revalidation_selectors,{}", self.revalidation_selectors)?;
+ writeln!(f, "[PERF],dependency_selectors,{}", self.dependency_selectors)?;
writeln!(f, "[PERF],declarations,{}", self.declarations)?;
writeln!(f, "[PERF],stylist_rebuilds,{}", self.stylist_rebuilds)?;
writeln!(f, "[PERF],traversal_time_ms,{}", self.traversal_time_ms)?;
@@ -400,6 +405,7 @@ impl TraversalStatistics {
self.traversal_time_ms = (time::precise_time_s() - start) * 1000.0;
self.selectors = stylist.num_selectors() as u32;
self.revalidation_selectors = stylist.num_revalidation_selectors() as u32;
+ self.dependency_selectors = stylist.num_invalidations() as u32;
self.declarations = stylist.num_declarations() as u32;
self.stylist_rebuilds = stylist.num_rebuilds() as u32;
}