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

1
Cargo.lock generated
View file

@ -2249,6 +2249,7 @@ dependencies = [
"ipc-channel 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", "ipc-channel 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
"js 0.1.4 (git+https://github.com/servo/rust-mozjs)", "js 0.1.4 (git+https://github.com/servo/rust-mozjs)",
"jstraceable_derive 0.0.1", "jstraceable_derive 0.0.1",
"lazy_static 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.21 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.21 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)",
"mime 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", "mime 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)",

View file

@ -54,6 +54,7 @@ image = "0.12"
ipc-channel = "0.7" ipc-channel = "0.7"
js = {git = "https://github.com/servo/rust-mozjs", features = ["promises"]} js = {git = "https://github.com/servo/rust-mozjs", features = ["promises"]}
jstraceable_derive = {path = "../jstraceable_derive"} jstraceable_derive = {path = "../jstraceable_derive"}
lazy_static = "0.2"
libc = "0.2" libc = "0.2"
log = "0.3.5" log = "0.3.5"
mime = "0.2.1" mime = "0.2.1"

View file

@ -2132,7 +2132,21 @@ impl Document {
scripts: Default::default(), scripts: Default::default(),
anchors: Default::default(), anchors: Default::default(),
applets: 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: DOMRefCell::new(None),
stylesheets_changed_since_reflow: Cell::new(false), stylesheets_changed_since_reflow: Cell::new(false),
stylesheet_list: MutNullableJS::new(None), stylesheet_list: MutNullableJS::new(None),

View file

@ -60,6 +60,8 @@ extern crate ipc_channel;
extern crate js; extern crate js;
#[macro_use] #[macro_use]
extern crate jstraceable_derive; extern crate jstraceable_derive;
#[macro_use]
extern crate lazy_static;
extern crate libc; extern crate libc;
#[macro_use] #[macro_use]
extern crate log; extern crate log;