mirror of
https://github.com/servo/servo.git
synced 2025-07-30 10:40:27 +01:00
Add LayoutJS<T: Reflectable>.get_jsobject().
This commit is contained in:
parent
b7443bef83
commit
2cca095481
2 changed files with 9 additions and 12 deletions
|
@ -144,6 +144,13 @@ pub struct LayoutJS<T> {
|
|||
ptr: NonZero<*const T>
|
||||
}
|
||||
|
||||
impl<T: Reflectable> LayoutJS<T> {
|
||||
/// Get the reflector.
|
||||
pub unsafe fn get_jsobject(&self) -> *mut JSObject {
|
||||
(**self.ptr).reflector().get_jsobject()
|
||||
}
|
||||
}
|
||||
|
||||
impl<T> Copy for JS<T> {}
|
||||
|
||||
impl<T> Copy for LayoutJS<T> {}
|
||||
|
@ -241,15 +248,6 @@ impl<T: Reflectable> Reflectable for JS<T> {
|
|||
}
|
||||
}
|
||||
|
||||
// XXXjdm same above
|
||||
impl<T: Reflectable> Reflectable for LayoutJS<T> {
|
||||
fn reflector<'a>(&'a self) -> &'a Reflector {
|
||||
unsafe {
|
||||
(*self.unsafe_get()).reflector()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// A trait to be implemented for JS-managed types that can be stored in
|
||||
/// mutable member fields.
|
||||
///
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue