bindings: Return errors in Result rather than setting an out parameter

Fixes #909.
This commit is contained in:
Keegan McAllister 2013-09-18 15:23:03 -07:00
parent 4b0680a136
commit 73c1a12f30
73 changed files with 891 additions and 550 deletions

View file

@ -3,7 +3,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use dom::bindings::codegen::HTMLElementBinding;
use dom::bindings::utils::{DOMString, ErrorResult};
use dom::bindings::utils::{DOMString, ErrorResult, Fallible};
use dom::bindings::utils::{CacheableWrapper, BindingObject, WrapperCache};
use dom::element::{Element, ElementTypeId};
use dom::node::{AbstractNode, ScriptView};
@ -41,21 +41,24 @@ impl HTMLElement {
None
}
pub fn SetDir(&mut self, _dir: &DOMString, _rv: &mut ErrorResult) {
pub fn SetDir(&mut self, _dir: &DOMString) -> ErrorResult {
Ok(())
}
pub fn GetItemValue(&self, _cx: *JSContext, _rv: &mut ErrorResult) -> JSVal {
JSVAL_NULL
pub fn GetItemValue(&self, _cx: *JSContext) -> Fallible<JSVal> {
Ok(JSVAL_NULL)
}
pub fn SetItemValue(&mut self, _cx: *JSContext, _val: JSVal, _rv: &mut ErrorResult) {
pub fn SetItemValue(&mut self, _cx: *JSContext, _val: JSVal) -> ErrorResult {
Ok(())
}
pub fn Hidden(&self) -> bool {
false
}
pub fn SetHidden(&mut self, _hidden: bool, _rv: &mut ErrorResult) {
pub fn SetHidden(&mut self, _hidden: bool) -> ErrorResult {
Ok(())
}
pub fn Click(&self) {
@ -65,20 +68,24 @@ impl HTMLElement {
0
}
pub fn SetTabIndex(&mut self, _index: i32, _rv: &mut ErrorResult) {
pub fn SetTabIndex(&mut self, _index: i32) -> ErrorResult {
Ok(())
}
pub fn Focus(&self, _rv: &mut ErrorResult) {
pub fn Focus(&self) -> ErrorResult {
Ok(())
}
pub fn Blur(&self, _rv: &mut ErrorResult) {
pub fn Blur(&self) -> ErrorResult {
Ok(())
}
pub fn AccessKey(&self) -> DOMString {
None
}
pub fn SetAccessKey(&self, _key: &DOMString, _rv: &mut ErrorResult) {
pub fn SetAccessKey(&self, _key: &DOMString) -> ErrorResult {
Ok(())
}
pub fn AccessKeyLabel(&self) -> DOMString {
@ -89,14 +96,16 @@ impl HTMLElement {
false
}
pub fn SetDraggable(&mut self, _draggable: bool, _rv: &mut ErrorResult) {
pub fn SetDraggable(&mut self, _draggable: bool) -> ErrorResult {
Ok(())
}
pub fn ContentEditable(&self) -> DOMString {
None
}
pub fn SetContentEditable(&mut self, _val: &DOMString, _rv: &mut ErrorResult) {
pub fn SetContentEditable(&mut self, _val: &DOMString) -> ErrorResult {
Ok(())
}
pub fn IsContentEditable(&self) -> bool {
@ -107,7 +116,8 @@ impl HTMLElement {
false
}
pub fn SetSpellcheck(&self, _val: bool, _rv: &mut ErrorResult) {
pub fn SetSpellcheck(&self, _val: bool) -> ErrorResult {
Ok(())
}
pub fn ClassName(&self) -> DOMString {