mirror of
https://github.com/servo/servo.git
synced 2025-07-22 23:03:42 +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
|
@ -107,7 +107,8 @@ use std::sync::atomic::{AtomicUsize, Ordering};
|
|||
use std::sync::mpsc::{Receiver, Sender, channel};
|
||||
use std::thread;
|
||||
use style::animation::Animation;
|
||||
use style::context::{QuirksMode, ReflowGoal, SharedStyleContext, ThreadLocalStyleContextCreationInfo};
|
||||
use style::context::{QuirksMode, ReflowGoal, SharedStyleContext};
|
||||
use style::context::{StyleSystemOptions, ThreadLocalStyleContextCreationInfo};
|
||||
use style::data::StoredRestyleHint;
|
||||
use style::dom::{ShowSubtree, ShowSubtreeDataAndPrimaryValues, TElement, TNode};
|
||||
use style::error_reporting::StdoutErrorReporter;
|
||||
|
@ -516,6 +517,7 @@ impl LayoutThread {
|
|||
LayoutContext {
|
||||
style_context: SharedStyleContext {
|
||||
stylist: rw_data.stylist.clone(),
|
||||
options: StyleSystemOptions::default(),
|
||||
guards: guards,
|
||||
running_animations: self.running_animations.clone(),
|
||||
expired_animations: self.expired_animations.clone(),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue