Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lots of work on bindings #397

Merged
merged 10 commits into from Apr 24, 2013
Prev

Fix build errors after rebase.

  • Loading branch information
jdm committed Apr 23, 2013
commit bc26b4658847f2830c2b9359d9e1dd32f8d2dd54
@@ -79,10 +79,8 @@ pub fn create(cx: *JSContext, node: &mut AbstractNode) -> jsobj {
assert!(cache.get_wrapper().is_null());
cache.set_wrapper(obj.ptr);

unsafe {
let raw_ptr = node.raw_object() as *libc::c_void;
JS_SetReservedSlot(obj.ptr, DOM_OBJECT_SLOT as u32, RUST_PRIVATE_TO_JSVAL(raw_ptr));
}
let raw_ptr = node.raw_object() as *libc::c_void;
JS_SetReservedSlot(obj.ptr, DOM_OBJECT_SLOT as u32, RUST_PRIVATE_TO_JSVAL(raw_ptr));

return obj;
}
@@ -67,11 +67,9 @@ extern fn close(cx: *JSContext, _argc: c_uint, vp: *JSVal) -> JSBool {
}

extern fn gc(cx: *JSContext, _argc: c_uint, _vp: *JSVal) -> JSBool {
unsafe {
let runtime = JS_GetRuntime(cx);
JS_GC(runtime);
return 1;
}
let runtime = JS_GetRuntime(cx);
JS_GC(runtime);
return 1;
}

unsafe fn unwrap(obj: *JSObject) -> *rust_box<Window> {
@@ -130,9 +128,7 @@ pub fn init(compartment: @mut Compartment) {
}
];

unsafe {
JS_DefineFunctions(compartment.cx.ptr, proto.ptr, &methods[0]);
}
JS_DefineFunctions(compartment.cx.ptr, proto.ptr, &methods[0]);
}

pub fn create(compartment: @mut Compartment, win: @mut Window) {
@@ -29,7 +29,7 @@ pub fn Document(root: AbstractNode,
do root.with_imm_node |node| {
assert!(node.wrapper.get_wrapper().is_not_null());
let rootable = node.wrapper.get_rootable();
unsafe { JS_AddObjectRoot(compartment.cx.ptr, rootable); }
JS_AddObjectRoot(compartment.cx.ptr, rootable);
}
document::create(compartment, doc);
doc
@@ -42,7 +42,7 @@ impl Drop for Document {
do self.root.with_imm_node |node| {
assert!(node.wrapper.get_wrapper().is_not_null());
let rootable = node.wrapper.get_rootable();
unsafe { JS_RemoveObjectRoot(compartment.cx.ptr, rootable); }
JS_RemoveObjectRoot(compartment.cx.ptr, rootable);
}
}
}
@@ -243,7 +243,7 @@ pub fn parse_html(url: Url,
let url = url::from_str("http://example.com/"); // FIXME
let url_cell = Cell(url);
do child_node.with_imm_text |text_node| {
let data = text_node.text.to_str(); // FIXME: Bad copy.
let data = text_node.parent.data.to_str(); // FIXME: Bad copy.
let provenance = InlineProvenance(result::unwrap(url_cell.take()), data);
css_chan2.send(CSSTaskNewFile(provenance));
}
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.