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

@ -2925,8 +2925,6 @@ class CGCallGenerator(CGThing):
# Return values that go in outparams go here
if resultOutParam:
args.append(CGGeneric("result"))
if isFallible:
args.append(CGGeneric("&mut rv"))
needsCx = (typeNeedsCx(returnType, True) or
any(typeNeedsCx(a.type) for (a, _) in arguments) or
@ -2944,21 +2942,29 @@ class CGCallGenerator(CGThing):
else:
call = CGWrapper(call, pre="(*%s)." % object)
call = CGList([call, CGWrapper(args, pre="(", post=");")])
if result is not None:
if declareResult:
if isFallible:
self.cgRoot.prepend(CGWrapper(result if result is not None else CGGeneric("()"),
pre="let mut result_fallible: Result<", post=",Error>;"))
if result is not None and declareResult:
result = CGWrapper(result, pre="let mut result: ", post=";")
self.cgRoot.prepend(result)
if not resultOutParam:
if isFallible:
call = CGWrapper(call, pre="result_fallible = ")
elif result is not None and not resultOutParam:
call = CGWrapper(call, pre="result = ")
call = CGWrapper(call)
self.cgRoot.append(call)
if isFallible:
self.cgRoot.prepend(CGGeneric("let mut rv: ErrorResult = Ok(());"))
self.cgRoot.append(CGGeneric("if (rv.is_err()) {"))
self.cgRoot.append(CGGeneric("if (result_fallible.is_err()) {"))
self.cgRoot.append(CGIndenter(errorReport))
self.cgRoot.append(CGGeneric("}"))
if result is not None and not resultOutParam:
self.cgRoot.append(CGGeneric("result = result_fallible.unwrap();"))
def define(self):
return self.cgRoot.define()

View file

@ -752,7 +752,9 @@ pub enum Error {
InvalidCharacter,
}
pub type ErrorResult = Result<(), Error>;
pub type Fallible<T> = Result<T, Error>;
pub type ErrorResult = Fallible<()>;
pub struct EnumEntry {
value: &'static str,

View file

@ -4,7 +4,7 @@
//! DOM bindings for `CharacterData`.
use dom::bindings::utils::{DOMString, ErrorResult};
use dom::bindings::utils::{DOMString, ErrorResult, Fallible};
use dom::bindings::utils::{BindingObject, CacheableWrapper, WrapperCache};
use dom::node::{Node, NodeTypeId, ScriptView};
use js::jsapi::{JSObject, JSContext};
@ -26,31 +26,33 @@ impl CharacterData {
Some(self.data.clone())
}
pub fn SetData(&mut self, arg: &DOMString, _rv: &mut ErrorResult) {
pub fn SetData(&mut self, arg: &DOMString) -> ErrorResult {
self.data = arg.get_ref().clone();
Ok(())
}
pub fn Length(&self) -> u32 {
self.data.len() as u32
}
pub fn SubstringData(&self, offset: u32, count: u32, _rv: &mut ErrorResult) -> DOMString {
Some(self.data.slice(offset as uint, count as uint).to_str())
pub fn SubstringData(&self, offset: u32, count: u32) -> Fallible<DOMString> {
Ok(Some(self.data.slice(offset as uint, count as uint).to_str()))
}
pub fn AppendData(&mut self, arg: &DOMString, _rv: &mut ErrorResult) {
pub fn AppendData(&mut self, arg: &DOMString) -> ErrorResult {
self.data.push_str(arg.get_ref().clone());
Ok(())
}
pub fn InsertData(&mut self, _offset: u32, _arg: &DOMString, _rv: &mut ErrorResult) {
pub fn InsertData(&mut self, _offset: u32, _arg: &DOMString) -> ErrorResult {
fail!("CharacterData::InsertData() is unimplemented")
}
pub fn DeleteData(&mut self, _offset: u32, _count: u32, _rv: &mut ErrorResult) {
pub fn DeleteData(&mut self, _offset: u32, _count: u32) -> ErrorResult {
fail!("CharacterData::DeleteData() is unimplemented")
}
pub fn ReplaceData(&mut self, _offset: u32, _count: u32, _arg: &DOMString, _rv: &mut ErrorResult) {
pub fn ReplaceData(&mut self, _offset: u32, _count: u32, _arg: &DOMString) -> ErrorResult {
fail!("CharacterData::ReplaceData() is unimplemented")
}
}

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, null_str_as_empty};
use dom::bindings::utils::{DOMString, Fallible, null_str_as_empty};
use dom::characterdata::CharacterData;
use dom::node::{AbstractNode, ScriptView, CommentNodeTypeId, Node};
use dom::window::Window;
@ -20,11 +20,11 @@ impl Comment {
}
}
pub fn Constructor(owner: @mut Window, data: &DOMString, _rv: &mut ErrorResult) -> AbstractNode<ScriptView> {
pub fn Constructor(owner: @mut Window, data: &DOMString) -> Fallible<AbstractNode<ScriptView>> {
let s = null_str_as_empty(data);
unsafe {
let compartment = (*owner.page).js_info.get_ref().js_compartment;
Node::as_abstract_node(compartment.cx.ptr, @Comment::new(s))
Ok(Node::as_abstract_node(compartment.cx.ptr, @Comment::new(s)))
}
}
}

View file

@ -3,7 +3,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use dom::bindings::codegen::DocumentBinding;
use dom::bindings::utils::{DOMString, WrapperCache, ErrorResult};
use dom::bindings::utils::{DOMString, WrapperCache, ErrorResult, Fallible};
use dom::bindings::utils::{BindingObject, CacheableWrapper, DerivedWrapper};
use dom::bindings::utils::{is_valid_element_name, InvalidCharacter, Traceable, null_str_as_empty};
use dom::element::{Element};
@ -104,14 +104,14 @@ impl Document {
}
}
pub fn Constructor(owner: @mut Window, _rv: &mut ErrorResult) -> AbstractDocument {
pub fn Constructor(owner: @mut Window) -> Fallible<AbstractDocument> {
let root = @HTMLHtmlElement {
parent: HTMLElement::new(HTMLHtmlElementTypeId, ~"html")
};
let cx = owner.page.js_info.get_ref().js_compartment.cx.ptr;
let root = unsafe { Node::as_abstract_node(cx, root) };
AbstractDocument::as_abstract(cx, @mut Document::new(root, None, XML))
Ok(AbstractDocument::as_abstract(cx, @mut Document::new(root, None, XML)))
}
}
@ -242,19 +242,17 @@ impl Document {
None
}
pub fn CreateElement(&self, local_name: &DOMString, rv: &mut ErrorResult) -> AbstractNode<ScriptView> {
pub fn CreateElement(&self, local_name: &DOMString) -> Fallible<AbstractNode<ScriptView>> {
let cx = self.get_cx();
let local_name = null_str_as_empty(local_name);
if !is_valid_element_name(local_name) {
*rv = Err(InvalidCharacter);
// FIXME #909: what to return here?
fail!("invalid character");
return Err(InvalidCharacter);
}
let local_name = local_name.to_ascii_lower();
build_element_from_tag(cx, local_name)
Ok(build_element_from_tag(cx, local_name))
}
pub fn CreateElementNS(&self, _namespace: &DOMString, _qualified_name: &DOMString, _rv: &mut ErrorResult) -> AbstractNode<ScriptView> {
pub fn CreateElementNS(&self, _namespace: &DOMString, _qualified_name: &DOMString) -> Fallible<AbstractNode<ScriptView>> {
fail!("stub")
}
@ -263,7 +261,7 @@ impl Document {
unsafe { Node::as_abstract_node(cx, @Text::new(null_str_as_empty(data))) }
}
pub fn CreateEvent(&self, _interface: &DOMString, _rv: &mut ErrorResult) -> @mut Event {
pub fn CreateEvent(&self, _interface: &DOMString) -> Fallible<@mut Event> {
fail!("stub")
}
@ -312,7 +310,7 @@ impl Document {
Some(title)
}
pub fn SetTitle(&self, title: &DOMString, _rv: &mut ErrorResult) {
pub fn SetTitle(&self, title: &DOMString) -> ErrorResult {
match self.doctype {
SVG => {
fail!("no SVG document yet")
@ -349,6 +347,7 @@ impl Document {
};
}
}
Ok(())
}
pub fn Dir(&self) -> DOMString {
@ -366,8 +365,8 @@ impl Document {
None
}
pub fn HasFocus(&self, _rv: &mut ErrorResult) -> bool {
false
pub fn HasFocus(&self) -> Fallible<bool> {
Ok(false)
}
pub fn GetCurrentScript(&self) -> Option<AbstractNode<ScriptView>> {
@ -381,8 +380,8 @@ impl Document {
false
}
pub fn GetMozFullScreenElement(&self, _rv: &mut ErrorResult) -> Option<AbstractNode<ScriptView>> {
None
pub fn GetMozFullScreenElement(&self) -> Fallible<Option<AbstractNode<ScriptView>>> {
Ok(None)
}
pub fn GetMozPointerLockElement(&self) -> Option<AbstractNode<ScriptView>> {
@ -430,8 +429,8 @@ impl Document {
None
}
pub fn QuerySelector(&self, _selectors: &DOMString, _rv: &mut ErrorResult) -> Option<AbstractNode<ScriptView>> {
None
pub fn QuerySelector(&self, _selectors: &DOMString) -> Fallible<Option<AbstractNode<ScriptView>>> {
Ok(None)
}
pub fn GetElementsByName(&self, name: &DOMString) -> @mut HTMLCollection {

View file

@ -4,7 +4,7 @@
use dom::bindings::codegen::DOMParserBinding;
use dom::bindings::codegen::DOMParserBinding::SupportedTypeValues::{Text_html, Text_xml};
use dom::bindings::utils::{DOMString, ErrorResult, WrapperCache, CacheableWrapper};
use dom::bindings::utils::{DOMString, Fallible, WrapperCache, CacheableWrapper};
use dom::document::{AbstractDocument, Document, XML};
use dom::element::HTMLHtmlElementTypeId;
use dom::htmldocument::HTMLDocument;
@ -33,15 +33,14 @@ impl DOMParser {
parser
}
pub fn Constructor(owner: @mut Window, _rv: &mut ErrorResult) -> @mut DOMParser {
DOMParser::new(owner)
pub fn Constructor(owner: @mut Window) -> Fallible<@mut DOMParser> {
Ok(DOMParser::new(owner))
}
pub fn ParseFromString(&self,
_s: &DOMString,
ty: DOMParserBinding::SupportedType,
_rv: &mut ErrorResult)
-> AbstractDocument {
ty: DOMParserBinding::SupportedType)
-> Fallible<AbstractDocument> {
unsafe {
let root = @HTMLHtmlElement {
parent: HTMLElement::new(HTMLHtmlElementTypeId, ~"html")
@ -52,10 +51,10 @@ impl DOMParser {
match ty {
Text_html => {
HTMLDocument::new(root, None)
Ok(HTMLDocument::new(root, None))
}
Text_xml => {
AbstractDocument::as_abstract(cx, @mut Document::new(root, None, XML))
Ok(AbstractDocument::as_abstract(cx, @mut Document::new(root, None, XML)))
}
_ => {
fail!("unsupported document type")

View file

@ -4,7 +4,7 @@
//! Element nodes.
use dom::bindings::utils::{BindingObject, CacheableWrapper, DOMString, ErrorResult, WrapperCache};
use dom::bindings::utils::{BindingObject, CacheableWrapper, DOMString, ErrorResult, Fallible, WrapperCache};
use dom::bindings::utils::{null_str_as_empty, null_str_as_empty_ref};
use dom::htmlcollection::HTMLCollection;
use dom::clientrect::ClientRect;
@ -219,20 +219,21 @@ impl Element {
pub fn SetAttribute(&mut self,
abstract_self: AbstractNode<ScriptView>,
name: &DOMString,
value: &DOMString,
_rv: &mut ErrorResult) {
value: &DOMString) -> ErrorResult {
self.set_attr(abstract_self, name, value);
Ok(())
}
pub fn SetAttributeNS(&self, _namespace: &DOMString, _localname: &DOMString, _value: &DOMString, _rv: &mut ErrorResult) {
pub fn SetAttributeNS(&self, _namespace: &DOMString, _localname: &DOMString, _value: &DOMString) -> ErrorResult {
Ok(())
}
pub fn RemoveAttribute(&self, _name: &DOMString, _rv: &mut ErrorResult) -> bool {
false
pub fn RemoveAttribute(&self, _name: &DOMString) -> ErrorResult {
Ok(())
}
pub fn RemoveAttributeNS(&self, _namespace: &DOMString, _localname: &DOMString, _rv: &mut ErrorResult) -> bool {
false
pub fn RemoveAttributeNS(&self, _namespace: &DOMString, _localname: &DOMString) -> ErrorResult {
Ok(())
}
pub fn HasAttribute(&self, _name: &DOMString) -> bool {
@ -248,9 +249,9 @@ impl Element {
HTMLCollection::new(~[], cx, scope)
}
pub fn GetElementsByTagNameNS(&self, _namespace: &DOMString, _localname: &DOMString, _rv: &mut ErrorResult) -> @mut HTMLCollection {
pub fn GetElementsByTagNameNS(&self, _namespace: &DOMString, _localname: &DOMString) -> Fallible<@mut HTMLCollection> {
let (scope, cx) = self.get_scope_and_cx();
HTMLCollection::new(~[], cx, scope)
Ok(HTMLCollection::new(~[], cx, scope))
}
pub fn GetElementsByClassName(&self, _names: &DOMString) -> @mut HTMLCollection {
@ -258,8 +259,8 @@ impl Element {
HTMLCollection::new(~[], cx, scope)
}
pub fn MozMatchesSelector(&self, _selector: &DOMString, _rv: &mut ErrorResult) -> bool {
false
pub fn MozMatchesSelector(&self, _selector: &DOMString) -> Fallible<bool> {
Ok(false)
}
pub fn SetCapture(&self, _retargetToElement: bool) {
@ -388,25 +389,28 @@ impl Element {
0
}
pub fn GetInnerHTML(&self, _rv: &mut ErrorResult) -> DOMString {
None
pub fn GetInnerHTML(&self) -> Fallible<DOMString> {
Ok(None)
}
pub fn SetInnerHTML(&mut self, _value: &DOMString, _rv: &mut ErrorResult) {
pub fn SetInnerHTML(&mut self, _value: &DOMString) -> ErrorResult {
Ok(())
}
pub fn GetOuterHTML(&self, _rv: &mut ErrorResult) -> DOMString {
None
pub fn GetOuterHTML(&self) -> Fallible<DOMString> {
Ok(None)
}
pub fn SetOuterHTML(&mut self, _value: &DOMString, _rv: &mut ErrorResult) {
pub fn SetOuterHTML(&mut self, _value: &DOMString) -> ErrorResult {
Ok(())
}
pub fn InsertAdjacentHTML(&mut self, _position: &DOMString, _text: &DOMString, _rv: &mut ErrorResult) {
pub fn InsertAdjacentHTML(&mut self, _position: &DOMString, _text: &DOMString) -> ErrorResult {
Ok(())
}
pub fn QuerySelector(&self, _selectors: &DOMString, _rv: &mut ErrorResult) -> Option<AbstractNode<ScriptView>> {
None
pub fn QuerySelector(&self, _selectors: &DOMString) -> Fallible<Option<AbstractNode<ScriptView>>> {
Ok(None)
}
}

View file

@ -6,7 +6,7 @@ use dom::eventtarget::EventTarget;
use dom::window::Window;
use dom::bindings::codegen::EventBinding;
use dom::bindings::utils::{CacheableWrapper, BindingObject, DerivedWrapper};
use dom::bindings::utils::{DOMString, ErrorResult, WrapperCache};
use dom::bindings::utils::{DOMString, ErrorResult, Fallible, WrapperCache};
use geom::point::Point2D;
use js::glue::RUST_OBJECT_TO_JSVAL;
@ -95,11 +95,11 @@ impl Event {
pub fn InitEvent(&mut self,
type_: &DOMString,
bubbles: bool,
cancelable: bool,
_rv: &mut ErrorResult) {
cancelable: bool) -> ErrorResult {
self.type_ = (*type_).clone();
self.cancelable = cancelable;
self.bubbles = bubbles;
Ok(())
}
pub fn IsTrusted(&self) -> bool {
@ -108,9 +108,8 @@ impl Event {
pub fn Constructor(_global: @mut Window,
type_: &DOMString,
_init: &EventBinding::EventInit,
_rv: &mut ErrorResult) -> @mut Event {
@mut Event::new(type_)
_init: &EventBinding::EventInit) -> Fallible<@mut Event> {
Ok(@mut Event::new(type_))
}
}

View file

@ -14,90 +14,103 @@ impl HTMLAnchorElement {
None
}
pub fn SetHref(&mut self, _href: &DOMString, _rv: &mut ErrorResult) {
pub fn SetHref(&mut self, _href: &DOMString) -> ErrorResult {
Ok(())
}
pub fn Target(&self) -> DOMString {
None
}
pub fn SetTarget(&self, _target: &DOMString, _rv: &mut ErrorResult) {
pub fn SetTarget(&self, _target: &DOMString) -> ErrorResult {
Ok(())
}
pub fn Download(&self) -> DOMString {
None
}
pub fn SetDownload(&self, _download: &DOMString, _rv: &mut ErrorResult) {
pub fn SetDownload(&self, _download: &DOMString) -> ErrorResult {
Ok(())
}
pub fn Ping(&self) -> DOMString {
None
}
pub fn SetPing(&self, _ping: &DOMString, _rv: &mut ErrorResult) {
pub fn SetPing(&self, _ping: &DOMString) -> ErrorResult {
Ok(())
}
pub fn Rel(&self) -> DOMString {
None
}
pub fn SetRel(&self, _rel: &DOMString, _rv: &mut ErrorResult) {
pub fn SetRel(&self, _rel: &DOMString) -> ErrorResult {
Ok(())
}
pub fn Hreflang(&self) -> DOMString {
None
}
pub fn SetHreflang(&self, _href_lang: &DOMString, _rv: &mut ErrorResult) {
pub fn SetHreflang(&self, _href_lang: &DOMString) -> ErrorResult {
Ok(())
}
pub fn Type(&self) -> DOMString {
None
}
pub fn SetType(&mut self, _type: &DOMString, _rv: &mut ErrorResult) {
pub fn SetType(&mut self, _type: &DOMString) -> ErrorResult {
Ok(())
}
pub fn Text(&self) -> DOMString {
None
}
pub fn SetText(&mut self, _text: &DOMString, _rv: &mut ErrorResult) {
pub fn SetText(&mut self, _text: &DOMString) -> ErrorResult {
Ok(())
}
pub fn Coords(&self) -> DOMString {
None
}
pub fn SetCoords(&mut self, _coords: &DOMString, _rv: &mut ErrorResult) {
pub fn SetCoords(&mut self, _coords: &DOMString) -> ErrorResult {
Ok(())
}
pub fn Charset(&self) -> DOMString {
None
}
pub fn SetCharset(&mut self, _charset: &DOMString, _rv: &mut ErrorResult) {
pub fn SetCharset(&mut self, _charset: &DOMString) -> 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 Rev(&self) -> DOMString {
None
}
pub fn SetRev(&mut self, _rev: &DOMString, _rv: &mut ErrorResult) {
pub fn SetRev(&mut self, _rev: &DOMString) -> ErrorResult {
Ok(())
}
pub fn Shape(&self) -> DOMString {
None
}
pub fn SetShape(&mut self, _shape: &DOMString, _rv: &mut ErrorResult) {
pub fn SetShape(&mut self, _shape: &DOMString) -> ErrorResult {
Ok(())
}
}

View file

@ -14,76 +14,87 @@ impl HTMLAppletElement {
None
}
pub fn SetAlign(&mut self, _align: &DOMString, _rv: &mut ErrorResult) {
pub fn SetAlign(&mut self, _align: &DOMString) -> ErrorResult {
Ok(())
}
pub fn Alt(&self) -> DOMString {
None
}
pub fn SetAlt(&self, _alt: &DOMString, _rv: &mut ErrorResult) {
pub fn SetAlt(&self, _alt: &DOMString) -> ErrorResult {
Ok(())
}
pub fn Archive(&self) -> DOMString {
None
}
pub fn SetArchive(&self, _archive: &DOMString, _rv: &mut ErrorResult) {
pub fn SetArchive(&self, _archive: &DOMString) -> ErrorResult {
Ok(())
}
pub fn Code(&self) -> DOMString {
None
}
pub fn SetCode(&self, _code: &DOMString, _rv: &mut ErrorResult) {
pub fn SetCode(&self, _code: &DOMString) -> ErrorResult {
Ok(())
}
pub fn CodeBase(&self) -> DOMString {
None
}
pub fn SetCodeBase(&self, _code_base: &DOMString, _rv: &mut ErrorResult) {
pub fn SetCodeBase(&self, _code_base: &DOMString) -> ErrorResult {
Ok(())
}
pub fn Height(&self) -> DOMString {
None
}
pub fn SetHeight(&self, _height: &DOMString, _rv: &mut ErrorResult) {
pub fn SetHeight(&self, _height: &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 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 Object(&self) -> DOMString {
None
}
pub fn SetObject(&mut self, _object: &DOMString, _rv: &mut ErrorResult) {
pub fn SetObject(&mut self, _object: &DOMString) -> 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 Width(&self) -> DOMString {
None
}
pub fn SetWidth(&mut self, _width: &DOMString, _rv: &mut ErrorResult) {
pub fn SetWidth(&mut self, _width: &DOMString) -> ErrorResult {
Ok(())
}
}

View file

@ -14,55 +14,63 @@ impl HTMLAreaElement {
None
}
pub fn SetAlt(&self, _alt: &DOMString, _rv: &mut ErrorResult) {
pub fn SetAlt(&self, _alt: &DOMString) -> ErrorResult {
Ok(())
}
pub fn Coords(&self) -> DOMString {
None
}
pub fn SetCoords(&self, _coords: &DOMString, _rv: &mut ErrorResult) {
pub fn SetCoords(&self, _coords: &DOMString) -> ErrorResult {
Ok(())
}
pub fn Shape(&self) -> DOMString {
None
}
pub fn SetShape(&self, _shape: &DOMString, _rv: &mut ErrorResult) {
pub fn SetShape(&self, _shape: &DOMString) -> ErrorResult {
Ok(())
}
pub fn Href(&self) -> DOMString {
None
}
pub fn SetHref(&self, _href: &DOMString, _rv: &mut ErrorResult) {
pub fn SetHref(&self, _href: &DOMString) -> ErrorResult {
Ok(())
}
pub fn Target(&self) -> DOMString {
None
}
pub fn SetTarget(&self, _target: &DOMString, _rv: &mut ErrorResult) {
pub fn SetTarget(&self, _target: &DOMString) -> ErrorResult {
Ok(())
}
pub fn Download(&self) -> DOMString {
None
}
pub fn SetDownload(&self, _download: &DOMString, _rv: &mut ErrorResult) {
pub fn SetDownload(&self, _download: &DOMString) -> ErrorResult {
Ok(())
}
pub fn Ping(&self) -> DOMString {
None
}
pub fn SetPing(&self, _ping: &DOMString, _rv: &mut ErrorResult) {
pub fn SetPing(&self, _ping: &DOMString) -> ErrorResult {
Ok(())
}
pub fn NoHref(&self) -> bool {
false
}
pub fn SetNoHref(&mut self, _no_href: bool, _rv: &mut ErrorResult) {
pub fn SetNoHref(&mut self, _no_href: bool) -> ErrorResult {
Ok(())
}
}

View file

@ -14,13 +14,15 @@ impl HTMLBaseElement {
None
}
pub fn SetHref(&self, _href: &DOMString, _rv: &mut ErrorResult) {
pub fn SetHref(&self, _href: &DOMString) -> ErrorResult {
Ok(())
}
pub fn Target(&self) -> DOMString {
None
}
pub fn SetTarget(&self, _target: &DOMString, _rv: &mut ErrorResult) {
pub fn SetTarget(&self, _target: &DOMString) -> ErrorResult {
Ok(())
}
}

View file

@ -14,41 +14,47 @@ impl HTMLBodyElement {
None
}
pub fn SetText(&mut self, _text: &DOMString, _rv: &mut ErrorResult) {
pub fn SetText(&mut self, _text: &DOMString) -> ErrorResult {
Ok(())
}
pub fn Link(&self) -> DOMString {
None
}
pub fn SetLink(&self, _link: &DOMString, _rv: &mut ErrorResult) {
pub fn SetLink(&self, _link: &DOMString) -> ErrorResult {
Ok(())
}
pub fn VLink(&self) -> DOMString {
None
}
pub fn SetVLink(&self, _v_link: &DOMString, _rv: &mut ErrorResult) {
pub fn SetVLink(&self, _v_link: &DOMString) -> ErrorResult {
Ok(())
}
pub fn ALink(&self) -> DOMString {
None
}
pub fn SetALink(&self, _a_link: &DOMString, _rv: &mut ErrorResult) {
pub fn SetALink(&self, _a_link: &DOMString) -> ErrorResult {
Ok(())
}
pub fn BgColor(&self) -> DOMString {
None
}
pub fn SetBgColor(&self, _bg_color: &DOMString, _rv: &mut ErrorResult) {
pub fn SetBgColor(&self, _bg_color: &DOMString) -> ErrorResult {
Ok(())
}
pub fn Background(&self) -> DOMString {
None
}
pub fn SetBackground(&self, _background: &DOMString, _rv: &mut ErrorResult) {
pub fn SetBackground(&self, _background: &DOMString) -> ErrorResult {
Ok(())
}
}

View file

@ -14,6 +14,7 @@ impl HTMLBRElement {
None
}
pub fn SetClear(&mut self, _text: &DOMString, _rv: &mut ErrorResult) {
pub fn SetClear(&mut self, _text: &DOMString) -> ErrorResult {
Ok(())
}
}

View file

@ -16,14 +16,16 @@ impl HTMLButtonElement {
false
}
pub fn SetAutofocus(&mut self, _autofocus: bool, _rv: &mut ErrorResult) {
pub fn SetAutofocus(&mut self, _autofocus: bool) -> 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 GetForm(&self) -> Option<AbstractNode<ScriptView>> {
@ -34,56 +36,64 @@ impl HTMLButtonElement {
None
}
pub fn SetFormAction(&mut self, _formaction: &DOMString, _rv: &mut ErrorResult) {
pub fn SetFormAction(&mut self, _formaction: &DOMString) -> ErrorResult {
Ok(())
}
pub fn FormEnctype(&self) -> DOMString {
None
}
pub fn SetFormEnctype(&mut self, _formenctype: &DOMString, _rv: &mut ErrorResult) {
pub fn SetFormEnctype(&mut self, _formenctype: &DOMString) -> ErrorResult {
Ok(())
}
pub fn FormMethod(&self) -> DOMString {
None
}
pub fn SetFormMethod(&mut self, _formmethod: &DOMString, _rv: &mut ErrorResult) {
pub fn SetFormMethod(&mut self, _formmethod: &DOMString) -> ErrorResult {
Ok(())
}
pub fn FormNoValidate(&self) -> bool {
false
}
pub fn SetFormNoValidate(&mut self, _novalidate: bool, _rv: &mut ErrorResult) {
pub fn SetFormNoValidate(&mut self, _novalidate: bool) -> ErrorResult {
Ok(())
}
pub fn FormTarget(&self) -> DOMString {
None
}
pub fn SetFormTarget(&mut self, _formtarget: &DOMString, _rv: &mut ErrorResult) {
pub fn SetFormTarget(&mut self, _formtarget: &DOMString) -> 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 Type(&self) -> DOMString {
None
}
pub fn SetType(&mut self, _type: &DOMString, _rv: &mut ErrorResult) {
pub fn SetType(&mut self, _type: &DOMString) -> ErrorResult {
Ok(())
}
pub fn Value(&self) -> DOMString {
None
}
pub fn SetValue(&mut self, _value: &DOMString, _rv: &mut ErrorResult) {
pub fn SetValue(&mut self, _value: &DOMString) -> ErrorResult {
Ok(())
}
pub fn WillValidate(&self) -> bool {
@ -104,7 +114,8 @@ impl HTMLButtonElement {
None
}
pub fn SetValidationMessage(&mut self, _message: &DOMString, _rv: &mut ErrorResult) {
pub fn SetValidationMessage(&mut self, _message: &DOMString) -> ErrorResult {
Ok(())
}
pub fn CheckValidity(&self) -> bool {

View file

@ -14,13 +14,15 @@ impl HTMLCanvasElement {
0
}
pub fn SetWidth(&mut self, _width: u32, _rv: &mut ErrorResult) {
pub fn SetWidth(&mut self, _width: u32) -> ErrorResult {
Ok(())
}
pub fn Height(&self) -> u32 {
0
}
pub fn SetHeight(&mut self, _height: u32, _rv: &mut ErrorResult) {
pub fn SetHeight(&mut self, _height: u32) -> ErrorResult {
Ok(())
}
}

View file

@ -4,7 +4,7 @@
use dom::bindings::codegen::HTMLCollectionBinding;
use dom::bindings::utils::{CacheableWrapper, BindingObject, WrapperCache};
use dom::bindings::utils::{DOMString, ErrorResult};
use dom::bindings::utils::{DOMString, Fallible};
use dom::node::{AbstractNode, ScriptView};
use script_task::page_from_context;
@ -44,9 +44,8 @@ impl HTMLCollection {
}
}
pub fn NamedItem(&self, _cx: *JSContext, _name: &DOMString, rv: &mut ErrorResult) -> *JSObject {
*rv = Ok(());
ptr::null()
pub fn NamedItem(&self, _cx: *JSContext, _name: &DOMString) -> Fallible<*JSObject> {
Ok(ptr::null())
}
pub fn IndexedGetter(&self, index: u32, found: &mut bool) -> Option<AbstractNode<ScriptView>> {
@ -54,8 +53,8 @@ impl HTMLCollection {
self.Item(index)
}
pub fn NamedGetter(&self, _cx: *JSContext, _name: &DOMString, _found: &mut bool, _rv: &mut ErrorResult) -> *JSObject {
ptr::null()
pub fn NamedGetter(&self, _cx: *JSContext, _name: &DOMString, _found: &mut bool) -> Fallible<*JSObject> {
Ok(ptr::null())
}
}

View file

@ -14,6 +14,7 @@ impl HTMLDataElement {
None
}
pub fn SetValue(&mut self, _value: &DOMString, _rv: &mut ErrorResult) {
pub fn SetValue(&mut self, _value: &DOMString) -> ErrorResult {
Ok(())
}
}

View file

@ -14,6 +14,7 @@ impl HTMLDirectoryElement {
false
}
pub fn SetCompact(&mut self, _compact: bool, _rv: &mut ErrorResult) {
pub fn SetCompact(&mut self, _compact: bool) -> ErrorResult {
Ok(())
}
}

View file

@ -14,6 +14,7 @@ impl HTMLDivElement {
None
}
pub fn SetAlign(&mut self, _align: &DOMString, _rv: &mut ErrorResult) {
pub fn SetAlign(&mut self, _align: &DOMString) -> ErrorResult {
Ok(())
}
}

View file

@ -14,13 +14,15 @@ impl HTMLDListElement {
false
}
pub fn SetCompact(&mut self, _compact: bool, _rv: &mut ErrorResult) {
pub fn SetCompact(&mut self, _compact: bool) -> ErrorResult {
Ok(())
}
pub fn Type(&self) -> DOMString {
None
}
pub fn SetType(&mut self, _type: &DOMString, _rv: &mut ErrorResult) {
pub fn SetType(&mut self, _type: &DOMString) -> ErrorResult {
Ok(())
}
}

View file

@ -3,7 +3,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use dom::bindings::codegen::HTMLDocumentBinding;
use dom::bindings::utils::{DOMString, ErrorResult};
use dom::bindings::utils::{DOMString, ErrorResult, Fallible};
use dom::bindings::utils::{CacheableWrapper, BindingObject, WrapperCache};
use dom::document::{AbstractDocument, Document, WrappableDocument, HTML};
use dom::element::HTMLHeadElementTypeId;
@ -49,22 +49,24 @@ impl WrappableDocument for HTMLDocument {
}
impl HTMLDocument {
pub fn NamedGetter(&self, _cx: *JSContext, _name: &DOMString, _found: &mut bool, _rv: &mut ErrorResult) -> *JSObject {
ptr::null()
pub fn NamedGetter(&self, _cx: *JSContext, _name: &DOMString, _found: &mut bool) -> Fallible<*JSObject> {
Ok(ptr::null())
}
pub fn GetDomain(&self, _rv: &mut ErrorResult) -> DOMString {
None
pub fn GetDomain(&self) -> Fallible<DOMString> {
Ok(None)
}
pub fn SetDomain(&self, _domain: &DOMString, _rv: &mut ErrorResult) {
pub fn SetDomain(&self, _domain: &DOMString) -> ErrorResult {
Ok(())
}
pub fn GetCookie(&self, _rv: &mut ErrorResult) -> DOMString {
None
pub fn GetCookie(&self) -> Fallible<DOMString> {
Ok(None)
}
pub fn SetCookie(&self, _cookie: &DOMString, _rv: &mut ErrorResult) {
pub fn SetCookie(&self, _cookie: &DOMString) -> ErrorResult {
Ok(())
}
pub fn GetHead(&self) -> Option<AbstractNode<ScriptView>> {
@ -104,38 +106,40 @@ impl HTMLDocument {
self.parent.createHTMLCollection(|elem| eq_slice(elem.tag_name, "script"))
}
pub fn Close(&self, _rv: &mut ErrorResult) {
pub fn Close(&self) -> ErrorResult {
Ok(())
}
pub fn DesignMode(&self) -> DOMString {
None
}
pub fn SetDesignMode(&self, _mode: &DOMString, _rv: &mut ErrorResult) {
pub fn SetDesignMode(&self, _mode: &DOMString) -> ErrorResult {
Ok(())
}
pub fn ExecCommand(&self, _command_id: &DOMString, _show_ui: bool, _value: &DOMString, _rv: &mut ErrorResult) -> bool {
false
pub fn ExecCommand(&self, _command_id: &DOMString, _show_ui: bool, _value: &DOMString) -> Fallible<bool> {
Ok(false)
}
pub fn QueryCommandEnabled(&self, _command_id: &DOMString, _rv: &mut ErrorResult) -> bool {
false
pub fn QueryCommandEnabled(&self, _command_id: &DOMString) -> Fallible<bool> {
Ok(false)
}
pub fn QueryCommandIndeterm(&self, _command_id: &DOMString, _rv: &mut ErrorResult) -> bool {
false
pub fn QueryCommandIndeterm(&self, _command_id: &DOMString) -> Fallible<bool> {
Ok(false)
}
pub fn QueryCommandState(&self, _command_id: &DOMString, _rv: &mut ErrorResult) -> bool {
false
pub fn QueryCommandState(&self, _command_id: &DOMString) -> Fallible<bool> {
Ok(false)
}
pub fn QueryCommandSupported(&self, _command_id: &DOMString) -> bool {
false
}
pub fn QueryCommandValue(&self, _command_id: &DOMString, _rv: &mut ErrorResult) -> DOMString {
None
pub fn QueryCommandValue(&self, _command_id: &DOMString) -> Fallible<DOMString> {
Ok(None)
}
pub fn FgColor(&self) -> DOMString {
@ -186,8 +190,8 @@ impl HTMLDocument {
pub fn Clear(&self) {
}
pub fn GetAll(&self, _cx: *JSContext, _rv: &mut ErrorResult) -> *libc::c_void {
ptr::null()
pub fn GetAll(&self, _cx: *JSContext) -> Fallible<*libc::c_void> {
Ok(ptr::null())
}
}

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 {

View file

@ -15,42 +15,48 @@ impl HTMLEmbedElement {
None
}
pub fn SetSrc(&mut self, _src: &DOMString, _rv: &mut ErrorResult) {
pub fn SetSrc(&mut self, _src: &DOMString) -> ErrorResult {
Ok(())
}
pub fn Type(&self) -> DOMString {
None
}
pub fn SetType(&mut self, _type: &DOMString, _rv: &mut ErrorResult) {
pub fn SetType(&mut self, _type: &DOMString) -> ErrorResult {
Ok(())
}
pub fn Width(&self) -> DOMString {
None
}
pub fn SetWidth(&mut self, _width: &DOMString, _rv: &mut ErrorResult) {
pub fn SetWidth(&mut self, _width: &DOMString) -> ErrorResult {
Ok(())
}
pub fn Height(&self) -> DOMString {
None
}
pub fn SetHeight(&mut self, _height: &DOMString, _rv: &mut ErrorResult) {
pub fn SetHeight(&mut self, _height: &DOMString) -> ErrorResult {
Ok(())
}
pub fn Align(&self) -> DOMString {
None
}
pub fn SetAlign(&mut self, _type: &DOMString, _rv: &mut ErrorResult) {
pub fn SetAlign(&mut self, _type: &DOMString) -> ErrorResult {
Ok(())
}
pub fn Name(&self) -> DOMString {
None
}
pub fn SetName(&mut self, _type: &DOMString, _rv: &mut ErrorResult) {
pub fn SetName(&mut self, _type: &DOMString) -> ErrorResult {
Ok(())
}
pub fn GetSVGDocument(&self) -> Option<AbstractDocument> {

View file

@ -19,7 +19,8 @@ impl HTMLFieldSetElement {
false
}
pub fn SetDisabled(&mut self, _disabled: bool, _rv: &mut ErrorResult) {
pub fn SetDisabled(&mut self, _disabled: bool) -> ErrorResult {
Ok(())
}
pub fn GetForm(&self) -> Option<AbstractNode<ScriptView>> {
@ -30,7 +31,8 @@ impl HTMLFieldSetElement {
None
}
pub fn SetName(&mut self, _name: &DOMString, _rv: &mut ErrorResult) {
pub fn SetName(&mut self, _name: &DOMString) -> ErrorResult {
Ok(())
}
pub fn Type(&self) -> DOMString {

View file

@ -14,20 +14,23 @@ impl HTMLFontElement {
None
}
pub fn SetColor(&mut self, _color: &DOMString, _rv: &mut ErrorResult) {
pub fn SetColor(&mut self, _color: &DOMString) -> ErrorResult {
Ok(())
}
pub fn Face(&self) -> DOMString {
None
}
pub fn SetFace(&mut self, _face: &DOMString, _rv: &mut ErrorResult) {
pub fn SetFace(&mut self, _face: &DOMString) -> ErrorResult {
Ok(())
}
pub fn Size(&self) -> DOMString {
None
}
pub fn SetSize(&mut self, _size: &DOMString, _rv: &mut ErrorResult) {
pub fn SetSize(&mut self, _size: &DOMString) -> ErrorResult {
Ok(())
}
}

View file

@ -28,63 +28,72 @@ impl HTMLFormElement {
None
}
pub fn SetAcceptCharset(&mut self, _accept_charset: &DOMString, _rv: &mut ErrorResult) {
pub fn SetAcceptCharset(&mut self, _accept_charset: &DOMString) -> ErrorResult {
Ok(())
}
pub fn Action(&self) -> DOMString {
None
}
pub fn SetAction(&mut self, _action: &DOMString, _rv: &mut ErrorResult) {
pub fn SetAction(&mut self, _action: &DOMString) -> ErrorResult {
Ok(())
}
pub fn Autocomplete(&self) -> DOMString {
None
}
pub fn SetAutocomplete(&mut self, _autocomplete: &DOMString, _rv: &mut ErrorResult) {
pub fn SetAutocomplete(&mut self, _autocomplete: &DOMString) -> ErrorResult {
Ok(())
}
pub fn Enctype(&self) -> DOMString {
None
}
pub fn SetEnctype(&mut self, _enctype: &DOMString, _rv: &mut ErrorResult) {
pub fn SetEnctype(&mut self, _enctype: &DOMString) -> ErrorResult {
Ok(())
}
pub fn Encoding(&self) -> DOMString {
None
}
pub fn SetEncoding(&mut self, _encoding: &DOMString, _rv: &mut ErrorResult) {
pub fn SetEncoding(&mut self, _encoding: &DOMString) -> ErrorResult {
Ok(())
}
pub fn Method(&self) -> DOMString {
None
}
pub fn SetMethod(&mut self, _method: &DOMString, _rv: &mut ErrorResult) {
pub fn SetMethod(&mut self, _method: &DOMString) -> 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 NoValidate(&self) -> bool {
false
}
pub fn SetNoValidate(&mut self, _no_validate: bool, _rv: &mut ErrorResult) {
pub fn SetNoValidate(&mut self, _no_validate: bool) -> ErrorResult {
Ok(())
}
pub fn Target(&self) -> DOMString {
None
}
pub fn SetTarget(&mut self, _target: &DOMString, _rv: &mut ErrorResult) {
pub fn SetTarget(&mut self, _target: &DOMString) -> ErrorResult {
Ok(())
}
pub fn Elements(&self) -> @mut HTMLCollection {
@ -96,7 +105,8 @@ impl HTMLFormElement {
0
}
pub fn Submit(&self, _rv: &mut ErrorResult) {
pub fn Submit(&self) -> ErrorResult {
Ok(())
}
pub fn Reset(&self) {

View file

@ -16,42 +16,48 @@ impl HTMLFrameElement {
None
}
pub fn SetName(&mut self, _name: &DOMString, _rv: &mut ErrorResult) {
pub fn SetName(&mut self, _name: &DOMString) -> ErrorResult {
Ok(())
}
pub fn Scrolling(&self) -> DOMString {
None
}
pub fn SetScrolling(&mut self, _scrolling: &DOMString, _rv: &mut ErrorResult) {
pub fn SetScrolling(&mut self, _scrolling: &DOMString) -> ErrorResult {
Ok(())
}
pub fn Src(&self) -> DOMString {
None
}
pub fn SetSrc(&mut self, _src: &DOMString, _rv: &mut ErrorResult) {
pub fn SetSrc(&mut self, _src: &DOMString) -> ErrorResult {
Ok(())
}
pub fn FrameBorder(&self) -> DOMString {
None
}
pub fn SetFrameBorder(&mut self, _frameborder: &DOMString, _rv: &mut ErrorResult) {
pub fn SetFrameBorder(&mut self, _frameborder: &DOMString) -> 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 NoResize(&self) -> bool {
false
}
pub fn SetNoResize(&mut self, _no_resize: bool, _rv: &mut ErrorResult) {
pub fn SetNoResize(&mut self, _no_resize: bool) -> ErrorResult {
Ok(())
}
pub fn GetContentDocument(&self) -> Option<AbstractDocument> {
@ -66,13 +72,15 @@ impl HTMLFrameElement {
None
}
pub fn SetMarginHeight(&mut self, _height: &DOMString, _rv: &mut ErrorResult) {
pub fn SetMarginHeight(&mut self, _height: &DOMString) -> ErrorResult {
Ok(())
}
pub fn MarginWidth(&self) -> DOMString {
None
}
pub fn SetMarginWidth(&mut self, _height: &DOMString, _rv: &mut ErrorResult) {
pub fn SetMarginWidth(&mut self, _height: &DOMString) -> ErrorResult {
Ok(())
}
}

View file

@ -14,13 +14,15 @@ impl HTMLFrameSetElement {
None
}
pub fn SetCols(&mut self, _cols: &DOMString, _rv: &mut ErrorResult) {
pub fn SetCols(&mut self, _cols: &DOMString) -> ErrorResult {
Ok(())
}
pub fn Rows(&self) -> DOMString {
None
}
pub fn SetRows(&mut self, _rows: &DOMString, _rv: &mut ErrorResult) {
pub fn SetRows(&mut self, _rows: &DOMString) -> ErrorResult {
Ok(())
}
}

View file

@ -14,34 +14,39 @@ impl HTMLHRElement {
None
}
pub fn SetAlign(&mut self, _align: &DOMString, _rv: &mut ErrorResult) {
pub fn SetAlign(&mut self, _align: &DOMString) -> ErrorResult {
Ok(())
}
pub fn Color(&self) -> DOMString {
None
}
pub fn SetColor(&mut self, _color: &DOMString, _rv: &mut ErrorResult) {
pub fn SetColor(&mut self, _color: &DOMString) -> ErrorResult {
Ok(())
}
pub fn NoShade(&self) -> bool {
false
}
pub fn SetNoShade(&self, _no_shade: bool, _rv: &mut ErrorResult) {
pub fn SetNoShade(&self, _no_shade: bool) -> ErrorResult {
Ok(())
}
pub fn Size(&self) -> DOMString {
None
}
pub fn SetSize(&mut self, _size: &DOMString, _rv: &mut ErrorResult) {
pub fn SetSize(&mut self, _size: &DOMString) -> ErrorResult {
Ok(())
}
pub fn Width(&self) -> DOMString {
None
}
pub fn SetWidth(&mut self, _width: &DOMString, _rv: &mut ErrorResult) {
pub fn SetWidth(&mut self, _width: &DOMString) -> ErrorResult {
Ok(())
}
}

View file

@ -14,6 +14,7 @@ impl HTMLHtmlElement {
None
}
pub fn SetVersion(&mut self, _version: &DOMString, _rv: &mut ErrorResult) {
pub fn SetVersion(&mut self, _version: &DOMString) -> ErrorResult {
Ok(())
}
}

View file

@ -63,21 +63,24 @@ impl HTMLIFrameElement {
None
}
pub fn SetSrc(&mut self, _src: &DOMString, _rv: &mut ErrorResult) {
pub fn SetSrc(&mut self, _src: &DOMString) -> ErrorResult {
Ok(())
}
pub fn Srcdoc(&self) -> DOMString {
None
}
pub fn SetSrcdoc(&mut self, _srcdoc: &DOMString, _rv: &mut ErrorResult) {
pub fn SetSrcdoc(&mut self, _srcdoc: &DOMString) -> 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 Sandbox(&self, _abstract_self: AbstractNode<ScriptView>) -> DOMString {
@ -85,8 +88,7 @@ impl HTMLIFrameElement {
}
pub fn SetSandbox(&mut self, abstract_self: AbstractNode<ScriptView>, sandbox: &DOMString) {
let mut rv = Ok(());
self.parent.parent.SetAttribute(abstract_self, &Some(~"sandbox"), sandbox, &mut rv);
self.parent.parent.SetAttribute(abstract_self, &Some(~"sandbox"), sandbox);
}
pub fn AfterSetAttr(&mut self, name: &DOMString, value: &DOMString) {
@ -113,21 +115,24 @@ impl HTMLIFrameElement {
false
}
pub fn SetAllowFullscreen(&mut self, _allow: bool, _rv: &mut ErrorResult) {
pub fn SetAllowFullscreen(&mut self, _allow: bool) -> ErrorResult {
Ok(())
}
pub fn Width(&self) -> DOMString {
None
}
pub fn SetWidth(&mut self, _width: &DOMString, _rv: &mut ErrorResult) {
pub fn SetWidth(&mut self, _width: &DOMString) -> ErrorResult {
Ok(())
}
pub fn Height(&self) -> DOMString {
None
}
pub fn SetHeight(&mut self, _height: &DOMString, _rv: &mut ErrorResult) {
pub fn SetHeight(&mut self, _height: &DOMString) -> ErrorResult {
Ok(())
}
pub fn GetContentDocument(&self) -> Option<AbstractDocument> {
@ -142,42 +147,48 @@ impl HTMLIFrameElement {
None
}
pub fn SetAlign(&mut self, _align: &DOMString, _rv: &mut ErrorResult) {
pub fn SetAlign(&mut self, _align: &DOMString) -> ErrorResult {
Ok(())
}
pub fn Scrolling(&self) -> DOMString {
None
}
pub fn SetScrolling(&mut self, _scrolling: &DOMString, _rv: &mut ErrorResult) {
pub fn SetScrolling(&mut self, _scrolling: &DOMString) -> ErrorResult {
Ok(())
}
pub fn FrameBorder(&self) -> DOMString {
None
}
pub fn SetFrameBorder(&mut self, _frameborder: &DOMString, _rv: &mut ErrorResult) {
pub fn SetFrameBorder(&mut self, _frameborder: &DOMString) -> 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 MarginHeight(&self) -> DOMString {
None
}
pub fn SetMarginHeight(&mut self, _marginheight: &DOMString, _rv: &mut ErrorResult) {
pub fn SetMarginHeight(&mut self, _marginheight: &DOMString) -> ErrorResult {
Ok(())
}
pub fn MarginWidth(&self) -> DOMString {
None
}
pub fn SetMarginWidth(&mut self, _marginwidth: &DOMString, _rv: &mut ErrorResult) {
pub fn SetMarginWidth(&mut self, _marginwidth: &DOMString) -> ErrorResult {
Ok(())
}
pub fn GetSVGDocument(&self) -> Option<AbstractDocument> {

View file

@ -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(())
}
}

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 HTMLInputElement {
@ -14,35 +14,40 @@ impl HTMLInputElement {
None
}
pub fn SetAccept(&mut self, _accept: &DOMString, _rv: &mut ErrorResult) {
pub fn SetAccept(&mut self, _accept: &DOMString) -> ErrorResult {
Ok(())
}
pub fn Alt(&self) -> DOMString {
None
}
pub fn SetAlt(&mut self, _alt: &DOMString, _rv: &mut ErrorResult) {
pub fn SetAlt(&mut self, _alt: &DOMString) -> ErrorResult {
Ok(())
}
pub fn Autocomplete(&self) -> DOMString {
None
}
pub fn SetAutocomplete(&mut self, _autocomple: &DOMString, _rv: &mut ErrorResult) {
pub fn SetAutocomplete(&mut self, _autocomple: &DOMString) -> ErrorResult {
Ok(())
}
pub fn Autofocus(&self) -> bool {
false
}
pub fn SetAutofocus(&mut self, _autofocus: bool, _rv: &mut ErrorResult) {
pub fn SetAutofocus(&mut self, _autofocus: bool) -> ErrorResult {
Ok(())
}
pub fn DefaultChecked(&self) -> bool {
false
}
pub fn SetDefaultChecked(&mut self, _default_checked: bool, _rv: &mut ErrorResult) {
pub fn SetDefaultChecked(&mut self, _default_checked: bool) -> ErrorResult {
Ok(())
}
pub fn Checked(&self) -> bool {
@ -56,49 +61,56 @@ impl HTMLInputElement {
false
}
pub fn SetDisabled(&mut self, _disabled: bool, _rv: &mut ErrorResult) {
pub fn SetDisabled(&mut self, _disabled: bool) -> ErrorResult {
Ok(())
}
pub fn FormAction(&self) -> DOMString {
None
}
pub fn SetFormAction(&mut self, _form_action: &DOMString, _rv: &mut ErrorResult) {
pub fn SetFormAction(&mut self, _form_action: &DOMString) -> ErrorResult {
Ok(())
}
pub fn FormEnctype(&self) -> DOMString {
None
}
pub fn SetFormEnctype(&mut self, _form_enctype: &DOMString, _rv: &mut ErrorResult) {
pub fn SetFormEnctype(&mut self, _form_enctype: &DOMString) -> ErrorResult {
Ok(())
}
pub fn FormMethod(&self) -> DOMString {
None
}
pub fn SetFormMethod(&mut self, _form_method: &DOMString, _rv: &mut ErrorResult) {
pub fn SetFormMethod(&mut self, _form_method: &DOMString) -> ErrorResult {
Ok(())
}
pub fn FormNoValidate(&self) -> bool {
false
}
pub fn SetFormNoValidate(&mut self, _form_no_validate: bool, _rv: &mut ErrorResult) {
pub fn SetFormNoValidate(&mut self, _form_no_validate: bool) -> ErrorResult {
Ok(())
}
pub fn FormTarget(&self) -> DOMString {
None
}
pub fn SetFormTarget(&mut self, _form_target: &DOMString, _rv: &mut ErrorResult) {
pub fn SetFormTarget(&mut self, _form_target: &DOMString) -> ErrorResult {
Ok(())
}
pub fn Height(&self) -> u32 {
0
}
pub fn SetHeight(&mut self, _height: u32, _rv: &mut ErrorResult) {
pub fn SetHeight(&mut self, _height: u32) -> ErrorResult {
Ok(())
}
pub fn Indeterminate(&self) -> bool {
@ -112,112 +124,128 @@ impl HTMLInputElement {
None
}
pub fn SetInputMode(&mut self, _input_mode: &DOMString, _rv: &mut ErrorResult) {
pub fn SetInputMode(&mut self, _input_mode: &DOMString) -> ErrorResult {
Ok(())
}
pub fn Max(&self) -> DOMString {
None
}
pub fn SetMax(&mut self, _max: &DOMString, _rv: &mut ErrorResult) {
pub fn SetMax(&mut self, _max: &DOMString) -> ErrorResult {
Ok(())
}
pub fn MaxLength(&self) -> i32 {
0
}
pub fn SetMaxLength(&mut self, _max_length: i32, _rv: &mut ErrorResult) {
pub fn SetMaxLength(&mut self, _max_length: i32) -> ErrorResult {
Ok(())
}
pub fn Min(&self) -> DOMString {
None
}
pub fn SetMin(&mut self, _min: &DOMString, _rv: &mut ErrorResult) {
pub fn SetMin(&mut self, _min: &DOMString) -> ErrorResult {
Ok(())
}
pub fn Multiple(&self) -> bool {
false
}
pub fn SetMultiple(&mut self, _multiple: bool, _rv: &mut ErrorResult) {
pub fn SetMultiple(&mut self, _multiple: bool) -> 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 Pattern(&self) -> DOMString {
None
}
pub fn SetPattern(&mut self, _pattern: &DOMString, _rv: &mut ErrorResult) {
pub fn SetPattern(&mut self, _pattern: &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 Size(&self) -> u32 {
0
}
pub fn SetSize(&mut self, _size: u32, _rv: &mut ErrorResult) {
pub fn SetSize(&mut self, _size: u32) -> ErrorResult {
Ok(())
}
pub fn Src(&self) -> DOMString {
None
}
pub fn SetSrc(&mut self, _src: &DOMString, _rv: &mut ErrorResult) {
pub fn SetSrc(&mut self, _src: &DOMString) -> ErrorResult {
Ok(())
}
pub fn Step(&self) -> DOMString {
None
}
pub fn SetStep(&mut self, _step: &DOMString, _rv: &mut ErrorResult) {
pub fn SetStep(&mut self, _step: &DOMString) -> ErrorResult {
Ok(())
}
pub fn Type(&self) -> DOMString {
None
}
pub fn SetType(&mut self, _type: &DOMString, _rv: &mut ErrorResult) {
pub fn SetType(&mut self, _type: &DOMString) -> ErrorResult {
Ok(())
}
pub fn DefaultValue(&self) -> DOMString {
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 {
None
}
pub fn SetValue(&mut self, _value: &DOMString, _rv: &mut ErrorResult) {
pub fn SetValue(&mut self, _value: &DOMString) -> ErrorResult {
Ok(())
}
pub fn Width(&self) -> u32 {
@ -234,8 +262,8 @@ impl HTMLInputElement {
pub fn SetWillValidate(&self, _will_validate: bool) {
}
pub fn GetValidationMessage(&self, _rv: &mut ErrorResult) -> DOMString {
None
pub fn GetValidationMessage(&self) -> Fallible<DOMString> {
Ok(None)
}
pub fn CheckValidity(&self) -> bool {
@ -248,38 +276,43 @@ impl HTMLInputElement {
pub fn Select(&self) {
}
pub fn GetSelectionStart(&self, _rv: &mut ErrorResult) -> i32 {
0
pub fn GetSelectionStart(&self) -> Fallible<i32> {
Ok(0)
}
pub fn SetSelectionStart(&mut self, _selection_start: i32, _rv: &mut ErrorResult) {
pub fn SetSelectionStart(&mut self, _selection_start: i32) -> ErrorResult {
Ok(())
}
pub fn GetSelectionEnd(&self, _rv: &mut ErrorResult) -> i32 {
0
pub fn GetSelectionEnd(&self) -> Fallible<i32> {
Ok(0)
}
pub fn SetSelectionEnd(&mut self, _selection_end: i32, _rv: &mut ErrorResult) {
pub fn SetSelectionEnd(&mut self, _selection_end: i32) -> ErrorResult {
Ok(())
}
pub fn GetSelectionDirection(&self, _rv: &mut ErrorResult) -> DOMString {
None
pub fn GetSelectionDirection(&self) -> Fallible<DOMString> {
Ok(None)
}
pub fn SetSelectionDirection(&mut self, _selection_direction: &DOMString, _rv: &mut ErrorResult) {
pub fn SetSelectionDirection(&mut self, _selection_direction: &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 UseMap(&self) -> DOMString {
None
}
pub fn SetUseMap(&mut self, _align: &DOMString, _rv: &mut ErrorResult) {
pub fn SetUseMap(&mut self, _align: &DOMString) -> ErrorResult {
Ok(())
}
}

View file

@ -14,6 +14,7 @@ impl HTMLLegendElement {
None
}
pub fn SetAlign(&mut self, _align: &DOMString, _rv: &mut ErrorResult) {
pub fn SetAlign(&mut self, _align: &DOMString) -> ErrorResult {
Ok(())
}
}

View file

@ -14,13 +14,15 @@ impl HTMLLIElement {
0
}
pub fn SetValue(&mut self, _value: i32, _rv: &mut ErrorResult) {
pub fn SetValue(&mut self, _value: i32) -> ErrorResult {
Ok(())
}
pub fn Type(&self) -> DOMString {
None
}
pub fn SetType(&mut self, _type: &DOMString, _rv: &mut ErrorResult) {
pub fn SetType(&mut self, _type: &DOMString) -> ErrorResult {
Ok(())
}
}

View file

@ -21,62 +21,71 @@ impl HTMLLinkElement {
None
}
pub fn SetHref(&mut self, _href: &DOMString, _rv: &mut ErrorResult) {
pub fn SetHref(&mut self, _href: &DOMString) -> ErrorResult {
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 Rel(&self) -> DOMString {
None
}
pub fn SetRel(&mut self, _rel: &DOMString, _rv: &mut ErrorResult) {
pub fn SetRel(&mut self, _rel: &DOMString) -> ErrorResult {
Ok(())
}
pub fn Media(&self) -> DOMString {
None
}
pub fn SetMedia(&mut self, _media: &DOMString, _rv: &mut ErrorResult) {
pub fn SetMedia(&mut self, _media: &DOMString) -> ErrorResult {
Ok(())
}
pub fn Hreflang(&self) -> DOMString {
None
}
pub fn SetHreflang(&mut self, _href: &DOMString, _rv: &mut ErrorResult) {
pub fn SetHreflang(&mut self, _href: &DOMString) -> ErrorResult {
Ok(())
}
pub fn Type(&self) -> DOMString {
None
}
pub fn SetType(&mut self, _type: &DOMString, _rv: &mut ErrorResult) {
pub fn SetType(&mut self, _type: &DOMString) -> ErrorResult {
Ok(())
}
pub fn Charset(&self) -> DOMString {
None
}
pub fn SetCharset(&mut self, _charset: &DOMString, _rv: &mut ErrorResult) {
pub fn SetCharset(&mut self, _charset: &DOMString) -> ErrorResult {
Ok(())
}
pub fn Rev(&self) -> DOMString {
None
}
pub fn SetRev(&mut self, _rev: &DOMString, _rv: &mut ErrorResult) {
pub fn SetRev(&mut self, _rev: &DOMString) -> ErrorResult {
Ok(())
}
pub fn Target(&self) -> DOMString {
None
}
pub fn SetTarget(&mut self, _target: &DOMString, _rv: &mut ErrorResult) {
pub fn SetTarget(&mut self, _target: &DOMString) -> ErrorResult {
Ok(())
}
}

View file

@ -16,7 +16,8 @@ impl HTMLMapElement {
None
}
pub fn SetName(&mut self, _name: &DOMString, _rv: &mut ErrorResult) {
pub fn SetName(&mut self, _name: &DOMString) -> ErrorResult {
Ok(())
}
fn get_scope_and_cx(&self) -> (*JSObject, *JSContext) {

View file

@ -23,7 +23,8 @@ impl HTMLMediaElement {
None
}
pub fn SetSrc(&mut self, _src: &DOMString, _rv: &mut ErrorResult) {
pub fn SetSrc(&mut self, _src: &DOMString) -> ErrorResult {
Ok(())
}
pub fn CurrentSrc(&self) -> DOMString {
@ -34,14 +35,16 @@ impl HTMLMediaElement {
None
}
pub fn SetCrossOrigin(&mut self, _cross_origin: &DOMString, _rv: &mut ErrorResult) {
pub fn SetCrossOrigin(&mut self, _cross_origin: &DOMString) -> ErrorResult {
Ok(())
}
pub fn Preload(&self) -> DOMString {
None
}
pub fn SetPreload(&mut self, _preload: &DOMString, _rv: &mut ErrorResult) {
pub fn SetPreload(&mut self, _preload: &DOMString) -> ErrorResult {
Ok(())
}
pub fn Load(&self) {
@ -63,7 +66,8 @@ impl HTMLMediaElement {
0f64
}
pub fn SetCurrentTime(&mut self, _current_time: f64, _rv: &mut ErrorResult) {
pub fn SetCurrentTime(&mut self, _current_time: f64) -> ErrorResult {
Ok(())
}
pub fn GetDuration(&self) -> f64 {
@ -78,14 +82,16 @@ impl HTMLMediaElement {
0f64
}
pub fn SetDefaultPlaybackRate(&mut self, _default_playback_rate: f64, _rv: &mut ErrorResult) {
pub fn SetDefaultPlaybackRate(&mut self, _default_playback_rate: f64) -> ErrorResult {
Ok(())
}
pub fn PlaybackRate(&self) -> f64 {
0f64
}
pub fn SetPlaybackRate(&mut self, _playback_rate: f64, _rv: &mut ErrorResult) {
pub fn SetPlaybackRate(&mut self, _playback_rate: f64) -> ErrorResult {
Ok(())
}
pub fn Ended(&self) -> bool {
@ -96,34 +102,40 @@ impl HTMLMediaElement {
false
}
pub fn SetAutoplay(&mut self, _autoplay: bool, _rv: &mut ErrorResult) {
pub fn SetAutoplay(&mut self, _autoplay: bool) -> ErrorResult {
Ok(())
}
pub fn Loop(&self) -> bool {
false
}
pub fn SetLoop(&mut self, _loop: bool, _rv: &mut ErrorResult) {
pub fn SetLoop(&mut self, _loop: bool) -> ErrorResult {
Ok(())
}
pub fn Play(&self, _rv: &mut ErrorResult) {
pub fn Play(&self) -> ErrorResult {
Ok(())
}
pub fn Pause(&self, _rv: &mut ErrorResult) {
pub fn Pause(&self) -> ErrorResult {
Ok(())
}
pub fn Controls(&self) -> bool {
false
}
pub fn SetControls(&mut self, _controls: bool, _rv: &mut ErrorResult) {
pub fn SetControls(&mut self, _controls: bool) -> ErrorResult {
Ok(())
}
pub fn Volume(&self) -> f64 {
0f64
}
pub fn SetVolume(&mut self, _volume: f64, _rv: &mut ErrorResult) {
pub fn SetVolume(&mut self, _volume: f64) -> ErrorResult {
Ok(())
}
pub fn Muted(&self) -> bool {
@ -137,6 +149,7 @@ impl HTMLMediaElement {
false
}
pub fn SetDefaultMuted(&mut self, _default_muted: bool, _rv: &mut ErrorResult) {
pub fn SetDefaultMuted(&mut self, _default_muted: bool) -> ErrorResult {
Ok(())
}
}

View file

@ -14,27 +14,31 @@ impl HTMLMetaElement {
None
}
pub fn SetName(&mut self, _name: &DOMString, _rv: &mut ErrorResult) {
pub fn SetName(&mut self, _name: &DOMString) -> ErrorResult {
Ok(())
}
pub fn HttpEquiv(&self) -> DOMString {
None
}
pub fn SetHttpEquiv(&mut self, _http_equiv: &DOMString, _rv: &mut ErrorResult) {
pub fn SetHttpEquiv(&mut self, _http_equiv: &DOMString) -> ErrorResult {
Ok(())
}
pub fn Content(&self) -> DOMString {
None
}
pub fn SetContent(&mut self, _content: &DOMString, _rv: &mut ErrorResult) {
pub fn SetContent(&mut self, _content: &DOMString) -> ErrorResult {
Ok(())
}
pub fn Scheme(&self) -> DOMString {
None
}
pub fn SetScheme(&mut self, _scheme: &DOMString, _rv: &mut ErrorResult) {
pub fn SetScheme(&mut self, _scheme: &DOMString) -> ErrorResult {
Ok(())
}
}

View file

@ -14,41 +14,47 @@ impl HTMLMeterElement {
0.0
}
pub fn SetValue(&mut self, _value: f64, _rv: &mut ErrorResult) {
pub fn SetValue(&mut self, _value: f64) -> ErrorResult {
Ok(())
}
pub fn Min(&self) -> f64 {
0.0
}
pub fn SetMin(&mut self, _min: f64, _rv: &mut ErrorResult) {
pub fn SetMin(&mut self, _min: f64) -> ErrorResult {
Ok(())
}
pub fn Max(&self) -> f64 {
0.0
}
pub fn SetMax(&mut self, _max: f64, _rv: &mut ErrorResult) {
pub fn SetMax(&mut self, _max: f64) -> ErrorResult {
Ok(())
}
pub fn Low(&self) -> f64 {
0.0
}
pub fn SetLow(&mut self, _low: f64, _rv: &mut ErrorResult) {
pub fn SetLow(&mut self, _low: f64) -> ErrorResult {
Ok(())
}
pub fn High(&self) -> f64 {
0.0
}
pub fn SetHigh(&mut self, _high: f64, _rv: &mut ErrorResult) {
pub fn SetHigh(&mut self, _high: f64) -> ErrorResult {
Ok(())
}
pub fn Optimum(&self) -> f64 {
0.0
}
pub fn SetOptimum(&mut self, _optimum: f64, _rv: &mut ErrorResult) {
pub fn SetOptimum(&mut self, _optimum: f64) -> ErrorResult {
Ok(())
}
}

View file

@ -14,13 +14,15 @@ impl HTMLModElement {
None
}
pub fn SetCite(&mut self, _cite: &DOMString, _rv: &mut ErrorResult) {
pub fn SetCite(&mut self, _cite: &DOMString) -> ErrorResult {
Ok(())
}
pub fn DateTime(&self) -> DOMString {
None
}
pub fn SetDateTime(&mut self, _datetime: &DOMString, _rv: &mut ErrorResult) {
pub fn SetDateTime(&mut self, _datetime: &DOMString) -> ErrorResult {
Ok(())
}
}

View file

@ -18,28 +18,32 @@ impl HTMLObjectElement {
None
}
pub fn SetData(&mut self, _data: &DOMString, _rv: &mut ErrorResult) {
pub fn SetData(&mut self, _data: &DOMString) -> ErrorResult {
Ok(())
}
pub fn Type(&self) -> DOMString {
None
}
pub fn SetType(&mut self, _type: &DOMString, _rv: &mut ErrorResult) {
pub fn SetType(&mut self, _type: &DOMString) -> 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 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 GetForm(&self) -> Option<AbstractNode<ScriptView>> {
@ -50,14 +54,16 @@ impl HTMLObjectElement {
None
}
pub fn SetWidth(&mut self, _width: &DOMString, _rv: &mut ErrorResult) {
pub fn SetWidth(&mut self, _width: &DOMString) -> ErrorResult {
Ok(())
}
pub fn Height(&self) -> DOMString {
None
}
pub fn SetHeight(&mut self, _height: &DOMString, _rv: &mut ErrorResult) {
pub fn SetHeight(&mut self, _height: &DOMString) -> ErrorResult {
Ok(())
}
pub fn GetContentDocument(&self) -> Option<AbstractDocument> {
@ -91,70 +97,80 @@ impl HTMLObjectElement {
None
}
pub fn SetAlign(&mut self, _align: &DOMString, _rv: &mut ErrorResult) {
pub fn SetAlign(&mut self, _align: &DOMString) -> ErrorResult {
Ok(())
}
pub fn Archive(&self) -> DOMString {
None
}
pub fn SetArchive(&mut self, _archive: &DOMString, _rv: &mut ErrorResult) {
pub fn SetArchive(&mut self, _archive: &DOMString) -> ErrorResult {
Ok(())
}
pub fn Code(&self) -> DOMString {
None
}
pub fn SetCode(&mut self, _code: &DOMString, _rv: &mut ErrorResult) {
pub fn SetCode(&mut self, _code: &DOMString) -> ErrorResult {
Ok(())
}
pub fn Declare(&self) -> bool {
false
}
pub fn SetDeclare(&mut self, _declare: bool, _rv: &mut ErrorResult) {
pub fn SetDeclare(&mut self, _declare: bool) -> 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 Standby(&self) -> DOMString {
None
}
pub fn SetStandby(&mut self, _standby: &DOMString, _rv: &mut ErrorResult) {
pub fn SetStandby(&mut self, _standby: &DOMString) -> 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 CodeBase(&self) -> DOMString {
None
}
pub fn SetCodeBase(&mut self, _codebase: &DOMString, _rv: &mut ErrorResult) {
pub fn SetCodeBase(&mut self, _codebase: &DOMString) -> ErrorResult {
Ok(())
}
pub fn CodeType(&self) -> DOMString {
None
}
pub fn SetCodeType(&mut self, _codetype: &DOMString, _rv: &mut ErrorResult) {
pub fn SetCodeType(&mut self, _codetype: &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(())
}
pub fn GetSVGDocument(&self) -> Option<AbstractDocument> {

View file

@ -14,27 +14,31 @@ impl HTMLOListElement {
false
}
pub fn SetReversed(&self, _reversed: bool, _rv: &mut ErrorResult) {
pub fn SetReversed(&self, _reversed: bool) -> ErrorResult {
Ok(())
}
pub fn Start(&self) -> i32 {
0
}
pub fn SetStart(&mut self, _start: i32, _rv: &mut ErrorResult) {
pub fn SetStart(&mut self, _start: i32) -> ErrorResult {
Ok(())
}
pub fn Type(&self) -> DOMString {
None
}
pub fn SetType(&mut self, _type: &DOMString, _rv: &mut ErrorResult) {
pub fn SetType(&mut self, _type: &DOMString) -> ErrorResult {
Ok(())
}
pub fn Compact(&self) -> bool {
false
}
pub fn SetCompact(&self, _compact: bool, _rv: &mut ErrorResult) {
pub fn SetCompact(&self, _compact: bool) -> ErrorResult {
Ok(())
}
}

View file

@ -14,13 +14,15 @@ impl HTMLOptGroupElement {
false
}
pub fn SetDisabled(&mut self, _disabled: bool, _rv: &mut ErrorResult) {
pub fn SetDisabled(&mut self, _disabled: bool) -> ErrorResult {
Ok(())
}
pub fn Label(&self) -> DOMString {
None
}
pub fn SetLabel(&mut self, _label: &DOMString, _rv: &mut ErrorResult) {
pub fn SetLabel(&mut self, _label: &DOMString) -> ErrorResult {
Ok(())
}
}

View file

@ -15,7 +15,8 @@ impl HTMLOptionElement {
false
}
pub fn SetDisabled(&mut self, _disabled: bool, _rv: &mut ErrorResult) {
pub fn SetDisabled(&mut self, _disabled: bool) -> ErrorResult {
Ok(())
}
pub fn GetForm(&self) -> Option<AbstractNode<ScriptView>> {
@ -26,35 +27,40 @@ impl HTMLOptionElement {
None
}
pub fn SetLabel(&mut self, _label: &DOMString, _rv: &mut ErrorResult) {
pub fn SetLabel(&mut self, _label: &DOMString) -> ErrorResult {
Ok(())
}
pub fn DefaultSelected(&self) -> bool {
false
}
pub fn SetDefaultSelected(&mut self, _default_selected: bool, _rv: &mut ErrorResult) {
pub fn SetDefaultSelected(&mut self, _default_selected: bool) -> ErrorResult {
Ok(())
}
pub fn Selected(&self) -> bool {
false
}
pub fn SetSelected(&mut self, _selected: bool, _rv: &mut ErrorResult) {
pub fn SetSelected(&mut self, _selected: bool) -> ErrorResult {
Ok(())
}
pub fn Value(&self) -> DOMString {
None
}
pub fn SetValue(&mut self, _value: &DOMString, _rv: &mut ErrorResult) {
pub fn SetValue(&mut self, _value: &DOMString) -> ErrorResult {
Ok(())
}
pub fn Text(&self) -> DOMString {
None
}
pub fn SetText(&mut self, _text: &DOMString, _rv: &mut ErrorResult) {
pub fn SetText(&mut self, _text: &DOMString) -> ErrorResult {
Ok(())
}
pub fn Index(&self) -> i32 {

View file

@ -20,7 +20,8 @@ impl HTMLOutputElement {
None
}
pub fn SetName(&mut self, _name: &DOMString, _rv: &mut ErrorResult) {
pub fn SetName(&mut self, _name: &DOMString) -> ErrorResult {
Ok(())
}
pub fn Type(&self) -> DOMString {
@ -31,14 +32,16 @@ impl HTMLOutputElement {
None
}
pub fn SetDefaultValue(&mut self, _value: &DOMString, _rv: &mut ErrorResult) {
pub fn SetDefaultValue(&mut self, _value: &DOMString) -> ErrorResult {
Ok(())
}
pub fn Value(&self) -> DOMString {
None
}
pub fn SetValue(&mut self, _value: &DOMString, _rv: &mut ErrorResult) {
pub fn SetValue(&mut self, _value: &DOMString) -> ErrorResult {
Ok(())
}
pub fn WillValidate(&self) -> bool {
@ -59,7 +62,8 @@ impl HTMLOutputElement {
None
}
pub fn SetValidationMessage(&mut self, _message: &DOMString, _rv: &mut ErrorResult) {
pub fn SetValidationMessage(&mut self, _message: &DOMString) -> ErrorResult {
Ok(())
}
pub fn CheckValidity(&self) -> bool {

View file

@ -14,6 +14,7 @@ impl HTMLParagraphElement {
None
}
pub fn SetAlign(&mut self, _align: &DOMString, _rv: &mut ErrorResult) {
pub fn SetAlign(&mut self, _align: &DOMString) -> ErrorResult {
Ok(())
}
}

View file

@ -14,27 +14,31 @@ impl HTMLParamElement {
None
}
pub fn SetName(&mut self, _name: &DOMString, _rv: &mut ErrorResult) {
pub fn SetName(&mut self, _name: &DOMString) -> ErrorResult {
Ok(())
}
pub fn Value(&self) -> DOMString {
None
}
pub fn SetValue(&mut self, _value: &DOMString, _rv: &mut ErrorResult) {
pub fn SetValue(&mut self, _value: &DOMString) -> ErrorResult {
Ok(())
}
pub fn Type(&self) -> DOMString {
None
}
pub fn SetType(&mut self, _type: &DOMString, _rv: &mut ErrorResult) {
pub fn SetType(&mut self, _type: &DOMString) -> ErrorResult {
Ok(())
}
pub fn ValueType(&self) -> DOMString {
None
}
pub fn SetValueType(&mut self, _value_type: &DOMString, _rv: &mut ErrorResult) {
pub fn SetValueType(&mut self, _value_type: &DOMString) -> ErrorResult {
Ok(())
}
}

View file

@ -14,6 +14,7 @@ impl HTMLPreElement {
0
}
pub fn SetWidth(&mut self, _width: i32, _rv: &mut ErrorResult) {
pub fn SetWidth(&mut self, _width: i32) -> ErrorResult {
Ok(())
}
}

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::{ErrorResult};
use dom::bindings::utils::{ErrorResult, Fallible};
use dom::htmlelement::HTMLElement;
pub struct HTMLProgressElement {
@ -14,21 +14,23 @@ impl HTMLProgressElement {
0f64
}
pub fn SetValue(&mut self, _value: f64, _rv: &mut ErrorResult) {
pub fn SetValue(&mut self, _value: f64) -> ErrorResult {
Ok(())
}
pub fn Max(&self) -> f64 {
0f64
}
pub fn SetMax(&mut self, _max: f64, _rv: &mut ErrorResult) {
pub fn SetMax(&mut self, _max: f64) -> ErrorResult {
Ok(())
}
pub fn Position(&self) -> f64 {
0f64
}
pub fn GetPositiom(&self, _rv: &mut ErrorResult) -> f64 {
0f64
pub fn GetPositiom(&self) -> Fallible<f64> {
Ok(0f64)
}
}

View file

@ -14,6 +14,7 @@ impl HTMLQuoteElement {
None
}
pub fn SetCite(&self, _cite: &DOMString, _rv: &mut ErrorResult) {
pub fn SetCite(&self, _cite: &DOMString) -> ErrorResult {
Ok(())
}
}

View file

@ -14,62 +14,71 @@ impl HTMLScriptElement {
None
}
pub fn SetSrc(&mut self, _src: &DOMString, _rv: &mut ErrorResult) {
pub fn SetSrc(&mut self, _src: &DOMString) -> ErrorResult {
Ok(())
}
pub fn Type(&self) -> DOMString {
None
}
pub fn SetType(&mut self, _type: &DOMString, _rv: &mut ErrorResult) {
pub fn SetType(&mut self, _type: &DOMString) -> ErrorResult {
Ok(())
}
pub fn Charset(&self) -> DOMString {
None
}
pub fn SetCharset(&mut self, _charset: &DOMString, _rv: &mut ErrorResult) {
pub fn SetCharset(&mut self, _charset: &DOMString) -> ErrorResult {
Ok(())
}
pub fn Async(&self) -> bool {
false
}
pub fn SetAsync(&self, _async: bool, _rv: &mut ErrorResult) {
pub fn SetAsync(&self, _async: bool) -> ErrorResult {
Ok(())
}
pub fn Defer(&self) -> bool {
false
}
pub fn SetDefer(&self, _defer: bool, _rv: &mut ErrorResult) {
pub fn SetDefer(&self, _defer: bool) -> ErrorResult {
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 Text(&self) -> DOMString {
None
}
pub fn SetText(&mut self, _text: &DOMString, _rv: &mut ErrorResult) {
pub fn SetText(&mut self, _text: &DOMString) -> ErrorResult {
Ok(())
}
pub fn Event(&self) -> DOMString {
None
}
pub fn SetEvent(&mut self, _event: &DOMString, _rv: &mut ErrorResult) {
pub fn SetEvent(&mut self, _event: &DOMString) -> ErrorResult {
Ok(())
}
pub fn HtmlFor(&self) -> DOMString {
None
}
pub fn SetHtmlFor(&mut self, _html_for: &DOMString, _rv: &mut ErrorResult) {
pub fn SetHtmlFor(&mut self, _html_for: &DOMString) -> ErrorResult {
Ok(())
}
}

View file

@ -16,14 +16,16 @@ impl HTMLSelectElement {
false
}
pub fn SetAutofocus(&mut self, _autofocus: bool, _rv: &mut ErrorResult) {
pub fn SetAutofocus(&mut self, _autofocus: bool) -> 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 GetForm(&self) -> Option<AbstractNode<ScriptView>> {
@ -34,28 +36,32 @@ impl HTMLSelectElement {
false
}
pub fn SetMultiple(&mut self, _multiple: bool, _rv: &mut ErrorResult) {
pub fn SetMultiple(&mut self, _multiple: bool) -> 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 Required(&self) -> bool {
false
}
pub fn SetRequired(&mut self, _multiple: bool, _rv: &mut ErrorResult) {
pub fn SetRequired(&mut self, _multiple: bool) -> ErrorResult {
Ok(())
}
pub fn Size(&self) -> u32 {
0
}
pub fn SetSize(&mut self, _size: u32, _rv: &mut ErrorResult) {
pub fn SetSize(&mut self, _size: u32) -> ErrorResult {
Ok(())
}
pub fn Type(&self) -> DOMString {
@ -66,7 +72,8 @@ impl HTMLSelectElement {
0
}
pub fn SetLength(&mut self, _length: u32, _rv: &mut ErrorResult) {
pub fn SetLength(&mut self, _length: u32) -> ErrorResult {
Ok(())
}
pub fn Item(&self, _index: u32) -> Option<AbstractNode<ScriptView>> {
@ -81,7 +88,8 @@ impl HTMLSelectElement {
None
}
pub fn IndexedSetter(&mut self, _index: u32, _option: Option<AbstractNode<ScriptView>>, _rv: &mut ErrorResult) {
pub fn IndexedSetter(&mut self, _index: u32, _option: Option<AbstractNode<ScriptView>>) -> ErrorResult {
Ok(())
}
pub fn Remove_(&self) {
@ -94,7 +102,8 @@ impl HTMLSelectElement {
0
}
pub fn SetSelectedIndex(&mut self, _index: i32, _rv: &mut ErrorResult) {
pub fn SetSelectedIndex(&mut self, _index: i32) -> ErrorResult {
Ok(())
}
pub fn Value(&self) -> DOMString {
@ -122,7 +131,8 @@ impl HTMLSelectElement {
None
}
pub fn SetValidationMessage(&mut self, _message: &DOMString, _rv: &mut ErrorResult) {
pub fn SetValidationMessage(&mut self, _message: &DOMString) -> ErrorResult {
Ok(())
}
pub fn CheckValidity(&self) -> bool {

View file

@ -14,20 +14,23 @@ impl HTMLSourceElement {
None
}
pub fn SetSrc(&mut self, _src: &DOMString, _rv: &mut ErrorResult) {
pub fn SetSrc(&mut self, _src: &DOMString) -> ErrorResult {
Ok(())
}
pub fn Type(&self) -> DOMString {
None
}
pub fn SetType(&mut self, _type: &DOMString, _rv: &mut ErrorResult) {
pub fn SetType(&mut self, _type: &DOMString) -> ErrorResult {
Ok(())
}
pub fn Media(&self) -> DOMString {
None
}
pub fn SetMedia(&mut self, _media: &DOMString, _rv: &mut ErrorResult) {
pub fn SetMedia(&mut self, _media: &DOMString) -> ErrorResult {
Ok(())
}
}

View file

@ -21,20 +21,23 @@ impl HTMLStyleElement {
None
}
pub fn SetMedia(&mut self, _media: &DOMString, _rv: &mut ErrorResult) {
pub fn SetMedia(&mut self, _media: &DOMString) -> ErrorResult {
Ok(())
}
pub fn Type(&self) -> DOMString {
None
}
pub fn SetType(&mut self, _type: &DOMString, _rv: &mut ErrorResult) {
pub fn SetType(&mut self, _type: &DOMString) -> ErrorResult {
Ok(())
}
pub fn Scoped(&self) -> bool {
false
}
pub fn SetScoped(&self, _scoped: bool, _rv: &mut ErrorResult) {
pub fn SetScoped(&self, _scoped: bool) -> ErrorResult {
Ok(())
}
}

View file

@ -14,6 +14,7 @@ impl HTMLTableCaptionElement {
None
}
pub fn SetAlign(&mut self, _align: &DOMString, _rv: &mut ErrorResult) {
pub fn SetAlign(&mut self, _align: &DOMString) -> ErrorResult {
Ok(())
}
}

View file

@ -14,104 +14,119 @@ impl HTMLTableCellElement {
0
}
pub fn SetColSpan(&self, _col_span: u32, _rv: &mut ErrorResult) {
pub fn SetColSpan(&self, _col_span: u32) -> ErrorResult {
Ok(())
}
pub fn RowSpan(&self) -> u32 {
0
}
pub fn SetRowSpan(&self, _col_span: u32, _rv: &mut ErrorResult) {
pub fn SetRowSpan(&self, _col_span: u32) -> ErrorResult {
Ok(())
}
pub fn Headers(&self) -> DOMString {
None
}
pub fn SetHeaders(&self, _headers: &DOMString, _rv: &mut ErrorResult) {
pub fn SetHeaders(&self, _headers: &DOMString) -> ErrorResult {
Ok(())
}
pub fn CellIndex(&self) -> i32 {
0
}
pub fn GetCellIndex(&self, _cell_index: i32, _rv: &mut ErrorResult) {
pub fn GetCellIndex(&self, _cell_index: i32) -> ErrorResult {
Ok(())
}
pub fn Abbr(&self) -> DOMString {
None
}
pub fn SetAbbr(&self, _abbr: &DOMString, _rv: &mut ErrorResult) {
pub fn SetAbbr(&self, _abbr: &DOMString) -> ErrorResult {
Ok(())
}
pub fn Scope(&self) -> DOMString {
None
}
pub fn SetScope(&self, _abbr: &DOMString, _rv: &mut ErrorResult) {
pub fn SetScope(&self, _abbr: &DOMString) -> ErrorResult {
Ok(())
}
pub fn Align(&self) -> DOMString {
None
}
pub fn SetAlign(&self, _align: &DOMString, _rv: &mut ErrorResult) {
pub fn SetAlign(&self, _align: &DOMString) -> ErrorResult {
Ok(())
}
pub fn Axis(&self) -> DOMString {
None
}
pub fn SetAxis(&self, _axis: &DOMString, _rv: &mut ErrorResult) {
pub fn SetAxis(&self, _axis: &DOMString) -> ErrorResult {
Ok(())
}
pub fn Height(&self) -> DOMString {
None
}
pub fn SetHeight(&self, _height: &DOMString, _rv: &mut ErrorResult) {
pub fn SetHeight(&self, _height: &DOMString) -> ErrorResult {
Ok(())
}
pub fn Width(&self) -> DOMString {
None
}
pub fn SetWidth(&self, _width: &DOMString, _rv: &mut ErrorResult) {
pub fn SetWidth(&self, _width: &DOMString) -> ErrorResult {
Ok(())
}
pub fn Ch(&self) -> DOMString {
None
}
pub fn SetCh(&self, _ch: &DOMString, _rv: &mut ErrorResult) {
pub fn SetCh(&self, _ch: &DOMString) -> ErrorResult {
Ok(())
}
pub fn ChOff(&self) -> DOMString {
None
}
pub fn SetChOff(&self, _ch_off: &DOMString, _rv: &mut ErrorResult) {
pub fn SetChOff(&self, _ch_off: &DOMString) -> ErrorResult {
Ok(())
}
pub fn NoWrap(&self) -> bool {
false
}
pub fn SetNoWrap(&self, _no_wrap: bool, _rv: &mut ErrorResult) {
pub fn SetNoWrap(&self, _no_wrap: bool) -> ErrorResult {
Ok(())
}
pub fn VAlign(&self) -> DOMString {
None
}
pub fn SetVAlign(&self, _valign: &DOMString, _rv: &mut ErrorResult) {
pub fn SetVAlign(&self, _valign: &DOMString) -> ErrorResult {
Ok(())
}
pub fn BgColor(&self) -> DOMString {
None
}
pub fn SetBgColor(&self, _bg_color: &DOMString, _rv: &mut ErrorResult) {
pub fn SetBgColor(&self, _bg_color: &DOMString) -> ErrorResult {
Ok(())
}
}

View file

@ -14,41 +14,47 @@ impl HTMLTableColElement {
0
}
pub fn SetSpan(&mut self, _span: u32, _rv: &mut ErrorResult) {
pub fn SetSpan(&mut self, _span: u32) -> 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 Ch(&self) -> DOMString {
None
}
pub fn SetCh(&mut self, _ch: &DOMString, _rv: &mut ErrorResult) {
pub fn SetCh(&mut self, _ch: &DOMString) -> ErrorResult {
Ok(())
}
pub fn ChOff(&self) -> DOMString {
None
}
pub fn SetChOff(&mut self, _ch_off: &DOMString, _rv: &mut ErrorResult) {
pub fn SetChOff(&mut self, _ch_off: &DOMString) -> ErrorResult {
Ok(())
}
pub fn VAlign(&self) -> DOMString {
None
}
pub fn SetVAlign(&mut self, _v_align: &DOMString, _rv: &mut ErrorResult) {
pub fn SetVAlign(&mut self, _v_align: &DOMString) -> ErrorResult {
Ok(())
}
pub fn Width(&self) -> DOMString {
None
}
pub fn SetWidth(&mut self, _width: &DOMString, _rv: &mut ErrorResult) {
pub fn SetWidth(&mut self, _width: &DOMString) -> ErrorResult {
Ok(())
}
}

View file

@ -20,7 +20,8 @@ impl HTMLTableElement {
pub fn DeleteTFoot(&self) {
}
pub fn DeleteRow(&mut self, _index: i32, _rv: &mut ErrorResult) {
pub fn DeleteRow(&mut self, _index: i32) -> ErrorResult {
Ok(())
}
pub fn Sortable(&self) -> bool {
@ -37,62 +38,71 @@ impl HTMLTableElement {
None
}
pub fn SetAlign(&self, _align: &DOMString, _rv: &mut ErrorResult) {
pub fn SetAlign(&self, _align: &DOMString) -> ErrorResult {
Ok(())
}
pub fn Border(&self) -> DOMString {
None
}
pub fn SetBorder(&self, _border: &DOMString, _rv: &mut ErrorResult) {
pub fn SetBorder(&self, _border: &DOMString) -> ErrorResult {
Ok(())
}
pub fn Frame(&self) -> DOMString {
None
}
pub fn SetFrame(&self, _frame: &DOMString, _rv: &mut ErrorResult) {
pub fn SetFrame(&self, _frame: &DOMString) -> ErrorResult {
Ok(())
}
pub fn Rules(&self) -> DOMString {
None
}
pub fn SetRules(&self, _rules: &DOMString, _rv: &mut ErrorResult) {
pub fn SetRules(&self, _rules: &DOMString) -> ErrorResult {
Ok(())
}
pub fn Summary(&self) -> DOMString {
None
}
pub fn SetSummary(&self, _summary: &DOMString, _rv: &mut ErrorResult) {
pub fn SetSummary(&self, _summary: &DOMString) -> ErrorResult {
Ok(())
}
pub fn Width(&self) -> DOMString {
None
}
pub fn SetWidth(&self, _width: &DOMString, _rv: &mut ErrorResult) {
pub fn SetWidth(&self, _width: &DOMString) -> ErrorResult {
Ok(())
}
pub fn BgColor(&self) -> DOMString {
None
}
pub fn SetBgColor(&self, _bg_color: &DOMString, _rv: &mut ErrorResult) {
pub fn SetBgColor(&self, _bg_color: &DOMString) -> ErrorResult {
Ok(())
}
pub fn CellPadding(&self) -> DOMString {
None
}
pub fn SetCellPadding(&self, _cell_padding: &DOMString, _rv: &mut ErrorResult) {
pub fn SetCellPadding(&self, _cell_padding: &DOMString) -> ErrorResult {
Ok(())
}
pub fn CellSpacing(&self) -> DOMString {
None
}
pub fn SetCellSpacing(&self, _cell_spacing: &DOMString, _rv: &mut ErrorResult) {
pub fn SetCellSpacing(&self, _cell_spacing: &DOMString) -> ErrorResult {
Ok(())
}
}

View file

@ -26,41 +26,47 @@ impl HTMLTableRowElement {
0
}
pub fn DeleteCell(&mut self, _index: i32, _rv: &mut ErrorResult) {
pub fn DeleteCell(&mut self, _index: i32) -> ErrorResult {
Ok(())
}
pub fn Align(&self) -> DOMString {
None
}
pub fn SetAlign(&self, _align: &DOMString, _rv: &mut ErrorResult) {
pub fn SetAlign(&self, _align: &DOMString) -> ErrorResult {
Ok(())
}
pub fn Ch(&self) -> DOMString {
None
}
pub fn SetCh(&self, _ch: &DOMString, _rv: &mut ErrorResult) {
pub fn SetCh(&self, _ch: &DOMString) -> ErrorResult {
Ok(())
}
pub fn ChOff(&self) -> DOMString {
None
}
pub fn SetChOff(&self, _ch_off: &DOMString, _rv: &mut ErrorResult) {
pub fn SetChOff(&self, _ch_off: &DOMString) -> ErrorResult {
Ok(())
}
pub fn VAlign(&self) -> DOMString {
None
}
pub fn SetVAlign(&self, _v_align: &DOMString, _rv: &mut ErrorResult) {
pub fn SetVAlign(&self, _v_align: &DOMString) -> ErrorResult {
Ok(())
}
pub fn BgColor(&self) -> DOMString {
None
}
pub fn SetBgColor(&self, _bg_color: &DOMString, _rv: &mut ErrorResult) {
pub fn SetBgColor(&self, _bg_color: &DOMString) -> ErrorResult {
Ok(())
}
}

View file

@ -10,34 +10,39 @@ pub struct HTMLTableSectionElement {
}
impl HTMLTableSectionElement {
pub fn DeleteRow(&mut self, _index: i32, _rv: &mut ErrorResult) {
pub fn DeleteRow(&mut self, _index: i32) -> 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 Ch(&self) -> DOMString {
None
}
pub fn SetCh(&mut self, _ch: &DOMString, _rv: &mut ErrorResult) {
pub fn SetCh(&mut self, _ch: &DOMString) -> ErrorResult {
Ok(())
}
pub fn ChOff(&self) -> DOMString {
None
}
pub fn SetChOff(&mut self, _ch_off: &DOMString, _rv: &mut ErrorResult) {
pub fn SetChOff(&mut self, _ch_off: &DOMString) -> ErrorResult {
Ok(())
}
pub fn VAlign(&self) -> DOMString {
None
}
pub fn SetVAlign(&mut self, _v_align: &DOMString, _rv: &mut ErrorResult) {
pub fn SetVAlign(&mut self, _v_align: &DOMString) -> ErrorResult {
Ok(())
}
}

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) {

View file

@ -14,6 +14,7 @@ impl HTMLTimeElement {
None
}
pub fn SetDateTime(&mut self, _dateTime: &DOMString, _rv: &mut ErrorResult) {
pub fn SetDateTime(&mut self, _dateTime: &DOMString) -> ErrorResult {
Ok(())
}
}

View file

@ -14,6 +14,7 @@ impl HTMLTitleElement {
None
}
pub fn SetText(&mut self, _text: &DOMString, _rv: &mut ErrorResult) {
pub fn SetText(&mut self, _text: &DOMString) -> ErrorResult {
Ok(())
}
}

View file

@ -14,35 +14,40 @@ impl HTMLTrackElement {
None
}
pub fn SetKind(&mut self, _kind: &DOMString, _rv: &mut ErrorResult) {
pub fn SetKind(&mut self, _kind: &DOMString) -> ErrorResult {
Ok(())
}
pub fn Src(&self) -> DOMString {
None
}
pub fn SetSrc(&mut self, _src: &DOMString, _rv: &mut ErrorResult) {
pub fn SetSrc(&mut self, _src: &DOMString) -> ErrorResult {
Ok(())
}
pub fn Srclang(&self) -> DOMString {
None
}
pub fn SetSrclang(&mut self, _srclang: &DOMString, _rv: &mut ErrorResult) {
pub fn SetSrclang(&mut self, _srclang: &DOMString) -> ErrorResult {
Ok(())
}
pub fn Label(&self) -> DOMString {
None
}
pub fn SetLabel(&mut self, _label: &DOMString, _rv: &mut ErrorResult) {
pub fn SetLabel(&mut self, _label: &DOMString) -> ErrorResult {
Ok(())
}
pub fn Default(&self) -> bool {
false
}
pub fn SetDefault(&mut self, _default: bool, _rv: &mut ErrorResult) {
pub fn SetDefault(&mut self, _default: bool) -> ErrorResult {
Ok(())
}
pub fn ReadyState(&self) -> u16 {

View file

@ -14,13 +14,15 @@ impl HTMLUListElement {
false
}
pub fn SetCompact(&mut self, _compact: bool, _rv: &mut ErrorResult) {
pub fn SetCompact(&mut self, _compact: bool) -> ErrorResult {
Ok(())
}
pub fn Type(&self) -> DOMString {
None
}
pub fn SetType(&mut self, _type: &DOMString, _rv: &mut ErrorResult) {
pub fn SetType(&mut self, _type: &DOMString) -> ErrorResult {
Ok(())
}
}

View file

@ -14,14 +14,16 @@ impl HTMLVideoElement {
0
}
pub fn SetWidth(&mut self, _width: u32, _rv: &ErrorResult) {
pub fn SetWidth(&mut self, _width: u32) -> ErrorResult {
Ok(())
}
pub fn Height(&self) -> u32 {
0
}
pub fn SetHeight(&mut self, _height: u32, _rv: &ErrorResult) {
pub fn SetHeight(&mut self, _height: u32) -> ErrorResult {
Ok(())
}
pub fn VideoWidth(&self) -> u32 {
@ -36,6 +38,7 @@ impl HTMLVideoElement {
None
}
pub fn SetPoster(&mut self, _poster: &DOMString, _rv: &ErrorResult) {
pub fn SetPoster(&mut self, _poster: &DOMString) -> ErrorResult {
Ok(())
}
}

View file

@ -3,7 +3,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use dom::bindings::codegen::MouseEventBinding;
use dom::bindings::utils::{ErrorResult, DOMString};
use dom::bindings::utils::{ErrorResult, Fallible, DOMString};
use dom::bindings::utils::{CacheableWrapper, WrapperCache, BindingObject, DerivedWrapper};
use dom::eventtarget::EventTarget;
use dom::uievent::UIEvent;
@ -54,12 +54,11 @@ impl MouseEvent {
pub fn Constructor(_owner: @mut Window,
type_: &DOMString,
init: &MouseEventBinding::MouseEventInit,
_rv: &mut ErrorResult) -> @mut MouseEvent {
@mut MouseEvent::new(type_, init.bubbles, init.cancelable, init.view, init.detail,
init: &MouseEventBinding::MouseEventInit) -> Fallible<@mut MouseEvent> {
Ok(@mut MouseEvent::new(type_, init.bubbles, init.cancelable, init.view, init.detail,
init.screenX, init.screenY, init.clientX, init.clientY,
init.ctrlKey, init.shiftKey, init.altKey, init.metaKey,
init.button, init.buttons, init.relatedTarget)
init.button, init.buttons, init.relatedTarget))
}
pub fn ScreenX(&self) -> i32 {
@ -127,8 +126,7 @@ impl MouseEvent {
shiftKeyArg: bool,
metaKeyArg: bool,
buttonArg: u16,
relatedTargetArg: Option<@mut EventTarget>,
_rv: &mut ErrorResult) {
relatedTargetArg: Option<@mut EventTarget>) -> ErrorResult {
self.parent.InitUIEvent(typeArg, canBubbleArg, cancelableArg, viewArg, detailArg);
self.screen_x = screenXArg;
self.screen_y = screenYArg;
@ -140,6 +138,7 @@ impl MouseEvent {
self.meta_key = metaKeyArg;
self.button = buttonArg;
self.related_target = relatedTargetArg;
Ok(())
}
}

View file

@ -3,7 +3,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use dom::bindings::utils::{WrapperCache, BindingObject, CacheableWrapper};
use dom::bindings::utils::{DOMString, ErrorResult};
use dom::bindings::utils::{DOMString, Fallible};
use dom::bindings::codegen::NavigatorBinding;
use script_task::{page_from_context};
@ -46,12 +46,12 @@ impl Navigator {
false
}
pub fn GetBuildID(&self, _rv: &mut ErrorResult) -> DOMString {
None
pub fn GetBuildID(&self) -> Fallible<DOMString> {
Ok(None)
}
pub fn JavaEnabled(&self, _rv: &mut ErrorResult) -> bool {
false
pub fn JavaEnabled(&self) -> Fallible<bool> {
Ok(false)
}
pub fn TaintEnabled(&self) -> bool {
@ -62,20 +62,20 @@ impl Navigator {
Some(~"Netscape") // Like Gecko/Webkit
}
pub fn GetAppCodeName(&self, _rv: &mut ErrorResult) -> DOMString {
Some(~"Mozilla") // Like Gecko/Webkit
pub fn GetAppCodeName(&self) -> Fallible<DOMString> {
Ok(Some(~"Mozilla")) // Like Gecko/Webkit
}
pub fn GetAppVersion(&self, _rv: &mut ErrorResult) -> DOMString {
None
pub fn GetAppVersion(&self) -> Fallible<DOMString> {
Ok(None)
}
pub fn GetPlatform(&self, _rv: &mut ErrorResult) -> DOMString {
None
pub fn GetPlatform(&self) -> Fallible<DOMString> {
Ok(None)
}
pub fn GetUserAgent(&self, _rv: &mut ErrorResult) -> DOMString {
None
pub fn GetUserAgent(&self) -> Fallible<DOMString> {
Ok(None)
}
pub fn GetLanguage(&self) -> DOMString {

View file

@ -5,7 +5,7 @@
//! The core DOM types. Defines the basic DOM hierarchy as well as all the HTML elements.
use dom::bindings::node;
use dom::bindings::utils::{WrapperCache, DOMString, ErrorResult, NotFound, HierarchyRequest};
use dom::bindings::utils::{WrapperCache, DOMString, ErrorResult, Fallible, NotFound, HierarchyRequest};
use dom::bindings::utils::{BindingObject, CacheableWrapper, null_str_as_empty};
use dom::characterdata::CharacterData;
use dom::document::AbstractDocument;
@ -559,7 +559,8 @@ impl Node<ScriptView> {
None
}
pub fn SetNodeValue(&mut self, _val: &DOMString, _rv: &mut ErrorResult) {
pub fn SetNodeValue(&mut self, _val: &DOMString) -> ErrorResult {
Ok(())
}
pub fn GetTextContent(&self, abstract_self: AbstractNode<ScriptView>) -> DOMString {
@ -592,22 +593,20 @@ impl Node<ScriptView> {
abstract_self: AbstractNode<ScriptView>,
node: Option<AbstractNode<ScriptView>>) {
//FIXME: We should batch document notifications that occur here
let mut rv = Ok(());
for child in abstract_self.children() {
self.RemoveChild(abstract_self, child, &mut rv);
self.RemoveChild(abstract_self, child);
}
match node {
None => {},
Some(node) => {
self.AppendChild(abstract_self, node, &mut rv);
self.AppendChild(abstract_self, node);
}
}
}
pub fn SetTextContent(&mut self,
abstract_self: AbstractNode<ScriptView>,
value: &DOMString,
_rv: &mut ErrorResult) {
value: &DOMString) -> ErrorResult {
let is_empty = match value {
&Some(~"") | &None => true,
_ => false
@ -640,9 +639,10 @@ impl Node<ScriptView> {
}
DoctypeNodeTypeId => {}
}
Ok(())
}
pub fn InsertBefore(&mut self, _node: AbstractNode<ScriptView>, _child: Option<AbstractNode<ScriptView>>, _rv: &mut ErrorResult) -> AbstractNode<ScriptView> {
pub fn InsertBefore(&mut self, _node: AbstractNode<ScriptView>, _child: Option<AbstractNode<ScriptView>>) -> Fallible<AbstractNode<ScriptView>> {
fail!("stub")
}
@ -656,8 +656,7 @@ impl Node<ScriptView> {
pub fn AppendChild(&mut self,
abstract_self: AbstractNode<ScriptView>,
node: AbstractNode<ScriptView>,
rv: &mut ErrorResult) -> AbstractNode<ScriptView> {
node: AbstractNode<ScriptView>) -> Fallible<AbstractNode<ScriptView>> {
fn is_hierarchy_request_err(this_node: AbstractNode<ScriptView>,
new_child: AbstractNode<ScriptView>) -> bool {
if new_child.is_doctype() {
@ -680,12 +679,11 @@ impl Node<ScriptView> {
}
if is_hierarchy_request_err(abstract_self, node) {
*rv = Err(HierarchyRequest);
return Err(HierarchyRequest);
}
// TODO: Should we handle WRONG_DOCUMENT_ERR here?
if rv.is_ok() {
self.wait_until_safe_to_modify_dom();
// If the node already exists it is removed from current parent node.
@ -697,18 +695,16 @@ impl Node<ScriptView> {
},
None => ()
}
}
node
Ok(node)
}
pub fn ReplaceChild(&mut self, _node: AbstractNode<ScriptView>, _child: AbstractNode<ScriptView>, _rv: &mut ErrorResult) -> AbstractNode<ScriptView> {
pub fn ReplaceChild(&mut self, _node: AbstractNode<ScriptView>, _child: AbstractNode<ScriptView>) -> Fallible<AbstractNode<ScriptView>> {
fail!("stub")
}
pub fn RemoveChild(&mut self,
abstract_self: AbstractNode<ScriptView>,
node: AbstractNode<ScriptView>,
rv: &mut ErrorResult) -> AbstractNode<ScriptView> {
node: AbstractNode<ScriptView>) -> Fallible<AbstractNode<ScriptView>> {
fn is_not_found_err(this_node: AbstractNode<ScriptView>,
old_child: AbstractNode<ScriptView>) -> bool {
match old_child.parent_node() {
@ -718,21 +714,20 @@ impl Node<ScriptView> {
}
if is_not_found_err(abstract_self, node) {
*rv = Err(NotFound);
return Err(NotFound);
}
if rv.is_ok() {
self.wait_until_safe_to_modify_dom();
abstract_self.remove_child(node);
self.remove_from_doc();
}
node
Ok(node)
}
pub fn Normalize(&mut self) {
}
pub fn CloneNode(&self, _deep: bool, _rv: &mut ErrorResult) -> AbstractNode<ScriptView> {
pub fn CloneNode(&self, _deep: bool) -> Fallible<AbstractNode<ScriptView>> {
fail!("stub")
}

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, null_str_as_empty};
use dom::bindings::utils::{DOMString, Fallible, null_str_as_empty};
use dom::characterdata::CharacterData;
use dom::node::{AbstractNode, ScriptView, Node, TextNodeTypeId};
use dom::window::Window;
@ -20,16 +20,16 @@ impl Text {
}
}
pub fn Constructor(owner: @mut Window, text: &DOMString, _rv: &mut ErrorResult) -> AbstractNode<ScriptView> {
pub fn Constructor(owner: @mut Window, text: &DOMString) -> Fallible<AbstractNode<ScriptView>> {
let cx = owner.page.js_info.get_ref().js_compartment.cx.ptr;
unsafe { Node::as_abstract_node(cx, @Text::new(null_str_as_empty(text))) }
unsafe { Ok(Node::as_abstract_node(cx, @Text::new(null_str_as_empty(text)))) }
}
pub fn SplitText(&self, _offset: u32, _rv: &mut ErrorResult) -> AbstractNode<ScriptView> {
pub fn SplitText(&self, _offset: u32) -> Fallible<AbstractNode<ScriptView>> {
fail!("unimplemented")
}
pub fn GetWholeText(&self, _rv: &mut ErrorResult) -> DOMString {
None
pub fn GetWholeText(&self) -> Fallible<DOMString> {
Ok(None)
}
}

View file

@ -3,7 +3,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use dom::bindings::codegen::UIEventBinding;
use dom::bindings::utils::{ErrorResult, DOMString};
use dom::bindings::utils::{DOMString, Fallible};
use dom::bindings::utils::{CacheableWrapper, WrapperCache, BindingObject, DerivedWrapper};
use dom::node::{AbstractNode, ScriptView};
use dom::event::Event;
@ -39,10 +39,9 @@ impl UIEvent {
pub fn Constructor(_owner: @mut Window,
type_: &DOMString,
init: &UIEventBinding::UIEventInit,
_rv: &mut ErrorResult) -> @mut UIEvent {
@mut UIEvent::new(type_, init.parent.bubbles, init.parent.cancelable,
init.view, init.detail)
init: &UIEventBinding::UIEventInit) -> Fallible<@mut UIEvent> {
Ok(@mut UIEvent::new(type_, init.parent.bubbles, init.parent.cancelable,
init.view, init.detail))
}
pub fn GetView(&self) -> Option<@mut WindowProxy> {
@ -59,8 +58,7 @@ impl UIEvent {
cancelable: bool,
view: Option<@mut WindowProxy>,
detail: i32) {
let mut rv = Ok(());
self.parent.InitEvent(type_, can_bubble, cancelable, &mut rv);
self.parent.InitEvent(type_, can_bubble, cancelable);
self.can_bubble = can_bubble;
self.cancelable = cancelable;
self.view = view;