mirror of
https://github.com/servo/servo.git
synced 2025-08-09 15:35:34 +01:00
Bug 1331856 - Add style performance statistics to Servo. r=emilio
MozReview-Commit-ID: ECHZgYNA8nb
This commit is contained in:
parent
3a8167350b
commit
5370224877
5 changed files with 95 additions and 29 deletions
|
@ -6,7 +6,9 @@
|
|||
|
||||
#![deny(missing_docs)]
|
||||
|
||||
use context::TraversalStatistics;
|
||||
use dom::{TElement, TNode};
|
||||
use std::borrow::Borrow;
|
||||
use traversal::{DomTraversal, PerLevelTraversalData, PreTraverseToken};
|
||||
|
||||
/// Do a sequential DOM traversal for layout or styling, generic over `D`.
|
||||
|
@ -57,4 +59,10 @@ pub fn traverse_dom<E, D>(traversal: &D,
|
|||
} else {
|
||||
doit(traversal, &mut traversal_data, &mut tlc, root.as_node());
|
||||
}
|
||||
|
||||
// Dump statistics to stdout if requested.
|
||||
let tlsc = tlc.borrow();
|
||||
if TraversalStatistics::should_dump() {
|
||||
println!("{}", tlsc.statistics);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue