diff options
author | Josh Matthews <josh@joshmatthews.net> | 2017-05-10 18:20:31 -0400 |
---|---|---|
committer | Josh Matthews <josh@joshmatthews.net> | 2017-05-15 14:12:08 -0400 |
commit | b0bf2b4bad636acfba66d55571b417ebae795408 (patch) | |
tree | 5a729fc75babf869f51a16a4bccab1a023115da4 /components/script/script_thread.rs | |
parent | 2ca80a800f8c1f85135bbdb605f69641ae9aa7d0 (diff) | |
download | servo-b0bf2b4bad636acfba66d55571b417ebae795408.tar.gz servo-b0bf2b4bad636acfba66d55571b417ebae795408.zip |
Make methods storing layout-originating nodes unsafe.
Diffstat (limited to 'components/script/script_thread.rs')
-rw-r--r-- | components/script/script_thread.rs | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/components/script/script_thread.rs b/components/script/script_thread.rs index 805b19a24b2..b817fc77d1d 100644 --- a/components/script/script_thread.rs +++ b/components/script/script_thread.rs @@ -576,9 +576,9 @@ impl ScriptThreadFactory for ScriptThread { } impl ScriptThread { - pub fn note_newly_transitioning_nodes(nodes: Vec<UntrustedNodeAddress>) { + pub unsafe fn note_newly_transitioning_nodes(nodes: Vec<UntrustedNodeAddress>) { SCRIPT_THREAD_ROOT.with(|root| { - let script_thread = unsafe { &*root.get().unwrap() }; + let script_thread = &*root.get().unwrap(); let js_runtime = script_thread.js_runtime.rt(); let new_nodes = nodes .into_iter() @@ -1619,7 +1619,9 @@ impl ScriptThread { /// Handles firing of transition events. fn handle_transition_event(&self, unsafe_node: UntrustedNodeAddress, name: String, duration: f64) { let js_runtime = self.js_runtime.rt(); - let node = from_untrusted_node_address(js_runtime, unsafe_node); + let node = unsafe { + from_untrusted_node_address(js_runtime, unsafe_node) + }; let idx = self.transitioning_nodes .borrow() |