diff options
author | bors-servo <lbergstrom+bors@mozilla.com> | 2016-10-12 02:08:37 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-10-12 02:08:37 -0500 |
commit | cd2f950de3bcbf88208dec16f7025ff516473e0d (patch) | |
tree | 0ee85644b09c7262affb432be29d294793586c6c /components/script/dom/bindings/js.rs | |
parent | f12b77007981c056098b1daa9b759912d46b7c18 (diff) | |
parent | 668163ec5c4091806b155ef14d3b3522cb4697cd (diff) | |
download | servo-cd2f950de3bcbf88208dec16f7025ff516473e0d.tar.gz servo-cd2f950de3bcbf88208dec16f7025ff516473e0d.zip |
Auto merge of #13056 - KiChjang:transition-event, r=mbrubeck
Implement transition event and infrastructure
Fixes #10245.
<!-- 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/13056)
<!-- Reviewable:end -->
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 c35b4905ceb..779cb62d634 100644 --- a/components/script/dom/bindings/js.rs +++ b/components/script/dom/bindings/js.rs @@ -451,6 +451,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 a reference out of a rooted value. |