mirror of
https://github.com/servo/servo.git
synced 2025-08-05 13:40:08 +01:00
Store style system options in the global style data and shared style context.
I wanted to add an environmental variable to disable the style sharing cache for gecko, but the current pattern involves lazy_static!, which involves an atomic operation on lookup, which is a bit hot to do each time we try to share styles. This makes that work happen once per process.
This commit is contained in:
parent
3c5a21ebf3
commit
dc5dbd5542
7 changed files with 66 additions and 50 deletions
|
@ -6,7 +6,6 @@
|
|||
|
||||
#![deny(missing_docs)]
|
||||
|
||||
use context::TraversalStatistics;
|
||||
use dom::{TElement, TNode};
|
||||
use std::borrow::BorrowMut;
|
||||
use std::collections::VecDeque;
|
||||
|
@ -22,7 +21,7 @@ pub fn traverse_dom<E, D>(traversal: &D,
|
|||
where E: TElement,
|
||||
D: DomTraversal<E>,
|
||||
{
|
||||
let dump_stats = TraversalStatistics::should_dump();
|
||||
let dump_stats = traversal.shared_context().options.dump_style_statistics;
|
||||
let start_time = if dump_stats { Some(time::precise_time_s()) } else { None };
|
||||
|
||||
debug_assert!(!traversal.is_parallel());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue