mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
bindings: Return errors in Result rather than setting an out parameter
Fixes #909.
This commit is contained in:
parent
4b0680a136
commit
73c1a12f30
73 changed files with 891 additions and 550 deletions
|
@ -58,7 +58,8 @@ impl HTMLImageElement {
|
|||
None
|
||||
}
|
||||
|
||||
pub fn SetAlt(&mut self, _alt: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetAlt(&mut self, _alt: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn Src(&self, _abstract_self: AbstractNode<ScriptView>) -> DOMString {
|
||||
|
@ -67,33 +68,36 @@ impl HTMLImageElement {
|
|||
|
||||
pub fn SetSrc(&mut self,
|
||||
abstract_self: AbstractNode<ScriptView>,
|
||||
src: &DOMString,
|
||||
_rv: &mut ErrorResult) {
|
||||
src: &DOMString) -> ErrorResult {
|
||||
let node = &mut self.parent.parent;
|
||||
node.set_attr(abstract_self,
|
||||
&Some(~"src"),
|
||||
&Some(null_str_as_empty(src)));
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn CrossOrigin(&self) -> DOMString {
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetCrossOrigin(&mut self, _cross_origin: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetCrossOrigin(&mut self, _cross_origin: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn UseMap(&self) -> DOMString {
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetUseMap(&mut self, _use_map: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetUseMap(&mut self, _use_map: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn IsMap(&self) -> bool {
|
||||
false
|
||||
}
|
||||
|
||||
pub fn SetIsMap(&self, _is_map: bool, _rv: &mut ErrorResult) {
|
||||
pub fn SetIsMap(&self, _is_map: bool) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn Width(&self, abstract_self: AbstractNode<ScriptView>) -> u32 {
|
||||
|
@ -125,12 +129,12 @@ impl HTMLImageElement {
|
|||
|
||||
pub fn SetWidth(&mut self,
|
||||
abstract_self: AbstractNode<ScriptView>,
|
||||
width: u32,
|
||||
_rv: &mut ErrorResult) {
|
||||
width: u32) -> ErrorResult {
|
||||
let node = &mut self.parent.parent;
|
||||
node.set_attr(abstract_self,
|
||||
&Some(~"width"),
|
||||
&Some(width.to_str()));
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn Height(&self, abstract_self: AbstractNode<ScriptView>) -> u32 {
|
||||
|
@ -162,12 +166,12 @@ impl HTMLImageElement {
|
|||
|
||||
pub fn SetHeight(&mut self,
|
||||
abstract_self: AbstractNode<ScriptView>,
|
||||
height: u32,
|
||||
_rv: &mut ErrorResult) {
|
||||
height: u32) -> ErrorResult {
|
||||
let node = &mut self.parent.parent;
|
||||
node.set_attr(abstract_self,
|
||||
&Some(~"height"),
|
||||
&Some(height.to_str()));
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn NaturalWidth(&self) -> u32 {
|
||||
|
@ -186,41 +190,47 @@ impl HTMLImageElement {
|
|||
None
|
||||
}
|
||||
|
||||
pub fn SetName(&mut self, _name: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetName(&mut self, _name: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn Align(&self) -> DOMString {
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetAlign(&mut self, _align: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetAlign(&mut self, _align: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn Hspace(&self) -> u32 {
|
||||
0
|
||||
}
|
||||
|
||||
pub fn SetHspace(&mut self, _hspace: u32, _rv: &mut ErrorResult) {
|
||||
pub fn SetHspace(&mut self, _hspace: u32) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn Vspace(&self) -> u32 {
|
||||
0
|
||||
}
|
||||
|
||||
pub fn SetVspace(&mut self, _vspace: u32, _rv: &mut ErrorResult) {
|
||||
pub fn SetVspace(&mut self, _vspace: u32) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn LongDesc(&self) -> DOMString {
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetLongDesc(&mut self, _longdesc: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetLongDesc(&mut self, _longdesc: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn Border(&self) -> DOMString {
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetBorder(&mut self, _border: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetBorder(&mut self, _border: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue