diff --git a/components/style/gecko_bindings/sugar/ownership.rs b/components/style/gecko_bindings/sugar/ownership.rs index 5170b7dbc5a..0ece222a1c4 100644 --- a/components/style/gecko_bindings/sugar/ownership.rs +++ b/components/style/gecko_bindings/sugar/ownership.rs @@ -9,6 +9,7 @@ use std::marker::PhantomData; use std::mem::{forget, transmute}; use std::ops::{Deref, DerefMut}; use std::ptr; +use gecko_bindings::structs::root::mozilla::detail::CopyablePtr; /// Indicates that a given Servo type has a corresponding Gecko FFI type. pub unsafe trait HasFFI: Sized + 'static { @@ -332,3 +333,16 @@ impl OwnedOrNull { unsafe { transmute(self) } } } + +impl Deref for CopyablePtr { + type Target = T; + fn deref(&self) -> &Self::Target { + &self.mPtr + } +} + +impl DerefMut for CopyablePtr { + fn deref_mut<'a>(&'a mut self) -> &'a mut T { + &mut self.mPtr + } +} \ No newline at end of file