diff --git a/src/components/script/dom/attr.rs b/src/components/script/dom/attr.rs index 03d6a2e8d9f..f963ae962c9 100644 --- a/src/components/script/dom/attr.rs +++ b/src/components/script/dom/attr.rs @@ -4,7 +4,7 @@ use dom::bindings::codegen::AttrBinding; use dom::bindings::utils::{Reflectable, Reflector, DOMString}; -use dom::bindings::utils::{reflect_dom_object, null_str_as_empty}; +use dom::bindings::utils::reflect_dom_object; use dom::namespace::{Namespace, Null}; use dom::window::Window; @@ -69,20 +69,20 @@ impl Attr { } } - pub fn LocalName(&self) -> Option { - Some(self.local_name().to_owned()) + pub fn LocalName(&self) -> DOMString { + self.local_name().to_owned() } - pub fn Value(&self) -> Option { - Some(self.value.clone()) + pub fn Value(&self) -> DOMString { + self.value.clone() } - pub fn SetValue(&mut self, value: &Option) { - self.value = null_str_as_empty(value); + pub fn SetValue(&mut self, value: &DOMString) { + self.value = value.clone(); } - pub fn Name(&self) -> Option { - Some(self.name.clone()) + pub fn Name(&self) -> DOMString { + self.name.clone() } pub fn GetNamespaceURI(&self) -> Option { diff --git a/src/components/script/dom/bindings/codegen/CodegenRust.py b/src/components/script/dom/bindings/codegen/CodegenRust.py index c1739f1c13c..05255b95792 100644 --- a/src/components/script/dom/bindings/codegen/CodegenRust.py +++ b/src/components/script/dom/bindings/codegen/CodegenRust.py @@ -1066,9 +1066,6 @@ for (uint32_t i = 0; i < length; ++i) { def getConversionCode(varName, isOptional=False): strval = "strval" - if not type.nullable(): - # XXX #1207 Actually pass non-nullable strings to callees. - strval = "Some(%s)" % strval if isOptional: strval = "Some(%s)" % strval if type.nullable(): @@ -1092,7 +1089,7 @@ for (uint32_t i = 0; i < length; ++i) { return handleDefault( conversionCode, ("static data: [u8, ..%s] = [ %s ];\n" - "%s = Some(str::from_utf8(data));" % + "%s = str::from_utf8(data)" % (len(defaultValue.value) + 1, ", ".join(["'" + char + "' as u8" for char in defaultValue.value] + ["0"]), varName))) @@ -1109,12 +1106,14 @@ for (uint32_t i = 0; i < length; ++i) { "}\n" % CGIndenter(CGGeneric(getConversionCode("str"))).define(), declType, None, isOptional, None) + declType = "DOMString" + initialValue = None + if type.nullable(): + declType = "Option<%s>" % declType + if isOptional: - declType = "Option>" + declType = "Option<%s>" % declType initialValue = "None" - else: - declType = "Option" - initialValue = None return ( "%s\n" % @@ -1587,8 +1586,7 @@ for (uint32_t i = 0; i < length; ++i) { if type.nullable(): return (wrapAndSetPtr("*${jsvalPtr} = domstring_to_jsval(cx, &%s)" % result), False) else: - #XXXjdm Can we be smarter when we know it's not nullable? - return (wrapAndSetPtr("*${jsvalPtr} = domstring_to_jsval(cx, &%s)" % result), False) + return (wrapAndSetPtr("*${jsvalPtr} = str_to_jsval(cx, &%s)" % result), False) if type.isEnum(): if type.nullable(): @@ -1722,7 +1720,10 @@ def getRetvalDeclarationForType(returnType, descriptorProvider, result = CGWrapper(result, pre="Nullable<", post=">") return result, False if returnType.isString(): - return CGGeneric("Option"), False + result = CGGeneric("DOMString") + if returnType.nullable(): + result = CGWrapper(result, pre="Option<", post=">") + return result, False if returnType.isEnum(): if returnType.nullable(): raise TypeError("We don't support nullable enum return values") diff --git a/src/components/script/dom/bindings/utils.rs b/src/components/script/dom/bindings/utils.rs index 61b6ad54776..f3f24b34cc9 100644 --- a/src/components/script/dom/bindings/utils.rs +++ b/src/components/script/dom/bindings/utils.rs @@ -272,19 +272,24 @@ pub fn jsval_to_domstring(cx: *JSContext, v: JSVal) -> Result, } } +#[fixed_stack_segment] +pub unsafe fn str_to_jsval(cx: *JSContext, string: &DOMString) -> JSVal { + do string.to_utf16().as_imm_buf |buf, len| { + let jsstr = JS_NewUCStringCopyN(cx, buf, len as libc::size_t); + if jsstr.is_null() { + // FIXME: is there something else we should do on failure? + JSVAL_NULL + } else { + RUST_STRING_TO_JSVAL(jsstr) + } + } +} + #[fixed_stack_segment] pub unsafe fn domstring_to_jsval(cx: *JSContext, string: &Option) -> JSVal { match string { &None => JSVAL_NULL, - &Some(ref s) => do s.to_utf16().as_imm_buf |buf, len| { - let jsstr = JS_NewUCStringCopyN(cx, buf, len as libc::size_t); - if jsstr.is_null() { - // FIXME: is there something else we should do on failure? - JSVAL_NULL - } else { - RUST_STRING_TO_JSVAL(jsstr) - } - } + &Some(ref s) => str_to_jsval(cx, s), } } diff --git a/src/components/script/dom/characterdata.rs b/src/components/script/dom/characterdata.rs index ad4dc67ee1c..19a205cf5c4 100644 --- a/src/components/script/dom/characterdata.rs +++ b/src/components/script/dom/characterdata.rs @@ -22,12 +22,12 @@ impl CharacterData { } } - pub fn Data(&self) -> Option { - Some(self.data.clone()) + pub fn Data(&self) -> DOMString { + self.data.clone() } - pub fn SetData(&mut self, arg: &Option) -> ErrorResult { - self.data = arg.get_ref().clone(); + pub fn SetData(&mut self, arg: &DOMString) -> ErrorResult { + self.data = arg.clone(); Ok(()) } @@ -35,16 +35,16 @@ impl CharacterData { self.data.len() as u32 } - pub fn SubstringData(&self, offset: u32, count: u32) -> Fallible> { - Ok(Some(self.data.slice(offset as uint, count as uint).to_str())) + pub fn SubstringData(&self, offset: u32, count: u32) -> Fallible { + Ok(self.data.slice(offset as uint, count as uint).to_str()) } - pub fn AppendData(&mut self, arg: &Option) -> ErrorResult { - self.data.push_str(arg.get_ref().clone()); + pub fn AppendData(&mut self, arg: &DOMString) -> ErrorResult { + self.data.push_str(*arg); Ok(()) } - pub fn InsertData(&mut self, _offset: u32, _arg: &Option) -> ErrorResult { + pub fn InsertData(&mut self, _offset: u32, _arg: &DOMString) -> ErrorResult { fail!("CharacterData::InsertData() is unimplemented") } @@ -52,7 +52,7 @@ impl CharacterData { fail!("CharacterData::DeleteData() is unimplemented") } - pub fn ReplaceData(&mut self, _offset: u32, _count: u32, _arg: &Option) -> ErrorResult { + pub fn ReplaceData(&mut self, _offset: u32, _count: u32, _arg: &DOMString) -> ErrorResult { fail!("CharacterData::ReplaceData() is unimplemented") } } diff --git a/src/components/script/dom/comment.rs b/src/components/script/dom/comment.rs index 6971cef2ead..2e71b99a868 100644 --- a/src/components/script/dom/comment.rs +++ b/src/components/script/dom/comment.rs @@ -3,7 +3,7 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ use dom::bindings::codegen::CommentBinding; -use dom::bindings::utils::{DOMString, Fallible, null_str_as_empty}; +use dom::bindings::utils::{DOMString, Fallible}; use dom::characterdata::CharacterData; use dom::document::AbstractDocument; use dom::node::{AbstractNode, ScriptView, CommentNodeTypeId, Node}; @@ -26,7 +26,7 @@ impl Comment { Node::reflect_node(@mut node, document, CommentBinding::Wrap) } - pub fn Constructor(owner: @mut Window, data: &Option) -> Fallible> { - Ok(Comment::new(null_str_as_empty(data), owner.Document())) + pub fn Constructor(owner: @mut Window, data: &DOMString) -> Fallible> { + Ok(Comment::new(data.clone(), owner.Document())) } } diff --git a/src/components/script/dom/document.rs b/src/components/script/dom/document.rs index 15d68e2cc8f..f639f7e3b0c 100644 --- a/src/components/script/dom/document.rs +++ b/src/components/script/dom/document.rs @@ -6,7 +6,7 @@ use dom::comment::Comment; use dom::bindings::codegen::DocumentBinding; use dom::bindings::utils::{Reflectable, Reflector, Traceable, reflect_dom_object}; use dom::bindings::utils::{ErrorResult, Fallible, NotSupported, InvalidCharacter}; -use dom::bindings::utils::{DOMString, null_str_as_empty_ref, null_str_as_empty, null_str_as_word_null}; +use dom::bindings::utils::DOMString; use dom::bindings::utils::{xml_name_type, InvalidXMLName}; use dom::documentfragment::DocumentFragment; use dom::element::{Element}; @@ -180,31 +180,29 @@ impl Document { self.window.get_cx() } - pub fn GetElementsByTagName(&self, tag: &Option) -> @mut HTMLCollection { - self.createHTMLCollection(|elem| eq_slice(elem.tag_name, null_str_as_empty(tag))) + pub fn GetElementsByTagName(&self, tag: &DOMString) -> @mut HTMLCollection { + self.createHTMLCollection(|elem| eq_slice(elem.tag_name, *tag)) } - pub fn GetElementsByTagNameNS(&self, _ns: &Option, _tag: &Option) -> @mut HTMLCollection { + pub fn GetElementsByTagNameNS(&self, _ns: &Option, _tag: &DOMString) -> @mut HTMLCollection { HTMLCollection::new(self.window, ~[]) } - pub fn GetElementsByClassName(&self, _class: &Option) -> @mut HTMLCollection { + pub fn GetElementsByClassName(&self, _class: &DOMString) -> @mut HTMLCollection { HTMLCollection::new(self.window, ~[]) } - pub fn GetElementById(&self, id: &Option) -> Option> { - let key: &~str = &null_str_as_empty(id); + pub fn GetElementById(&self, id: &DOMString) -> Option> { // TODO: "in tree order, within the context object's tree" // http://dom.spec.whatwg.org/#dom-document-getelementbyid. - match self.idmap.find_equiv(key) { + match self.idmap.find_equiv(id) { None => None, Some(node) => Some(*node), } } - pub fn CreateElement(&self, abstract_self: AbstractDocument, local_name: &Option) -> Fallible> { - let local_name = null_str_as_empty(local_name); - if xml_name_type(local_name) == InvalidXMLName { + pub fn CreateElement(&self, abstract_self: AbstractDocument, local_name: &DOMString) -> Fallible> { + if xml_name_type(*local_name) == InvalidXMLName { return Err(InvalidCharacter); } let local_name = local_name.to_ascii_lower(); @@ -215,16 +213,16 @@ impl Document { DocumentFragment::new(abstract_self) } - pub fn CreateTextNode(&self, abstract_self: AbstractDocument, data: &Option) -> AbstractNode { - Text::new(null_str_as_empty(data), abstract_self) + pub fn CreateTextNode(&self, abstract_self: AbstractDocument, data: &DOMString) -> AbstractNode { + Text::new(data.clone(), abstract_self) } - pub fn CreateComment(&self, abstract_self: AbstractDocument, data: &Option) -> AbstractNode { - Comment::new(null_str_as_word_null(data), abstract_self) + pub fn CreateComment(&self, abstract_self: AbstractDocument, data: &DOMString) -> AbstractNode { + Comment::new(data.clone(), abstract_self) } - pub fn CreateEvent(&self, interface: &Option) -> Fallible { - match null_str_as_empty_ref(interface) { + pub fn CreateEvent(&self, interface: &DOMString) -> Fallible { + match interface.as_slice() { "UIEvents" => Ok(UIEvent::new(self.window, UIEventTypeId)), "MouseEvents" => Ok(MouseEvent::new(self.window)), "HTMLEvents" => Ok(Event::new(self.window, HTMLEventTypeId)), @@ -232,7 +230,7 @@ impl Document { } } - pub fn Title(&self, _: AbstractDocument) -> Option { + pub fn Title(&self, _: AbstractDocument) -> DOMString { let mut title = ~""; match self.doctype { SVG => { @@ -249,8 +247,7 @@ impl Document { for child in node.children() { if child.is_text() { do child.with_imm_text() |text| { - let s = text.element.Data(); - title = title + null_str_as_empty(&s); + title = title + text.element.Data(); } } } @@ -263,10 +260,10 @@ impl Document { let v: ~[&str] = title.word_iter().collect(); title = v.connect(" "); title = title.trim().to_owned(); - Some(title) + title } - pub fn SetTitle(&self, abstract_self: AbstractDocument, title: &Option) -> ErrorResult { + pub fn SetTitle(&self, abstract_self: AbstractDocument, title: &DOMString) -> ErrorResult { match self.doctype { SVG => { fail!("no SVG document yet") @@ -305,9 +302,9 @@ impl Document { Ok(()) } - pub fn GetElementsByName(&self, name: &Option) -> @mut HTMLCollection { + pub fn GetElementsByName(&self, name: &DOMString) -> @mut HTMLCollection { self.createHTMLCollection(|elem| - elem.get_attr("name").is_some() && eq_slice(elem.get_attr("name").unwrap(), null_str_as_empty(name))) + elem.get_attr("name").is_some() && eq_slice(elem.get_attr("name").unwrap(), *name)) } pub fn createHTMLCollection(&self, callback: &fn(elem: &Element) -> bool) -> @mut HTMLCollection { diff --git a/src/components/script/dom/documenttype.rs b/src/components/script/dom/documenttype.rs index 797a75ea04c..7456ab79330 100644 --- a/src/components/script/dom/documenttype.rs +++ b/src/components/script/dom/documenttype.rs @@ -10,9 +10,9 @@ use dom::node::{AbstractNode, ScriptView, Node, DoctypeNodeTypeId}; /// The `DOCTYPE` tag. pub struct DocumentType { node: Node, - name: ~str, - public_id: Option<~str>, - system_id: Option<~str>, + name: DOMString, + public_id: DOMString, + system_id: DOMString, force_quirks: bool } @@ -26,8 +26,8 @@ impl DocumentType { DocumentType { node: Node::new(DoctypeNodeTypeId, document), name: name, - public_id: public_id, - system_id: system_id, + public_id: public_id.unwrap_or(~""), + system_id: system_id.unwrap_or(~""), force_quirks: force_quirks, } } @@ -47,15 +47,15 @@ impl DocumentType { } impl DocumentType { - pub fn Name(&self) -> Option { - Some(self.name.clone()) + pub fn Name(&self) -> DOMString { + self.name.clone() } - pub fn PublicId(&self) -> Option { + pub fn PublicId(&self) -> DOMString { self.public_id.clone() } - pub fn SystemId(&self) -> Option { + pub fn SystemId(&self) -> DOMString { self.system_id.clone() } } diff --git a/src/components/script/dom/domparser.rs b/src/components/script/dom/domparser.rs index 6c657daf170..7fc874d05d1 100644 --- a/src/components/script/dom/domparser.rs +++ b/src/components/script/dom/domparser.rs @@ -33,7 +33,7 @@ impl DOMParser { } pub fn ParseFromString(&self, - _s: &Option, + _s: &DOMString, ty: DOMParserBinding::SupportedType) -> Fallible { match ty { diff --git a/src/components/script/dom/element.rs b/src/components/script/dom/element.rs index a3d4257b393..62a668bfdf3 100644 --- a/src/components/script/dom/element.rs +++ b/src/components/script/dom/element.rs @@ -261,12 +261,12 @@ impl<'self> Element { match abstract_self.type_id() { ElementNodeTypeId(HTMLImageElementTypeId) => { do abstract_self.with_mut_image_element |image| { - image.AfterSetAttr(&Some(local_name.clone()), value); + image.AfterSetAttr(&local_name, &null_str_as_empty(value)); } } ElementNodeTypeId(HTMLIframeElementTypeId) => { do abstract_self.with_mut_iframe_element |iframe| { - iframe.AfterSetAttr(&Some(local_name.clone()), value); + iframe.AfterSetAttr(&local_name, &null_str_as_empty(value)); } } _ => () @@ -280,44 +280,44 @@ impl<'self> Element { } impl Element { - pub fn TagName(&self) -> Option { - Some(self.tag_name.to_owned().to_ascii_upper()) + pub fn TagName(&self) -> DOMString { + self.tag_name.to_owned().to_ascii_upper() } - pub fn Id(&self, _abstract_self: AbstractNode) -> Option { + pub fn Id(&self, _abstract_self: AbstractNode) -> DOMString { match self.get_attr(&"id") { - Some(x) => Some(x), - None => Some(~"") + Some(x) => x, + None => ~"" } } - pub fn SetId(&mut self, abstract_self: AbstractNode, id: &Option) { - self.set_attribute(abstract_self, namespace::Null, &Some(~"id"), id); + pub fn SetId(&mut self, abstract_self: AbstractNode, id: &DOMString) { + self.set_attribute(abstract_self, namespace::Null, &Some(~"id"), &Some(id.clone())); } - pub fn GetAttribute(&self, name: &Option) -> Option { - self.get_attr(null_str_as_empty_ref(name)) + pub fn GetAttribute(&self, name: &DOMString) -> Option { + self.get_attr(*name).map(|s| s.to_owned()) } - pub fn GetAttributeNS(&self, namespace: &Option, local_name: &Option) -> Option { - self.get_attribute(namespace, null_str_as_empty_ref(local_name)) + pub fn GetAttributeNS(&self, namespace: &Option, local_name: &DOMString) -> Option { + self.get_attribute(namespace, *local_name) .map(|attr| attr.value.clone()) } pub fn SetAttribute(&mut self, abstract_self: AbstractNode, - name: &Option, - value: &Option) -> ErrorResult { - self.set_attr(abstract_self, name, value); + name: &DOMString, + value: &DOMString) -> ErrorResult { + self.set_attr(abstract_self, &Some(name.clone()), &Some(value.clone())); Ok(()) } pub fn SetAttributeNS(&mut self, abstract_self: AbstractNode, namespace_url: &Option, - name: &Option, - value: &Option) -> ErrorResult { - let name_type = xml_name_type(name.to_str()); + name: &DOMString, + value: &DOMString) -> ErrorResult { + let name_type = xml_name_type(*name); match name_type { InvalidXMLName => return Err(InvalidCharacter), Name => return Err(NamespaceError), @@ -325,38 +325,38 @@ impl Element { } let namespace = Namespace::from_str(namespace_url); - self.set_attribute(abstract_self, namespace, name, value) + self.set_attribute(abstract_self, namespace, &Some(name.clone()), &Some(value.clone())) } - pub fn RemoveAttribute(&self, _name: &Option) -> ErrorResult { + pub fn RemoveAttribute(&self, _name: &DOMString) -> ErrorResult { Ok(()) } - pub fn RemoveAttributeNS(&self, _namespace: &Option, _localname: &Option) -> ErrorResult { + pub fn RemoveAttributeNS(&self, _namespace: &Option, _localname: &DOMString) -> ErrorResult { Ok(()) } - pub fn HasAttribute(&self, name: &Option) -> bool { + pub fn HasAttribute(&self, name: &DOMString) -> bool { self.GetAttribute(name).is_some() } - pub fn HasAttributeNS(&self, namespace: &Option, local_name: &Option) -> bool { + pub fn HasAttributeNS(&self, namespace: &Option, local_name: &DOMString) -> bool { self.GetAttributeNS(namespace, local_name).is_some() } - pub fn GetElementsByTagName(&self, _localname: &Option) -> @mut HTMLCollection { + pub fn GetElementsByTagName(&self, _localname: &DOMString) -> @mut HTMLCollection { HTMLCollection::new(self.node.owner_doc().document().window, ~[]) } - pub fn GetElementsByTagNameNS(&self, _namespace: &Option, _localname: &Option) -> Fallible<@mut HTMLCollection> { + pub fn GetElementsByTagNameNS(&self, _namespace: &Option, _localname: &DOMString) -> Fallible<@mut HTMLCollection> { Ok(HTMLCollection::new(self.node.owner_doc().document().window, ~[])) } - pub fn GetElementsByClassName(&self, _names: &Option) -> @mut HTMLCollection { + pub fn GetElementsByClassName(&self, _names: &DOMString) -> @mut HTMLCollection { HTMLCollection::new(self.node.owner_doc().document().window, ~[]) } - pub fn MozMatchesSelector(&self, _selector: &Option) -> Fallible { + pub fn MozMatchesSelector(&self, _selector: &DOMString) -> Fallible { Ok(false) } @@ -452,27 +452,27 @@ impl Element { 0 } - pub fn GetInnerHTML(&self) -> Fallible> { - Ok(None) + pub fn GetInnerHTML(&self) -> Fallible { + Ok(~"") } - pub fn SetInnerHTML(&mut self, _value: &Option) -> ErrorResult { + pub fn SetInnerHTML(&mut self, _value: &DOMString) -> ErrorResult { Ok(()) } - pub fn GetOuterHTML(&self) -> Fallible> { - Ok(None) + pub fn GetOuterHTML(&self) -> Fallible { + Ok(~"") } - pub fn SetOuterHTML(&mut self, _value: &Option) -> ErrorResult { + pub fn SetOuterHTML(&mut self, _value: &DOMString) -> ErrorResult { Ok(()) } - pub fn InsertAdjacentHTML(&mut self, _position: &Option, _text: &Option) -> ErrorResult { + pub fn InsertAdjacentHTML(&mut self, _position: &DOMString, _text: &DOMString) -> ErrorResult { Ok(()) } - pub fn QuerySelector(&self, _selectors: &Option) -> Fallible>> { + pub fn QuerySelector(&self, _selectors: &DOMString) -> Fallible>> { Ok(None) } } diff --git a/src/components/script/dom/event.rs b/src/components/script/dom/event.rs index 985c5bf7cf4..58d0bad3cff 100644 --- a/src/components/script/dom/event.rs +++ b/src/components/script/dom/event.rs @@ -6,7 +6,7 @@ use dom::eventtarget::AbstractEventTarget; use dom::window::Window; use dom::bindings::codegen::EventBinding; use dom::bindings::utils::{Reflectable, Reflector, reflect_dom_object}; -use dom::bindings::utils::{DOMString, ErrorResult, Fallible, null_str_as_word_null}; +use dom::bindings::utils::{DOMString, ErrorResult, Fallible}; use dom::mouseevent::MouseEvent; use dom::uievent::UIEvent; @@ -181,8 +181,8 @@ impl Event { self.phase as u16 } - pub fn Type(&self) -> Option { - Some(self.type_.clone()) + pub fn Type(&self) -> DOMString { + self.type_.clone() } pub fn GetTarget(&self) -> Option { @@ -225,10 +225,10 @@ impl Event { } pub fn InitEvent(&mut self, - type_: &Option, + type_: &DOMString, bubbles: bool, cancelable: bool) -> ErrorResult { - self.type_ = null_str_as_word_null(type_); + self.type_ = type_.clone(); self.cancelable = cancelable; self.bubbles = bubbles; self.initialized = true; @@ -240,7 +240,7 @@ impl Event { } pub fn Constructor(global: @mut Window, - type_: &Option, + type_: &DOMString, init: &EventBinding::EventInit) -> Fallible { let ev = Event::new(global, HTMLEventTypeId); ev.mut_event().InitEvent(type_, init.bubbles, init.cancelable); diff --git a/src/components/script/dom/eventtarget.rs b/src/components/script/dom/eventtarget.rs index e584d544637..92858f93e16 100644 --- a/src/components/script/dom/eventtarget.rs +++ b/src/components/script/dom/eventtarget.rs @@ -3,7 +3,7 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ use dom::bindings::utils::{Reflectable, Reflector, DOMString, Fallible}; -use dom::bindings::utils::{null_str_as_word_null, InvalidState}; +use dom::bindings::utils::{InvalidState}; use dom::bindings::codegen::EventListenerBinding::EventListener; use dom::document::AbstractDocument; use dom::event::AbstractEvent; @@ -141,11 +141,11 @@ impl EventTarget { } pub fn AddEventListener(&mut self, - ty: &Option, + ty: &DOMString, listener: Option, capture: bool) { for &listener in listener.iter() { - let entry = self.handlers.find_or_insert_with(null_str_as_word_null(ty), |_| ~[]); + let entry = self.handlers.find_or_insert_with(ty.clone(), |_| ~[]); let phase = if capture { Capturing } else { Bubbling }; let new_entry = EventListenerEntry { phase: phase, @@ -158,11 +158,11 @@ impl EventTarget { } pub fn RemoveEventListener(&mut self, - ty: &Option, + ty: &DOMString, listener: Option, capture: bool) { for &listener in listener.iter() { - let mut entry = self.handlers.find_mut(&null_str_as_word_null(ty)); + let mut entry = self.handlers.find_mut(ty); for entry in entry.mut_iter() { let phase = if capture { Capturing } else { Bubbling }; let old_entry = EventListenerEntry { diff --git a/src/components/script/dom/formdata.rs b/src/components/script/dom/formdata.rs index 1c95f2b7b3b..1a0a760f505 100644 --- a/src/components/script/dom/formdata.rs +++ b/src/components/script/dom/formdata.rs @@ -3,7 +3,7 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ use dom::bindings::utils::{Reflectable, Reflector, reflect_dom_object}; -use dom::bindings::utils::{DOMString, null_str_as_empty}; +use dom::bindings::utils::DOMString; use dom::bindings::codegen::FormDataBinding; use dom::blob::Blob; use dom::window::Window; @@ -11,8 +11,8 @@ use dom::window::Window; use std::hashmap::HashMap; enum FormDatum { - StringData(Option), - BlobData { blob: @mut Blob, name: Option } + StringData(DOMString), + BlobData { blob: @mut Blob, name: DOMString } } pub struct FormData { @@ -34,16 +34,16 @@ impl FormData { reflect_dom_object(@mut FormData::new_inherited(window), window, FormDataBinding::Wrap) } - pub fn Append(&mut self, name: &Option, value: @mut Blob, filename: Option>) { + pub fn Append(&mut self, name: &DOMString, value: @mut Blob, filename: Option) { let blob = BlobData { blob: value, - name: filename.unwrap_or(Some(~"default")) + name: filename.unwrap_or(~"default") }; - self.data.insert(null_str_as_empty(name), blob); + self.data.insert(name.clone(), blob); } - pub fn Append_(&mut self, name: &Option, value: &Option) { - self.data.insert(null_str_as_empty(name), StringData((*value).clone())); + pub fn Append_(&mut self, name: &DOMString, value: &DOMString) { + self.data.insert(name.clone(), StringData((*value).clone())); } } diff --git a/src/components/script/dom/htmlanchorelement.rs b/src/components/script/dom/htmlanchorelement.rs index 4f11edbc288..53310c7b336 100644 --- a/src/components/script/dom/htmlanchorelement.rs +++ b/src/components/script/dom/htmlanchorelement.rs @@ -27,107 +27,107 @@ impl HTMLAnchorElement { } impl HTMLAnchorElement { - pub fn Href(&self) -> Option { - None + pub fn Href(&self) -> DOMString { + ~"" } - pub fn SetHref(&mut self, _href: &Option) -> ErrorResult { + pub fn SetHref(&mut self, _href: &DOMString) -> ErrorResult { Ok(()) } - pub fn Target(&self) -> Option { - None + pub fn Target(&self) -> DOMString { + ~"" } - pub fn SetTarget(&self, _target: &Option) -> ErrorResult { + pub fn SetTarget(&self, _target: &DOMString) -> ErrorResult { Ok(()) } - pub fn Download(&self) -> Option { - None + pub fn Download(&self) -> DOMString { + ~"" } - pub fn SetDownload(&self, _download: &Option) -> ErrorResult { + pub fn SetDownload(&self, _download: &DOMString) -> ErrorResult { Ok(()) } - pub fn Ping(&self) -> Option { - None + pub fn Ping(&self) -> DOMString { + ~"" } - pub fn SetPing(&self, _ping: &Option) -> ErrorResult { + pub fn SetPing(&self, _ping: &DOMString) -> ErrorResult { Ok(()) } - pub fn Rel(&self) -> Option { - None + pub fn Rel(&self) -> DOMString { + ~"" } - pub fn SetRel(&self, _rel: &Option) -> ErrorResult { + pub fn SetRel(&self, _rel: &DOMString) -> ErrorResult { Ok(()) } - pub fn Hreflang(&self) -> Option { - None + pub fn Hreflang(&self) -> DOMString { + ~"" } - pub fn SetHreflang(&self, _href_lang: &Option) -> ErrorResult { + pub fn SetHreflang(&self, _href_lang: &DOMString) -> ErrorResult { Ok(()) } - pub fn Type(&self) -> Option { - None + pub fn Type(&self) -> DOMString { + ~"" } - pub fn SetType(&mut self, _type: &Option) -> ErrorResult { + pub fn SetType(&mut self, _type: &DOMString) -> ErrorResult { Ok(()) } - pub fn Text(&self) -> Option { - None + pub fn Text(&self) -> DOMString { + ~"" } - pub fn SetText(&mut self, _text: &Option) -> ErrorResult { + pub fn SetText(&mut self, _text: &DOMString) -> ErrorResult { Ok(()) } - pub fn Coords(&self) -> Option { - None + pub fn Coords(&self) -> DOMString { + ~"" } - pub fn SetCoords(&mut self, _coords: &Option) -> ErrorResult { + pub fn SetCoords(&mut self, _coords: &DOMString) -> ErrorResult { Ok(()) } - pub fn Charset(&self) -> Option { - None + pub fn Charset(&self) -> DOMString { + ~"" } - pub fn SetCharset(&mut self, _charset: &Option) -> ErrorResult { + pub fn SetCharset(&mut self, _charset: &DOMString) -> ErrorResult { Ok(()) } - pub fn Name(&self) -> Option { - None + pub fn Name(&self) -> DOMString { + ~"" } - pub fn SetName(&mut self, _name: &Option) -> ErrorResult { + pub fn SetName(&mut self, _name: &DOMString) -> ErrorResult { Ok(()) } - pub fn Rev(&self) -> Option { - None + pub fn Rev(&self) -> DOMString { + ~"" } - pub fn SetRev(&mut self, _rev: &Option) -> ErrorResult { + pub fn SetRev(&mut self, _rev: &DOMString) -> ErrorResult { Ok(()) } - pub fn Shape(&self) -> Option { - None + pub fn Shape(&self) -> DOMString { + ~"" } - pub fn SetShape(&mut self, _shape: &Option) -> ErrorResult { + pub fn SetShape(&mut self, _shape: &DOMString) -> ErrorResult { Ok(()) } } diff --git a/src/components/script/dom/htmlappletelement.rs b/src/components/script/dom/htmlappletelement.rs index e2be12ceb09..bc61d7b48eb 100644 --- a/src/components/script/dom/htmlappletelement.rs +++ b/src/components/script/dom/htmlappletelement.rs @@ -27,51 +27,51 @@ impl HTMLAppletElement { } impl HTMLAppletElement { - pub fn Align(&self) -> Option { - None + pub fn Align(&self) -> DOMString { + ~"" } - pub fn SetAlign(&mut self, _align: &Option) -> ErrorResult { + pub fn SetAlign(&mut self, _align: &DOMString) -> ErrorResult { Ok(()) } - pub fn Alt(&self) -> Option { - None + pub fn Alt(&self) -> DOMString { + ~"" } - pub fn SetAlt(&self, _alt: &Option) -> ErrorResult { + pub fn SetAlt(&self, _alt: &DOMString) -> ErrorResult { Ok(()) } - pub fn Archive(&self) -> Option { - None + pub fn Archive(&self) -> DOMString { + ~"" } - pub fn SetArchive(&self, _archive: &Option) -> ErrorResult { + pub fn SetArchive(&self, _archive: &DOMString) -> ErrorResult { Ok(()) } - pub fn Code(&self) -> Option { - None + pub fn Code(&self) -> DOMString { + ~"" } - pub fn SetCode(&self, _code: &Option) -> ErrorResult { + pub fn SetCode(&self, _code: &DOMString) -> ErrorResult { Ok(()) } - pub fn CodeBase(&self) -> Option { - None + pub fn CodeBase(&self) -> DOMString { + ~"" } - pub fn SetCodeBase(&self, _code_base: &Option) -> ErrorResult { + pub fn SetCodeBase(&self, _code_base: &DOMString) -> ErrorResult { Ok(()) } - pub fn Height(&self) -> Option { - None + pub fn Height(&self) -> DOMString { + ~"" } - pub fn SetHeight(&self, _height: &Option) -> ErrorResult { + pub fn SetHeight(&self, _height: &DOMString) -> ErrorResult { Ok(()) } @@ -83,19 +83,19 @@ impl HTMLAppletElement { Ok(()) } - pub fn Name(&self) -> Option { - None + pub fn Name(&self) -> DOMString { + ~"" } - pub fn SetName(&mut self, _name: &Option) -> ErrorResult { + pub fn SetName(&mut self, _name: &DOMString) -> ErrorResult { Ok(()) } - pub fn Object(&self) -> Option { - None + pub fn Object(&self) -> DOMString { + ~"" } - pub fn SetObject(&mut self, _object: &Option) -> ErrorResult { + pub fn SetObject(&mut self, _object: &DOMString) -> ErrorResult { Ok(()) } @@ -107,11 +107,11 @@ impl HTMLAppletElement { Ok(()) } - pub fn Width(&self) -> Option { - None + pub fn Width(&self) -> DOMString { + ~"" } - pub fn SetWidth(&mut self, _width: &Option) -> ErrorResult { + pub fn SetWidth(&mut self, _width: &DOMString) -> ErrorResult { Ok(()) } } diff --git a/src/components/script/dom/htmlareaelement.rs b/src/components/script/dom/htmlareaelement.rs index 2a005020c2c..7f786c1e461 100644 --- a/src/components/script/dom/htmlareaelement.rs +++ b/src/components/script/dom/htmlareaelement.rs @@ -27,59 +27,59 @@ impl HTMLAreaElement { } impl HTMLAreaElement { - pub fn Alt(&self) -> Option { - None + pub fn Alt(&self) -> DOMString { + ~"" } - pub fn SetAlt(&self, _alt: &Option) -> ErrorResult { + pub fn SetAlt(&self, _alt: &DOMString) -> ErrorResult { Ok(()) } - pub fn Coords(&self) -> Option { - None + pub fn Coords(&self) -> DOMString { + ~"" } - pub fn SetCoords(&self, _coords: &Option) -> ErrorResult { + pub fn SetCoords(&self, _coords: &DOMString) -> ErrorResult { Ok(()) } - pub fn Shape(&self) -> Option { - None + pub fn Shape(&self) -> DOMString { + ~"" } - pub fn SetShape(&self, _shape: &Option) -> ErrorResult { + pub fn SetShape(&self, _shape: &DOMString) -> ErrorResult { Ok(()) } - pub fn Href(&self) -> Option { - None + pub fn Href(&self) -> DOMString { + ~"" } - pub fn SetHref(&self, _href: &Option) -> ErrorResult { + pub fn SetHref(&self, _href: &DOMString) -> ErrorResult { Ok(()) } - pub fn Target(&self) -> Option { - None + pub fn Target(&self) -> DOMString { + ~"" } - pub fn SetTarget(&self, _target: &Option) -> ErrorResult { + pub fn SetTarget(&self, _target: &DOMString) -> ErrorResult { Ok(()) } - pub fn Download(&self) -> Option { - None + pub fn Download(&self) -> DOMString { + ~"" } - pub fn SetDownload(&self, _download: &Option) -> ErrorResult { + pub fn SetDownload(&self, _download: &DOMString) -> ErrorResult { Ok(()) } - pub fn Ping(&self) -> Option { - None + pub fn Ping(&self) -> DOMString { + ~"" } - pub fn SetPing(&self, _ping: &Option) -> ErrorResult { + pub fn SetPing(&self, _ping: &DOMString) -> ErrorResult { Ok(()) } diff --git a/src/components/script/dom/htmlbaseelement.rs b/src/components/script/dom/htmlbaseelement.rs index 47b61ebbd86..4ea0dbe457b 100644 --- a/src/components/script/dom/htmlbaseelement.rs +++ b/src/components/script/dom/htmlbaseelement.rs @@ -27,19 +27,19 @@ impl HTMLBaseElement { } impl HTMLBaseElement { - pub fn Href(&self) -> Option { - None + pub fn Href(&self) -> DOMString { + ~"" } - pub fn SetHref(&self, _href: &Option) -> ErrorResult { + pub fn SetHref(&self, _href: &DOMString) -> ErrorResult { Ok(()) } - pub fn Target(&self) -> Option { - None + pub fn Target(&self) -> DOMString { + ~"" } - pub fn SetTarget(&self, _target: &Option) -> ErrorResult { + pub fn SetTarget(&self, _target: &DOMString) -> ErrorResult { Ok(()) } } diff --git a/src/components/script/dom/htmlbodyelement.rs b/src/components/script/dom/htmlbodyelement.rs index 1c812c0652f..05468113282 100644 --- a/src/components/script/dom/htmlbodyelement.rs +++ b/src/components/script/dom/htmlbodyelement.rs @@ -27,51 +27,51 @@ impl HTMLBodyElement { } impl HTMLBodyElement { - pub fn Text(&self) -> Option { - None + pub fn Text(&self) -> DOMString { + ~"" } - pub fn SetText(&mut self, _text: &Option) -> ErrorResult { + pub fn SetText(&mut self, _text: &DOMString) -> ErrorResult { Ok(()) } - pub fn Link(&self) -> Option { - None + pub fn Link(&self) -> DOMString { + ~"" } - pub fn SetLink(&self, _link: &Option) -> ErrorResult { + pub fn SetLink(&self, _link: &DOMString) -> ErrorResult { Ok(()) } - pub fn VLink(&self) -> Option { - None + pub fn VLink(&self) -> DOMString { + ~"" } - pub fn SetVLink(&self, _v_link: &Option) -> ErrorResult { + pub fn SetVLink(&self, _v_link: &DOMString) -> ErrorResult { Ok(()) } - pub fn ALink(&self) -> Option { - None + pub fn ALink(&self) -> DOMString { + ~"" } - pub fn SetALink(&self, _a_link: &Option) -> ErrorResult { + pub fn SetALink(&self, _a_link: &DOMString) -> ErrorResult { Ok(()) } - pub fn BgColor(&self) -> Option { - None + pub fn BgColor(&self) -> DOMString { + ~"" } - pub fn SetBgColor(&self, _bg_color: &Option) -> ErrorResult { + pub fn SetBgColor(&self, _bg_color: &DOMString) -> ErrorResult { Ok(()) } - pub fn Background(&self) -> Option { - None + pub fn Background(&self) -> DOMString { + ~"" } - pub fn SetBackground(&self, _background: &Option) -> ErrorResult { + pub fn SetBackground(&self, _background: &DOMString) -> ErrorResult { Ok(()) } } diff --git a/src/components/script/dom/htmlbrelement.rs b/src/components/script/dom/htmlbrelement.rs index b216171394c..49ee1afddc0 100644 --- a/src/components/script/dom/htmlbrelement.rs +++ b/src/components/script/dom/htmlbrelement.rs @@ -27,11 +27,11 @@ impl HTMLBRElement { } impl HTMLBRElement { - pub fn Clear(&self) -> Option { - None + pub fn Clear(&self) -> DOMString { + ~"" } - pub fn SetClear(&mut self, _text: &Option) -> ErrorResult { + pub fn SetClear(&mut self, _text: &DOMString) -> ErrorResult { Ok(()) } } diff --git a/src/components/script/dom/htmlbuttonelement.rs b/src/components/script/dom/htmlbuttonelement.rs index fbf81b5f0dd..b57d51bd2ed 100644 --- a/src/components/script/dom/htmlbuttonelement.rs +++ b/src/components/script/dom/htmlbuttonelement.rs @@ -48,27 +48,27 @@ impl HTMLButtonElement { None } - pub fn FormAction(&self) -> Option { - None + pub fn FormAction(&self) -> DOMString { + ~"" } - pub fn SetFormAction(&mut self, _formaction: &Option) -> ErrorResult { + pub fn SetFormAction(&mut self, _formaction: &DOMString) -> ErrorResult { Ok(()) } - pub fn FormEnctype(&self) -> Option { - None + pub fn FormEnctype(&self) -> DOMString { + ~"" } - pub fn SetFormEnctype(&mut self, _formenctype: &Option) -> ErrorResult { + pub fn SetFormEnctype(&mut self, _formenctype: &DOMString) -> ErrorResult { Ok(()) } - pub fn FormMethod(&self) -> Option { - None + pub fn FormMethod(&self) -> DOMString { + ~"" } - pub fn SetFormMethod(&mut self, _formmethod: &Option) -> ErrorResult { + pub fn SetFormMethod(&mut self, _formmethod: &DOMString) -> ErrorResult { Ok(()) } @@ -80,35 +80,35 @@ impl HTMLButtonElement { Ok(()) } - pub fn FormTarget(&self) -> Option { - None + pub fn FormTarget(&self) -> DOMString { + ~"" } - pub fn SetFormTarget(&mut self, _formtarget: &Option) -> ErrorResult { + pub fn SetFormTarget(&mut self, _formtarget: &DOMString) -> ErrorResult { Ok(()) } - pub fn Name(&self) -> Option { - None + pub fn Name(&self) -> DOMString { + ~"" } - pub fn SetName(&mut self, _name: &Option) -> ErrorResult { + pub fn SetName(&mut self, _name: &DOMString) -> ErrorResult { Ok(()) } - pub fn Type(&self) -> Option { - None + pub fn Type(&self) -> DOMString { + ~"" } - pub fn SetType(&mut self, _type: &Option) -> ErrorResult { + pub fn SetType(&mut self, _type: &DOMString) -> ErrorResult { Ok(()) } - pub fn Value(&self) -> Option { - None + pub fn Value(&self) -> DOMString { + ~"" } - pub fn SetValue(&mut self, _value: &Option) -> ErrorResult { + pub fn SetValue(&mut self, _value: &DOMString) -> ErrorResult { Ok(()) } @@ -127,11 +127,11 @@ impl HTMLButtonElement { pub fn SetValidity(&mut self, _validity: @mut ValidityState) { } - pub fn ValidationMessage(&self) -> Option { - None + pub fn ValidationMessage(&self) -> DOMString { + ~"" } - pub fn SetValidationMessage(&mut self, _message: &Option) -> ErrorResult { + pub fn SetValidationMessage(&mut self, _message: &DOMString) -> ErrorResult { Ok(()) } @@ -139,6 +139,6 @@ impl HTMLButtonElement { true } - pub fn SetCustomValidity(&mut self, _error: &Option) { + pub fn SetCustomValidity(&mut self, _error: &DOMString) { } } diff --git a/src/components/script/dom/htmlcollection.rs b/src/components/script/dom/htmlcollection.rs index b42277d72ad..c54606ba108 100644 --- a/src/components/script/dom/htmlcollection.rs +++ b/src/components/script/dom/htmlcollection.rs @@ -46,7 +46,7 @@ impl HTMLCollection { } } - pub fn NamedItem(&self, _cx: *JSContext, _name: &Option) -> Fallible<*JSObject> { + pub fn NamedItem(&self, _cx: *JSContext, _name: &DOMString) -> Fallible<*JSObject> { Ok(ptr::null()) } diff --git a/src/components/script/dom/htmldataelement.rs b/src/components/script/dom/htmldataelement.rs index 7c367f9f300..609cae1029e 100644 --- a/src/components/script/dom/htmldataelement.rs +++ b/src/components/script/dom/htmldataelement.rs @@ -27,11 +27,11 @@ impl HTMLDataElement { } impl HTMLDataElement { - pub fn Value(&self) -> Option { - None + pub fn Value(&self) -> DOMString { + ~"" } - pub fn SetValue(&mut self, _value: &Option) -> ErrorResult { + pub fn SetValue(&mut self, _value: &DOMString) -> ErrorResult { Ok(()) } } diff --git a/src/components/script/dom/htmldivelement.rs b/src/components/script/dom/htmldivelement.rs index 11d56dd1eda..62811cf7a3c 100644 --- a/src/components/script/dom/htmldivelement.rs +++ b/src/components/script/dom/htmldivelement.rs @@ -27,11 +27,11 @@ impl HTMLDivElement { } impl HTMLDivElement { - pub fn Align(&self) -> Option { - None + pub fn Align(&self) -> DOMString { + ~"" } - pub fn SetAlign(&mut self, _align: &Option) -> ErrorResult { + pub fn SetAlign(&mut self, _align: &DOMString) -> ErrorResult { Ok(()) } } diff --git a/src/components/script/dom/htmldlistelement.rs b/src/components/script/dom/htmldlistelement.rs index 96647e53794..ce7ceca98de 100644 --- a/src/components/script/dom/htmldlistelement.rs +++ b/src/components/script/dom/htmldlistelement.rs @@ -35,11 +35,11 @@ impl HTMLDListElement { Ok(()) } - pub fn Type(&self) -> Option { - None + pub fn Type(&self) -> DOMString { + ~"" } - pub fn SetType(&mut self, _type: &Option) -> ErrorResult { + pub fn SetType(&mut self, _type: &DOMString) -> ErrorResult { Ok(()) } } diff --git a/src/components/script/dom/htmlelement.rs b/src/components/script/dom/htmlelement.rs index e157a79f520..a5291e5b575 100644 --- a/src/components/script/dom/htmlelement.rs +++ b/src/components/script/dom/htmlelement.rs @@ -28,25 +28,25 @@ impl HTMLElement { } impl HTMLElement { - pub fn Title(&self) -> Option { - None + pub fn Title(&self) -> DOMString { + ~"" } - pub fn SetTitle(&mut self, _title: &Option) { + pub fn SetTitle(&mut self, _title: &DOMString) { } - pub fn Lang(&self) -> Option { - None + pub fn Lang(&self) -> DOMString { + ~"" } - pub fn SetLang(&mut self, _lang: &Option) { + pub fn SetLang(&mut self, _lang: &DOMString) { } - pub fn Dir(&self) -> Option { - None + pub fn Dir(&self) -> DOMString { + ~"" } - pub fn SetDir(&mut self, _dir: &Option) -> ErrorResult { + pub fn SetDir(&mut self, _dir: &DOMString) -> ErrorResult { Ok(()) } @@ -85,16 +85,16 @@ impl HTMLElement { Ok(()) } - pub fn AccessKey(&self) -> Option { - None + pub fn AccessKey(&self) -> DOMString { + ~"" } - pub fn SetAccessKey(&self, _key: &Option) -> ErrorResult { + pub fn SetAccessKey(&self, _key: &DOMString) -> ErrorResult { Ok(()) } - pub fn AccessKeyLabel(&self) -> Option { - None + pub fn AccessKeyLabel(&self) -> DOMString { + ~"" } pub fn Draggable(&self) -> bool { @@ -105,11 +105,11 @@ impl HTMLElement { Ok(()) } - pub fn ContentEditable(&self) -> Option { - None + pub fn ContentEditable(&self) -> DOMString { + ~"" } - pub fn SetContentEditable(&mut self, _val: &Option) -> ErrorResult { + pub fn SetContentEditable(&mut self, _val: &DOMString) -> ErrorResult { Ok(()) } @@ -125,11 +125,11 @@ impl HTMLElement { Ok(()) } - pub fn ClassName(&self) -> Option { - None + pub fn ClassName(&self) -> DOMString { + ~"" } - pub fn SetClassName(&self, _class: &Option) { + pub fn SetClassName(&self, _class: &DOMString) { } pub fn GetOffsetParent(&self) -> Option> { diff --git a/src/components/script/dom/htmlembedelement.rs b/src/components/script/dom/htmlembedelement.rs index e1e6151918c..747d5f218f7 100644 --- a/src/components/script/dom/htmlembedelement.rs +++ b/src/components/script/dom/htmlembedelement.rs @@ -27,51 +27,51 @@ impl HTMLEmbedElement { } impl HTMLEmbedElement { - pub fn Src(&self) -> Option { - None + pub fn Src(&self) -> DOMString { + ~"" } - pub fn SetSrc(&mut self, _src: &Option) -> ErrorResult { + pub fn SetSrc(&mut self, _src: &DOMString) -> ErrorResult { Ok(()) } - pub fn Type(&self) -> Option { - None + pub fn Type(&self) -> DOMString { + ~"" } - pub fn SetType(&mut self, _type: &Option) -> ErrorResult { + pub fn SetType(&mut self, _type: &DOMString) -> ErrorResult { Ok(()) } - pub fn Width(&self) -> Option { - None + pub fn Width(&self) -> DOMString { + ~"" } - pub fn SetWidth(&mut self, _width: &Option) -> ErrorResult { + pub fn SetWidth(&mut self, _width: &DOMString) -> ErrorResult { Ok(()) } - pub fn Height(&self) -> Option { - None + pub fn Height(&self) -> DOMString { + ~"" } - pub fn SetHeight(&mut self, _height: &Option) -> ErrorResult { + pub fn SetHeight(&mut self, _height: &DOMString) -> ErrorResult { Ok(()) } - pub fn Align(&self) -> Option { - None + pub fn Align(&self) -> DOMString { + ~"" } - pub fn SetAlign(&mut self, _type: &Option) -> ErrorResult { + pub fn SetAlign(&mut self, _type: &DOMString) -> ErrorResult { Ok(()) } - pub fn Name(&self) -> Option { - None + pub fn Name(&self) -> DOMString { + ~"" } - pub fn SetName(&mut self, _type: &Option) -> ErrorResult { + pub fn SetName(&mut self, _type: &DOMString) -> ErrorResult { Ok(()) } diff --git a/src/components/script/dom/htmlfieldsetelement.rs b/src/components/script/dom/htmlfieldsetelement.rs index 5c87ea51f47..d5c1fc659c0 100644 --- a/src/components/script/dom/htmlfieldsetelement.rs +++ b/src/components/script/dom/htmlfieldsetelement.rs @@ -41,16 +41,16 @@ impl HTMLFieldSetElement { None } - pub fn Name(&self) -> Option { - None + pub fn Name(&self) -> DOMString { + ~"" } - pub fn SetName(&mut self, _name: &Option) -> ErrorResult { + pub fn SetName(&mut self, _name: &DOMString) -> ErrorResult { Ok(()) } - pub fn Type(&self) -> Option { - None + pub fn Type(&self) -> DOMString { + ~"" } pub fn Elements(&self) -> @mut HTMLCollection { @@ -67,14 +67,14 @@ impl HTMLFieldSetElement { ValidityState::new(global) } - pub fn ValidationMessage(&self) -> Option { - None + pub fn ValidationMessage(&self) -> DOMString { + ~"" } pub fn CheckValidity(&self) -> bool { false } - pub fn SetCustomValidity(&mut self, _error: &Option) { + pub fn SetCustomValidity(&mut self, _error: &DOMString) { } } diff --git a/src/components/script/dom/htmlfontelement.rs b/src/components/script/dom/htmlfontelement.rs index 6ddf3491dbf..43b60973dcb 100644 --- a/src/components/script/dom/htmlfontelement.rs +++ b/src/components/script/dom/htmlfontelement.rs @@ -27,27 +27,27 @@ impl HTMLFontElement { } impl HTMLFontElement { - pub fn Color(&self) -> Option { - None + pub fn Color(&self) -> DOMString { + ~"" } - pub fn SetColor(&mut self, _color: &Option) -> ErrorResult { + pub fn SetColor(&mut self, _color: &DOMString) -> ErrorResult { Ok(()) } - pub fn Face(&self) -> Option { - None + pub fn Face(&self) -> DOMString { + ~"" } - pub fn SetFace(&mut self, _face: &Option) -> ErrorResult { + pub fn SetFace(&mut self, _face: &DOMString) -> ErrorResult { Ok(()) } - pub fn Size(&self) -> Option { - None + pub fn Size(&self) -> DOMString { + ~"" } - pub fn SetSize(&mut self, _size: &Option) -> ErrorResult { + pub fn SetSize(&mut self, _size: &DOMString) -> ErrorResult { Ok(()) } } diff --git a/src/components/script/dom/htmlformelement.rs b/src/components/script/dom/htmlformelement.rs index 5d81fabd0d0..ff207ae4535 100644 --- a/src/components/script/dom/htmlformelement.rs +++ b/src/components/script/dom/htmlformelement.rs @@ -28,59 +28,59 @@ impl HTMLFormElement { } impl HTMLFormElement { - pub fn AcceptCharset(&self) -> Option { - None + pub fn AcceptCharset(&self) -> DOMString { + ~"" } - pub fn SetAcceptCharset(&mut self, _accept_charset: &Option) -> ErrorResult { + pub fn SetAcceptCharset(&mut self, _accept_charset: &DOMString) -> ErrorResult { Ok(()) } - pub fn Action(&self) -> Option { - None + pub fn Action(&self) -> DOMString { + ~"" } - pub fn SetAction(&mut self, _action: &Option) -> ErrorResult { + pub fn SetAction(&mut self, _action: &DOMString) -> ErrorResult { Ok(()) } - pub fn Autocomplete(&self) -> Option { - None + pub fn Autocomplete(&self) -> DOMString { + ~"" } - pub fn SetAutocomplete(&mut self, _autocomplete: &Option) -> ErrorResult { + pub fn SetAutocomplete(&mut self, _autocomplete: &DOMString) -> ErrorResult { Ok(()) } - pub fn Enctype(&self) -> Option { - None + pub fn Enctype(&self) -> DOMString { + ~"" } - pub fn SetEnctype(&mut self, _enctype: &Option) -> ErrorResult { + pub fn SetEnctype(&mut self, _enctype: &DOMString) -> ErrorResult { Ok(()) } - pub fn Encoding(&self) -> Option { - None + pub fn Encoding(&self) -> DOMString { + ~"" } - pub fn SetEncoding(&mut self, _encoding: &Option) -> ErrorResult { + pub fn SetEncoding(&mut self, _encoding: &DOMString) -> ErrorResult { Ok(()) } - pub fn Method(&self) -> Option { - None + pub fn Method(&self) -> DOMString { + ~"" } - pub fn SetMethod(&mut self, _method: &Option) -> ErrorResult { + pub fn SetMethod(&mut self, _method: &DOMString) -> ErrorResult { Ok(()) } - pub fn Name(&self) -> Option { - None + pub fn Name(&self) -> DOMString { + ~"" } - pub fn SetName(&mut self, _name: &Option) -> ErrorResult { + pub fn SetName(&mut self, _name: &DOMString) -> ErrorResult { Ok(()) } @@ -92,11 +92,11 @@ impl HTMLFormElement { Ok(()) } - pub fn Target(&self) -> Option { - None + pub fn Target(&self) -> DOMString { + ~"" } - pub fn SetTarget(&mut self, _target: &Option) -> ErrorResult { + pub fn SetTarget(&mut self, _target: &DOMString) -> ErrorResult { Ok(()) } diff --git a/src/components/script/dom/htmlframeelement.rs b/src/components/script/dom/htmlframeelement.rs index 7a688fa4cc6..8ccefd328ce 100644 --- a/src/components/script/dom/htmlframeelement.rs +++ b/src/components/script/dom/htmlframeelement.rs @@ -28,43 +28,43 @@ impl HTMLFrameElement { } impl HTMLFrameElement { - pub fn Name(&self) -> Option { - None + pub fn Name(&self) -> DOMString { + ~"" } - pub fn SetName(&mut self, _name: &Option) -> ErrorResult { + pub fn SetName(&mut self, _name: &DOMString) -> ErrorResult { Ok(()) } - pub fn Scrolling(&self) -> Option { - None + pub fn Scrolling(&self) -> DOMString { + ~"" } - pub fn SetScrolling(&mut self, _scrolling: &Option) -> ErrorResult { + pub fn SetScrolling(&mut self, _scrolling: &DOMString) -> ErrorResult { Ok(()) } - pub fn Src(&self) -> Option { - None + pub fn Src(&self) -> DOMString { + ~"" } - pub fn SetSrc(&mut self, _src: &Option) -> ErrorResult { + pub fn SetSrc(&mut self, _src: &DOMString) -> ErrorResult { Ok(()) } - pub fn FrameBorder(&self) -> Option { - None + pub fn FrameBorder(&self) -> DOMString { + ~"" } - pub fn SetFrameBorder(&mut self, _frameborder: &Option) -> ErrorResult { + pub fn SetFrameBorder(&mut self, _frameborder: &DOMString) -> ErrorResult { Ok(()) } - pub fn LongDesc(&self) -> Option { - None + pub fn LongDesc(&self) -> DOMString { + ~"" } - pub fn SetLongDesc(&mut self, _longdesc: &Option) -> ErrorResult { + pub fn SetLongDesc(&mut self, _longdesc: &DOMString) -> ErrorResult { Ok(()) } @@ -84,19 +84,19 @@ impl HTMLFrameElement { None } - pub fn MarginHeight(&self) -> Option { - None + pub fn MarginHeight(&self) -> DOMString { + ~"" } - pub fn SetMarginHeight(&mut self, _height: &Option) -> ErrorResult { + pub fn SetMarginHeight(&mut self, _height: &DOMString) -> ErrorResult { Ok(()) } - pub fn MarginWidth(&self) -> Option { - None + pub fn MarginWidth(&self) -> DOMString { + ~"" } - pub fn SetMarginWidth(&mut self, _height: &Option) -> ErrorResult { + pub fn SetMarginWidth(&mut self, _height: &DOMString) -> ErrorResult { Ok(()) } } diff --git a/src/components/script/dom/htmlframesetelement.rs b/src/components/script/dom/htmlframesetelement.rs index 56490e9ca2a..f5d9404654c 100644 --- a/src/components/script/dom/htmlframesetelement.rs +++ b/src/components/script/dom/htmlframesetelement.rs @@ -27,19 +27,19 @@ impl HTMLFrameSetElement { } impl HTMLFrameSetElement { - pub fn Cols(&self) -> Option { - None + pub fn Cols(&self) -> DOMString { + ~"" } - pub fn SetCols(&mut self, _cols: &Option) -> ErrorResult { + pub fn SetCols(&mut self, _cols: &DOMString) -> ErrorResult { Ok(()) } - pub fn Rows(&self) -> Option { - None + pub fn Rows(&self) -> DOMString { + ~"" } - pub fn SetRows(&mut self, _rows: &Option) -> ErrorResult { + pub fn SetRows(&mut self, _rows: &DOMString) -> ErrorResult { Ok(()) } } diff --git a/src/components/script/dom/htmlheadingelement.rs b/src/components/script/dom/htmlheadingelement.rs index 2e5c4db10a2..cce5eaf11ea 100644 --- a/src/components/script/dom/htmlheadingelement.rs +++ b/src/components/script/dom/htmlheadingelement.rs @@ -38,10 +38,10 @@ impl HTMLHeadingElement { } impl HTMLHeadingElement { - pub fn Align(&self) -> Option { - None + pub fn Align(&self) -> DOMString { + ~"" } - pub fn SetAlign(&mut self, _align: &Option) { + pub fn SetAlign(&mut self, _align: &DOMString) { } } diff --git a/src/components/script/dom/htmlhrelement.rs b/src/components/script/dom/htmlhrelement.rs index 222cc397a24..40be15ef330 100644 --- a/src/components/script/dom/htmlhrelement.rs +++ b/src/components/script/dom/htmlhrelement.rs @@ -27,19 +27,19 @@ impl HTMLHRElement { } impl HTMLHRElement { - pub fn Align(&self) -> Option { - None + pub fn Align(&self) -> DOMString { + ~"" } - pub fn SetAlign(&mut self, _align: &Option) -> ErrorResult { + pub fn SetAlign(&mut self, _align: &DOMString) -> ErrorResult { Ok(()) } - pub fn Color(&self) -> Option { - None + pub fn Color(&self) -> DOMString { + ~"" } - pub fn SetColor(&mut self, _color: &Option) -> ErrorResult { + pub fn SetColor(&mut self, _color: &DOMString) -> ErrorResult { Ok(()) } @@ -51,19 +51,19 @@ impl HTMLHRElement { Ok(()) } - pub fn Size(&self) -> Option { - None + pub fn Size(&self) -> DOMString { + ~"" } - pub fn SetSize(&mut self, _size: &Option) -> ErrorResult { + pub fn SetSize(&mut self, _size: &DOMString) -> ErrorResult { Ok(()) } - pub fn Width(&self) -> Option { - None + pub fn Width(&self) -> DOMString { + ~"" } - pub fn SetWidth(&mut self, _width: &Option) -> ErrorResult { + pub fn SetWidth(&mut self, _width: &DOMString) -> ErrorResult { Ok(()) } } diff --git a/src/components/script/dom/htmlhtmlelement.rs b/src/components/script/dom/htmlhtmlelement.rs index 1a14961fab6..31b4e0f99de 100644 --- a/src/components/script/dom/htmlhtmlelement.rs +++ b/src/components/script/dom/htmlhtmlelement.rs @@ -27,11 +27,11 @@ impl HTMLHtmlElement { } impl HTMLHtmlElement { - pub fn Version(&self) -> Option { - None + pub fn Version(&self) -> DOMString { + ~"" } - pub fn SetVersion(&mut self, _version: &Option) -> ErrorResult { + pub fn SetVersion(&mut self, _version: &DOMString) -> ErrorResult { Ok(()) } } diff --git a/src/components/script/dom/htmliframeelement.rs b/src/components/script/dom/htmliframeelement.rs index f93d28b61ae..f0bc904e54a 100644 --- a/src/components/script/dom/htmliframeelement.rs +++ b/src/components/script/dom/htmliframeelement.rs @@ -3,7 +3,7 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ use dom::bindings::codegen::HTMLIFrameElementBinding; -use dom::bindings::utils::{DOMString, ErrorResult, null_str_as_empty}; +use dom::bindings::utils::{DOMString, ErrorResult}; use dom::document::AbstractDocument; use dom::element::HTMLIframeElementTypeId; use dom::htmlelement::HTMLElement; @@ -77,44 +77,45 @@ impl HTMLIFrameElement { } impl HTMLIFrameElement { - pub fn Src(&self) -> Option { - None + pub fn Src(&self) -> DOMString { + ~"" } - pub fn SetSrc(&mut self, _src: &Option) -> ErrorResult { + pub fn SetSrc(&mut self, _src: &DOMString) -> ErrorResult { Ok(()) } - pub fn Srcdoc(&self) -> Option { - None + pub fn Srcdoc(&self) -> DOMString { + ~"" } - pub fn SetSrcdoc(&mut self, _srcdoc: &Option) -> ErrorResult { + pub fn SetSrcdoc(&mut self, _srcdoc: &DOMString) -> ErrorResult { Ok(()) } - pub fn Name(&self) -> Option { - None + pub fn Name(&self) -> DOMString { + ~"" } - pub fn SetName(&mut self, _name: &Option) -> ErrorResult { + pub fn SetName(&mut self, _name: &DOMString) -> ErrorResult { Ok(()) } - pub fn Sandbox(&self, _abstract_self: AbstractNode) -> Option { - self.htmlelement.element.GetAttribute(&Some(~"sandbox")) + pub fn Sandbox(&self, _abstract_self: AbstractNode) -> DOMString { + match self.htmlelement.element.GetAttribute(&~"sandbox") { + Some(s) => s.to_owned(), + None => ~"", + } } - pub fn SetSandbox(&mut self, abstract_self: AbstractNode, sandbox: &Option) { - self.htmlelement.element.SetAttribute(abstract_self, &Some(~"sandbox"), sandbox); + pub fn SetSandbox(&mut self, abstract_self: AbstractNode, sandbox: &DOMString) { + self.htmlelement.element.SetAttribute(abstract_self, &~"sandbox", sandbox); } - pub fn AfterSetAttr(&mut self, name: &Option, value: &Option) { - let name = null_str_as_empty(name); - if "sandbox" == name { + pub fn AfterSetAttr(&mut self, name: &DOMString, value: &DOMString) { + if "sandbox" == *name { let mut modes = AllowNothing as u8; - let words = null_str_as_empty(value); - for word in words.split_iter(' ') { + for word in value.split_iter(' ') { modes |= match word.to_ascii_lower().as_slice() { "allow-same-origin" => AllowSameOrigin, "allow-forms" => AllowForms, @@ -137,19 +138,19 @@ impl HTMLIFrameElement { Ok(()) } - pub fn Width(&self) -> Option { - None + pub fn Width(&self) -> DOMString { + ~"" } - pub fn SetWidth(&mut self, _width: &Option) -> ErrorResult { + pub fn SetWidth(&mut self, _width: &DOMString) -> ErrorResult { Ok(()) } - pub fn Height(&self) -> Option { - None + pub fn Height(&self) -> DOMString { + ~"" } - pub fn SetHeight(&mut self, _height: &Option) -> ErrorResult { + pub fn SetHeight(&mut self, _height: &DOMString) -> ErrorResult { Ok(()) } @@ -161,51 +162,51 @@ impl HTMLIFrameElement { None } - pub fn Align(&self) -> Option { - None + pub fn Align(&self) -> DOMString { + ~"" } - pub fn SetAlign(&mut self, _align: &Option) -> ErrorResult { + pub fn SetAlign(&mut self, _align: &DOMString) -> ErrorResult { Ok(()) } - pub fn Scrolling(&self) -> Option { - None + pub fn Scrolling(&self) -> DOMString { + ~"" } - pub fn SetScrolling(&mut self, _scrolling: &Option) -> ErrorResult { + pub fn SetScrolling(&mut self, _scrolling: &DOMString) -> ErrorResult { Ok(()) } - pub fn FrameBorder(&self) -> Option { - None + pub fn FrameBorder(&self) -> DOMString { + ~"" } - pub fn SetFrameBorder(&mut self, _frameborder: &Option) -> ErrorResult { + pub fn SetFrameBorder(&mut self, _frameborder: &DOMString) -> ErrorResult { Ok(()) } - pub fn LongDesc(&self) -> Option { - None + pub fn LongDesc(&self) -> DOMString { + ~"" } - pub fn SetLongDesc(&mut self, _longdesc: &Option) -> ErrorResult { + pub fn SetLongDesc(&mut self, _longdesc: &DOMString) -> ErrorResult { Ok(()) } - pub fn MarginHeight(&self) -> Option { - None + pub fn MarginHeight(&self) -> DOMString { + ~"" } - pub fn SetMarginHeight(&mut self, _marginheight: &Option) -> ErrorResult { + pub fn SetMarginHeight(&mut self, _marginheight: &DOMString) -> ErrorResult { Ok(()) } - pub fn MarginWidth(&self) -> Option { - None + pub fn MarginWidth(&self) -> DOMString { + ~"" } - pub fn SetMarginWidth(&mut self, _marginwidth: &Option) -> ErrorResult { + pub fn SetMarginWidth(&mut self, _marginwidth: &DOMString) -> ErrorResult { Ok(()) } diff --git a/src/components/script/dom/htmlimageelement.rs b/src/components/script/dom/htmlimageelement.rs index 0f34f1a52f2..ea5aeabc541 100644 --- a/src/components/script/dom/htmlimageelement.rs +++ b/src/components/script/dom/htmlimageelement.rs @@ -3,7 +3,7 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ use dom::bindings::codegen::HTMLImageElementBinding; -use dom::bindings::utils::{DOMString, ErrorResult, null_str_as_empty}; +use dom::bindings::utils::{DOMString, ErrorResult}; use dom::document::AbstractDocument; use dom::element::HTMLImageElementTypeId; use dom::htmlelement::HTMLElement; @@ -57,9 +57,8 @@ impl HTMLImageElement { } } - pub fn AfterSetAttr(&mut self, name: &Option, _value: &Option) { - let name = null_str_as_empty(name); - if "src" == name { + pub fn AfterSetAttr(&mut self, name: &DOMString, _value: &DOMString) { + if "src" == *name { let document = self.htmlelement.element.node.owner_doc(); let window = document.document().window; let url = window.page.url.as_ref().map(|&(ref url, _)| url.clone()); @@ -67,41 +66,41 @@ impl HTMLImageElement { } } - pub fn Alt(&self) -> Option { - None + pub fn Alt(&self) -> DOMString { + ~"" } - pub fn SetAlt(&mut self, _alt: &Option) -> ErrorResult { + pub fn SetAlt(&mut self, _alt: &DOMString) -> ErrorResult { Ok(()) } - pub fn Src(&self, _abstract_self: AbstractNode) -> Option { - None + pub fn Src(&self, _abstract_self: AbstractNode) -> DOMString { + ~"" } pub fn SetSrc(&mut self, abstract_self: AbstractNode, - src: &Option) -> ErrorResult { + src: &DOMString) -> ErrorResult { let node = &mut self.htmlelement.element; node.set_attr(abstract_self, &Some(~"src"), - &Some(null_str_as_empty(src))); + &Some(src.clone())); Ok(()) } - pub fn CrossOrigin(&self) -> Option { - None + pub fn CrossOrigin(&self) -> DOMString { + ~"" } - pub fn SetCrossOrigin(&mut self, _cross_origin: &Option) -> ErrorResult { + pub fn SetCrossOrigin(&mut self, _cross_origin: &DOMString) -> ErrorResult { Ok(()) } - pub fn UseMap(&self) -> Option { - None + pub fn UseMap(&self) -> DOMString { + ~"" } - pub fn SetUseMap(&mut self, _use_map: &Option) -> ErrorResult { + pub fn SetUseMap(&mut self, _use_map: &DOMString) -> ErrorResult { Ok(()) } @@ -167,19 +166,19 @@ impl HTMLImageElement { false } - pub fn Name(&self) -> Option { - None + pub fn Name(&self) -> DOMString { + ~"" } - pub fn SetName(&mut self, _name: &Option) -> ErrorResult { + pub fn SetName(&mut self, _name: &DOMString) -> ErrorResult { Ok(()) } - pub fn Align(&self) -> Option { - None + pub fn Align(&self) -> DOMString { + ~"" } - pub fn SetAlign(&mut self, _align: &Option) -> ErrorResult { + pub fn SetAlign(&mut self, _align: &DOMString) -> ErrorResult { Ok(()) } @@ -199,19 +198,19 @@ impl HTMLImageElement { Ok(()) } - pub fn LongDesc(&self) -> Option { - None + pub fn LongDesc(&self) -> DOMString { + ~"" } - pub fn SetLongDesc(&mut self, _longdesc: &Option) -> ErrorResult { + pub fn SetLongDesc(&mut self, _longdesc: &DOMString) -> ErrorResult { Ok(()) } - pub fn Border(&self) -> Option { - None + pub fn Border(&self) -> DOMString { + ~"" } - pub fn SetBorder(&mut self, _border: &Option) -> ErrorResult { + pub fn SetBorder(&mut self, _border: &DOMString) -> ErrorResult { Ok(()) } } diff --git a/src/components/script/dom/htmlinputelement.rs b/src/components/script/dom/htmlinputelement.rs index b6b4c7786c6..59ec882568a 100644 --- a/src/components/script/dom/htmlinputelement.rs +++ b/src/components/script/dom/htmlinputelement.rs @@ -27,27 +27,27 @@ impl HTMLInputElement { } impl HTMLInputElement { - pub fn Accept(&self) -> Option { - None + pub fn Accept(&self) -> DOMString { + ~"" } - pub fn SetAccept(&mut self, _accept: &Option) -> ErrorResult { + pub fn SetAccept(&mut self, _accept: &DOMString) -> ErrorResult { Ok(()) } - pub fn Alt(&self) -> Option { - None + pub fn Alt(&self) -> DOMString { + ~"" } - pub fn SetAlt(&mut self, _alt: &Option) -> ErrorResult { + pub fn SetAlt(&mut self, _alt: &DOMString) -> ErrorResult { Ok(()) } - pub fn Autocomplete(&self) -> Option { - None + pub fn Autocomplete(&self) -> DOMString { + ~"" } - pub fn SetAutocomplete(&mut self, _autocomple: &Option) -> ErrorResult { + pub fn SetAutocomplete(&mut self, _autocomple: &DOMString) -> ErrorResult { Ok(()) } @@ -82,27 +82,27 @@ impl HTMLInputElement { Ok(()) } - pub fn FormAction(&self) -> Option { - None + pub fn FormAction(&self) -> DOMString { + ~"" } - pub fn SetFormAction(&mut self, _form_action: &Option) -> ErrorResult { + pub fn SetFormAction(&mut self, _form_action: &DOMString) -> ErrorResult { Ok(()) } - pub fn FormEnctype(&self) -> Option { - None + pub fn FormEnctype(&self) -> DOMString { + ~"" } - pub fn SetFormEnctype(&mut self, _form_enctype: &Option) -> ErrorResult { + pub fn SetFormEnctype(&mut self, _form_enctype: &DOMString) -> ErrorResult { Ok(()) } - pub fn FormMethod(&self) -> Option { - None + pub fn FormMethod(&self) -> DOMString { + ~"" } - pub fn SetFormMethod(&mut self, _form_method: &Option) -> ErrorResult { + pub fn SetFormMethod(&mut self, _form_method: &DOMString) -> ErrorResult { Ok(()) } @@ -114,11 +114,11 @@ impl HTMLInputElement { Ok(()) } - pub fn FormTarget(&self) -> Option { - None + pub fn FormTarget(&self) -> DOMString { + ~"" } - pub fn SetFormTarget(&mut self, _form_target: &Option) -> ErrorResult { + pub fn SetFormTarget(&mut self, _form_target: &DOMString) -> ErrorResult { Ok(()) } @@ -137,19 +137,19 @@ impl HTMLInputElement { pub fn SetIndeterminate(&mut self, _indeterminate: bool) { } - pub fn InputMode(&self) -> Option { - None + pub fn InputMode(&self) -> DOMString { + ~"" } - pub fn SetInputMode(&mut self, _input_mode: &Option) -> ErrorResult { + pub fn SetInputMode(&mut self, _input_mode: &DOMString) -> ErrorResult { Ok(()) } - pub fn Max(&self) -> Option { - None + pub fn Max(&self) -> DOMString { + ~"" } - pub fn SetMax(&mut self, _max: &Option) -> ErrorResult { + pub fn SetMax(&mut self, _max: &DOMString) -> ErrorResult { Ok(()) } @@ -161,11 +161,11 @@ impl HTMLInputElement { Ok(()) } - pub fn Min(&self) -> Option { - None + pub fn Min(&self) -> DOMString { + ~"" } - pub fn SetMin(&mut self, _min: &Option) -> ErrorResult { + pub fn SetMin(&mut self, _min: &DOMString) -> ErrorResult { Ok(()) } @@ -177,27 +177,27 @@ impl HTMLInputElement { Ok(()) } - pub fn Name(&self) -> Option { - None + pub fn Name(&self) -> DOMString { + ~"" } - pub fn SetName(&mut self, _name: &Option) -> ErrorResult { + pub fn SetName(&mut self, _name: &DOMString) -> ErrorResult { Ok(()) } - pub fn Pattern(&self) -> Option { - None + pub fn Pattern(&self) -> DOMString { + ~"" } - pub fn SetPattern(&mut self, _pattern: &Option) -> ErrorResult { + pub fn SetPattern(&mut self, _pattern: &DOMString) -> ErrorResult { Ok(()) } - pub fn Placeholder(&self) -> Option { - None + pub fn Placeholder(&self) -> DOMString { + ~"" } - pub fn SetPlaceholder(&mut self, _placeholder: &Option) -> ErrorResult { + pub fn SetPlaceholder(&mut self, _placeholder: &DOMString) -> ErrorResult { Ok(()) } @@ -225,43 +225,43 @@ impl HTMLInputElement { Ok(()) } - pub fn Src(&self) -> Option { - None + pub fn Src(&self) -> DOMString { + ~"" } - pub fn SetSrc(&mut self, _src: &Option) -> ErrorResult { + pub fn SetSrc(&mut self, _src: &DOMString) -> ErrorResult { Ok(()) } - pub fn Step(&self) -> Option { - None + pub fn Step(&self) -> DOMString { + ~"" } - pub fn SetStep(&mut self, _step: &Option) -> ErrorResult { + pub fn SetStep(&mut self, _step: &DOMString) -> ErrorResult { Ok(()) } - pub fn Type(&self) -> Option { - None + pub fn Type(&self) -> DOMString { + ~"" } - pub fn SetType(&mut self, _type: &Option) -> ErrorResult { + pub fn SetType(&mut self, _type: &DOMString) -> ErrorResult { Ok(()) } - pub fn DefaultValue(&self) -> Option { - None + pub fn DefaultValue(&self) -> DOMString { + ~"" } - pub fn SetDefaultValue(&mut self, _default_value: &Option) -> ErrorResult { + pub fn SetDefaultValue(&mut self, _default_value: &DOMString) -> ErrorResult { Ok(()) } - pub fn Value(&self) -> Option { - None + pub fn Value(&self) -> DOMString { + ~"" } - pub fn SetValue(&mut self, _value: &Option) -> ErrorResult { + pub fn SetValue(&mut self, _value: &DOMString) -> ErrorResult { Ok(()) } @@ -279,15 +279,15 @@ impl HTMLInputElement { pub fn SetWillValidate(&self, _will_validate: bool) { } - pub fn GetValidationMessage(&self) -> Fallible> { - Ok(None) + pub fn GetValidationMessage(&self) -> Fallible { + Ok(~"") } pub fn CheckValidity(&self) -> bool { false } - pub fn SetCustomValidity(&self, _error: &Option) { + pub fn SetCustomValidity(&self, _error: &DOMString) { } pub fn Select(&self) { @@ -309,27 +309,27 @@ impl HTMLInputElement { Ok(()) } - pub fn GetSelectionDirection(&self) -> Fallible> { - Ok(None) + pub fn GetSelectionDirection(&self) -> Fallible { + Ok(~"") } - pub fn SetSelectionDirection(&mut self, _selection_direction: &Option) -> ErrorResult { + pub fn SetSelectionDirection(&mut self, _selection_direction: &DOMString) -> ErrorResult { Ok(()) } - pub fn Align(&self) -> Option { - None + pub fn Align(&self) -> DOMString { + ~"" } - pub fn SetAlign(&mut self, _align: &Option) -> ErrorResult { + pub fn SetAlign(&mut self, _align: &DOMString) -> ErrorResult { Ok(()) } - pub fn UseMap(&self) -> Option { - None + pub fn UseMap(&self) -> DOMString { + ~"" } - pub fn SetUseMap(&mut self, _align: &Option) -> ErrorResult { + pub fn SetUseMap(&mut self, _align: &DOMString) -> ErrorResult { Ok(()) } } diff --git a/src/components/script/dom/htmllabelelement.rs b/src/components/script/dom/htmllabelelement.rs index 9d59f687397..68c07e78c97 100644 --- a/src/components/script/dom/htmllabelelement.rs +++ b/src/components/script/dom/htmllabelelement.rs @@ -27,10 +27,10 @@ impl HTMLLabelElement { } impl HTMLLabelElement { - pub fn HtmlFor(&self) -> Option { - None + pub fn HtmlFor(&self) -> DOMString { + ~"" } - pub fn SetHtmlFor(&mut self, _html_for: &Option) { + pub fn SetHtmlFor(&mut self, _html_for: &DOMString) { } } diff --git a/src/components/script/dom/htmllegendelement.rs b/src/components/script/dom/htmllegendelement.rs index 4ed9d385cba..ab6fdf47d25 100644 --- a/src/components/script/dom/htmllegendelement.rs +++ b/src/components/script/dom/htmllegendelement.rs @@ -27,11 +27,11 @@ impl HTMLLegendElement { } impl HTMLLegendElement { - pub fn Align(&self) -> Option { - None + pub fn Align(&self) -> DOMString { + ~"" } - pub fn SetAlign(&mut self, _align: &Option) -> ErrorResult { + pub fn SetAlign(&mut self, _align: &DOMString) -> ErrorResult { Ok(()) } } diff --git a/src/components/script/dom/htmllielement.rs b/src/components/script/dom/htmllielement.rs index 18bd0224573..025db42d4a7 100644 --- a/src/components/script/dom/htmllielement.rs +++ b/src/components/script/dom/htmllielement.rs @@ -35,11 +35,11 @@ impl HTMLLIElement { Ok(()) } - pub fn Type(&self) -> Option { - None + pub fn Type(&self) -> DOMString { + ~"" } - pub fn SetType(&mut self, _type: &Option) -> ErrorResult { + pub fn SetType(&mut self, _type: &DOMString) -> ErrorResult { Ok(()) } } diff --git a/src/components/script/dom/htmllinkelement.rs b/src/components/script/dom/htmllinkelement.rs index 75cc63207c3..de8cef23169 100644 --- a/src/components/script/dom/htmllinkelement.rs +++ b/src/components/script/dom/htmllinkelement.rs @@ -34,75 +34,75 @@ impl HTMLLinkElement { pub fn SetDisabled(&mut self, _disable: bool) { } - pub fn Href(&self) -> Option { - None + pub fn Href(&self) -> DOMString { + ~"" } - pub fn SetHref(&mut self, _href: &Option) -> ErrorResult { + pub fn SetHref(&mut self, _href: &DOMString) -> ErrorResult { Ok(()) } - pub fn CrossOrigin(&self) -> Option { - None + pub fn CrossOrigin(&self) -> DOMString { + ~"" } - pub fn SetCrossOrigin(&mut self, _cross_origin: &Option) -> ErrorResult { + pub fn SetCrossOrigin(&mut self, _cross_origin: &DOMString) -> ErrorResult { Ok(()) } - pub fn Rel(&self) -> Option { - None + pub fn Rel(&self) -> DOMString { + ~"" } - pub fn SetRel(&mut self, _rel: &Option) -> ErrorResult { + pub fn SetRel(&mut self, _rel: &DOMString) -> ErrorResult { Ok(()) } - pub fn Media(&self) -> Option { - None + pub fn Media(&self) -> DOMString { + ~"" } - pub fn SetMedia(&mut self, _media: &Option) -> ErrorResult { + pub fn SetMedia(&mut self, _media: &DOMString) -> ErrorResult { Ok(()) } - pub fn Hreflang(&self) -> Option { - None + pub fn Hreflang(&self) -> DOMString { + ~"" } - pub fn SetHreflang(&mut self, _href: &Option) -> ErrorResult { + pub fn SetHreflang(&mut self, _href: &DOMString) -> ErrorResult { Ok(()) } - pub fn Type(&self) -> Option { - None + pub fn Type(&self) -> DOMString { + ~"" } - pub fn SetType(&mut self, _type: &Option) -> ErrorResult { + pub fn SetType(&mut self, _type: &DOMString) -> ErrorResult { Ok(()) } - pub fn Charset(&self) -> Option { - None + pub fn Charset(&self) -> DOMString { + ~"" } - pub fn SetCharset(&mut self, _charset: &Option) -> ErrorResult { + pub fn SetCharset(&mut self, _charset: &DOMString) -> ErrorResult { Ok(()) } - pub fn Rev(&self) -> Option { - None + pub fn Rev(&self) -> DOMString { + ~"" } - pub fn SetRev(&mut self, _rev: &Option) -> ErrorResult { + pub fn SetRev(&mut self, _rev: &DOMString) -> ErrorResult { Ok(()) } - pub fn Target(&self) -> Option { - None + pub fn Target(&self) -> DOMString { + ~"" } - pub fn SetTarget(&mut self, _target: &Option) -> ErrorResult { + pub fn SetTarget(&mut self, _target: &DOMString) -> ErrorResult { Ok(()) } } diff --git a/src/components/script/dom/htmlmapelement.rs b/src/components/script/dom/htmlmapelement.rs index 1d95436fdda..20ad9fc1b41 100644 --- a/src/components/script/dom/htmlmapelement.rs +++ b/src/components/script/dom/htmlmapelement.rs @@ -28,11 +28,11 @@ impl HTMLMapElement { } impl HTMLMapElement { - pub fn Name(&self) -> Option { - None + pub fn Name(&self) -> DOMString { + ~"" } - pub fn SetName(&mut self, _name: &Option) -> ErrorResult { + pub fn SetName(&mut self, _name: &DOMString) -> ErrorResult { Ok(()) } diff --git a/src/components/script/dom/htmlmediaelement.rs b/src/components/script/dom/htmlmediaelement.rs index 073313b61ad..40f6632af46 100644 --- a/src/components/script/dom/htmlmediaelement.rs +++ b/src/components/script/dom/htmlmediaelement.rs @@ -20,39 +20,39 @@ impl HTMLMediaElement { } impl HTMLMediaElement { - pub fn Src(&self) -> Option { - None + pub fn Src(&self) -> DOMString { + ~"" } - pub fn SetSrc(&mut self, _src: &Option) -> ErrorResult { + pub fn SetSrc(&mut self, _src: &DOMString) -> ErrorResult { Ok(()) } - pub fn CurrentSrc(&self) -> Option { - None + pub fn CurrentSrc(&self) -> DOMString { + ~"" } - pub fn CrossOrigin(&self) -> Option { - None + pub fn CrossOrigin(&self) -> DOMString { + ~"" } - pub fn SetCrossOrigin(&mut self, _cross_origin: &Option) -> ErrorResult { + pub fn SetCrossOrigin(&mut self, _cross_origin: &DOMString) -> ErrorResult { Ok(()) } - pub fn Preload(&self) -> Option { - None + pub fn Preload(&self) -> DOMString { + ~"" } - pub fn SetPreload(&mut self, _preload: &Option) -> ErrorResult { + pub fn SetPreload(&mut self, _preload: &DOMString) -> ErrorResult { Ok(()) } pub fn Load(&self) { } - pub fn CanPlayType(&self, _type: &Option) -> Option { - None + pub fn CanPlayType(&self, _type: &DOMString) -> DOMString { + ~"" } pub fn ReadyState(&self) -> u16 { diff --git a/src/components/script/dom/htmlmetaelement.rs b/src/components/script/dom/htmlmetaelement.rs index 89a71d9aaf4..45aa5c78bcd 100644 --- a/src/components/script/dom/htmlmetaelement.rs +++ b/src/components/script/dom/htmlmetaelement.rs @@ -27,35 +27,35 @@ impl HTMLMetaElement { } impl HTMLMetaElement { - pub fn Name(&self) -> Option { - None + pub fn Name(&self) -> DOMString { + ~"" } - pub fn SetName(&mut self, _name: &Option) -> ErrorResult { + pub fn SetName(&mut self, _name: &DOMString) -> ErrorResult { Ok(()) } - pub fn HttpEquiv(&self) -> Option { - None + pub fn HttpEquiv(&self) -> DOMString { + ~"" } - pub fn SetHttpEquiv(&mut self, _http_equiv: &Option) -> ErrorResult { + pub fn SetHttpEquiv(&mut self, _http_equiv: &DOMString) -> ErrorResult { Ok(()) } - pub fn Content(&self) -> Option { - None + pub fn Content(&self) -> DOMString { + ~"" } - pub fn SetContent(&mut self, _content: &Option) -> ErrorResult { + pub fn SetContent(&mut self, _content: &DOMString) -> ErrorResult { Ok(()) } - pub fn Scheme(&self) -> Option { - None + pub fn Scheme(&self) -> DOMString { + ~"" } - pub fn SetScheme(&mut self, _scheme: &Option) -> ErrorResult { + pub fn SetScheme(&mut self, _scheme: &DOMString) -> ErrorResult { Ok(()) } } diff --git a/src/components/script/dom/htmlmodelement.rs b/src/components/script/dom/htmlmodelement.rs index 360abfdf981..3414f6f17f2 100644 --- a/src/components/script/dom/htmlmodelement.rs +++ b/src/components/script/dom/htmlmodelement.rs @@ -27,19 +27,19 @@ impl HTMLModElement { } impl HTMLModElement { - pub fn Cite(&self) -> Option { - None + pub fn Cite(&self) -> DOMString { + ~"" } - pub fn SetCite(&mut self, _cite: &Option) -> ErrorResult { + pub fn SetCite(&mut self, _cite: &DOMString) -> ErrorResult { Ok(()) } - pub fn DateTime(&self) -> Option { - None + pub fn DateTime(&self) -> DOMString { + ~"" } - pub fn SetDateTime(&mut self, _datetime: &Option) -> ErrorResult { + pub fn SetDateTime(&mut self, _datetime: &DOMString) -> ErrorResult { Ok(()) } } diff --git a/src/components/script/dom/htmlobjectelement.rs b/src/components/script/dom/htmlobjectelement.rs index 745a223645b..ce73cb0c830 100644 --- a/src/components/script/dom/htmlobjectelement.rs +++ b/src/components/script/dom/htmlobjectelement.rs @@ -29,35 +29,35 @@ impl HTMLObjectElement { } impl HTMLObjectElement { - pub fn Data(&self) -> Option { - None + pub fn Data(&self) -> DOMString { + ~"" } - pub fn SetData(&mut self, _data: &Option) -> ErrorResult { + pub fn SetData(&mut self, _data: &DOMString) -> ErrorResult { Ok(()) } - pub fn Type(&self) -> Option { - None + pub fn Type(&self) -> DOMString { + ~"" } - pub fn SetType(&mut self, _type: &Option) -> ErrorResult { + pub fn SetType(&mut self, _type: &DOMString) -> ErrorResult { Ok(()) } - pub fn Name(&self) -> Option { - None + pub fn Name(&self) -> DOMString { + ~"" } - pub fn SetName(&mut self, _name: &Option) -> ErrorResult { + pub fn SetName(&mut self, _name: &DOMString) -> ErrorResult { Ok(()) } - pub fn UseMap(&self) -> Option { - None + pub fn UseMap(&self) -> DOMString { + ~"" } - pub fn SetUseMap(&mut self, _use_map: &Option) -> ErrorResult { + pub fn SetUseMap(&mut self, _use_map: &DOMString) -> ErrorResult { Ok(()) } @@ -65,19 +65,19 @@ impl HTMLObjectElement { None } - pub fn Width(&self) -> Option { - None + pub fn Width(&self) -> DOMString { + ~"" } - pub fn SetWidth(&mut self, _width: &Option) -> ErrorResult { + pub fn SetWidth(&mut self, _width: &DOMString) -> ErrorResult { Ok(()) } - pub fn Height(&self) -> Option { - None + pub fn Height(&self) -> DOMString { + ~"" } - pub fn SetHeight(&mut self, _height: &Option) -> ErrorResult { + pub fn SetHeight(&mut self, _height: &DOMString) -> ErrorResult { Ok(()) } @@ -98,38 +98,38 @@ impl HTMLObjectElement { ValidityState::new(global) } - pub fn ValidationMessage(&self) -> Option { - None + pub fn ValidationMessage(&self) -> DOMString { + ~"" } pub fn CheckValidity(&self) -> bool { false } - pub fn SetCustomValidity(&mut self, _error: &Option) { + pub fn SetCustomValidity(&mut self, _error: &DOMString) { } - pub fn Align(&self) -> Option { - None + pub fn Align(&self) -> DOMString { + ~"" } - pub fn SetAlign(&mut self, _align: &Option) -> ErrorResult { + pub fn SetAlign(&mut self, _align: &DOMString) -> ErrorResult { Ok(()) } - pub fn Archive(&self) -> Option { - None + pub fn Archive(&self) -> DOMString { + ~"" } - pub fn SetArchive(&mut self, _archive: &Option) -> ErrorResult { + pub fn SetArchive(&mut self, _archive: &DOMString) -> ErrorResult { Ok(()) } - pub fn Code(&self) -> Option { - None + pub fn Code(&self) -> DOMString { + ~"" } - pub fn SetCode(&mut self, _code: &Option) -> ErrorResult { + pub fn SetCode(&mut self, _code: &DOMString) -> ErrorResult { Ok(()) } @@ -149,11 +149,11 @@ impl HTMLObjectElement { Ok(()) } - pub fn Standby(&self) -> Option { - None + pub fn Standby(&self) -> DOMString { + ~"" } - pub fn SetStandby(&mut self, _standby: &Option) -> ErrorResult { + pub fn SetStandby(&mut self, _standby: &DOMString) -> ErrorResult { Ok(()) } @@ -165,27 +165,27 @@ impl HTMLObjectElement { Ok(()) } - pub fn CodeBase(&self) -> Option { - None + pub fn CodeBase(&self) -> DOMString { + ~"" } - pub fn SetCodeBase(&mut self, _codebase: &Option) -> ErrorResult { + pub fn SetCodeBase(&mut self, _codebase: &DOMString) -> ErrorResult { Ok(()) } - pub fn CodeType(&self) -> Option { - None + pub fn CodeType(&self) -> DOMString { + ~"" } - pub fn SetCodeType(&mut self, _codetype: &Option) -> ErrorResult { + pub fn SetCodeType(&mut self, _codetype: &DOMString) -> ErrorResult { Ok(()) } - pub fn Border(&self) -> Option { - None + pub fn Border(&self) -> DOMString { + ~"" } - pub fn SetBorder(&mut self, _border: &Option) -> ErrorResult { + pub fn SetBorder(&mut self, _border: &DOMString) -> ErrorResult { Ok(()) } diff --git a/src/components/script/dom/htmlolistelement.rs b/src/components/script/dom/htmlolistelement.rs index 781885fdb46..9a8c8617314 100644 --- a/src/components/script/dom/htmlolistelement.rs +++ b/src/components/script/dom/htmlolistelement.rs @@ -43,11 +43,11 @@ impl HTMLOListElement { Ok(()) } - pub fn Type(&self) -> Option { - None + pub fn Type(&self) -> DOMString { + ~"" } - pub fn SetType(&mut self, _type: &Option) -> ErrorResult { + pub fn SetType(&mut self, _type: &DOMString) -> ErrorResult { Ok(()) } diff --git a/src/components/script/dom/htmloptgroupelement.rs b/src/components/script/dom/htmloptgroupelement.rs index ce76e75031a..b0876569c19 100644 --- a/src/components/script/dom/htmloptgroupelement.rs +++ b/src/components/script/dom/htmloptgroupelement.rs @@ -35,11 +35,11 @@ impl HTMLOptGroupElement { Ok(()) } - pub fn Label(&self) -> Option { - None + pub fn Label(&self) -> DOMString { + ~"" } - pub fn SetLabel(&mut self, _label: &Option) -> ErrorResult { + pub fn SetLabel(&mut self, _label: &DOMString) -> ErrorResult { Ok(()) } } diff --git a/src/components/script/dom/htmloptionelement.rs b/src/components/script/dom/htmloptionelement.rs index d5674e9cd47..de82444e37e 100644 --- a/src/components/script/dom/htmloptionelement.rs +++ b/src/components/script/dom/htmloptionelement.rs @@ -39,11 +39,11 @@ impl HTMLOptionElement { None } - pub fn Label(&self) -> Option { - None + pub fn Label(&self) -> DOMString { + ~"" } - pub fn SetLabel(&mut self, _label: &Option) -> ErrorResult { + pub fn SetLabel(&mut self, _label: &DOMString) -> ErrorResult { Ok(()) } @@ -63,19 +63,19 @@ impl HTMLOptionElement { Ok(()) } - pub fn Value(&self) -> Option { - None + pub fn Value(&self) -> DOMString { + ~"" } - pub fn SetValue(&mut self, _value: &Option) -> ErrorResult { + pub fn SetValue(&mut self, _value: &DOMString) -> ErrorResult { Ok(()) } - pub fn Text(&self) -> Option { - None + pub fn Text(&self) -> DOMString { + ~"" } - pub fn SetText(&mut self, _text: &Option) -> ErrorResult { + pub fn SetText(&mut self, _text: &DOMString) -> ErrorResult { Ok(()) } diff --git a/src/components/script/dom/htmloutputelement.rs b/src/components/script/dom/htmloutputelement.rs index 1c3689cdf53..96829a4c960 100644 --- a/src/components/script/dom/htmloutputelement.rs +++ b/src/components/script/dom/htmloutputelement.rs @@ -32,31 +32,31 @@ impl HTMLOutputElement { None } - pub fn Name(&self) -> Option { - None + pub fn Name(&self) -> DOMString { + ~"" } - pub fn SetName(&mut self, _name: &Option) -> ErrorResult { + pub fn SetName(&mut self, _name: &DOMString) -> ErrorResult { Ok(()) } - pub fn Type(&self) -> Option { - None + pub fn Type(&self) -> DOMString { + ~"" } - pub fn DefaultValue(&self) -> Option { - None + pub fn DefaultValue(&self) -> DOMString { + ~"" } - pub fn SetDefaultValue(&mut self, _value: &Option) -> ErrorResult { + pub fn SetDefaultValue(&mut self, _value: &DOMString) -> ErrorResult { Ok(()) } - pub fn Value(&self) -> Option { - None + pub fn Value(&self) -> DOMString { + ~"" } - pub fn SetValue(&mut self, _value: &Option) -> ErrorResult { + pub fn SetValue(&mut self, _value: &DOMString) -> ErrorResult { Ok(()) } @@ -75,11 +75,11 @@ impl HTMLOutputElement { pub fn SetValidity(&mut self, _validity: @mut ValidityState) { } - pub fn ValidationMessage(&self) -> Option { - None + pub fn ValidationMessage(&self) -> DOMString { + ~"" } - pub fn SetValidationMessage(&mut self, _message: &Option) -> ErrorResult { + pub fn SetValidationMessage(&mut self, _message: &DOMString) -> ErrorResult { Ok(()) } @@ -87,6 +87,6 @@ impl HTMLOutputElement { true } - pub fn SetCustomValidity(&mut self, _error: &Option) { + pub fn SetCustomValidity(&mut self, _error: &DOMString) { } } diff --git a/src/components/script/dom/htmlparagraphelement.rs b/src/components/script/dom/htmlparagraphelement.rs index b88e8bc9913..352e111e2fe 100644 --- a/src/components/script/dom/htmlparagraphelement.rs +++ b/src/components/script/dom/htmlparagraphelement.rs @@ -27,11 +27,11 @@ impl HTMLParagraphElement { } impl HTMLParagraphElement { - pub fn Align(&self) -> Option { - None + pub fn Align(&self) -> DOMString { + ~"" } - pub fn SetAlign(&mut self, _align: &Option) -> ErrorResult { + pub fn SetAlign(&mut self, _align: &DOMString) -> ErrorResult { Ok(()) } } diff --git a/src/components/script/dom/htmlparamelement.rs b/src/components/script/dom/htmlparamelement.rs index c7259b219a8..fbf82eef009 100644 --- a/src/components/script/dom/htmlparamelement.rs +++ b/src/components/script/dom/htmlparamelement.rs @@ -27,35 +27,35 @@ impl HTMLParamElement { } impl HTMLParamElement { - pub fn Name(&self) -> Option { - None + pub fn Name(&self) -> DOMString { + ~"" } - pub fn SetName(&mut self, _name: &Option) -> ErrorResult { + pub fn SetName(&mut self, _name: &DOMString) -> ErrorResult { Ok(()) } - pub fn Value(&self) -> Option { - None + pub fn Value(&self) -> DOMString { + ~"" } - pub fn SetValue(&mut self, _value: &Option) -> ErrorResult { + pub fn SetValue(&mut self, _value: &DOMString) -> ErrorResult { Ok(()) } - pub fn Type(&self) -> Option { - None + pub fn Type(&self) -> DOMString { + ~"" } - pub fn SetType(&mut self, _type: &Option) -> ErrorResult { + pub fn SetType(&mut self, _type: &DOMString) -> ErrorResult { Ok(()) } - pub fn ValueType(&self) -> Option { - None + pub fn ValueType(&self) -> DOMString { + ~"" } - pub fn SetValueType(&mut self, _value_type: &Option) -> ErrorResult { + pub fn SetValueType(&mut self, _value_type: &DOMString) -> ErrorResult { Ok(()) } } diff --git a/src/components/script/dom/htmlquoteelement.rs b/src/components/script/dom/htmlquoteelement.rs index c1955020b19..96a4a12dc0e 100644 --- a/src/components/script/dom/htmlquoteelement.rs +++ b/src/components/script/dom/htmlquoteelement.rs @@ -27,11 +27,11 @@ impl HTMLQuoteElement { } impl HTMLQuoteElement { - pub fn Cite(&self) -> Option { - None + pub fn Cite(&self) -> DOMString { + ~"" } - pub fn SetCite(&self, _cite: &Option) -> ErrorResult { + pub fn SetCite(&self, _cite: &DOMString) -> ErrorResult { Ok(()) } } diff --git a/src/components/script/dom/htmlscriptelement.rs b/src/components/script/dom/htmlscriptelement.rs index e416bf8bc64..504acc85431 100644 --- a/src/components/script/dom/htmlscriptelement.rs +++ b/src/components/script/dom/htmlscriptelement.rs @@ -28,27 +28,30 @@ impl HTMLScriptElement { } impl HTMLScriptElement { - pub fn Src(&self) -> Option { - self.htmlelement.element.get_attr("src").map(|s| s.to_str()) + pub fn Src(&self) -> DOMString { + match self.htmlelement.element.get_attr("src") { + Some(s) => s.to_owned(), + None => ~"" + } } - pub fn SetSrc(&mut self, _src: &Option) -> ErrorResult { + pub fn SetSrc(&mut self, _src: &DOMString) -> ErrorResult { Ok(()) } - pub fn Type(&self) -> Option { - None + pub fn Type(&self) -> DOMString { + ~"" } - pub fn SetType(&mut self, _type: &Option) -> ErrorResult { + pub fn SetType(&mut self, _type: &DOMString) -> ErrorResult { Ok(()) } - pub fn Charset(&self) -> Option { - None + pub fn Charset(&self) -> DOMString { + ~"" } - pub fn SetCharset(&mut self, _charset: &Option) -> ErrorResult { + pub fn SetCharset(&mut self, _charset: &DOMString) -> ErrorResult { Ok(()) } @@ -68,35 +71,35 @@ impl HTMLScriptElement { Ok(()) } - pub fn CrossOrigin(&self) -> Option { - None + pub fn CrossOrigin(&self) -> DOMString { + ~"" } - pub fn SetCrossOrigin(&mut self, _cross_origin: &Option) -> ErrorResult { + pub fn SetCrossOrigin(&mut self, _cross_origin: &DOMString) -> ErrorResult { Ok(()) } - pub fn Text(&self) -> Option { - None + pub fn Text(&self) -> DOMString { + ~"" } - pub fn SetText(&mut self, _text: &Option) -> ErrorResult { + pub fn SetText(&mut self, _text: &DOMString) -> ErrorResult { Ok(()) } - pub fn Event(&self) -> Option { - None + pub fn Event(&self) -> DOMString { + ~"" } - pub fn SetEvent(&mut self, _event: &Option) -> ErrorResult { + pub fn SetEvent(&mut self, _event: &DOMString) -> ErrorResult { Ok(()) } - pub fn HtmlFor(&self) -> Option { - None + pub fn HtmlFor(&self) -> DOMString { + ~"" } - pub fn SetHtmlFor(&mut self, _html_for: &Option) -> ErrorResult { + pub fn SetHtmlFor(&mut self, _html_for: &DOMString) -> ErrorResult { Ok(()) } } diff --git a/src/components/script/dom/htmlselectelement.rs b/src/components/script/dom/htmlselectelement.rs index 1676672816b..608295e903a 100644 --- a/src/components/script/dom/htmlselectelement.rs +++ b/src/components/script/dom/htmlselectelement.rs @@ -56,11 +56,11 @@ impl HTMLSelectElement { Ok(()) } - pub fn Name(&self) -> Option { - None + pub fn Name(&self) -> DOMString { + ~"" } - pub fn SetName(&mut self, _name: &Option) -> ErrorResult { + pub fn SetName(&mut self, _name: &DOMString) -> ErrorResult { Ok(()) } @@ -80,8 +80,8 @@ impl HTMLSelectElement { Ok(()) } - pub fn Type(&self) -> Option { - None + pub fn Type(&self) -> DOMString { + ~"" } pub fn Length(&self) -> u32 { @@ -96,7 +96,7 @@ impl HTMLSelectElement { None } - pub fn NamedItem(&self, _name: &Option) -> Option> { + pub fn NamedItem(&self, _name: &DOMString) -> Option> { None } @@ -122,11 +122,11 @@ impl HTMLSelectElement { Ok(()) } - pub fn Value(&self) -> Option { - None + pub fn Value(&self) -> DOMString { + ~"" } - pub fn SetValue(&mut self, _value: &Option) { + pub fn SetValue(&mut self, _value: &DOMString) { } pub fn WillValidate(&self) -> bool { @@ -144,11 +144,11 @@ impl HTMLSelectElement { pub fn SetValidity(&mut self, _validity: @mut ValidityState) { } - pub fn ValidationMessage(&self) -> Option { - None + pub fn ValidationMessage(&self) -> DOMString { + ~"" } - pub fn SetValidationMessage(&mut self, _message: &Option) -> ErrorResult { + pub fn SetValidationMessage(&mut self, _message: &DOMString) -> ErrorResult { Ok(()) } @@ -156,6 +156,6 @@ impl HTMLSelectElement { true } - pub fn SetCustomValidity(&mut self, _error: &Option) { + pub fn SetCustomValidity(&mut self, _error: &DOMString) { } } diff --git a/src/components/script/dom/htmlsourceelement.rs b/src/components/script/dom/htmlsourceelement.rs index 52974594bf6..66842feb156 100644 --- a/src/components/script/dom/htmlsourceelement.rs +++ b/src/components/script/dom/htmlsourceelement.rs @@ -27,27 +27,27 @@ impl HTMLSourceElement { } impl HTMLSourceElement { - pub fn Src(&self) -> Option { - None + pub fn Src(&self) -> DOMString { + ~"" } - pub fn SetSrc(&mut self, _src: &Option) -> ErrorResult { + pub fn SetSrc(&mut self, _src: &DOMString) -> ErrorResult { Ok(()) } - pub fn Type(&self) -> Option { - None + pub fn Type(&self) -> DOMString { + ~"" } - pub fn SetType(&mut self, _type: &Option) -> ErrorResult { + pub fn SetType(&mut self, _type: &DOMString) -> ErrorResult { Ok(()) } - pub fn Media(&self) -> Option { - None + pub fn Media(&self) -> DOMString { + ~"" } - pub fn SetMedia(&mut self, _media: &Option) -> ErrorResult { + pub fn SetMedia(&mut self, _media: &DOMString) -> ErrorResult { Ok(()) } } diff --git a/src/components/script/dom/htmlstyleelement.rs b/src/components/script/dom/htmlstyleelement.rs index cf18b229f8e..b532506b703 100644 --- a/src/components/script/dom/htmlstyleelement.rs +++ b/src/components/script/dom/htmlstyleelement.rs @@ -34,19 +34,19 @@ impl HTMLStyleElement { pub fn SetDisabled(&self, _disabled: bool) { } - pub fn Media(&self) -> Option { - None + pub fn Media(&self) -> DOMString { + ~"" } - pub fn SetMedia(&mut self, _media: &Option) -> ErrorResult { + pub fn SetMedia(&mut self, _media: &DOMString) -> ErrorResult { Ok(()) } - pub fn Type(&self) -> Option { - None + pub fn Type(&self) -> DOMString { + ~"" } - pub fn SetType(&mut self, _type: &Option) -> ErrorResult { + pub fn SetType(&mut self, _type: &DOMString) -> ErrorResult { Ok(()) } diff --git a/src/components/script/dom/htmltablecaptionelement.rs b/src/components/script/dom/htmltablecaptionelement.rs index 93be5a96013..69bd5bfb1fc 100644 --- a/src/components/script/dom/htmltablecaptionelement.rs +++ b/src/components/script/dom/htmltablecaptionelement.rs @@ -27,11 +27,11 @@ impl HTMLTableCaptionElement { } impl HTMLTableCaptionElement { - pub fn Align(&self) -> Option { - None + pub fn Align(&self) -> DOMString { + ~"" } - pub fn SetAlign(&mut self, _align: &Option) -> ErrorResult { + pub fn SetAlign(&mut self, _align: &DOMString) -> ErrorResult { Ok(()) } } diff --git a/src/components/script/dom/htmltablecellelement.rs b/src/components/script/dom/htmltablecellelement.rs index a0f5bfdfc12..9d594493ac1 100644 --- a/src/components/script/dom/htmltablecellelement.rs +++ b/src/components/script/dom/htmltablecellelement.rs @@ -36,11 +36,11 @@ impl HTMLTableCellElement { Ok(()) } - pub fn Headers(&self) -> Option { - None + pub fn Headers(&self) -> DOMString { + ~"" } - pub fn SetHeaders(&self, _headers: &Option) -> ErrorResult { + pub fn SetHeaders(&self, _headers: &DOMString) -> ErrorResult { Ok(()) } @@ -52,67 +52,67 @@ impl HTMLTableCellElement { Ok(()) } - pub fn Abbr(&self) -> Option { - None + pub fn Abbr(&self) -> DOMString { + ~"" } - pub fn SetAbbr(&self, _abbr: &Option) -> ErrorResult { + pub fn SetAbbr(&self, _abbr: &DOMString) -> ErrorResult { Ok(()) } - pub fn Scope(&self) -> Option { - None + pub fn Scope(&self) -> DOMString { + ~"" } - pub fn SetScope(&self, _abbr: &Option) -> ErrorResult { + pub fn SetScope(&self, _abbr: &DOMString) -> ErrorResult { Ok(()) } - pub fn Align(&self) -> Option { - None + pub fn Align(&self) -> DOMString { + ~"" } - pub fn SetAlign(&self, _align: &Option) -> ErrorResult { + pub fn SetAlign(&self, _align: &DOMString) -> ErrorResult { Ok(()) } - pub fn Axis(&self) -> Option { - None + pub fn Axis(&self) -> DOMString { + ~"" } - pub fn SetAxis(&self, _axis: &Option) -> ErrorResult { + pub fn SetAxis(&self, _axis: &DOMString) -> ErrorResult { Ok(()) } - pub fn Height(&self) -> Option { - None + pub fn Height(&self) -> DOMString { + ~"" } - pub fn SetHeight(&self, _height: &Option) -> ErrorResult { + pub fn SetHeight(&self, _height: &DOMString) -> ErrorResult { Ok(()) } - pub fn Width(&self) -> Option { - None + pub fn Width(&self) -> DOMString { + ~"" } - pub fn SetWidth(&self, _width: &Option) -> ErrorResult { + pub fn SetWidth(&self, _width: &DOMString) -> ErrorResult { Ok(()) } - pub fn Ch(&self) -> Option { - None + pub fn Ch(&self) -> DOMString { + ~"" } - pub fn SetCh(&self, _ch: &Option) -> ErrorResult { + pub fn SetCh(&self, _ch: &DOMString) -> ErrorResult { Ok(()) } - pub fn ChOff(&self) -> Option { - None + pub fn ChOff(&self) -> DOMString { + ~"" } - pub fn SetChOff(&self, _ch_off: &Option) -> ErrorResult { + pub fn SetChOff(&self, _ch_off: &DOMString) -> ErrorResult { Ok(()) } @@ -124,19 +124,19 @@ impl HTMLTableCellElement { Ok(()) } - pub fn VAlign(&self) -> Option { - None + pub fn VAlign(&self) -> DOMString { + ~"" } - pub fn SetVAlign(&self, _valign: &Option) -> ErrorResult { + pub fn SetVAlign(&self, _valign: &DOMString) -> ErrorResult { Ok(()) } - pub fn BgColor(&self) -> Option { - None + pub fn BgColor(&self) -> DOMString { + ~"" } - pub fn SetBgColor(&self, _bg_color: &Option) -> ErrorResult { + pub fn SetBgColor(&self, _bg_color: &DOMString) -> ErrorResult { Ok(()) } } diff --git a/src/components/script/dom/htmltablecolelement.rs b/src/components/script/dom/htmltablecolelement.rs index ddce6ff8a75..f17147d3dfa 100644 --- a/src/components/script/dom/htmltablecolelement.rs +++ b/src/components/script/dom/htmltablecolelement.rs @@ -35,43 +35,43 @@ impl HTMLTableColElement { Ok(()) } - pub fn Align(&self) -> Option { - None + pub fn Align(&self) -> DOMString { + ~"" } - pub fn SetAlign(&mut self, _align: &Option) -> ErrorResult { + pub fn SetAlign(&mut self, _align: &DOMString) -> ErrorResult { Ok(()) } - pub fn Ch(&self) -> Option { - None + pub fn Ch(&self) -> DOMString { + ~"" } - pub fn SetCh(&mut self, _ch: &Option) -> ErrorResult { + pub fn SetCh(&mut self, _ch: &DOMString) -> ErrorResult { Ok(()) } - pub fn ChOff(&self) -> Option { - None + pub fn ChOff(&self) -> DOMString { + ~"" } - pub fn SetChOff(&mut self, _ch_off: &Option) -> ErrorResult { + pub fn SetChOff(&mut self, _ch_off: &DOMString) -> ErrorResult { Ok(()) } - pub fn VAlign(&self) -> Option { - None + pub fn VAlign(&self) -> DOMString { + ~"" } - pub fn SetVAlign(&mut self, _v_align: &Option) -> ErrorResult { + pub fn SetVAlign(&mut self, _v_align: &DOMString) -> ErrorResult { Ok(()) } - pub fn Width(&self) -> Option { - None + pub fn Width(&self) -> DOMString { + ~"" } - pub fn SetWidth(&mut self, _width: &Option) -> ErrorResult { + pub fn SetWidth(&mut self, _width: &DOMString) -> ErrorResult { Ok(()) } } diff --git a/src/components/script/dom/htmltableelement.rs b/src/components/script/dom/htmltableelement.rs index b06e0d7c220..4ab2ef5c1e7 100644 --- a/src/components/script/dom/htmltableelement.rs +++ b/src/components/script/dom/htmltableelement.rs @@ -50,75 +50,75 @@ impl HTMLTableElement { pub fn StopSorting(&self) { } - pub fn Align(&self) -> Option { - None + pub fn Align(&self) -> DOMString { + ~"" } - pub fn SetAlign(&self, _align: &Option) -> ErrorResult { + pub fn SetAlign(&self, _align: &DOMString) -> ErrorResult { Ok(()) } - pub fn Border(&self) -> Option { - None + pub fn Border(&self) -> DOMString { + ~"" } - pub fn SetBorder(&self, _border: &Option) -> ErrorResult { + pub fn SetBorder(&self, _border: &DOMString) -> ErrorResult { Ok(()) } - pub fn Frame(&self) -> Option { - None + pub fn Frame(&self) -> DOMString { + ~"" } - pub fn SetFrame(&self, _frame: &Option) -> ErrorResult { + pub fn SetFrame(&self, _frame: &DOMString) -> ErrorResult { Ok(()) } - pub fn Rules(&self) -> Option { - None + pub fn Rules(&self) -> DOMString { + ~"" } - pub fn SetRules(&self, _rules: &Option) -> ErrorResult { + pub fn SetRules(&self, _rules: &DOMString) -> ErrorResult { Ok(()) } - pub fn Summary(&self) -> Option { - None + pub fn Summary(&self) -> DOMString { + ~"" } - pub fn SetSummary(&self, _summary: &Option) -> ErrorResult { + pub fn SetSummary(&self, _summary: &DOMString) -> ErrorResult { Ok(()) } - pub fn Width(&self) -> Option { - None + pub fn Width(&self) -> DOMString { + ~"" } - pub fn SetWidth(&self, _width: &Option) -> ErrorResult { + pub fn SetWidth(&self, _width: &DOMString) -> ErrorResult { Ok(()) } - pub fn BgColor(&self) -> Option { - None + pub fn BgColor(&self) -> DOMString { + ~"" } - pub fn SetBgColor(&self, _bg_color: &Option) -> ErrorResult { + pub fn SetBgColor(&self, _bg_color: &DOMString) -> ErrorResult { Ok(()) } - pub fn CellPadding(&self) -> Option { - None + pub fn CellPadding(&self) -> DOMString { + ~"" } - pub fn SetCellPadding(&self, _cell_padding: &Option) -> ErrorResult { + pub fn SetCellPadding(&self, _cell_padding: &DOMString) -> ErrorResult { Ok(()) } - pub fn CellSpacing(&self) -> Option { - None + pub fn CellSpacing(&self) -> DOMString { + ~"" } - pub fn SetCellSpacing(&self, _cell_spacing: &Option) -> ErrorResult { + pub fn SetCellSpacing(&self, _cell_spacing: &DOMString) -> ErrorResult { Ok(()) } } diff --git a/src/components/script/dom/htmltablerowelement.rs b/src/components/script/dom/htmltablerowelement.rs index d363192707d..a3c90d313a1 100644 --- a/src/components/script/dom/htmltablerowelement.rs +++ b/src/components/script/dom/htmltablerowelement.rs @@ -47,43 +47,43 @@ impl HTMLTableRowElement { Ok(()) } - pub fn Align(&self) -> Option { - None + pub fn Align(&self) -> DOMString { + ~"" } - pub fn SetAlign(&self, _align: &Option) -> ErrorResult { + pub fn SetAlign(&self, _align: &DOMString) -> ErrorResult { Ok(()) } - pub fn Ch(&self) -> Option { - None + pub fn Ch(&self) -> DOMString { + ~"" } - pub fn SetCh(&self, _ch: &Option) -> ErrorResult { + pub fn SetCh(&self, _ch: &DOMString) -> ErrorResult { Ok(()) } - pub fn ChOff(&self) -> Option { - None + pub fn ChOff(&self) -> DOMString { + ~"" } - pub fn SetChOff(&self, _ch_off: &Option) -> ErrorResult { + pub fn SetChOff(&self, _ch_off: &DOMString) -> ErrorResult { Ok(()) } - pub fn VAlign(&self) -> Option { - None + pub fn VAlign(&self) -> DOMString { + ~"" } - pub fn SetVAlign(&self, _v_align: &Option) -> ErrorResult { + pub fn SetVAlign(&self, _v_align: &DOMString) -> ErrorResult { Ok(()) } - pub fn BgColor(&self) -> Option { - None + pub fn BgColor(&self) -> DOMString { + ~"" } - pub fn SetBgColor(&self, _bg_color: &Option) -> ErrorResult { + pub fn SetBgColor(&self, _bg_color: &DOMString) -> ErrorResult { Ok(()) } } diff --git a/src/components/script/dom/htmltablesectionelement.rs b/src/components/script/dom/htmltablesectionelement.rs index 90a1d0f0bcb..2114766620c 100644 --- a/src/components/script/dom/htmltablesectionelement.rs +++ b/src/components/script/dom/htmltablesectionelement.rs @@ -31,35 +31,35 @@ impl HTMLTableSectionElement { Ok(()) } - pub fn Align(&self) -> Option { - None + pub fn Align(&self) -> DOMString { + ~"" } - pub fn SetAlign(&mut self, _align: &Option) -> ErrorResult { + pub fn SetAlign(&mut self, _align: &DOMString) -> ErrorResult { Ok(()) } - pub fn Ch(&self) -> Option { - None + pub fn Ch(&self) -> DOMString { + ~"" } - pub fn SetCh(&mut self, _ch: &Option) -> ErrorResult { + pub fn SetCh(&mut self, _ch: &DOMString) -> ErrorResult { Ok(()) } - pub fn ChOff(&self) -> Option { - None + pub fn ChOff(&self) -> DOMString { + ~"" } - pub fn SetChOff(&mut self, _ch_off: &Option) -> ErrorResult { + pub fn SetChOff(&mut self, _ch_off: &DOMString) -> ErrorResult { Ok(()) } - pub fn VAlign(&self) -> Option { - None + pub fn VAlign(&self) -> DOMString { + ~"" } - pub fn SetVAlign(&mut self, _v_align: &Option) -> ErrorResult { + pub fn SetVAlign(&mut self, _v_align: &DOMString) -> ErrorResult { Ok(()) } } diff --git a/src/components/script/dom/htmltextareaelement.rs b/src/components/script/dom/htmltextareaelement.rs index e92fb1cc7c4..4c5655fd6e7 100644 --- a/src/components/script/dom/htmltextareaelement.rs +++ b/src/components/script/dom/htmltextareaelement.rs @@ -59,19 +59,19 @@ impl HTMLTextAreaElement { Ok(()) } - pub fn Name(&self) -> Option { - None + pub fn Name(&self) -> DOMString { + ~"" } - pub fn SetName(&mut self, _name: &Option) -> ErrorResult { + pub fn SetName(&mut self, _name: &DOMString) -> ErrorResult { Ok(()) } - pub fn Placeholder(&self) -> Option { - None + pub fn Placeholder(&self) -> DOMString { + ~"" } - pub fn SetPlaceholder(&mut self, _placeholder: &Option) -> ErrorResult { + pub fn SetPlaceholder(&mut self, _placeholder: &DOMString) -> ErrorResult { Ok(()) } @@ -99,34 +99,34 @@ impl HTMLTextAreaElement { Ok(()) } - pub fn Wrap(&self) -> Option { - None + pub fn Wrap(&self) -> DOMString { + ~"" } - pub fn SetWrap(&mut self, _wrap: &Option) -> ErrorResult { + pub fn SetWrap(&mut self, _wrap: &DOMString) -> ErrorResult { Ok(()) } - pub fn Type(&self) -> Option { - None + pub fn Type(&self) -> DOMString { + ~"" } - pub fn SetType(&mut self, _type: &Option) { + pub fn SetType(&mut self, _type: &DOMString) { } - pub fn DefaultValue(&self) -> Option { - None + pub fn DefaultValue(&self) -> DOMString { + ~"" } - pub fn SetDefaultValue(&mut self, _default_value: &Option) -> ErrorResult { + pub fn SetDefaultValue(&mut self, _default_value: &DOMString) -> ErrorResult { Ok(()) } - pub fn Value(&self) -> Option { - None + pub fn Value(&self) -> DOMString { + ~"" } - pub fn SetValue(&mut self, _value: &Option) { + pub fn SetValue(&mut self, _value: &DOMString) { } pub fn TextLength(&self) -> u32 { @@ -145,15 +145,15 @@ impl HTMLTextAreaElement { Ok(()) } - pub fn ValidationMessage(&self) -> Option { - None + pub fn ValidationMessage(&self) -> DOMString { + ~"" } pub fn CheckValidity(&self) -> bool { false } - pub fn SetCustomValidity(&self, _error: &Option) { + pub fn SetCustomValidity(&self, _error: &DOMString) { } pub fn Select(&self) { @@ -175,14 +175,14 @@ impl HTMLTextAreaElement { Ok(()) } - pub fn GetSelectionDirection(&self) -> Fallible> { - Ok(None) + pub fn GetSelectionDirection(&self) -> Fallible { + Ok(~"") } - pub fn SetSelectionDirection(&self, _selection_direction: &Option) -> ErrorResult { + pub fn SetSelectionDirection(&self, _selection_direction: &DOMString) -> ErrorResult { Ok(()) } - pub fn SetRangeText(&self, _replacement: &Option) { + pub fn SetRangeText(&self, _replacement: &DOMString) { } } diff --git a/src/components/script/dom/htmltimeelement.rs b/src/components/script/dom/htmltimeelement.rs index bb3328808e6..0c24a15a5f9 100644 --- a/src/components/script/dom/htmltimeelement.rs +++ b/src/components/script/dom/htmltimeelement.rs @@ -27,11 +27,11 @@ impl HTMLTimeElement { } impl HTMLTimeElement { - pub fn DateTime(&self) -> Option { - None + pub fn DateTime(&self) -> DOMString { + ~"" } - pub fn SetDateTime(&mut self, _dateTime: &Option) -> ErrorResult { + pub fn SetDateTime(&mut self, _dateTime: &DOMString) -> ErrorResult { Ok(()) } } diff --git a/src/components/script/dom/htmltitleelement.rs b/src/components/script/dom/htmltitleelement.rs index eb0831e519a..30113d951e4 100644 --- a/src/components/script/dom/htmltitleelement.rs +++ b/src/components/script/dom/htmltitleelement.rs @@ -27,11 +27,11 @@ impl HTMLTitleElement { } impl HTMLTitleElement { - pub fn Text(&self) -> Option { - None + pub fn Text(&self) -> DOMString { + ~"" } - pub fn SetText(&mut self, _text: &Option) -> ErrorResult { + pub fn SetText(&mut self, _text: &DOMString) -> ErrorResult { Ok(()) } } diff --git a/src/components/script/dom/htmltrackelement.rs b/src/components/script/dom/htmltrackelement.rs index d6aacdb3b45..2beed957a3f 100644 --- a/src/components/script/dom/htmltrackelement.rs +++ b/src/components/script/dom/htmltrackelement.rs @@ -27,35 +27,35 @@ impl HTMLTrackElement { } impl HTMLTrackElement { - pub fn Kind(&self) -> Option { - None + pub fn Kind(&self) -> DOMString { + ~"" } - pub fn SetKind(&mut self, _kind: &Option) -> ErrorResult { + pub fn SetKind(&mut self, _kind: &DOMString) -> ErrorResult { Ok(()) } - pub fn Src(&self) -> Option { - None + pub fn Src(&self) -> DOMString { + ~"" } - pub fn SetSrc(&mut self, _src: &Option) -> ErrorResult { + pub fn SetSrc(&mut self, _src: &DOMString) -> ErrorResult { Ok(()) } - pub fn Srclang(&self) -> Option { - None + pub fn Srclang(&self) -> DOMString { + ~"" } - pub fn SetSrclang(&mut self, _srclang: &Option) -> ErrorResult { + pub fn SetSrclang(&mut self, _srclang: &DOMString) -> ErrorResult { Ok(()) } - pub fn Label(&self) -> Option { - None + pub fn Label(&self) -> DOMString { + ~"" } - pub fn SetLabel(&mut self, _label: &Option) -> ErrorResult { + pub fn SetLabel(&mut self, _label: &DOMString) -> ErrorResult { Ok(()) } diff --git a/src/components/script/dom/htmlulistelement.rs b/src/components/script/dom/htmlulistelement.rs index d559ae60ff1..40ae76deec2 100644 --- a/src/components/script/dom/htmlulistelement.rs +++ b/src/components/script/dom/htmlulistelement.rs @@ -35,11 +35,11 @@ impl HTMLUListElement { Ok(()) } - pub fn Type(&self) -> Option { - None + pub fn Type(&self) -> DOMString { + ~"" } - pub fn SetType(&mut self, _type: &Option) -> ErrorResult { + pub fn SetType(&mut self, _type: &DOMString) -> ErrorResult { Ok(()) } } diff --git a/src/components/script/dom/htmlvideoelement.rs b/src/components/script/dom/htmlvideoelement.rs index f5d34487ff3..690fec3956f 100644 --- a/src/components/script/dom/htmlvideoelement.rs +++ b/src/components/script/dom/htmlvideoelement.rs @@ -51,11 +51,11 @@ impl HTMLVideoElement { 0 } - pub fn Poster(&self) -> Option { - None + pub fn Poster(&self) -> DOMString { + ~"" } - pub fn SetPoster(&mut self, _poster: &Option) -> ErrorResult { + pub fn SetPoster(&mut self, _poster: &DOMString) -> ErrorResult { Ok(()) } } diff --git a/src/components/script/dom/mouseevent.rs b/src/components/script/dom/mouseevent.rs index bcc69a7ebac..30dae36521e 100644 --- a/src/components/script/dom/mouseevent.rs +++ b/src/components/script/dom/mouseevent.rs @@ -49,7 +49,7 @@ impl MouseEvent { } pub fn Constructor(owner: @mut Window, - type_: &Option, + type_: &DOMString, init: &MouseEventBinding::MouseEventInit) -> Fallible { let ev = MouseEvent::new(owner); ev.mut_mouseevent().InitMouseEvent(type_, init.bubbles, init.cancelable, init.view, @@ -105,13 +105,13 @@ impl MouseEvent { self.related_target } - pub fn GetModifierState(&self, _keyArg: &Option) -> bool { + pub fn GetModifierState(&self, _keyArg: &DOMString) -> bool { //TODO false } pub fn InitMouseEvent(&mut self, - typeArg: &Option, + typeArg: &DOMString, canBubbleArg: bool, cancelableArg: bool, viewArg: Option<@mut WindowProxy>, diff --git a/src/components/script/dom/navigator.rs b/src/components/script/dom/navigator.rs index 7fd782c9731..1d9c404545a 100644 --- a/src/components/script/dom/navigator.rs +++ b/src/components/script/dom/navigator.rs @@ -22,32 +22,32 @@ impl Navigator { reflect_dom_object(@mut Navigator::new_inherited(), window, NavigatorBinding::Wrap) } - pub fn DoNotTrack(&self) -> Option { - Some(~"unspecified") + pub fn DoNotTrack(&self) -> DOMString { + ~"unspecified" } - pub fn Vendor(&self) -> Option { - Some(~"") // Like Gecko + pub fn Vendor(&self) -> DOMString { + ~"" // Like Gecko } - pub fn VendorSub(&self) -> Option { - Some(~"") // Like Gecko + pub fn VendorSub(&self) -> DOMString { + ~"" // Like Gecko } - pub fn Product(&self) -> Option { - Some(~"Gecko") // This is supposed to be constant, see webidl. + pub fn Product(&self) -> DOMString { + ~"Gecko" } - pub fn ProductSub(&self) -> Option { - None + pub fn ProductSub(&self) -> DOMString { + ~"" } pub fn CookieEnabled(&self) -> bool { false } - pub fn GetBuildID(&self) -> Fallible> { - Ok(None) + pub fn GetBuildID(&self) -> Fallible { + Ok(~"") } pub fn JavaEnabled(&self) -> Fallible { @@ -58,24 +58,24 @@ impl Navigator { false } - pub fn AppName(&self) -> Option { - Some(~"Netscape") // Like Gecko/Webkit + pub fn AppName(&self) -> DOMString { + ~"Netscape" // Like Gecko/Webkit } - pub fn GetAppCodeName(&self) -> Fallible> { - Ok(Some(~"Mozilla")) // Like Gecko/Webkit + pub fn GetAppCodeName(&self) -> Fallible { + Ok(~"Mozilla") // Like Gecko/Webkit } - pub fn GetAppVersion(&self) -> Fallible> { - Ok(None) + pub fn GetAppVersion(&self) -> Fallible { + Ok(~"") } - pub fn GetPlatform(&self) -> Fallible> { - Ok(None) + pub fn GetPlatform(&self) -> Fallible { + Ok(~"") } - pub fn GetUserAgent(&self) -> Fallible> { - Ok(None) + pub fn GetUserAgent(&self) -> Fallible { + Ok(~"") } pub fn GetLanguage(&self) -> Option { diff --git a/src/components/script/dom/node.rs b/src/components/script/dom/node.rs index 9b3468688d2..e2369b786b9 100644 --- a/src/components/script/dom/node.rs +++ b/src/components/script/dom/node.rs @@ -561,11 +561,11 @@ impl Node { } } - pub fn NodeName(&self, abstract_self: AbstractNode) -> Option { - Some(match self.type_id { + pub fn NodeName(&self, abstract_self: AbstractNode) -> DOMString { + match self.type_id { ElementNodeTypeId(*) => { do abstract_self.with_imm_element |element| { - element.TagName().expect("tagName should never be null") + element.TagName() } } CommentNodeTypeId => ~"#comment", @@ -577,7 +577,7 @@ impl Node { }, DocumentFragmentNodeTypeId => ~"#document-fragment", DocumentNodeTypeId(_) => ~"#document" - }) + } } pub fn GetBaseURI(&self) -> Option { @@ -628,7 +628,7 @@ impl Node { // ProcessingInstruction CommentNodeTypeId | TextNodeTypeId => { do abstract_self.with_imm_characterdata() |characterdata| { - characterdata.Data() + Some(characterdata.Data()) } } _ => { @@ -648,8 +648,7 @@ impl Node { for node in abstract_self.traverse_preorder() { if node.is_text() { do node.with_imm_text() |text| { - let s = text.element.Data(); - content = content + null_str_as_empty(&s); + content = content + text.element.Data(); } } } @@ -657,7 +656,7 @@ impl Node { } CommentNodeTypeId | TextNodeTypeId => { do abstract_self.with_imm_characterdata() |characterdata| { - characterdata.Data() + Some(characterdata.Data()) } } DoctypeNodeTypeId | DocumentNodeTypeId(_) => { @@ -940,17 +939,14 @@ impl Node { pub fn SetTextContent(&mut self, abstract_self: AbstractNode, value: &Option) -> ErrorResult { - let is_empty = match value { - &Some(~"") | &None => true, - _ => false - }; + let value = null_str_as_empty(value); match self.type_id { DocumentFragmentNodeTypeId | ElementNodeTypeId(*) => { - let node = if is_empty { + let node = if value.len() == 0 { None } else { let document = self.owner_doc(); - Some(document.document().CreateTextNode(document, value)) + Some(document.document().CreateTextNode(document, &value)) }; self.replace_all(abstract_self, node); } @@ -958,7 +954,7 @@ impl Node { self.wait_until_safe_to_modify_dom(); do abstract_self.with_mut_characterdata() |characterdata| { - characterdata.data = null_str_as_empty(value); + characterdata.data = value.clone(); // Notify the document that the content of this node is different let document = self.owner_doc(); diff --git a/src/components/script/dom/text.rs b/src/components/script/dom/text.rs index b7b49ad3d3d..a0d866b21bd 100644 --- a/src/components/script/dom/text.rs +++ b/src/components/script/dom/text.rs @@ -3,7 +3,7 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ use dom::bindings::codegen::TextBinding; -use dom::bindings::utils::{DOMString, Fallible, null_str_as_empty}; +use dom::bindings::utils::{DOMString, Fallible}; use dom::characterdata::CharacterData; use dom::document::AbstractDocument; use dom::node::{AbstractNode, ScriptView, Node, TextNodeTypeId}; @@ -26,15 +26,15 @@ impl Text { Node::reflect_node(@mut node, document, TextBinding::Wrap) } - pub fn Constructor(owner: @mut Window, text: &Option) -> Fallible> { - Ok(Text::new(null_str_as_empty(text), owner.Document())) + pub fn Constructor(owner: @mut Window, text: &DOMString) -> Fallible> { + Ok(Text::new(text.clone(), owner.Document())) } pub fn SplitText(&self, _offset: u32) -> Fallible> { fail!("unimplemented") } - pub fn GetWholeText(&self) -> Fallible> { - Ok(None) + pub fn GetWholeText(&self) -> Fallible { + Ok(~"") } } diff --git a/src/components/script/dom/uievent.rs b/src/components/script/dom/uievent.rs index 313f658ee20..b3a48c69d2b 100644 --- a/src/components/script/dom/uievent.rs +++ b/src/components/script/dom/uievent.rs @@ -33,7 +33,7 @@ impl UIEvent { } pub fn Constructor(owner: @mut Window, - type_: &Option, + type_: &DOMString, init: &UIEventBinding::UIEventInit) -> Fallible { let ev = UIEvent::new(owner, UIEventTypeId); ev.mut_uievent().InitUIEvent(type_, init.parent.bubbles, init.parent.cancelable, @@ -50,7 +50,7 @@ impl UIEvent { } pub fn InitUIEvent(&mut self, - type_: &Option, + type_: &DOMString, can_bubble: bool, cancelable: bool, view: Option<@mut WindowProxy>, diff --git a/src/components/script/dom/window.rs b/src/components/script/dom/window.rs index d35dcd92ec7..093e699d3f5 100644 --- a/src/components/script/dom/window.rs +++ b/src/components/script/dom/window.rs @@ -3,8 +3,8 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ use dom::bindings::codegen::WindowBinding; -use dom::bindings::utils::{Reflectable, Reflector}; -use dom::bindings::utils::{DOMString, null_str_as_empty, Traceable}; +use dom::bindings::utils::{Reflectable, Reflector, Traceable}; +use dom::bindings::utils::DOMString; use dom::document::AbstractDocument; use dom::eventtarget::{EventTarget, WindowTypeId}; use dom::node::{AbstractNode, ScriptView}; @@ -72,9 +72,9 @@ pub struct TimerData { } impl Window { - pub fn Alert(&self, s: &Option) { + pub fn Alert(&self, s: &DOMString) { // Right now, just print to the console - println(format!("ALERT: {:s}", null_str_as_empty(s))); + println(format!("ALERT: {:s}", *s)); } pub fn Close(&self) { @@ -85,18 +85,18 @@ impl Window { self.page.frame.unwrap().document } - pub fn Name(&self) -> Option { - None + pub fn Name(&self) -> DOMString { + ~"" } - pub fn SetName(&self, _name: &Option) { + pub fn SetName(&self, _name: &DOMString) { } - pub fn Status(&self) -> Option { - None + pub fn Status(&self) -> DOMString { + ~"" } - pub fn SetStatus(&self, _status: &Option) { + pub fn SetStatus(&self, _status: &DOMString) { } pub fn Closed(&self) -> bool { @@ -123,18 +123,18 @@ impl Window { self.navigator.unwrap() } - pub fn Confirm(&self, _message: &Option) -> bool { + pub fn Confirm(&self, _message: &DOMString) -> bool { false } - pub fn Prompt(&self, _message: &Option, _default: &Option) -> Option { + pub fn Prompt(&self, _message: &DOMString, _default: &DOMString) -> Option { None } pub fn Print(&self) { } - pub fn ShowModalDialog(&self, _cx: *JSContext, _url: &Option, _argument: JSVal) -> JSVal { + pub fn ShowModalDialog(&self, _cx: *JSContext, _url: &DOMString, _argument: JSVal) -> JSVal { JSVAL_NULL } } diff --git a/src/components/script/script_task.rs b/src/components/script/script_task.rs index 8a21e984639..1a97730772d 100644 --- a/src/components/script/script_task.rs +++ b/src/components/script/script_task.rs @@ -772,7 +772,7 @@ impl ScriptTask { // "load" event as soon as we've finished executing all scripts parsed during // the initial load. let event = Event::new(window, HTMLEventTypeId); - event.mut_event().InitEvent(&Some(~"load"), false, false); + event.mut_event().InitEvent(&~"load", false, false); let doctarget = AbstractEventTarget::from_document(document); let wintarget = AbstractEventTarget::from_window(window); window.eventtarget.dispatch_event_with_target(wintarget, Some(doctarget), event);