diff options
author | bors-servo <lbergstrom+bors@mozilla.com> | 2017-04-03 16:16:07 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-04-03 16:16:07 -0500 |
commit | b6b6608ca3a46113bb488e4da835b4ee743299fd (patch) | |
tree | 00ec2b5dd71970fdd4361e43a79e6b68dbadbffe /components/script | |
parent | dc8ed0d740ede21ed3eb11f8b64813858fc1ca06 (diff) | |
parent | c8b5b4a9bb787d1d5ff8f60038a9bb4a1781f11e (diff) | |
download | servo-b6b6608ca3a46113bb488e4da835b4ee743299fd.tar.gz servo-b6b6608ca3a46113bb488e4da835b4ee743299fd.zip |
Auto merge of #16246 - servo:revert-per-doc, r=jdm
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
<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/16246)
<!-- Reviewable:end -->
Diffstat (limited to 'components/script')
-rw-r--r-- | components/script/Cargo.toml | 1 | ||||
-rw-r--r-- | components/script/dom/document.rs | 16 | ||||
-rw-r--r-- | components/script/lib.rs | 2 |
3 files changed, 18 insertions, 1 deletions
diff --git a/components/script/Cargo.toml b/components/script/Cargo.toml index cb4418b94df..de9456ec1e7 100644 --- a/components/script/Cargo.toml +++ b/components/script/Cargo.toml @@ -54,6 +54,7 @@ image = "0.12" ipc-channel = "0.7" js = {git = "https://github.com/servo/rust-mozjs", features = ["promises"]} jstraceable_derive = {path = "../jstraceable_derive"} +lazy_static = "0.2" libc = "0.2" log = "0.3.5" mime = "0.2.1" diff --git a/components/script/dom/document.rs b/components/script/dom/document.rs index fe1065104f4..8dd3cd17aec 100644 --- a/components/script/dom/document.rs +++ b/components/script/dom/document.rs @@ -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), diff --git a/components/script/lib.rs b/components/script/lib.rs index ade3543bbe8..2de2e37ea38 100644 --- a/components/script/lib.rs +++ b/components/script/lib.rs @@ -60,6 +60,8 @@ extern crate ipc_channel; extern crate js; #[macro_use] extern crate jstraceable_derive; +#[macro_use] +extern crate lazy_static; extern crate libc; #[macro_use] extern crate log; |