Fix forward declaration in webIDL that breaks the build.

This commit is contained in:
Josh Matthews 2013-03-15 13:35:49 -04:00
parent 2cfbe2b000
commit ecb4a9981a

View file

@ -4,82 +4,7 @@
* You can obtain one at http://mozilla.org/MPL/2.0/.
*/
interface ClientRect;
interface ClientRectList {
readonly attribute unsigned long length;
getter ClientRect? item(unsigned long index);
};
/* Helpers
unsafe fn unwrap<T>(obj: *JSObject) -> *rust_box<T> {
let val = JS_GetReservedSlot(obj, 0);
cast::reinterpret_cast(&RUST_JSVAL_TO_PRIVATE(val))
}
trait ToJsval {
fn to_jsval(cx: *JSContext) -> jsval;
}
impl Option : ToJsval {
fn to_jsval(cx: *JSContext) -> jsval {
match self {
Some(v) => v.to_jsval(),
None => JSVAL_NULL
}
}
}
*/
/*
trait ClientRectList {
fn getLength() -> u32;
fn getItem(u32 index) -> Option<@ClientRect>;
}
mod ClientRectList {
mod bindings {
fn getLength(cx: *JSContext, argc: c_uint, argv: *jsval) -> JSBool unsafe {
let obj = JS_THIS_OBJECT(cx, unsafe::reinterpret_cast(&vp));
if obj.is_null() {
return 0;
}
let conrete = unwrap<ClientRectList>(obj);
let rval = (*concrete).getLength();
JS_SET_RVAL(argv, rval);
return 1;
}
fn getItem(cx: *JSContext, argc: c_uint, vp: *jsval) -> JSBool unsafe {
let obj = JS_THIS_OBJECT(cx, unsafe::reinterpret_cast(&vp));
if obj.is_null() {
return 0;
}
let raw_arg1 = if argc < 1 {
//XXX convert null
} else {
JS_ARGV(vp, 0);
};
let arg1 = if !RUST_JSVAL_IS_INT(raw_arg1) {
//XXX convert to int
} else {
RUST_JSVAL_TO_INT(raw_arg1);
} as u32;
let conrete = unwrap<ClientRectList>(obj);
let rval = (*concrete).getItem(arg1);
JS_SET_RVAL(vp, rval.to_jsval())
return 1;
}
}
*/