Revert to per-process shared lock for author-origin stylesheets

Fixes https://github.com/servo/servo/issues/16097
Reopens https://github.com/servo/servo/issues/16027
This commit is contained in:
Simon Sapin 2017-04-03 18:03:14 +02:00
parent e03093e96c
commit c8b5b4a9bb
4 changed files with 19 additions and 1 deletions

View file

@ -2132,7 +2132,21 @@ impl Document {
scripts: Default::default(),
anchors: Default::default(),
applets: Default::default(),
style_shared_lock: StyleSharedRwLock::new(),
style_shared_lock: {
lazy_static! {
/// Per-process shared lock for author-origin stylesheets
///
/// FIXME: make it per-document or per-pipeline instead:
/// https://github.com/servo/servo/issues/16027
/// (Need to figure out what to do with the style attribute
/// of elements adopted into another document.)
static ref PER_PROCESS_AUTHOR_SHARED_LOCK: StyleSharedRwLock = {
StyleSharedRwLock::new()
};
}
PER_PROCESS_AUTHOR_SHARED_LOCK.clone()
//StyleSharedRwLock::new()
},
stylesheets: DOMRefCell::new(None),
stylesheets_changed_since_reflow: Cell::new(false),
stylesheet_list: MutNullableJS::new(None),