mirror of
https://github.com/servo/servo.git
synced 2025-08-06 22:15:33 +01:00
Fix build errors after rebase.
This commit is contained in:
parent
5bade7b0fb
commit
bc26b46588
4 changed files with 9 additions and 15 deletions
|
@ -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));
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue