mirror of
https://github.com/servo/servo.git
synced 2025-08-10 16:05:43 +01:00
Rename Reflectable
to DomObject
.
Fixes https://github.com/servo/servo/issues/8473.
This commit is contained in:
parent
0fe94a6724
commit
449f6337d4
72 changed files with 168 additions and 168 deletions
|
@ -35,7 +35,7 @@
|
|||
use dom::bindings::inheritance::Castable;
|
||||
use dom::bindings::js::Root;
|
||||
use dom::bindings::num::Finite;
|
||||
use dom::bindings::reflector::{Reflectable, Reflector};
|
||||
use dom::bindings::reflector::{DomObject, Reflector};
|
||||
use dom::bindings::str::{ByteString, DOMString, USVString};
|
||||
use dom::bindings::utils::DOMClass;
|
||||
use js;
|
||||
|
@ -102,7 +102,7 @@ impl<T: Float + FromJSValConvertible<Config=()>> FromJSValConvertible for Finite
|
|||
}
|
||||
}
|
||||
|
||||
impl <T: Reflectable + IDLInterface> FromJSValConvertible for Root<T> {
|
||||
impl <T: DomObject + IDLInterface> FromJSValConvertible for Root<T> {
|
||||
type Config = ();
|
||||
|
||||
unsafe fn from_jsval(_cx: *mut JSContext,
|
||||
|
@ -404,7 +404,7 @@ pub unsafe fn private_from_proto_check<F>(mut obj: *mut JSObject,
|
|||
|
||||
/// Get a `*const T` for a DOM object accessible from a `JSObject`.
|
||||
pub fn native_from_object<T>(obj: *mut JSObject) -> Result<*const T, ()>
|
||||
where T: Reflectable + IDLInterface
|
||||
where T: DomObject + IDLInterface
|
||||
{
|
||||
unsafe {
|
||||
private_from_proto_check(obj, T::derives).map(|ptr| ptr as *const T)
|
||||
|
@ -418,7 +418,7 @@ pub fn native_from_object<T>(obj: *mut JSObject) -> Result<*const T, ()>
|
|||
/// not a reflector for a DOM object of the given type (as defined by the
|
||||
/// proto_id and proto_depth).
|
||||
pub fn root_from_object<T>(obj: *mut JSObject) -> Result<Root<T>, ()>
|
||||
where T: Reflectable + IDLInterface
|
||||
where T: DomObject + IDLInterface
|
||||
{
|
||||
native_from_object(obj).map(|ptr| unsafe { Root::from_ref(&*ptr) })
|
||||
}
|
||||
|
@ -426,7 +426,7 @@ pub fn root_from_object<T>(obj: *mut JSObject) -> Result<Root<T>, ()>
|
|||
/// Get a `*const T` for a DOM object accessible from a `HandleValue`.
|
||||
/// Caller is responsible for throwing a JS exception if needed in case of error.
|
||||
pub fn native_from_handlevalue<T>(v: HandleValue) -> Result<*const T, ()>
|
||||
where T: Reflectable + IDLInterface
|
||||
where T: DomObject + IDLInterface
|
||||
{
|
||||
if !v.get().is_object() {
|
||||
return Err(());
|
||||
|
@ -437,7 +437,7 @@ pub fn native_from_handlevalue<T>(v: HandleValue) -> Result<*const T, ()>
|
|||
/// Get a `Root<T>` for a DOM object accessible from a `HandleValue`.
|
||||
/// Caller is responsible for throwing a JS exception if needed in case of error.
|
||||
pub fn root_from_handlevalue<T>(v: HandleValue) -> Result<Root<T>, ()>
|
||||
where T: Reflectable + IDLInterface
|
||||
where T: DomObject + IDLInterface
|
||||
{
|
||||
if !v.get().is_object() {
|
||||
return Err(());
|
||||
|
@ -447,12 +447,12 @@ pub fn root_from_handlevalue<T>(v: HandleValue) -> Result<Root<T>, ()>
|
|||
|
||||
/// Get a `Root<T>` for a DOM object accessible from a `HandleObject`.
|
||||
pub fn root_from_handleobject<T>(obj: HandleObject) -> Result<Root<T>, ()>
|
||||
where T: Reflectable + IDLInterface
|
||||
where T: DomObject + IDLInterface
|
||||
{
|
||||
root_from_object(obj.get())
|
||||
}
|
||||
|
||||
impl<T: Reflectable> ToJSValConvertible for Root<T> {
|
||||
impl<T: DomObject> ToJSValConvertible for Root<T> {
|
||||
unsafe fn to_jsval(&self, cx: *mut JSContext, rval: MutableHandleValue) {
|
||||
self.reflector().to_jsval(cx, rval);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue