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

@ -2,7 +2,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use dom::bindings::utils::{DOMString, ErrorResult};
use dom::bindings::utils::{DOMString, ErrorResult, Fallible};
use dom::htmlelement::HTMLElement;
pub struct HTMLTextAreaElement {
@ -14,70 +14,80 @@ impl HTMLTextAreaElement {
false
}
pub fn SetAutofocus(&mut self, _autofocus: bool, _rv: &mut ErrorResult) {
pub fn SetAutofocus(&mut self, _autofocus: bool) -> ErrorResult {
Ok(())
}
pub fn Cols(&self) -> u32 {
0
}
pub fn SetCols(&self, _cols: u32, _rv: &mut ErrorResult) {
pub fn SetCols(&self, _cols: u32) -> ErrorResult {
Ok(())
}
pub fn Disabled(&self) -> bool {
false
}
pub fn SetDisabled(&mut self, _disabled: bool, _rv: &mut ErrorResult) {
pub fn SetDisabled(&mut self, _disabled: bool) -> ErrorResult {
Ok(())
}
pub fn MaxLength(&self) -> i32 {
0
}
pub fn SetMaxLength(&self, _max_length: i32, _rv: &mut ErrorResult) {
pub fn SetMaxLength(&self, _max_length: i32) -> ErrorResult {
Ok(())
}
pub fn Name(&self) -> DOMString {
None
}
pub fn SetName(&mut self, _name: &DOMString, _rv: &mut ErrorResult) {
pub fn SetName(&mut self, _name: &DOMString) -> ErrorResult {
Ok(())
}
pub fn Placeholder(&self) -> DOMString {
None
}
pub fn SetPlaceholder(&mut self, _placeholder: &DOMString, _rv: &mut ErrorResult) {
pub fn SetPlaceholder(&mut self, _placeholder: &DOMString) -> ErrorResult {
Ok(())
}
pub fn ReadOnly(&self) -> bool {
false
}
pub fn SetReadOnly(&mut self, _read_only: bool, _rv: &mut ErrorResult) {
pub fn SetReadOnly(&mut self, _read_only: bool) -> ErrorResult {
Ok(())
}
pub fn Required(&self) -> bool {
false
}
pub fn SetRequired(&mut self, _required: bool, _rv: &mut ErrorResult) {
pub fn SetRequired(&mut self, _required: bool) -> ErrorResult {
Ok(())
}
pub fn Rows(&self) -> u32 {
0
}
pub fn SetRows(&self, _rows: u32, _rv: &mut ErrorResult) {
pub fn SetRows(&self, _rows: u32) -> ErrorResult {
Ok(())
}
pub fn Wrap(&self) -> DOMString {
None
}
pub fn SetWrap(&mut self, _wrap: &DOMString, _rv: &mut ErrorResult) {
pub fn SetWrap(&mut self, _wrap: &DOMString) -> ErrorResult {
Ok(())
}
pub fn Type(&self) -> DOMString {
@ -91,7 +101,8 @@ impl HTMLTextAreaElement {
None
}
pub fn SetDefaultValue(&mut self, _default_value: &DOMString, _rv: &mut ErrorResult) {
pub fn SetDefaultValue(&mut self, _default_value: &DOMString) -> ErrorResult {
Ok(())
}
pub fn Value(&self) -> DOMString {
@ -105,14 +116,16 @@ impl HTMLTextAreaElement {
0
}
pub fn SetTextLength(&self, _text_length: u32, _rv: &mut ErrorResult) {
pub fn SetTextLength(&self, _text_length: u32) -> ErrorResult {
Ok(())
}
pub fn WillValidate(&self) -> bool {
false
}
pub fn SetWillValidate(&mut self, _will_validate: bool, _rv: &mut ErrorResult) {
pub fn SetWillValidate(&mut self, _will_validate: bool) -> ErrorResult {
Ok(())
}
pub fn ValidationMessage(&self) -> DOMString {
@ -129,25 +142,28 @@ impl HTMLTextAreaElement {
pub fn Select(&self) {
}
pub fn GetSelectionStart(&self, _rv: &mut ErrorResult) -> u32 {
0
pub fn GetSelectionStart(&self) -> Fallible<u32> {
Ok(0)
}
pub fn SetSelectionStart(&self, _selection_start: u32, _rv: &mut ErrorResult) {
pub fn SetSelectionStart(&self, _selection_start: u32) -> ErrorResult {
Ok(())
}
pub fn GetSelectionEnd(&self, _rv: &mut ErrorResult) -> u32 {
0
pub fn GetSelectionEnd(&self) -> Fallible<u32> {
Ok(0)
}
pub fn SetSelectionEnd(&self, _selection_end: u32, _rv: &mut ErrorResult) {
pub fn SetSelectionEnd(&self, _selection_end: u32) -> ErrorResult {
Ok(())
}
pub fn GetSelectionDirection(&self, _rv: &mut ErrorResult) -> DOMString {
None
pub fn GetSelectionDirection(&self) -> Fallible<DOMString> {
Ok(None)
}
pub fn SetSelectionDirection(&self, _selection_direction: &DOMString, _rv: &mut ErrorResult) {
pub fn SetSelectionDirection(&self, _selection_direction: &DOMString) -> ErrorResult {
Ok(())
}
pub fn SetRangeText(&self, _replacement: &DOMString) {