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

Add Event bindings and support for WebIDL dictionaries #422

Merged
merged 2 commits into from May 8, 2013
Merged
Changes from 1 commit
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

Prev

Remove unused mutable warning spam from generated code.

  • Loading branch information
jdm committed May 8, 2013
commit c9f46e61677fce4ef294f49c8f8fbd0a3b2239aa
@@ -2138,7 +2138,7 @@ def __init__(self, descriptors, dictionaries, declareImports, defineImports, chi
# TODO imports to cover descriptors, etc.

def _useString(imports):
return '#[allow(unused_imports,unused_variable,unused_unsafe)];' + ''.join(['use %s;\n' % i for i in imports]) + '\n'
return '#[allow(unused_imports,unused_variable,unused_unsafe,unused_mut)];' + ''.join(['use %s;\n' % i for i in imports]) + '\n'
CGWrapper.__init__(self, child,
declarePre=_useString(sorted(declareImports)))

@@ -174,7 +174,7 @@ extern fn getBoundingClientRect(cx: *JSContext, _argc: c_uint, vp: *JSVal) -> JS
extern fn setAttribute(cx: *JSContext, argc: c_uint, vp: *JSVal) -> JSBool {
unsafe {
let obj = JS_THIS_OBJECT(cx, vp);
let mut node = unwrap(obj);
let node = unwrap(obj);

if (argc < 2) {
return 0; //XXXjdm throw exception
@@ -212,7 +212,7 @@ extern fn HTMLImageElement_getWidth(cx: *JSContext, _argc: c_uint, vp: *mut JSVa
return 0;
}

let mut node = unwrap(obj);
let node = unwrap(obj);
let width = match node.type_id() {
ElementNodeTypeId(HTMLImageElementTypeId) => {
let content = task_from_context(cx);
@@ -245,7 +245,7 @@ extern fn HTMLImageElement_setWidth(cx: *JSContext, _argc: c_uint, vp: *mut JSVa
return 0;
}

let mut node = unwrap(obj);
let node = unwrap(obj);
match node.type_id() {
ElementNodeTypeId(HTMLImageElementTypeId) => {
do node.as_mut_element |elem| {
@@ -269,7 +269,7 @@ extern fn getTagName(cx: *JSContext, _argc: c_uint, vp: *mut JSVal) -> JSBool {
return 0;
}

let mut node = unwrap(obj);
let node = unwrap(obj);
do node.with_imm_element |elem| {
let s = str(copy elem.tag_name);
*vp = domstring_to_jsval(cx, &s);
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.