diff options
author | Keith Yeung <kungfukeith11@gmail.com> | 2016-09-03 07:27:39 -0700 |
---|---|---|
committer | Keith Yeung <kungfukeith11@gmail.com> | 2016-10-11 19:36:06 -0700 |
commit | 668163ec5c4091806b155ef14d3b3522cb4697cd (patch) | |
tree | c392fa270399e7fdf1ae103720ea7b7406ddfc2d /components/script/dom/bindings/js.rs | |
parent | 752c6e6019f72e6ee1b7ee959e80f588b6714cfd (diff) | |
download | servo-668163ec5c4091806b155ef14d3b3522cb4697cd.tar.gz servo-668163ec5c4091806b155ef14d3b3522cb4697cd.zip |
Emit TransitionEnd events in the layout thread and process it in the script thread
Diffstat (limited to 'components/script/dom/bindings/js.rs')
-rw-r--r-- | components/script/dom/bindings/js.rs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/components/script/dom/bindings/js.rs b/components/script/dom/bindings/js.rs index 1fd127b3b28..fc881fee3b7 100644 --- a/components/script/dom/bindings/js.rs +++ b/components/script/dom/bindings/js.rs @@ -444,6 +444,14 @@ impl<T: Reflectable> LayoutJS<T> { debug_assert!(thread_state::get().is_layout()); *self.ptr } + + /// Returns a reference to the interior of this JS object. This method is + /// safe to call because it originates from the layout thread, and it cannot + /// mutate DOM nodes. + pub fn get_for_script(&self) -> &T { + debug_assert!(thread_state::get().is_script()); + unsafe { &**self.ptr } + } } /// Get an `&T` out of a `Rc<T>` |