aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/script/dom/bindings
diff options
context:
space:
mode:
Diffstat (limited to 'src/components/script/dom/bindings')
-rw-r--r--src/components/script/dom/bindings/element.rs11
-rw-r--r--src/components/script/dom/bindings/proxyhandler.rs4
-rw-r--r--src/components/script/dom/bindings/utils.rs6
3 files changed, 9 insertions, 12 deletions
diff --git a/src/components/script/dom/bindings/element.rs b/src/components/script/dom/bindings/element.rs
index 9a34f7c5dc6..b79daf75db7 100644
--- a/src/components/script/dom/bindings/element.rs
+++ b/src/components/script/dom/bindings/element.rs
@@ -16,6 +16,7 @@ use std::cast;
use std::i32;
use std::libc;
use std::libc::c_uint;
+use std::comm;
use std::ptr;
use std::ptr::null;
use std::result;
@@ -229,13 +230,9 @@ extern fn HTMLImageElement_getWidth(cx: *JSContext, _argc: c_uint, vp: *mut JSVa
let width = match node.type_id() {
ElementNodeTypeId(HTMLImageElementTypeId) => {
let script_context = task_from_context(cx);
- match (*script_context).query_layout(ContentBoxQuery(node)) {
- Ok(rect) => {
- match rect {
- ContentBoxResponse(rect) => rect.size.width.to_px(),
- _ => fail!(~"unexpected layout reply")
- }
- }
+ let (port, chan) = comm::stream();
+ match (*script_context).query_layout(ContentBoxQuery(node, chan), port) {
+ Ok(ContentBoxResponse(rect)) => rect.size.width.to_px(),
Err(()) => 0
}
// TODO: if nothing is being rendered(?), return zero dimensions
diff --git a/src/components/script/dom/bindings/proxyhandler.rs b/src/components/script/dom/bindings/proxyhandler.rs
index 2780a969eb2..cbbc4f1525d 100644
--- a/src/components/script/dom/bindings/proxyhandler.rs
+++ b/src/components/script/dom/bindings/proxyhandler.rs
@@ -71,7 +71,7 @@ pub fn _obj_toString(cx: *JSContext, className: *libc::c_char) -> *JSString {
return ptr::null();
}
- let result = ~"[object " + name + ~"]";
+ let result = ~"[object " + name + "]";
for result.iter().enumerate().advance |(i, c)| {
*chars.offset(i) = c as jschar;
}
@@ -86,4 +86,4 @@ pub fn _obj_toString(cx: *JSContext, className: *libc::c_char) -> *JSString {
pub fn GetExpandoObject(_proxy: *JSObject) -> *JSObject {
ptr::null()
-} \ No newline at end of file
+}
diff --git a/src/components/script/dom/bindings/utils.rs b/src/components/script/dom/bindings/utils.rs
index 9d3105fefca..5a42e109268 100644
--- a/src/components/script/dom/bindings/utils.rs
+++ b/src/components/script/dom/bindings/utils.rs
@@ -21,12 +21,12 @@ use js::glue::{PROPERTY_STUB, STRICT_PROPERTY_STUB, ENUMERATE_STUB, CONVERT_STUB
use js::jsapi::{JS_AlreadyHasOwnProperty, JS_NewObject, JS_NewFunction};
use js::jsapi::{JS_DefineProperties, JS_WrapValue, JS_ForwardGetPropertyTo};
use js::jsapi::{JS_EncodeString, JS_free, JS_GetStringCharsAndLength};
-use js::jsapi::{JS_GetClass, JS_GetPrototype, JS_LinkConstructorAndPrototype};
+use js::jsapi::{JS_GetClass, JS_LinkConstructorAndPrototype};
use js::jsapi::{JS_GetFunctionPrototype, JS_InternString, JS_GetFunctionObject};
use js::jsapi::{JS_HasPropertyById, JS_GetPrototype, JS_GetGlobalForObject};
use js::jsapi::{JS_NewStringCopyN, JS_DefineFunctions, JS_DefineProperty};
use js::jsapi::{JS_ValueToString, JS_GetReservedSlot, JS_SetReservedSlot};
-use js::jsapi::{JSContext, JSVal, JSObject, JSBool, jsid, JSClass, JSNative};
+use js::jsapi::{JSContext, JSObject, JSBool, jsid, JSClass, JSNative};
use js::jsapi::{JSFunctionSpec, JSPropertySpec, JSVal, JSPropertyDescriptor};
use js::jsfriendapi::bindgen::JS_NewObjectWithUniqueType;
use js::rust::Compartment;
@@ -83,7 +83,7 @@ extern fn InterfaceObjectToString(cx: *JSContext, _argc: uint, vp: *mut JSVal) -
}
let name = jsval_to_str(cx, *v).get();
- let retval = str(~"function " + name + ~"() {\n [native code]\n}");
+ let retval = str(~"function " + name + "() {\n [native code]\n}");
*vp = domstring_to_jsval(cx, &retval);
return 1;
}