From 803cd4b7cfa0e846d5fa89be04ef4140e6f1a7d2 Mon Sep 17 00:00:00 2001 From: Ms2ger Date: Sat, 9 Nov 2013 21:30:41 +0100 Subject: [PATCH] Make DOMString represent a non-nullable string. --- src/components/script/dom/attr.rs | 14 +-- .../dom/bindings/codegen/CodegenRust.py | 10 +-- src/components/script/dom/bindings/utils.rs | 12 +-- src/components/script/dom/characterdata.rs | 12 +-- src/components/script/dom/comment.rs | 2 +- src/components/script/dom/document.rs | 22 ++--- src/components/script/dom/documenttype.rs | 6 +- src/components/script/dom/domparser.rs | 2 +- src/components/script/dom/element.rs | 62 ++++++------- src/components/script/dom/event.rs | 6 +- src/components/script/dom/eventtarget.rs | 4 +- src/components/script/dom/formdata.rs | 8 +- .../script/dom/htmlanchorelement.rs | 52 +++++------ .../script/dom/htmlappletelement.rs | 36 ++++---- src/components/script/dom/htmlareaelement.rs | 28 +++--- src/components/script/dom/htmlbaseelement.rs | 8 +- src/components/script/dom/htmlbodyelement.rs | 24 ++--- src/components/script/dom/htmlbrelement.rs | 4 +- .../script/dom/htmlbuttonelement.rs | 34 +++---- src/components/script/dom/htmlcollection.rs | 4 +- src/components/script/dom/htmldataelement.rs | 4 +- src/components/script/dom/htmldivelement.rs | 4 +- src/components/script/dom/htmldlistelement.rs | 4 +- src/components/script/dom/htmlelement.rs | 26 +++--- src/components/script/dom/htmlembedelement.rs | 24 ++--- .../script/dom/htmlfieldsetelement.rs | 10 +-- src/components/script/dom/htmlfontelement.rs | 12 +-- src/components/script/dom/htmlformelement.rs | 32 +++---- src/components/script/dom/htmlframeelement.rs | 28 +++--- .../script/dom/htmlframesetelement.rs | 8 +- .../script/dom/htmlheadingelement.rs | 4 +- src/components/script/dom/htmlhrelement.rs | 16 ++-- src/components/script/dom/htmlhtmlelement.rs | 4 +- .../script/dom/htmliframeelement.rs | 50 +++++------ src/components/script/dom/htmlimageelement.rs | 34 +++---- src/components/script/dom/htmlinputelement.rs | 88 +++++++++---------- src/components/script/dom/htmllabelelement.rs | 4 +- .../script/dom/htmllegendelement.rs | 4 +- src/components/script/dom/htmllielement.rs | 4 +- src/components/script/dom/htmllinkelement.rs | 36 ++++---- src/components/script/dom/htmlmapelement.rs | 4 +- src/components/script/dom/htmlmediaelement.rs | 16 ++-- src/components/script/dom/htmlmetaelement.rs | 16 ++-- src/components/script/dom/htmlmodelement.rs | 8 +- .../script/dom/htmlobjectelement.rs | 56 ++++++------ src/components/script/dom/htmlolistelement.rs | 4 +- .../script/dom/htmloptgroupelement.rs | 4 +- .../script/dom/htmloptionelement.rs | 12 +-- .../script/dom/htmloutputelement.rs | 20 ++--- .../script/dom/htmlparagraphelement.rs | 4 +- src/components/script/dom/htmlparamelement.rs | 16 ++-- src/components/script/dom/htmlquoteelement.rs | 4 +- .../script/dom/htmlscriptelement.rs | 28 +++--- .../script/dom/htmlselectelement.rs | 18 ++-- .../script/dom/htmlsourceelement.rs | 12 +-- src/components/script/dom/htmlstyleelement.rs | 8 +- .../script/dom/htmltablecaptionelement.rs | 4 +- .../script/dom/htmltablecellelement.rs | 44 +++++----- .../script/dom/htmltablecolelement.rs | 20 ++--- src/components/script/dom/htmltableelement.rs | 36 ++++---- .../script/dom/htmltablerowelement.rs | 20 ++--- .../script/dom/htmltablesectionelement.rs | 16 ++-- .../script/dom/htmltextareaelement.rs | 34 +++---- src/components/script/dom/htmltimeelement.rs | 4 +- src/components/script/dom/htmltitleelement.rs | 4 +- src/components/script/dom/htmltrackelement.rs | 16 ++-- src/components/script/dom/htmlulistelement.rs | 4 +- src/components/script/dom/htmlvideoelement.rs | 4 +- src/components/script/dom/mouseevent.rs | 6 +- src/components/script/dom/namespace.rs | 4 +- src/components/script/dom/navigator.rs | 24 ++--- src/components/script/dom/node.rs | 24 ++--- src/components/script/dom/text.rs | 4 +- src/components/script/dom/uievent.rs | 4 +- src/components/script/dom/window.rs | 16 ++-- 75 files changed, 632 insertions(+), 632 deletions(-) diff --git a/src/components/script/dom/attr.rs b/src/components/script/dom/attr.rs index 310dc2f3de6..03d6a2e8d9f 100644 --- a/src/components/script/dom/attr.rs +++ b/src/components/script/dom/attr.rs @@ -16,7 +16,7 @@ pub struct Attr { value: ~str, name: ~str, namespace: Namespace, - prefix: DOMString + prefix: Option } impl Reflectable for Attr { @@ -69,27 +69,27 @@ impl Attr { } } - pub fn LocalName(&self) -> DOMString { + pub fn LocalName(&self) -> Option { Some(self.local_name().to_owned()) } - pub fn Value(&self) -> DOMString { + pub fn Value(&self) -> Option { Some(self.value.clone()) } - pub fn SetValue(&mut self, value: &DOMString) { + pub fn SetValue(&mut self, value: &Option) { self.value = null_str_as_empty(value); } - pub fn Name(&self) -> DOMString { + pub fn Name(&self) -> Option { Some(self.name.clone()) } - pub fn GetNamespaceURI(&self) -> DOMString { + pub fn GetNamespaceURI(&self) -> Option { self.namespace.to_str() } - pub fn GetPrefix(&self) -> DOMString { + pub fn GetPrefix(&self) -> Option { self.prefix.clone() } } diff --git a/src/components/script/dom/bindings/codegen/CodegenRust.py b/src/components/script/dom/bindings/codegen/CodegenRust.py index 9f333ca6e75..c1739f1c13c 100644 --- a/src/components/script/dom/bindings/codegen/CodegenRust.py +++ b/src/components/script/dom/bindings/codegen/CodegenRust.py @@ -1110,10 +1110,10 @@ for (uint32_t i = 0; i < length; ++i) { declType, None, isOptional, None) if isOptional: - declType = "Option" + declType = "Option>" initialValue = "None" else: - declType = "DOMString" + declType = "Option" initialValue = None return ( @@ -1722,7 +1722,7 @@ def getRetvalDeclarationForType(returnType, descriptorProvider, result = CGWrapper(result, pre="Nullable<", post=">") return result, False if returnType.isString(): - return CGGeneric("DOMString"), False + return CGGeneric("Option"), False if returnType.isEnum(): if returnType.nullable(): raise TypeError("We don't support nullable enum return values") @@ -2960,8 +2960,8 @@ class CGCallGenerator(CGThing): if a.type.isObject() and not a.type.nullable() and not a.optional: name = "(JSObject&)" + name #XXXjdm Perhaps we should pass all nontrivial types by borrowed pointer - # Aoid passing Option by reference. If only one of optional or - # defaultValue are truthy we pass an Option, otherwise it's a concrete DOMString. + # Aoid passing Option> by reference. If only one of optional or + # defaultValue are truthy we pass an Option, otherwise it's a concrete Option. if a.type.isDictionary() or (a.type.isString() and not (bool(a.defaultValue) ^ a.optional)): name = "&" + name args.append(CGGeneric(name)) diff --git a/src/components/script/dom/bindings/utils.rs b/src/components/script/dom/bindings/utils.rs index 6fa2a8ec0c3..61b6ad54776 100644 --- a/src/components/script/dom/bindings/utils.rs +++ b/src/components/script/dom/bindings/utils.rs @@ -116,9 +116,9 @@ extern fn InterfaceObjectToString(cx: *JSContext, _argc: c_uint, vp: *mut JSVal) } } -pub type DOMString = Option<~str>; +pub type DOMString = ~str; -pub fn null_str_as_empty(s: &DOMString) -> ~str { +pub fn null_str_as_empty(s: &Option) -> ~str { // We don't use map_default because it would allocate ~"" even for Some. match *s { Some(ref s) => s.clone(), @@ -126,14 +126,14 @@ pub fn null_str_as_empty(s: &DOMString) -> ~str { } } -pub fn null_str_as_empty_ref<'a>(s: &'a DOMString) -> &'a str { +pub fn null_str_as_empty_ref<'a>(s: &'a Option) -> &'a str { match *s { Some(ref s) => s.as_slice(), None => &'a "" } } -pub fn null_str_as_word_null(s: &DOMString) -> ~str { +pub fn null_str_as_word_null(s: &Option) -> ~str { // We don't use map_default because it would allocate ~"null" even for Some. match *s { Some(ref s) => s.clone(), @@ -259,7 +259,7 @@ pub fn jsval_to_str(cx: *JSContext, v: JSVal, } #[fixed_stack_segment] -pub fn jsval_to_domstring(cx: *JSContext, v: JSVal) -> Result { +pub fn jsval_to_domstring(cx: *JSContext, v: JSVal) -> Result, ()> { if jsval::is_null(v) || jsval::is_undefined(v) { Ok(None) } else { @@ -273,7 +273,7 @@ pub fn jsval_to_domstring(cx: *JSContext, v: JSVal) -> Result { } #[fixed_stack_segment] -pub unsafe fn domstring_to_jsval(cx: *JSContext, string: &DOMString) -> JSVal { +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| { diff --git a/src/components/script/dom/characterdata.rs b/src/components/script/dom/characterdata.rs index f84ebbbdb50..ad4dc67ee1c 100644 --- a/src/components/script/dom/characterdata.rs +++ b/src/components/script/dom/characterdata.rs @@ -22,11 +22,11 @@ impl CharacterData { } } - pub fn Data(&self) -> DOMString { + pub fn Data(&self) -> Option { Some(self.data.clone()) } - pub fn SetData(&mut self, arg: &DOMString) -> ErrorResult { + pub fn SetData(&mut self, arg: &Option) -> ErrorResult { self.data = arg.get_ref().clone(); Ok(()) } @@ -35,16 +35,16 @@ impl CharacterData { self.data.len() as u32 } - pub fn SubstringData(&self, offset: u32, count: u32) -> Fallible { + pub fn SubstringData(&self, offset: u32, count: u32) -> Fallible> { Ok(Some(self.data.slice(offset as uint, count as uint).to_str())) } - pub fn AppendData(&mut self, arg: &DOMString) -> ErrorResult { + pub fn AppendData(&mut self, arg: &Option) -> ErrorResult { self.data.push_str(arg.get_ref().clone()); Ok(()) } - pub fn InsertData(&mut self, _offset: u32, _arg: &DOMString) -> ErrorResult { + pub fn InsertData(&mut self, _offset: u32, _arg: &Option) -> 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: &DOMString) -> ErrorResult { + pub fn ReplaceData(&mut self, _offset: u32, _count: u32, _arg: &Option) -> ErrorResult { fail!("CharacterData::ReplaceData() is unimplemented") } } diff --git a/src/components/script/dom/comment.rs b/src/components/script/dom/comment.rs index bd238af7b50..6971cef2ead 100644 --- a/src/components/script/dom/comment.rs +++ b/src/components/script/dom/comment.rs @@ -26,7 +26,7 @@ impl Comment { Node::reflect_node(@mut node, document, CommentBinding::Wrap) } - pub fn Constructor(owner: @mut Window, data: &DOMString) -> Fallible> { + pub fn Constructor(owner: @mut Window, data: &Option) -> Fallible> { Ok(Comment::new(null_str_as_empty(data), owner.Document())) } } diff --git a/src/components/script/dom/document.rs b/src/components/script/dom/document.rs index e7542fc8975..15d68e2cc8f 100644 --- a/src/components/script/dom/document.rs +++ b/src/components/script/dom/document.rs @@ -180,19 +180,19 @@ impl Document { self.window.get_cx() } - pub fn GetElementsByTagName(&self, tag: &DOMString) -> @mut HTMLCollection { + pub fn GetElementsByTagName(&self, tag: &Option) -> @mut HTMLCollection { self.createHTMLCollection(|elem| eq_slice(elem.tag_name, null_str_as_empty(tag))) } - pub fn GetElementsByTagNameNS(&self, _ns: &DOMString, _tag: &DOMString) -> @mut HTMLCollection { + pub fn GetElementsByTagNameNS(&self, _ns: &Option, _tag: &Option) -> @mut HTMLCollection { HTMLCollection::new(self.window, ~[]) } - pub fn GetElementsByClassName(&self, _class: &DOMString) -> @mut HTMLCollection { + pub fn GetElementsByClassName(&self, _class: &Option) -> @mut HTMLCollection { HTMLCollection::new(self.window, ~[]) } - pub fn GetElementById(&self, id: &DOMString) -> Option> { + pub fn GetElementById(&self, id: &Option) -> Option> { let key: &~str = &null_str_as_empty(id); // TODO: "in tree order, within the context object's tree" // http://dom.spec.whatwg.org/#dom-document-getelementbyid. @@ -202,7 +202,7 @@ impl Document { } } - pub fn CreateElement(&self, abstract_self: AbstractDocument, local_name: &DOMString) -> Fallible> { + 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 { return Err(InvalidCharacter); @@ -215,15 +215,15 @@ impl Document { DocumentFragment::new(abstract_self) } - pub fn CreateTextNode(&self, abstract_self: AbstractDocument, data: &DOMString) -> AbstractNode { + pub fn CreateTextNode(&self, abstract_self: AbstractDocument, data: &Option) -> AbstractNode { Text::new(null_str_as_empty(data), abstract_self) } - pub fn CreateComment(&self, abstract_self: AbstractDocument, data: &DOMString) -> AbstractNode { + pub fn CreateComment(&self, abstract_self: AbstractDocument, data: &Option) -> AbstractNode { Comment::new(null_str_as_word_null(data), abstract_self) } - pub fn CreateEvent(&self, interface: &DOMString) -> Fallible { + pub fn CreateEvent(&self, interface: &Option) -> Fallible { match null_str_as_empty_ref(interface) { "UIEvents" => Ok(UIEvent::new(self.window, UIEventTypeId)), "MouseEvents" => Ok(MouseEvent::new(self.window)), @@ -232,7 +232,7 @@ impl Document { } } - pub fn Title(&self, _: AbstractDocument) -> DOMString { + pub fn Title(&self, _: AbstractDocument) -> Option { let mut title = ~""; match self.doctype { SVG => { @@ -266,7 +266,7 @@ impl Document { Some(title) } - pub fn SetTitle(&self, abstract_self: AbstractDocument, title: &DOMString) -> ErrorResult { + pub fn SetTitle(&self, abstract_self: AbstractDocument, title: &Option) -> ErrorResult { match self.doctype { SVG => { fail!("no SVG document yet") @@ -305,7 +305,7 @@ impl Document { Ok(()) } - pub fn GetElementsByName(&self, name: &DOMString) -> @mut HTMLCollection { + pub fn GetElementsByName(&self, name: &Option) -> @mut HTMLCollection { self.createHTMLCollection(|elem| elem.get_attr("name").is_some() && eq_slice(elem.get_attr("name").unwrap(), null_str_as_empty(name))) } diff --git a/src/components/script/dom/documenttype.rs b/src/components/script/dom/documenttype.rs index 463ddcfa239..797a75ea04c 100644 --- a/src/components/script/dom/documenttype.rs +++ b/src/components/script/dom/documenttype.rs @@ -47,15 +47,15 @@ impl DocumentType { } impl DocumentType { - pub fn Name(&self) -> DOMString { + pub fn Name(&self) -> Option { Some(self.name.clone()) } - pub fn PublicId(&self) -> DOMString { + pub fn PublicId(&self) -> Option { self.public_id.clone() } - pub fn SystemId(&self) -> DOMString { + pub fn SystemId(&self) -> Option { self.system_id.clone() } } diff --git a/src/components/script/dom/domparser.rs b/src/components/script/dom/domparser.rs index 7fc874d05d1..6c657daf170 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: &DOMString, + _s: &Option, ty: DOMParserBinding::SupportedType) -> Fallible { match ty { diff --git a/src/components/script/dom/element.rs b/src/components/script/dom/element.rs index d0baf973bc9..a3d4257b393 100644 --- a/src/components/script/dom/element.rs +++ b/src/components/script/dom/element.rs @@ -154,7 +154,7 @@ impl<'self> Element { } } - pub fn normalize_attr_name(&self, name: &DOMString) -> ~str { + pub fn normalize_attr_name(&self, name: &Option) -> ~str { //FIXME: Throw for XML-invalid names let owner = self.node.owner_doc(); if owner.document().doctype == document::HTML { // && self.namespace == Namespace::HTML @@ -165,7 +165,7 @@ impl<'self> Element { } pub fn get_attribute<'a>(&'a self, - namespace_url: &DOMString, + namespace_url: &Option, name: &str) -> Option<@mut Attr> { let namespace = Namespace::from_str(namespace_url); // FIXME: only case-insensitive in the HTML namespace (as opposed to SVG, etc.) @@ -179,16 +179,16 @@ impl<'self> Element { pub fn set_attr(&mut self, abstract_self: AbstractNode, - raw_name: &DOMString, - raw_value: &DOMString) -> ErrorResult { + raw_name: &Option, + raw_value: &Option) -> ErrorResult { self.set_attribute(abstract_self, namespace::Null, raw_name, raw_value) } pub fn set_attribute(&mut self, abstract_self: AbstractNode, namespace: Namespace, - raw_name: &DOMString, - raw_value: &DOMString) -> ErrorResult { + raw_name: &Option, + raw_value: &Option) -> ErrorResult { //FIXME: Throw for XML-invalid names //FIXME: Throw for XMLNS-invalid names let name = null_str_as_empty(raw_name).to_ascii_lower(); @@ -246,7 +246,7 @@ impl<'self> Element { abstract_self: AbstractNode, namespace: &Namespace, local_name: ~str, - value: &DOMString) { + value: &Option) { if "style" == local_name && *namespace == namespace::Null { self.style_attribute = Some(style::parse_style_attribute( @@ -280,43 +280,43 @@ impl<'self> Element { } impl Element { - pub fn TagName(&self) -> DOMString { + pub fn TagName(&self) -> Option { Some(self.tag_name.to_owned().to_ascii_upper()) } - pub fn Id(&self, _abstract_self: AbstractNode) -> DOMString { + pub fn Id(&self, _abstract_self: AbstractNode) -> Option { match self.get_attr(&"id") { Some(x) => Some(x), None => Some(~"") } } - pub fn SetId(&mut self, abstract_self: AbstractNode, id: &DOMString) { + pub fn SetId(&mut self, abstract_self: AbstractNode, id: &Option) { self.set_attribute(abstract_self, namespace::Null, &Some(~"id"), id); } - pub fn GetAttribute(&self, name: &DOMString) -> DOMString { + pub fn GetAttribute(&self, name: &Option) -> Option { self.get_attr(null_str_as_empty_ref(name)) } - pub fn GetAttributeNS(&self, namespace: &DOMString, local_name: &DOMString) -> DOMString { + pub fn GetAttributeNS(&self, namespace: &Option, local_name: &Option) -> Option { self.get_attribute(namespace, null_str_as_empty_ref(local_name)) .map(|attr| attr.value.clone()) } pub fn SetAttribute(&mut self, abstract_self: AbstractNode, - name: &DOMString, - value: &DOMString) -> ErrorResult { + name: &Option, + value: &Option) -> ErrorResult { self.set_attr(abstract_self, name, value); Ok(()) } pub fn SetAttributeNS(&mut self, abstract_self: AbstractNode, - namespace_url: &DOMString, - name: &DOMString, - value: &DOMString) -> ErrorResult { + namespace_url: &Option, + name: &Option, + value: &Option) -> ErrorResult { let name_type = xml_name_type(name.to_str()); match name_type { InvalidXMLName => return Err(InvalidCharacter), @@ -328,35 +328,35 @@ impl Element { self.set_attribute(abstract_self, namespace, name, value) } - pub fn RemoveAttribute(&self, _name: &DOMString) -> ErrorResult { + pub fn RemoveAttribute(&self, _name: &Option) -> ErrorResult { Ok(()) } - pub fn RemoveAttributeNS(&self, _namespace: &DOMString, _localname: &DOMString) -> ErrorResult { + pub fn RemoveAttributeNS(&self, _namespace: &Option, _localname: &Option) -> ErrorResult { Ok(()) } - pub fn HasAttribute(&self, name: &DOMString) -> bool { + pub fn HasAttribute(&self, name: &Option) -> bool { self.GetAttribute(name).is_some() } - pub fn HasAttributeNS(&self, namespace: &DOMString, local_name: &DOMString) -> bool { + pub fn HasAttributeNS(&self, namespace: &Option, local_name: &Option) -> bool { self.GetAttributeNS(namespace, local_name).is_some() } - pub fn GetElementsByTagName(&self, _localname: &DOMString) -> @mut HTMLCollection { + pub fn GetElementsByTagName(&self, _localname: &Option) -> @mut HTMLCollection { HTMLCollection::new(self.node.owner_doc().document().window, ~[]) } - pub fn GetElementsByTagNameNS(&self, _namespace: &DOMString, _localname: &DOMString) -> Fallible<@mut HTMLCollection> { + pub fn GetElementsByTagNameNS(&self, _namespace: &Option, _localname: &Option) -> Fallible<@mut HTMLCollection> { Ok(HTMLCollection::new(self.node.owner_doc().document().window, ~[])) } - pub fn GetElementsByClassName(&self, _names: &DOMString) -> @mut HTMLCollection { + pub fn GetElementsByClassName(&self, _names: &Option) -> @mut HTMLCollection { HTMLCollection::new(self.node.owner_doc().document().window, ~[]) } - pub fn MozMatchesSelector(&self, _selector: &DOMString) -> Fallible { + pub fn MozMatchesSelector(&self, _selector: &Option) -> Fallible { Ok(false) } @@ -452,27 +452,27 @@ impl Element { 0 } - pub fn GetInnerHTML(&self) -> Fallible { + pub fn GetInnerHTML(&self) -> Fallible> { Ok(None) } - pub fn SetInnerHTML(&mut self, _value: &DOMString) -> ErrorResult { + pub fn SetInnerHTML(&mut self, _value: &Option) -> ErrorResult { Ok(()) } - pub fn GetOuterHTML(&self) -> Fallible { + pub fn GetOuterHTML(&self) -> Fallible> { Ok(None) } - pub fn SetOuterHTML(&mut self, _value: &DOMString) -> ErrorResult { + pub fn SetOuterHTML(&mut self, _value: &Option) -> ErrorResult { Ok(()) } - pub fn InsertAdjacentHTML(&mut self, _position: &DOMString, _text: &DOMString) -> ErrorResult { + pub fn InsertAdjacentHTML(&mut self, _position: &Option, _text: &Option) -> ErrorResult { Ok(()) } - pub fn QuerySelector(&self, _selectors: &DOMString) -> Fallible>> { + pub fn QuerySelector(&self, _selectors: &Option) -> Fallible>> { Ok(None) } } diff --git a/src/components/script/dom/event.rs b/src/components/script/dom/event.rs index aa70ade8f5c..985c5bf7cf4 100644 --- a/src/components/script/dom/event.rs +++ b/src/components/script/dom/event.rs @@ -181,7 +181,7 @@ impl Event { self.phase as u16 } - pub fn Type(&self) -> DOMString { + pub fn Type(&self) -> Option { Some(self.type_.clone()) } @@ -225,7 +225,7 @@ impl Event { } pub fn InitEvent(&mut self, - type_: &DOMString, + type_: &Option, bubbles: bool, cancelable: bool) -> ErrorResult { self.type_ = null_str_as_word_null(type_); @@ -240,7 +240,7 @@ impl Event { } pub fn Constructor(global: @mut Window, - type_: &DOMString, + type_: &Option, 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 77753fd3b5a..e584d544637 100644 --- a/src/components/script/dom/eventtarget.rs +++ b/src/components/script/dom/eventtarget.rs @@ -141,7 +141,7 @@ impl EventTarget { } pub fn AddEventListener(&mut self, - ty: &DOMString, + ty: &Option, listener: Option, capture: bool) { for &listener in listener.iter() { @@ -158,7 +158,7 @@ impl EventTarget { } pub fn RemoveEventListener(&mut self, - ty: &DOMString, + ty: &Option, listener: Option, capture: bool) { for &listener in listener.iter() { diff --git a/src/components/script/dom/formdata.rs b/src/components/script/dom/formdata.rs index de34386bcac..1c95f2b7b3b 100644 --- a/src/components/script/dom/formdata.rs +++ b/src/components/script/dom/formdata.rs @@ -11,8 +11,8 @@ use dom::window::Window; use std::hashmap::HashMap; enum FormDatum { - StringData(DOMString), - BlobData { blob: @mut Blob, name: DOMString } + StringData(Option), + BlobData { blob: @mut Blob, name: Option } } pub struct FormData { @@ -34,7 +34,7 @@ impl FormData { reflect_dom_object(@mut FormData::new_inherited(window), window, FormDataBinding::Wrap) } - pub fn Append(&mut self, name: &DOMString, value: @mut Blob, filename: Option) { + pub fn Append(&mut self, name: &Option, value: @mut Blob, filename: Option>) { let blob = BlobData { blob: value, name: filename.unwrap_or(Some(~"default")) @@ -42,7 +42,7 @@ impl FormData { self.data.insert(null_str_as_empty(name), blob); } - pub fn Append_(&mut self, name: &DOMString, value: &DOMString) { + pub fn Append_(&mut self, name: &Option, value: &Option) { self.data.insert(null_str_as_empty(name), StringData((*value).clone())); } } diff --git a/src/components/script/dom/htmlanchorelement.rs b/src/components/script/dom/htmlanchorelement.rs index 21a28aecaeb..4f11edbc288 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) -> DOMString { + pub fn Href(&self) -> Option { None } - pub fn SetHref(&mut self, _href: &DOMString) -> ErrorResult { + pub fn SetHref(&mut self, _href: &Option) -> ErrorResult { Ok(()) } - pub fn Target(&self) -> DOMString { + pub fn Target(&self) -> Option { None } - pub fn SetTarget(&self, _target: &DOMString) -> ErrorResult { + pub fn SetTarget(&self, _target: &Option) -> ErrorResult { Ok(()) } - pub fn Download(&self) -> DOMString { + pub fn Download(&self) -> Option { None } - pub fn SetDownload(&self, _download: &DOMString) -> ErrorResult { + pub fn SetDownload(&self, _download: &Option) -> ErrorResult { Ok(()) } - pub fn Ping(&self) -> DOMString { + pub fn Ping(&self) -> Option { None } - pub fn SetPing(&self, _ping: &DOMString) -> ErrorResult { + pub fn SetPing(&self, _ping: &Option) -> ErrorResult { Ok(()) } - pub fn Rel(&self) -> DOMString { + pub fn Rel(&self) -> Option { None } - pub fn SetRel(&self, _rel: &DOMString) -> ErrorResult { + pub fn SetRel(&self, _rel: &Option) -> ErrorResult { Ok(()) } - pub fn Hreflang(&self) -> DOMString { + pub fn Hreflang(&self) -> Option { None } - pub fn SetHreflang(&self, _href_lang: &DOMString) -> ErrorResult { + pub fn SetHreflang(&self, _href_lang: &Option) -> ErrorResult { Ok(()) } - pub fn Type(&self) -> DOMString { + pub fn Type(&self) -> Option { None } - pub fn SetType(&mut self, _type: &DOMString) -> ErrorResult { + pub fn SetType(&mut self, _type: &Option) -> ErrorResult { Ok(()) } - pub fn Text(&self) -> DOMString { + pub fn Text(&self) -> Option { None } - pub fn SetText(&mut self, _text: &DOMString) -> ErrorResult { + pub fn SetText(&mut self, _text: &Option) -> ErrorResult { Ok(()) } - pub fn Coords(&self) -> DOMString { + pub fn Coords(&self) -> Option { None } - pub fn SetCoords(&mut self, _coords: &DOMString) -> ErrorResult { + pub fn SetCoords(&mut self, _coords: &Option) -> ErrorResult { Ok(()) } - pub fn Charset(&self) -> DOMString { + pub fn Charset(&self) -> Option { None } - pub fn SetCharset(&mut self, _charset: &DOMString) -> ErrorResult { + pub fn SetCharset(&mut self, _charset: &Option) -> ErrorResult { Ok(()) } - pub fn Name(&self) -> DOMString { + pub fn Name(&self) -> Option { None } - pub fn SetName(&mut self, _name: &DOMString) -> ErrorResult { + pub fn SetName(&mut self, _name: &Option) -> ErrorResult { Ok(()) } - pub fn Rev(&self) -> DOMString { + pub fn Rev(&self) -> Option { None } - pub fn SetRev(&mut self, _rev: &DOMString) -> ErrorResult { + pub fn SetRev(&mut self, _rev: &Option) -> ErrorResult { Ok(()) } - pub fn Shape(&self) -> DOMString { + pub fn Shape(&self) -> Option { None } - pub fn SetShape(&mut self, _shape: &DOMString) -> ErrorResult { + pub fn SetShape(&mut self, _shape: &Option) -> ErrorResult { Ok(()) } } diff --git a/src/components/script/dom/htmlappletelement.rs b/src/components/script/dom/htmlappletelement.rs index 7471c3557d6..e2be12ceb09 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) -> DOMString { + pub fn Align(&self) -> Option { None } - pub fn SetAlign(&mut self, _align: &DOMString) -> ErrorResult { + pub fn SetAlign(&mut self, _align: &Option) -> ErrorResult { Ok(()) } - pub fn Alt(&self) -> DOMString { + pub fn Alt(&self) -> Option { None } - pub fn SetAlt(&self, _alt: &DOMString) -> ErrorResult { + pub fn SetAlt(&self, _alt: &Option) -> ErrorResult { Ok(()) } - pub fn Archive(&self) -> DOMString { + pub fn Archive(&self) -> Option { None } - pub fn SetArchive(&self, _archive: &DOMString) -> ErrorResult { + pub fn SetArchive(&self, _archive: &Option) -> ErrorResult { Ok(()) } - pub fn Code(&self) -> DOMString { + pub fn Code(&self) -> Option { None } - pub fn SetCode(&self, _code: &DOMString) -> ErrorResult { + pub fn SetCode(&self, _code: &Option) -> ErrorResult { Ok(()) } - pub fn CodeBase(&self) -> DOMString { + pub fn CodeBase(&self) -> Option { None } - pub fn SetCodeBase(&self, _code_base: &DOMString) -> ErrorResult { + pub fn SetCodeBase(&self, _code_base: &Option) -> ErrorResult { Ok(()) } - pub fn Height(&self) -> DOMString { + pub fn Height(&self) -> Option { None } - pub fn SetHeight(&self, _height: &DOMString) -> ErrorResult { + pub fn SetHeight(&self, _height: &Option) -> ErrorResult { Ok(()) } @@ -83,19 +83,19 @@ impl HTMLAppletElement { Ok(()) } - pub fn Name(&self) -> DOMString { + pub fn Name(&self) -> Option { None } - pub fn SetName(&mut self, _name: &DOMString) -> ErrorResult { + pub fn SetName(&mut self, _name: &Option) -> ErrorResult { Ok(()) } - pub fn Object(&self) -> DOMString { + pub fn Object(&self) -> Option { None } - pub fn SetObject(&mut self, _object: &DOMString) -> ErrorResult { + pub fn SetObject(&mut self, _object: &Option) -> ErrorResult { Ok(()) } @@ -107,11 +107,11 @@ impl HTMLAppletElement { Ok(()) } - pub fn Width(&self) -> DOMString { + pub fn Width(&self) -> Option { None } - pub fn SetWidth(&mut self, _width: &DOMString) -> ErrorResult { + pub fn SetWidth(&mut self, _width: &Option) -> ErrorResult { Ok(()) } } diff --git a/src/components/script/dom/htmlareaelement.rs b/src/components/script/dom/htmlareaelement.rs index 4f77f9a12ed..2a005020c2c 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) -> DOMString { + pub fn Alt(&self) -> Option { None } - pub fn SetAlt(&self, _alt: &DOMString) -> ErrorResult { + pub fn SetAlt(&self, _alt: &Option) -> ErrorResult { Ok(()) } - pub fn Coords(&self) -> DOMString { + pub fn Coords(&self) -> Option { None } - pub fn SetCoords(&self, _coords: &DOMString) -> ErrorResult { + pub fn SetCoords(&self, _coords: &Option) -> ErrorResult { Ok(()) } - pub fn Shape(&self) -> DOMString { + pub fn Shape(&self) -> Option { None } - pub fn SetShape(&self, _shape: &DOMString) -> ErrorResult { + pub fn SetShape(&self, _shape: &Option) -> ErrorResult { Ok(()) } - pub fn Href(&self) -> DOMString { + pub fn Href(&self) -> Option { None } - pub fn SetHref(&self, _href: &DOMString) -> ErrorResult { + pub fn SetHref(&self, _href: &Option) -> ErrorResult { Ok(()) } - pub fn Target(&self) -> DOMString { + pub fn Target(&self) -> Option { None } - pub fn SetTarget(&self, _target: &DOMString) -> ErrorResult { + pub fn SetTarget(&self, _target: &Option) -> ErrorResult { Ok(()) } - pub fn Download(&self) -> DOMString { + pub fn Download(&self) -> Option { None } - pub fn SetDownload(&self, _download: &DOMString) -> ErrorResult { + pub fn SetDownload(&self, _download: &Option) -> ErrorResult { Ok(()) } - pub fn Ping(&self) -> DOMString { + pub fn Ping(&self) -> Option { None } - pub fn SetPing(&self, _ping: &DOMString) -> ErrorResult { + pub fn SetPing(&self, _ping: &Option) -> ErrorResult { Ok(()) } diff --git a/src/components/script/dom/htmlbaseelement.rs b/src/components/script/dom/htmlbaseelement.rs index 077db6d8405..47b61ebbd86 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) -> DOMString { + pub fn Href(&self) -> Option { None } - pub fn SetHref(&self, _href: &DOMString) -> ErrorResult { + pub fn SetHref(&self, _href: &Option) -> ErrorResult { Ok(()) } - pub fn Target(&self) -> DOMString { + pub fn Target(&self) -> Option { None } - pub fn SetTarget(&self, _target: &DOMString) -> ErrorResult { + pub fn SetTarget(&self, _target: &Option) -> ErrorResult { Ok(()) } } diff --git a/src/components/script/dom/htmlbodyelement.rs b/src/components/script/dom/htmlbodyelement.rs index 4105c0742ad..1c812c0652f 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) -> DOMString { + pub fn Text(&self) -> Option { None } - pub fn SetText(&mut self, _text: &DOMString) -> ErrorResult { + pub fn SetText(&mut self, _text: &Option) -> ErrorResult { Ok(()) } - pub fn Link(&self) -> DOMString { + pub fn Link(&self) -> Option { None } - pub fn SetLink(&self, _link: &DOMString) -> ErrorResult { + pub fn SetLink(&self, _link: &Option) -> ErrorResult { Ok(()) } - pub fn VLink(&self) -> DOMString { + pub fn VLink(&self) -> Option { None } - pub fn SetVLink(&self, _v_link: &DOMString) -> ErrorResult { + pub fn SetVLink(&self, _v_link: &Option) -> ErrorResult { Ok(()) } - pub fn ALink(&self) -> DOMString { + pub fn ALink(&self) -> Option { None } - pub fn SetALink(&self, _a_link: &DOMString) -> ErrorResult { + pub fn SetALink(&self, _a_link: &Option) -> ErrorResult { Ok(()) } - pub fn BgColor(&self) -> DOMString { + pub fn BgColor(&self) -> Option { None } - pub fn SetBgColor(&self, _bg_color: &DOMString) -> ErrorResult { + pub fn SetBgColor(&self, _bg_color: &Option) -> ErrorResult { Ok(()) } - pub fn Background(&self) -> DOMString { + pub fn Background(&self) -> Option { None } - pub fn SetBackground(&self, _background: &DOMString) -> ErrorResult { + pub fn SetBackground(&self, _background: &Option) -> ErrorResult { Ok(()) } } diff --git a/src/components/script/dom/htmlbrelement.rs b/src/components/script/dom/htmlbrelement.rs index 653424c1c8c..b216171394c 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) -> DOMString { + pub fn Clear(&self) -> Option { None } - pub fn SetClear(&mut self, _text: &DOMString) -> ErrorResult { + pub fn SetClear(&mut self, _text: &Option) -> ErrorResult { Ok(()) } } diff --git a/src/components/script/dom/htmlbuttonelement.rs b/src/components/script/dom/htmlbuttonelement.rs index 5bd1c352d8e..fbf81b5f0dd 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) -> DOMString { + pub fn FormAction(&self) -> Option { None } - pub fn SetFormAction(&mut self, _formaction: &DOMString) -> ErrorResult { + pub fn SetFormAction(&mut self, _formaction: &Option) -> ErrorResult { Ok(()) } - pub fn FormEnctype(&self) -> DOMString { + pub fn FormEnctype(&self) -> Option { None } - pub fn SetFormEnctype(&mut self, _formenctype: &DOMString) -> ErrorResult { + pub fn SetFormEnctype(&mut self, _formenctype: &Option) -> ErrorResult { Ok(()) } - pub fn FormMethod(&self) -> DOMString { + pub fn FormMethod(&self) -> Option { None } - pub fn SetFormMethod(&mut self, _formmethod: &DOMString) -> ErrorResult { + pub fn SetFormMethod(&mut self, _formmethod: &Option) -> ErrorResult { Ok(()) } @@ -80,35 +80,35 @@ impl HTMLButtonElement { Ok(()) } - pub fn FormTarget(&self) -> DOMString { + pub fn FormTarget(&self) -> Option { None } - pub fn SetFormTarget(&mut self, _formtarget: &DOMString) -> ErrorResult { + pub fn SetFormTarget(&mut self, _formtarget: &Option) -> ErrorResult { Ok(()) } - pub fn Name(&self) -> DOMString { + pub fn Name(&self) -> Option { None } - pub fn SetName(&mut self, _name: &DOMString) -> ErrorResult { + pub fn SetName(&mut self, _name: &Option) -> ErrorResult { Ok(()) } - pub fn Type(&self) -> DOMString { + pub fn Type(&self) -> Option { None } - pub fn SetType(&mut self, _type: &DOMString) -> ErrorResult { + pub fn SetType(&mut self, _type: &Option) -> ErrorResult { Ok(()) } - pub fn Value(&self) -> DOMString { + pub fn Value(&self) -> Option { None } - pub fn SetValue(&mut self, _value: &DOMString) -> ErrorResult { + pub fn SetValue(&mut self, _value: &Option) -> ErrorResult { Ok(()) } @@ -127,11 +127,11 @@ impl HTMLButtonElement { pub fn SetValidity(&mut self, _validity: @mut ValidityState) { } - pub fn ValidationMessage(&self) -> DOMString { + pub fn ValidationMessage(&self) -> Option { None } - pub fn SetValidationMessage(&mut self, _message: &DOMString) -> ErrorResult { + pub fn SetValidationMessage(&mut self, _message: &Option) -> ErrorResult { Ok(()) } @@ -139,6 +139,6 @@ impl HTMLButtonElement { true } - pub fn SetCustomValidity(&mut self, _error: &DOMString) { + pub fn SetCustomValidity(&mut self, _error: &Option) { } } diff --git a/src/components/script/dom/htmlcollection.rs b/src/components/script/dom/htmlcollection.rs index 03a5ebac878..b42277d72ad 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: &DOMString) -> Fallible<*JSObject> { + pub fn NamedItem(&self, _cx: *JSContext, _name: &Option) -> Fallible<*JSObject> { Ok(ptr::null()) } @@ -55,7 +55,7 @@ impl HTMLCollection { self.Item(index) } - pub fn NamedGetter(&self, _cx: *JSContext, _name: &DOMString, _found: &mut bool) -> Fallible<*JSObject> { + pub fn NamedGetter(&self, _cx: *JSContext, _name: &Option, _found: &mut bool) -> Fallible<*JSObject> { Ok(ptr::null()) } } diff --git a/src/components/script/dom/htmldataelement.rs b/src/components/script/dom/htmldataelement.rs index 5e97f113cbf..7c367f9f300 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) -> DOMString { + pub fn Value(&self) -> Option { None } - pub fn SetValue(&mut self, _value: &DOMString) -> ErrorResult { + pub fn SetValue(&mut self, _value: &Option) -> ErrorResult { Ok(()) } } diff --git a/src/components/script/dom/htmldivelement.rs b/src/components/script/dom/htmldivelement.rs index 26ce3ba6a14..11d56dd1eda 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) -> DOMString { + pub fn Align(&self) -> Option { None } - pub fn SetAlign(&mut self, _align: &DOMString) -> ErrorResult { + pub fn SetAlign(&mut self, _align: &Option) -> ErrorResult { Ok(()) } } diff --git a/src/components/script/dom/htmldlistelement.rs b/src/components/script/dom/htmldlistelement.rs index 63b770e9534..96647e53794 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) -> DOMString { + pub fn Type(&self) -> Option { None } - pub fn SetType(&mut self, _type: &DOMString) -> ErrorResult { + pub fn SetType(&mut self, _type: &Option) -> ErrorResult { Ok(()) } } diff --git a/src/components/script/dom/htmlelement.rs b/src/components/script/dom/htmlelement.rs index b7ff82b6e6d..e157a79f520 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) -> DOMString { + pub fn Title(&self) -> Option { None } - pub fn SetTitle(&mut self, _title: &DOMString) { + pub fn SetTitle(&mut self, _title: &Option) { } - pub fn Lang(&self) -> DOMString { + pub fn Lang(&self) -> Option { None } - pub fn SetLang(&mut self, _lang: &DOMString) { + pub fn SetLang(&mut self, _lang: &Option) { } - pub fn Dir(&self) -> DOMString { + pub fn Dir(&self) -> Option { None } - pub fn SetDir(&mut self, _dir: &DOMString) -> ErrorResult { + pub fn SetDir(&mut self, _dir: &Option) -> ErrorResult { Ok(()) } @@ -85,15 +85,15 @@ impl HTMLElement { Ok(()) } - pub fn AccessKey(&self) -> DOMString { + pub fn AccessKey(&self) -> Option { None } - pub fn SetAccessKey(&self, _key: &DOMString) -> ErrorResult { + pub fn SetAccessKey(&self, _key: &Option) -> ErrorResult { Ok(()) } - pub fn AccessKeyLabel(&self) -> DOMString { + pub fn AccessKeyLabel(&self) -> Option { None } @@ -105,11 +105,11 @@ impl HTMLElement { Ok(()) } - pub fn ContentEditable(&self) -> DOMString { + pub fn ContentEditable(&self) -> Option { None } - pub fn SetContentEditable(&mut self, _val: &DOMString) -> ErrorResult { + pub fn SetContentEditable(&mut self, _val: &Option) -> ErrorResult { Ok(()) } @@ -125,11 +125,11 @@ impl HTMLElement { Ok(()) } - pub fn ClassName(&self) -> DOMString { + pub fn ClassName(&self) -> Option { None } - pub fn SetClassName(&self, _class: &DOMString) { + pub fn SetClassName(&self, _class: &Option) { } pub fn GetOffsetParent(&self) -> Option> { diff --git a/src/components/script/dom/htmlembedelement.rs b/src/components/script/dom/htmlembedelement.rs index ca9b0e5a53e..e1e6151918c 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) -> DOMString { + pub fn Src(&self) -> Option { None } - pub fn SetSrc(&mut self, _src: &DOMString) -> ErrorResult { + pub fn SetSrc(&mut self, _src: &Option) -> ErrorResult { Ok(()) } - pub fn Type(&self) -> DOMString { + pub fn Type(&self) -> Option { None } - pub fn SetType(&mut self, _type: &DOMString) -> ErrorResult { + pub fn SetType(&mut self, _type: &Option) -> ErrorResult { Ok(()) } - pub fn Width(&self) -> DOMString { + pub fn Width(&self) -> Option { None } - pub fn SetWidth(&mut self, _width: &DOMString) -> ErrorResult { + pub fn SetWidth(&mut self, _width: &Option) -> ErrorResult { Ok(()) } - pub fn Height(&self) -> DOMString { + pub fn Height(&self) -> Option { None } - pub fn SetHeight(&mut self, _height: &DOMString) -> ErrorResult { + pub fn SetHeight(&mut self, _height: &Option) -> ErrorResult { Ok(()) } - pub fn Align(&self) -> DOMString { + pub fn Align(&self) -> Option { None } - pub fn SetAlign(&mut self, _type: &DOMString) -> ErrorResult { + pub fn SetAlign(&mut self, _type: &Option) -> ErrorResult { Ok(()) } - pub fn Name(&self) -> DOMString { + pub fn Name(&self) -> Option { None } - pub fn SetName(&mut self, _type: &DOMString) -> ErrorResult { + pub fn SetName(&mut self, _type: &Option) -> ErrorResult { Ok(()) } diff --git a/src/components/script/dom/htmlfieldsetelement.rs b/src/components/script/dom/htmlfieldsetelement.rs index 89011d9dfda..5c87ea51f47 100644 --- a/src/components/script/dom/htmlfieldsetelement.rs +++ b/src/components/script/dom/htmlfieldsetelement.rs @@ -41,15 +41,15 @@ impl HTMLFieldSetElement { None } - pub fn Name(&self) -> DOMString { + pub fn Name(&self) -> Option { None } - pub fn SetName(&mut self, _name: &DOMString) -> ErrorResult { + pub fn SetName(&mut self, _name: &Option) -> ErrorResult { Ok(()) } - pub fn Type(&self) -> DOMString { + pub fn Type(&self) -> Option { None } @@ -67,7 +67,7 @@ impl HTMLFieldSetElement { ValidityState::new(global) } - pub fn ValidationMessage(&self) -> DOMString { + pub fn ValidationMessage(&self) -> Option { None } @@ -75,6 +75,6 @@ impl HTMLFieldSetElement { false } - pub fn SetCustomValidity(&mut self, _error: &DOMString) { + pub fn SetCustomValidity(&mut self, _error: &Option) { } } diff --git a/src/components/script/dom/htmlfontelement.rs b/src/components/script/dom/htmlfontelement.rs index d15251e4c7d..6ddf3491dbf 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) -> DOMString { + pub fn Color(&self) -> Option { None } - pub fn SetColor(&mut self, _color: &DOMString) -> ErrorResult { + pub fn SetColor(&mut self, _color: &Option) -> ErrorResult { Ok(()) } - pub fn Face(&self) -> DOMString { + pub fn Face(&self) -> Option { None } - pub fn SetFace(&mut self, _face: &DOMString) -> ErrorResult { + pub fn SetFace(&mut self, _face: &Option) -> ErrorResult { Ok(()) } - pub fn Size(&self) -> DOMString { + pub fn Size(&self) -> Option { None } - pub fn SetSize(&mut self, _size: &DOMString) -> ErrorResult { + pub fn SetSize(&mut self, _size: &Option) -> ErrorResult { Ok(()) } } diff --git a/src/components/script/dom/htmlformelement.rs b/src/components/script/dom/htmlformelement.rs index 54469a9631f..5d81fabd0d0 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) -> DOMString { + pub fn AcceptCharset(&self) -> Option { None } - pub fn SetAcceptCharset(&mut self, _accept_charset: &DOMString) -> ErrorResult { + pub fn SetAcceptCharset(&mut self, _accept_charset: &Option) -> ErrorResult { Ok(()) } - pub fn Action(&self) -> DOMString { + pub fn Action(&self) -> Option { None } - pub fn SetAction(&mut self, _action: &DOMString) -> ErrorResult { + pub fn SetAction(&mut self, _action: &Option) -> ErrorResult { Ok(()) } - pub fn Autocomplete(&self) -> DOMString { + pub fn Autocomplete(&self) -> Option { None } - pub fn SetAutocomplete(&mut self, _autocomplete: &DOMString) -> ErrorResult { + pub fn SetAutocomplete(&mut self, _autocomplete: &Option) -> ErrorResult { Ok(()) } - pub fn Enctype(&self) -> DOMString { + pub fn Enctype(&self) -> Option { None } - pub fn SetEnctype(&mut self, _enctype: &DOMString) -> ErrorResult { + pub fn SetEnctype(&mut self, _enctype: &Option) -> ErrorResult { Ok(()) } - pub fn Encoding(&self) -> DOMString { + pub fn Encoding(&self) -> Option { None } - pub fn SetEncoding(&mut self, _encoding: &DOMString) -> ErrorResult { + pub fn SetEncoding(&mut self, _encoding: &Option) -> ErrorResult { Ok(()) } - pub fn Method(&self) -> DOMString { + pub fn Method(&self) -> Option { None } - pub fn SetMethod(&mut self, _method: &DOMString) -> ErrorResult { + pub fn SetMethod(&mut self, _method: &Option) -> ErrorResult { Ok(()) } - pub fn Name(&self) -> DOMString { + pub fn Name(&self) -> Option { None } - pub fn SetName(&mut self, _name: &DOMString) -> ErrorResult { + pub fn SetName(&mut self, _name: &Option) -> ErrorResult { Ok(()) } @@ -92,11 +92,11 @@ impl HTMLFormElement { Ok(()) } - pub fn Target(&self) -> DOMString { + pub fn Target(&self) -> Option { None } - pub fn SetTarget(&mut self, _target: &DOMString) -> ErrorResult { + pub fn SetTarget(&mut self, _target: &Option) -> ErrorResult { Ok(()) } diff --git a/src/components/script/dom/htmlframeelement.rs b/src/components/script/dom/htmlframeelement.rs index a9ab387c58e..7a688fa4cc6 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) -> DOMString { + pub fn Name(&self) -> Option { None } - pub fn SetName(&mut self, _name: &DOMString) -> ErrorResult { + pub fn SetName(&mut self, _name: &Option) -> ErrorResult { Ok(()) } - pub fn Scrolling(&self) -> DOMString { + pub fn Scrolling(&self) -> Option { None } - pub fn SetScrolling(&mut self, _scrolling: &DOMString) -> ErrorResult { + pub fn SetScrolling(&mut self, _scrolling: &Option) -> ErrorResult { Ok(()) } - pub fn Src(&self) -> DOMString { + pub fn Src(&self) -> Option { None } - pub fn SetSrc(&mut self, _src: &DOMString) -> ErrorResult { + pub fn SetSrc(&mut self, _src: &Option) -> ErrorResult { Ok(()) } - pub fn FrameBorder(&self) -> DOMString { + pub fn FrameBorder(&self) -> Option { None } - pub fn SetFrameBorder(&mut self, _frameborder: &DOMString) -> ErrorResult { + pub fn SetFrameBorder(&mut self, _frameborder: &Option) -> ErrorResult { Ok(()) } - pub fn LongDesc(&self) -> DOMString { + pub fn LongDesc(&self) -> Option { None } - pub fn SetLongDesc(&mut self, _longdesc: &DOMString) -> ErrorResult { + pub fn SetLongDesc(&mut self, _longdesc: &Option) -> ErrorResult { Ok(()) } @@ -84,19 +84,19 @@ impl HTMLFrameElement { None } - pub fn MarginHeight(&self) -> DOMString { + pub fn MarginHeight(&self) -> Option { None } - pub fn SetMarginHeight(&mut self, _height: &DOMString) -> ErrorResult { + pub fn SetMarginHeight(&mut self, _height: &Option) -> ErrorResult { Ok(()) } - pub fn MarginWidth(&self) -> DOMString { + pub fn MarginWidth(&self) -> Option { None } - pub fn SetMarginWidth(&mut self, _height: &DOMString) -> ErrorResult { + pub fn SetMarginWidth(&mut self, _height: &Option) -> ErrorResult { Ok(()) } } diff --git a/src/components/script/dom/htmlframesetelement.rs b/src/components/script/dom/htmlframesetelement.rs index 42dc12f78e4..56490e9ca2a 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) -> DOMString { + pub fn Cols(&self) -> Option { None } - pub fn SetCols(&mut self, _cols: &DOMString) -> ErrorResult { + pub fn SetCols(&mut self, _cols: &Option) -> ErrorResult { Ok(()) } - pub fn Rows(&self) -> DOMString { + pub fn Rows(&self) -> Option { None } - pub fn SetRows(&mut self, _rows: &DOMString) -> ErrorResult { + pub fn SetRows(&mut self, _rows: &Option) -> ErrorResult { Ok(()) } } diff --git a/src/components/script/dom/htmlheadingelement.rs b/src/components/script/dom/htmlheadingelement.rs index a8b840b6edc..2e5c4db10a2 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) -> DOMString { + pub fn Align(&self) -> Option { None } - pub fn SetAlign(&mut self, _align: &DOMString) { + pub fn SetAlign(&mut self, _align: &Option) { } } diff --git a/src/components/script/dom/htmlhrelement.rs b/src/components/script/dom/htmlhrelement.rs index cb7662148c1..222cc397a24 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) -> DOMString { + pub fn Align(&self) -> Option { None } - pub fn SetAlign(&mut self, _align: &DOMString) -> ErrorResult { + pub fn SetAlign(&mut self, _align: &Option) -> ErrorResult { Ok(()) } - pub fn Color(&self) -> DOMString { + pub fn Color(&self) -> Option { None } - pub fn SetColor(&mut self, _color: &DOMString) -> ErrorResult { + pub fn SetColor(&mut self, _color: &Option) -> ErrorResult { Ok(()) } @@ -51,19 +51,19 @@ impl HTMLHRElement { Ok(()) } - pub fn Size(&self) -> DOMString { + pub fn Size(&self) -> Option { None } - pub fn SetSize(&mut self, _size: &DOMString) -> ErrorResult { + pub fn SetSize(&mut self, _size: &Option) -> ErrorResult { Ok(()) } - pub fn Width(&self) -> DOMString { + pub fn Width(&self) -> Option { None } - pub fn SetWidth(&mut self, _width: &DOMString) -> ErrorResult { + pub fn SetWidth(&mut self, _width: &Option) -> ErrorResult { Ok(()) } } diff --git a/src/components/script/dom/htmlhtmlelement.rs b/src/components/script/dom/htmlhtmlelement.rs index 1292ff49692..1a14961fab6 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) -> DOMString { + pub fn Version(&self) -> Option { None } - pub fn SetVersion(&mut self, _version: &DOMString) -> ErrorResult { + pub fn SetVersion(&mut self, _version: &Option) -> ErrorResult { Ok(()) } } diff --git a/src/components/script/dom/htmliframeelement.rs b/src/components/script/dom/htmliframeelement.rs index 08bde32f44e..f93d28b61ae 100644 --- a/src/components/script/dom/htmliframeelement.rs +++ b/src/components/script/dom/htmliframeelement.rs @@ -77,39 +77,39 @@ impl HTMLIFrameElement { } impl HTMLIFrameElement { - pub fn Src(&self) -> DOMString { + pub fn Src(&self) -> Option { None } - pub fn SetSrc(&mut self, _src: &DOMString) -> ErrorResult { + pub fn SetSrc(&mut self, _src: &Option) -> ErrorResult { Ok(()) } - pub fn Srcdoc(&self) -> DOMString { + pub fn Srcdoc(&self) -> Option { None } - pub fn SetSrcdoc(&mut self, _srcdoc: &DOMString) -> ErrorResult { + pub fn SetSrcdoc(&mut self, _srcdoc: &Option) -> ErrorResult { Ok(()) } - pub fn Name(&self) -> DOMString { + pub fn Name(&self) -> Option { None } - pub fn SetName(&mut self, _name: &DOMString) -> ErrorResult { + pub fn SetName(&mut self, _name: &Option) -> ErrorResult { Ok(()) } - pub fn Sandbox(&self, _abstract_self: AbstractNode) -> DOMString { + pub fn Sandbox(&self, _abstract_self: AbstractNode) -> Option { self.htmlelement.element.GetAttribute(&Some(~"sandbox")) } - pub fn SetSandbox(&mut self, abstract_self: AbstractNode, sandbox: &DOMString) { + pub fn SetSandbox(&mut self, abstract_self: AbstractNode, sandbox: &Option) { self.htmlelement.element.SetAttribute(abstract_self, &Some(~"sandbox"), sandbox); } - pub fn AfterSetAttr(&mut self, name: &DOMString, value: &DOMString) { + pub fn AfterSetAttr(&mut self, name: &Option, value: &Option) { let name = null_str_as_empty(name); if "sandbox" == name { let mut modes = AllowNothing as u8; @@ -137,19 +137,19 @@ impl HTMLIFrameElement { Ok(()) } - pub fn Width(&self) -> DOMString { + pub fn Width(&self) -> Option { None } - pub fn SetWidth(&mut self, _width: &DOMString) -> ErrorResult { + pub fn SetWidth(&mut self, _width: &Option) -> ErrorResult { Ok(()) } - pub fn Height(&self) -> DOMString { + pub fn Height(&self) -> Option { None } - pub fn SetHeight(&mut self, _height: &DOMString) -> ErrorResult { + pub fn SetHeight(&mut self, _height: &Option) -> ErrorResult { Ok(()) } @@ -161,51 +161,51 @@ impl HTMLIFrameElement { None } - pub fn Align(&self) -> DOMString { + pub fn Align(&self) -> Option { None } - pub fn SetAlign(&mut self, _align: &DOMString) -> ErrorResult { + pub fn SetAlign(&mut self, _align: &Option) -> ErrorResult { Ok(()) } - pub fn Scrolling(&self) -> DOMString { + pub fn Scrolling(&self) -> Option { None } - pub fn SetScrolling(&mut self, _scrolling: &DOMString) -> ErrorResult { + pub fn SetScrolling(&mut self, _scrolling: &Option) -> ErrorResult { Ok(()) } - pub fn FrameBorder(&self) -> DOMString { + pub fn FrameBorder(&self) -> Option { None } - pub fn SetFrameBorder(&mut self, _frameborder: &DOMString) -> ErrorResult { + pub fn SetFrameBorder(&mut self, _frameborder: &Option) -> ErrorResult { Ok(()) } - pub fn LongDesc(&self) -> DOMString { + pub fn LongDesc(&self) -> Option { None } - pub fn SetLongDesc(&mut self, _longdesc: &DOMString) -> ErrorResult { + pub fn SetLongDesc(&mut self, _longdesc: &Option) -> ErrorResult { Ok(()) } - pub fn MarginHeight(&self) -> DOMString { + pub fn MarginHeight(&self) -> Option { None } - pub fn SetMarginHeight(&mut self, _marginheight: &DOMString) -> ErrorResult { + pub fn SetMarginHeight(&mut self, _marginheight: &Option) -> ErrorResult { Ok(()) } - pub fn MarginWidth(&self) -> DOMString { + pub fn MarginWidth(&self) -> Option { None } - pub fn SetMarginWidth(&mut self, _marginwidth: &DOMString) -> ErrorResult { + pub fn SetMarginWidth(&mut self, _marginwidth: &Option) -> ErrorResult { Ok(()) } diff --git a/src/components/script/dom/htmlimageelement.rs b/src/components/script/dom/htmlimageelement.rs index 94b48b6252f..0f34f1a52f2 100644 --- a/src/components/script/dom/htmlimageelement.rs +++ b/src/components/script/dom/htmlimageelement.rs @@ -57,7 +57,7 @@ impl HTMLImageElement { } } - pub fn AfterSetAttr(&mut self, name: &DOMString, _value: &DOMString) { + pub fn AfterSetAttr(&mut self, name: &Option, _value: &Option) { let name = null_str_as_empty(name); if "src" == name { let document = self.htmlelement.element.node.owner_doc(); @@ -67,21 +67,21 @@ impl HTMLImageElement { } } - pub fn Alt(&self) -> DOMString { + pub fn Alt(&self) -> Option { None } - pub fn SetAlt(&mut self, _alt: &DOMString) -> ErrorResult { + pub fn SetAlt(&mut self, _alt: &Option) -> ErrorResult { Ok(()) } - pub fn Src(&self, _abstract_self: AbstractNode) -> DOMString { + pub fn Src(&self, _abstract_self: AbstractNode) -> Option { None } pub fn SetSrc(&mut self, abstract_self: AbstractNode, - src: &DOMString) -> ErrorResult { + src: &Option) -> ErrorResult { let node = &mut self.htmlelement.element; node.set_attr(abstract_self, &Some(~"src"), @@ -89,19 +89,19 @@ impl HTMLImageElement { Ok(()) } - pub fn CrossOrigin(&self) -> DOMString { + pub fn CrossOrigin(&self) -> Option { None } - pub fn SetCrossOrigin(&mut self, _cross_origin: &DOMString) -> ErrorResult { + pub fn SetCrossOrigin(&mut self, _cross_origin: &Option) -> ErrorResult { Ok(()) } - pub fn UseMap(&self) -> DOMString { + pub fn UseMap(&self) -> Option { None } - pub fn SetUseMap(&mut self, _use_map: &DOMString) -> ErrorResult { + pub fn SetUseMap(&mut self, _use_map: &Option) -> ErrorResult { Ok(()) } @@ -167,19 +167,19 @@ impl HTMLImageElement { false } - pub fn Name(&self) -> DOMString { + pub fn Name(&self) -> Option { None } - pub fn SetName(&mut self, _name: &DOMString) -> ErrorResult { + pub fn SetName(&mut self, _name: &Option) -> ErrorResult { Ok(()) } - pub fn Align(&self) -> DOMString { + pub fn Align(&self) -> Option { None } - pub fn SetAlign(&mut self, _align: &DOMString) -> ErrorResult { + pub fn SetAlign(&mut self, _align: &Option) -> ErrorResult { Ok(()) } @@ -199,19 +199,19 @@ impl HTMLImageElement { Ok(()) } - pub fn LongDesc(&self) -> DOMString { + pub fn LongDesc(&self) -> Option { None } - pub fn SetLongDesc(&mut self, _longdesc: &DOMString) -> ErrorResult { + pub fn SetLongDesc(&mut self, _longdesc: &Option) -> ErrorResult { Ok(()) } - pub fn Border(&self) -> DOMString { + pub fn Border(&self) -> Option { None } - pub fn SetBorder(&mut self, _border: &DOMString) -> ErrorResult { + pub fn SetBorder(&mut self, _border: &Option) -> ErrorResult { Ok(()) } } diff --git a/src/components/script/dom/htmlinputelement.rs b/src/components/script/dom/htmlinputelement.rs index 5e85f32dc79..b6b4c7786c6 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) -> DOMString { + pub fn Accept(&self) -> Option { None } - pub fn SetAccept(&mut self, _accept: &DOMString) -> ErrorResult { + pub fn SetAccept(&mut self, _accept: &Option) -> ErrorResult { Ok(()) } - pub fn Alt(&self) -> DOMString { + pub fn Alt(&self) -> Option { None } - pub fn SetAlt(&mut self, _alt: &DOMString) -> ErrorResult { + pub fn SetAlt(&mut self, _alt: &Option) -> ErrorResult { Ok(()) } - pub fn Autocomplete(&self) -> DOMString { + pub fn Autocomplete(&self) -> Option { None } - pub fn SetAutocomplete(&mut self, _autocomple: &DOMString) -> ErrorResult { + pub fn SetAutocomplete(&mut self, _autocomple: &Option) -> ErrorResult { Ok(()) } @@ -82,27 +82,27 @@ impl HTMLInputElement { Ok(()) } - pub fn FormAction(&self) -> DOMString { + pub fn FormAction(&self) -> Option { None } - pub fn SetFormAction(&mut self, _form_action: &DOMString) -> ErrorResult { + pub fn SetFormAction(&mut self, _form_action: &Option) -> ErrorResult { Ok(()) } - pub fn FormEnctype(&self) -> DOMString { + pub fn FormEnctype(&self) -> Option { None } - pub fn SetFormEnctype(&mut self, _form_enctype: &DOMString) -> ErrorResult { + pub fn SetFormEnctype(&mut self, _form_enctype: &Option) -> ErrorResult { Ok(()) } - pub fn FormMethod(&self) -> DOMString { + pub fn FormMethod(&self) -> Option { None } - pub fn SetFormMethod(&mut self, _form_method: &DOMString) -> ErrorResult { + pub fn SetFormMethod(&mut self, _form_method: &Option) -> ErrorResult { Ok(()) } @@ -114,11 +114,11 @@ impl HTMLInputElement { Ok(()) } - pub fn FormTarget(&self) -> DOMString { + pub fn FormTarget(&self) -> Option { None } - pub fn SetFormTarget(&mut self, _form_target: &DOMString) -> ErrorResult { + pub fn SetFormTarget(&mut self, _form_target: &Option) -> ErrorResult { Ok(()) } @@ -137,19 +137,19 @@ impl HTMLInputElement { pub fn SetIndeterminate(&mut self, _indeterminate: bool) { } - pub fn InputMode(&self) -> DOMString { + pub fn InputMode(&self) -> Option { None } - pub fn SetInputMode(&mut self, _input_mode: &DOMString) -> ErrorResult { + pub fn SetInputMode(&mut self, _input_mode: &Option) -> ErrorResult { Ok(()) } - pub fn Max(&self) -> DOMString { + pub fn Max(&self) -> Option { None } - pub fn SetMax(&mut self, _max: &DOMString) -> ErrorResult { + pub fn SetMax(&mut self, _max: &Option) -> ErrorResult { Ok(()) } @@ -161,11 +161,11 @@ impl HTMLInputElement { Ok(()) } - pub fn Min(&self) -> DOMString { + pub fn Min(&self) -> Option { None } - pub fn SetMin(&mut self, _min: &DOMString) -> ErrorResult { + pub fn SetMin(&mut self, _min: &Option) -> ErrorResult { Ok(()) } @@ -177,27 +177,27 @@ impl HTMLInputElement { Ok(()) } - pub fn Name(&self) -> DOMString { + pub fn Name(&self) -> Option { None } - pub fn SetName(&mut self, _name: &DOMString) -> ErrorResult { + pub fn SetName(&mut self, _name: &Option) -> ErrorResult { Ok(()) } - pub fn Pattern(&self) -> DOMString { + pub fn Pattern(&self) -> Option { None } - pub fn SetPattern(&mut self, _pattern: &DOMString) -> ErrorResult { + pub fn SetPattern(&mut self, _pattern: &Option) -> ErrorResult { Ok(()) } - pub fn Placeholder(&self) -> DOMString { + pub fn Placeholder(&self) -> Option { None } - pub fn SetPlaceholder(&mut self, _placeholder: &DOMString) -> ErrorResult { + pub fn SetPlaceholder(&mut self, _placeholder: &Option) -> ErrorResult { Ok(()) } @@ -225,43 +225,43 @@ impl HTMLInputElement { Ok(()) } - pub fn Src(&self) -> DOMString { + pub fn Src(&self) -> Option { None } - pub fn SetSrc(&mut self, _src: &DOMString) -> ErrorResult { + pub fn SetSrc(&mut self, _src: &Option) -> ErrorResult { Ok(()) } - pub fn Step(&self) -> DOMString { + pub fn Step(&self) -> Option { None } - pub fn SetStep(&mut self, _step: &DOMString) -> ErrorResult { + pub fn SetStep(&mut self, _step: &Option) -> ErrorResult { Ok(()) } - pub fn Type(&self) -> DOMString { + pub fn Type(&self) -> Option { None } - pub fn SetType(&mut self, _type: &DOMString) -> ErrorResult { + pub fn SetType(&mut self, _type: &Option) -> ErrorResult { Ok(()) } - pub fn DefaultValue(&self) -> DOMString { + pub fn DefaultValue(&self) -> Option { None } - pub fn SetDefaultValue(&mut self, _default_value: &DOMString) -> ErrorResult { + pub fn SetDefaultValue(&mut self, _default_value: &Option) -> ErrorResult { Ok(()) } - pub fn Value(&self) -> DOMString { + pub fn Value(&self) -> Option { None } - pub fn SetValue(&mut self, _value: &DOMString) -> ErrorResult { + pub fn SetValue(&mut self, _value: &Option) -> ErrorResult { Ok(()) } @@ -279,7 +279,7 @@ impl HTMLInputElement { pub fn SetWillValidate(&self, _will_validate: bool) { } - pub fn GetValidationMessage(&self) -> Fallible { + pub fn GetValidationMessage(&self) -> Fallible> { Ok(None) } @@ -287,7 +287,7 @@ impl HTMLInputElement { false } - pub fn SetCustomValidity(&self, _error: &DOMString) { + pub fn SetCustomValidity(&self, _error: &Option) { } pub fn Select(&self) { @@ -309,27 +309,27 @@ impl HTMLInputElement { Ok(()) } - pub fn GetSelectionDirection(&self) -> Fallible { + pub fn GetSelectionDirection(&self) -> Fallible> { Ok(None) } - pub fn SetSelectionDirection(&mut self, _selection_direction: &DOMString) -> ErrorResult { + pub fn SetSelectionDirection(&mut self, _selection_direction: &Option) -> ErrorResult { Ok(()) } - pub fn Align(&self) -> DOMString { + pub fn Align(&self) -> Option { None } - pub fn SetAlign(&mut self, _align: &DOMString) -> ErrorResult { + pub fn SetAlign(&mut self, _align: &Option) -> ErrorResult { Ok(()) } - pub fn UseMap(&self) -> DOMString { + pub fn UseMap(&self) -> Option { None } - pub fn SetUseMap(&mut self, _align: &DOMString) -> ErrorResult { + pub fn SetUseMap(&mut self, _align: &Option) -> ErrorResult { Ok(()) } } diff --git a/src/components/script/dom/htmllabelelement.rs b/src/components/script/dom/htmllabelelement.rs index 35ffbfa900e..9d59f687397 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) -> DOMString { + pub fn HtmlFor(&self) -> Option { None } - pub fn SetHtmlFor(&mut self, _html_for: &DOMString) { + pub fn SetHtmlFor(&mut self, _html_for: &Option) { } } diff --git a/src/components/script/dom/htmllegendelement.rs b/src/components/script/dom/htmllegendelement.rs index 2eeec359a44..4ed9d385cba 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) -> DOMString { + pub fn Align(&self) -> Option { None } - pub fn SetAlign(&mut self, _align: &DOMString) -> ErrorResult { + pub fn SetAlign(&mut self, _align: &Option) -> ErrorResult { Ok(()) } } diff --git a/src/components/script/dom/htmllielement.rs b/src/components/script/dom/htmllielement.rs index ea719be1362..18bd0224573 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) -> DOMString { + pub fn Type(&self) -> Option { None } - pub fn SetType(&mut self, _type: &DOMString) -> ErrorResult { + pub fn SetType(&mut self, _type: &Option) -> ErrorResult { Ok(()) } } diff --git a/src/components/script/dom/htmllinkelement.rs b/src/components/script/dom/htmllinkelement.rs index 6833e457ba4..75cc63207c3 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) -> DOMString { + pub fn Href(&self) -> Option { None } - pub fn SetHref(&mut self, _href: &DOMString) -> ErrorResult { + pub fn SetHref(&mut self, _href: &Option) -> ErrorResult { Ok(()) } - pub fn CrossOrigin(&self) -> DOMString { + pub fn CrossOrigin(&self) -> Option { None } - pub fn SetCrossOrigin(&mut self, _cross_origin: &DOMString) -> ErrorResult { + pub fn SetCrossOrigin(&mut self, _cross_origin: &Option) -> ErrorResult { Ok(()) } - pub fn Rel(&self) -> DOMString { + pub fn Rel(&self) -> Option { None } - pub fn SetRel(&mut self, _rel: &DOMString) -> ErrorResult { + pub fn SetRel(&mut self, _rel: &Option) -> ErrorResult { Ok(()) } - pub fn Media(&self) -> DOMString { + pub fn Media(&self) -> Option { None } - pub fn SetMedia(&mut self, _media: &DOMString) -> ErrorResult { + pub fn SetMedia(&mut self, _media: &Option) -> ErrorResult { Ok(()) } - pub fn Hreflang(&self) -> DOMString { + pub fn Hreflang(&self) -> Option { None } - pub fn SetHreflang(&mut self, _href: &DOMString) -> ErrorResult { + pub fn SetHreflang(&mut self, _href: &Option) -> ErrorResult { Ok(()) } - pub fn Type(&self) -> DOMString { + pub fn Type(&self) -> Option { None } - pub fn SetType(&mut self, _type: &DOMString) -> ErrorResult { + pub fn SetType(&mut self, _type: &Option) -> ErrorResult { Ok(()) } - pub fn Charset(&self) -> DOMString { + pub fn Charset(&self) -> Option { None } - pub fn SetCharset(&mut self, _charset: &DOMString) -> ErrorResult { + pub fn SetCharset(&mut self, _charset: &Option) -> ErrorResult { Ok(()) } - pub fn Rev(&self) -> DOMString { + pub fn Rev(&self) -> Option { None } - pub fn SetRev(&mut self, _rev: &DOMString) -> ErrorResult { + pub fn SetRev(&mut self, _rev: &Option) -> ErrorResult { Ok(()) } - pub fn Target(&self) -> DOMString { + pub fn Target(&self) -> Option { None } - pub fn SetTarget(&mut self, _target: &DOMString) -> ErrorResult { + pub fn SetTarget(&mut self, _target: &Option) -> ErrorResult { Ok(()) } } diff --git a/src/components/script/dom/htmlmapelement.rs b/src/components/script/dom/htmlmapelement.rs index 7174f829c31..1d95436fdda 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) -> DOMString { + pub fn Name(&self) -> Option { None } - pub fn SetName(&mut self, _name: &DOMString) -> ErrorResult { + pub fn SetName(&mut self, _name: &Option) -> ErrorResult { Ok(()) } diff --git a/src/components/script/dom/htmlmediaelement.rs b/src/components/script/dom/htmlmediaelement.rs index 1daad8ecf95..073313b61ad 100644 --- a/src/components/script/dom/htmlmediaelement.rs +++ b/src/components/script/dom/htmlmediaelement.rs @@ -20,38 +20,38 @@ impl HTMLMediaElement { } impl HTMLMediaElement { - pub fn Src(&self) -> DOMString { + pub fn Src(&self) -> Option { None } - pub fn SetSrc(&mut self, _src: &DOMString) -> ErrorResult { + pub fn SetSrc(&mut self, _src: &Option) -> ErrorResult { Ok(()) } - pub fn CurrentSrc(&self) -> DOMString { + pub fn CurrentSrc(&self) -> Option { None } - pub fn CrossOrigin(&self) -> DOMString { + pub fn CrossOrigin(&self) -> Option { None } - pub fn SetCrossOrigin(&mut self, _cross_origin: &DOMString) -> ErrorResult { + pub fn SetCrossOrigin(&mut self, _cross_origin: &Option) -> ErrorResult { Ok(()) } - pub fn Preload(&self) -> DOMString { + pub fn Preload(&self) -> Option { None } - pub fn SetPreload(&mut self, _preload: &DOMString) -> ErrorResult { + pub fn SetPreload(&mut self, _preload: &Option) -> ErrorResult { Ok(()) } pub fn Load(&self) { } - pub fn CanPlayType(&self, _type: &DOMString) -> DOMString { + pub fn CanPlayType(&self, _type: &Option) -> Option { None } diff --git a/src/components/script/dom/htmlmetaelement.rs b/src/components/script/dom/htmlmetaelement.rs index 20a6257e74b..89a71d9aaf4 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) -> DOMString { + pub fn Name(&self) -> Option { None } - pub fn SetName(&mut self, _name: &DOMString) -> ErrorResult { + pub fn SetName(&mut self, _name: &Option) -> ErrorResult { Ok(()) } - pub fn HttpEquiv(&self) -> DOMString { + pub fn HttpEquiv(&self) -> Option { None } - pub fn SetHttpEquiv(&mut self, _http_equiv: &DOMString) -> ErrorResult { + pub fn SetHttpEquiv(&mut self, _http_equiv: &Option) -> ErrorResult { Ok(()) } - pub fn Content(&self) -> DOMString { + pub fn Content(&self) -> Option { None } - pub fn SetContent(&mut self, _content: &DOMString) -> ErrorResult { + pub fn SetContent(&mut self, _content: &Option) -> ErrorResult { Ok(()) } - pub fn Scheme(&self) -> DOMString { + pub fn Scheme(&self) -> Option { None } - pub fn SetScheme(&mut self, _scheme: &DOMString) -> ErrorResult { + pub fn SetScheme(&mut self, _scheme: &Option) -> ErrorResult { Ok(()) } } diff --git a/src/components/script/dom/htmlmodelement.rs b/src/components/script/dom/htmlmodelement.rs index ff45b90be87..360abfdf981 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) -> DOMString { + pub fn Cite(&self) -> Option { None } - pub fn SetCite(&mut self, _cite: &DOMString) -> ErrorResult { + pub fn SetCite(&mut self, _cite: &Option) -> ErrorResult { Ok(()) } - pub fn DateTime(&self) -> DOMString { + pub fn DateTime(&self) -> Option { None } - pub fn SetDateTime(&mut self, _datetime: &DOMString) -> ErrorResult { + pub fn SetDateTime(&mut self, _datetime: &Option) -> ErrorResult { Ok(()) } } diff --git a/src/components/script/dom/htmlobjectelement.rs b/src/components/script/dom/htmlobjectelement.rs index 7fc29c32812..745a223645b 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) -> DOMString { + pub fn Data(&self) -> Option { None } - pub fn SetData(&mut self, _data: &DOMString) -> ErrorResult { + pub fn SetData(&mut self, _data: &Option) -> ErrorResult { Ok(()) } - pub fn Type(&self) -> DOMString { + pub fn Type(&self) -> Option { None } - pub fn SetType(&mut self, _type: &DOMString) -> ErrorResult { + pub fn SetType(&mut self, _type: &Option) -> ErrorResult { Ok(()) } - pub fn Name(&self) -> DOMString { + pub fn Name(&self) -> Option { None } - pub fn SetName(&mut self, _name: &DOMString) -> ErrorResult { + pub fn SetName(&mut self, _name: &Option) -> ErrorResult { Ok(()) } - pub fn UseMap(&self) -> DOMString { + pub fn UseMap(&self) -> Option { None } - pub fn SetUseMap(&mut self, _use_map: &DOMString) -> ErrorResult { + pub fn SetUseMap(&mut self, _use_map: &Option) -> ErrorResult { Ok(()) } @@ -65,19 +65,19 @@ impl HTMLObjectElement { None } - pub fn Width(&self) -> DOMString { + pub fn Width(&self) -> Option { None } - pub fn SetWidth(&mut self, _width: &DOMString) -> ErrorResult { + pub fn SetWidth(&mut self, _width: &Option) -> ErrorResult { Ok(()) } - pub fn Height(&self) -> DOMString { + pub fn Height(&self) -> Option { None } - pub fn SetHeight(&mut self, _height: &DOMString) -> ErrorResult { + pub fn SetHeight(&mut self, _height: &Option) -> ErrorResult { Ok(()) } @@ -98,7 +98,7 @@ impl HTMLObjectElement { ValidityState::new(global) } - pub fn ValidationMessage(&self) -> DOMString { + pub fn ValidationMessage(&self) -> Option { None } @@ -106,30 +106,30 @@ impl HTMLObjectElement { false } - pub fn SetCustomValidity(&mut self, _error: &DOMString) { + pub fn SetCustomValidity(&mut self, _error: &Option) { } - pub fn Align(&self) -> DOMString { + pub fn Align(&self) -> Option { None } - pub fn SetAlign(&mut self, _align: &DOMString) -> ErrorResult { + pub fn SetAlign(&mut self, _align: &Option) -> ErrorResult { Ok(()) } - pub fn Archive(&self) -> DOMString { + pub fn Archive(&self) -> Option { None } - pub fn SetArchive(&mut self, _archive: &DOMString) -> ErrorResult { + pub fn SetArchive(&mut self, _archive: &Option) -> ErrorResult { Ok(()) } - pub fn Code(&self) -> DOMString { + pub fn Code(&self) -> Option { None } - pub fn SetCode(&mut self, _code: &DOMString) -> ErrorResult { + pub fn SetCode(&mut self, _code: &Option) -> ErrorResult { Ok(()) } @@ -149,11 +149,11 @@ impl HTMLObjectElement { Ok(()) } - pub fn Standby(&self) -> DOMString { + pub fn Standby(&self) -> Option { None } - pub fn SetStandby(&mut self, _standby: &DOMString) -> ErrorResult { + pub fn SetStandby(&mut self, _standby: &Option) -> ErrorResult { Ok(()) } @@ -165,27 +165,27 @@ impl HTMLObjectElement { Ok(()) } - pub fn CodeBase(&self) -> DOMString { + pub fn CodeBase(&self) -> Option { None } - pub fn SetCodeBase(&mut self, _codebase: &DOMString) -> ErrorResult { + pub fn SetCodeBase(&mut self, _codebase: &Option) -> ErrorResult { Ok(()) } - pub fn CodeType(&self) -> DOMString { + pub fn CodeType(&self) -> Option { None } - pub fn SetCodeType(&mut self, _codetype: &DOMString) -> ErrorResult { + pub fn SetCodeType(&mut self, _codetype: &Option) -> ErrorResult { Ok(()) } - pub fn Border(&self) -> DOMString { + pub fn Border(&self) -> Option { None } - pub fn SetBorder(&mut self, _border: &DOMString) -> ErrorResult { + pub fn SetBorder(&mut self, _border: &Option) -> ErrorResult { Ok(()) } diff --git a/src/components/script/dom/htmlolistelement.rs b/src/components/script/dom/htmlolistelement.rs index 1a2fd349032..781885fdb46 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) -> DOMString { + pub fn Type(&self) -> Option { None } - pub fn SetType(&mut self, _type: &DOMString) -> ErrorResult { + pub fn SetType(&mut self, _type: &Option) -> ErrorResult { Ok(()) } diff --git a/src/components/script/dom/htmloptgroupelement.rs b/src/components/script/dom/htmloptgroupelement.rs index 0bd13fbd6e3..ce76e75031a 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) -> DOMString { + pub fn Label(&self) -> Option { None } - pub fn SetLabel(&mut self, _label: &DOMString) -> ErrorResult { + pub fn SetLabel(&mut self, _label: &Option) -> ErrorResult { Ok(()) } } diff --git a/src/components/script/dom/htmloptionelement.rs b/src/components/script/dom/htmloptionelement.rs index 4f7adb4b845..d5674e9cd47 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) -> DOMString { + pub fn Label(&self) -> Option { None } - pub fn SetLabel(&mut self, _label: &DOMString) -> ErrorResult { + pub fn SetLabel(&mut self, _label: &Option) -> ErrorResult { Ok(()) } @@ -63,19 +63,19 @@ impl HTMLOptionElement { Ok(()) } - pub fn Value(&self) -> DOMString { + pub fn Value(&self) -> Option { None } - pub fn SetValue(&mut self, _value: &DOMString) -> ErrorResult { + pub fn SetValue(&mut self, _value: &Option) -> ErrorResult { Ok(()) } - pub fn Text(&self) -> DOMString { + pub fn Text(&self) -> Option { None } - pub fn SetText(&mut self, _text: &DOMString) -> ErrorResult { + pub fn SetText(&mut self, _text: &Option) -> ErrorResult { Ok(()) } diff --git a/src/components/script/dom/htmloutputelement.rs b/src/components/script/dom/htmloutputelement.rs index 8c5832f1d6a..1c3689cdf53 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) -> DOMString { + pub fn Name(&self) -> Option { None } - pub fn SetName(&mut self, _name: &DOMString) -> ErrorResult { + pub fn SetName(&mut self, _name: &Option) -> ErrorResult { Ok(()) } - pub fn Type(&self) -> DOMString { + pub fn Type(&self) -> Option { None } - pub fn DefaultValue(&self) -> DOMString { + pub fn DefaultValue(&self) -> Option { None } - pub fn SetDefaultValue(&mut self, _value: &DOMString) -> ErrorResult { + pub fn SetDefaultValue(&mut self, _value: &Option) -> ErrorResult { Ok(()) } - pub fn Value(&self) -> DOMString { + pub fn Value(&self) -> Option { None } - pub fn SetValue(&mut self, _value: &DOMString) -> ErrorResult { + pub fn SetValue(&mut self, _value: &Option) -> ErrorResult { Ok(()) } @@ -75,11 +75,11 @@ impl HTMLOutputElement { pub fn SetValidity(&mut self, _validity: @mut ValidityState) { } - pub fn ValidationMessage(&self) -> DOMString { + pub fn ValidationMessage(&self) -> Option { None } - pub fn SetValidationMessage(&mut self, _message: &DOMString) -> ErrorResult { + pub fn SetValidationMessage(&mut self, _message: &Option) -> ErrorResult { Ok(()) } @@ -87,6 +87,6 @@ impl HTMLOutputElement { true } - pub fn SetCustomValidity(&mut self, _error: &DOMString) { + pub fn SetCustomValidity(&mut self, _error: &Option) { } } diff --git a/src/components/script/dom/htmlparagraphelement.rs b/src/components/script/dom/htmlparagraphelement.rs index 2c07892f7e6..b88e8bc9913 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) -> DOMString { + pub fn Align(&self) -> Option { None } - pub fn SetAlign(&mut self, _align: &DOMString) -> ErrorResult { + pub fn SetAlign(&mut self, _align: &Option) -> ErrorResult { Ok(()) } } diff --git a/src/components/script/dom/htmlparamelement.rs b/src/components/script/dom/htmlparamelement.rs index b97eb017872..c7259b219a8 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) -> DOMString { + pub fn Name(&self) -> Option { None } - pub fn SetName(&mut self, _name: &DOMString) -> ErrorResult { + pub fn SetName(&mut self, _name: &Option) -> ErrorResult { Ok(()) } - pub fn Value(&self) -> DOMString { + pub fn Value(&self) -> Option { None } - pub fn SetValue(&mut self, _value: &DOMString) -> ErrorResult { + pub fn SetValue(&mut self, _value: &Option) -> ErrorResult { Ok(()) } - pub fn Type(&self) -> DOMString { + pub fn Type(&self) -> Option { None } - pub fn SetType(&mut self, _type: &DOMString) -> ErrorResult { + pub fn SetType(&mut self, _type: &Option) -> ErrorResult { Ok(()) } - pub fn ValueType(&self) -> DOMString { + pub fn ValueType(&self) -> Option { None } - pub fn SetValueType(&mut self, _value_type: &DOMString) -> ErrorResult { + pub fn SetValueType(&mut self, _value_type: &Option) -> ErrorResult { Ok(()) } } diff --git a/src/components/script/dom/htmlquoteelement.rs b/src/components/script/dom/htmlquoteelement.rs index 5b03188c9c6..c1955020b19 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) -> DOMString { + pub fn Cite(&self) -> Option { None } - pub fn SetCite(&self, _cite: &DOMString) -> ErrorResult { + pub fn SetCite(&self, _cite: &Option) -> ErrorResult { Ok(()) } } diff --git a/src/components/script/dom/htmlscriptelement.rs b/src/components/script/dom/htmlscriptelement.rs index ea47c904f1f..e416bf8bc64 100644 --- a/src/components/script/dom/htmlscriptelement.rs +++ b/src/components/script/dom/htmlscriptelement.rs @@ -28,27 +28,27 @@ impl HTMLScriptElement { } impl HTMLScriptElement { - pub fn Src(&self) -> DOMString { + pub fn Src(&self) -> Option { self.htmlelement.element.get_attr("src").map(|s| s.to_str()) } - pub fn SetSrc(&mut self, _src: &DOMString) -> ErrorResult { + pub fn SetSrc(&mut self, _src: &Option) -> ErrorResult { Ok(()) } - pub fn Type(&self) -> DOMString { + pub fn Type(&self) -> Option { None } - pub fn SetType(&mut self, _type: &DOMString) -> ErrorResult { + pub fn SetType(&mut self, _type: &Option) -> ErrorResult { Ok(()) } - pub fn Charset(&self) -> DOMString { + pub fn Charset(&self) -> Option { None } - pub fn SetCharset(&mut self, _charset: &DOMString) -> ErrorResult { + pub fn SetCharset(&mut self, _charset: &Option) -> ErrorResult { Ok(()) } @@ -68,35 +68,35 @@ impl HTMLScriptElement { Ok(()) } - pub fn CrossOrigin(&self) -> DOMString { + pub fn CrossOrigin(&self) -> Option { None } - pub fn SetCrossOrigin(&mut self, _cross_origin: &DOMString) -> ErrorResult { + pub fn SetCrossOrigin(&mut self, _cross_origin: &Option) -> ErrorResult { Ok(()) } - pub fn Text(&self) -> DOMString { + pub fn Text(&self) -> Option { None } - pub fn SetText(&mut self, _text: &DOMString) -> ErrorResult { + pub fn SetText(&mut self, _text: &Option) -> ErrorResult { Ok(()) } - pub fn Event(&self) -> DOMString { + pub fn Event(&self) -> Option { None } - pub fn SetEvent(&mut self, _event: &DOMString) -> ErrorResult { + pub fn SetEvent(&mut self, _event: &Option) -> ErrorResult { Ok(()) } - pub fn HtmlFor(&self) -> DOMString { + pub fn HtmlFor(&self) -> Option { None } - pub fn SetHtmlFor(&mut self, _html_for: &DOMString) -> ErrorResult { + pub fn SetHtmlFor(&mut self, _html_for: &Option) -> ErrorResult { Ok(()) } } diff --git a/src/components/script/dom/htmlselectelement.rs b/src/components/script/dom/htmlselectelement.rs index bda52c7ed18..1676672816b 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) -> DOMString { + pub fn Name(&self) -> Option { None } - pub fn SetName(&mut self, _name: &DOMString) -> ErrorResult { + pub fn SetName(&mut self, _name: &Option) -> ErrorResult { Ok(()) } @@ -80,7 +80,7 @@ impl HTMLSelectElement { Ok(()) } - pub fn Type(&self) -> DOMString { + pub fn Type(&self) -> Option { None } @@ -96,7 +96,7 @@ impl HTMLSelectElement { None } - pub fn NamedItem(&self, _name: &DOMString) -> Option> { + pub fn NamedItem(&self, _name: &Option) -> Option> { None } @@ -122,11 +122,11 @@ impl HTMLSelectElement { Ok(()) } - pub fn Value(&self) -> DOMString { + pub fn Value(&self) -> Option { None } - pub fn SetValue(&mut self, _value: &DOMString) { + pub fn SetValue(&mut self, _value: &Option) { } pub fn WillValidate(&self) -> bool { @@ -144,11 +144,11 @@ impl HTMLSelectElement { pub fn SetValidity(&mut self, _validity: @mut ValidityState) { } - pub fn ValidationMessage(&self) -> DOMString { + pub fn ValidationMessage(&self) -> Option { None } - pub fn SetValidationMessage(&mut self, _message: &DOMString) -> ErrorResult { + pub fn SetValidationMessage(&mut self, _message: &Option) -> ErrorResult { Ok(()) } @@ -156,6 +156,6 @@ impl HTMLSelectElement { true } - pub fn SetCustomValidity(&mut self, _error: &DOMString) { + pub fn SetCustomValidity(&mut self, _error: &Option) { } } diff --git a/src/components/script/dom/htmlsourceelement.rs b/src/components/script/dom/htmlsourceelement.rs index 89933a7478a..52974594bf6 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) -> DOMString { + pub fn Src(&self) -> Option { None } - pub fn SetSrc(&mut self, _src: &DOMString) -> ErrorResult { + pub fn SetSrc(&mut self, _src: &Option) -> ErrorResult { Ok(()) } - pub fn Type(&self) -> DOMString { + pub fn Type(&self) -> Option { None } - pub fn SetType(&mut self, _type: &DOMString) -> ErrorResult { + pub fn SetType(&mut self, _type: &Option) -> ErrorResult { Ok(()) } - pub fn Media(&self) -> DOMString { + pub fn Media(&self) -> Option { None } - pub fn SetMedia(&mut self, _media: &DOMString) -> ErrorResult { + pub fn SetMedia(&mut self, _media: &Option) -> ErrorResult { Ok(()) } } diff --git a/src/components/script/dom/htmlstyleelement.rs b/src/components/script/dom/htmlstyleelement.rs index 88c933d851e..cf18b229f8e 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) -> DOMString { + pub fn Media(&self) -> Option { None } - pub fn SetMedia(&mut self, _media: &DOMString) -> ErrorResult { + pub fn SetMedia(&mut self, _media: &Option) -> ErrorResult { Ok(()) } - pub fn Type(&self) -> DOMString { + pub fn Type(&self) -> Option { None } - pub fn SetType(&mut self, _type: &DOMString) -> ErrorResult { + pub fn SetType(&mut self, _type: &Option) -> ErrorResult { Ok(()) } diff --git a/src/components/script/dom/htmltablecaptionelement.rs b/src/components/script/dom/htmltablecaptionelement.rs index 788e239344a..93be5a96013 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) -> DOMString { + pub fn Align(&self) -> Option { None } - pub fn SetAlign(&mut self, _align: &DOMString) -> ErrorResult { + pub fn SetAlign(&mut self, _align: &Option) -> ErrorResult { Ok(()) } } diff --git a/src/components/script/dom/htmltablecellelement.rs b/src/components/script/dom/htmltablecellelement.rs index 9869bf3fb7f..a0f5bfdfc12 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) -> DOMString { + pub fn Headers(&self) -> Option { None } - pub fn SetHeaders(&self, _headers: &DOMString) -> ErrorResult { + pub fn SetHeaders(&self, _headers: &Option) -> ErrorResult { Ok(()) } @@ -52,67 +52,67 @@ impl HTMLTableCellElement { Ok(()) } - pub fn Abbr(&self) -> DOMString { + pub fn Abbr(&self) -> Option { None } - pub fn SetAbbr(&self, _abbr: &DOMString) -> ErrorResult { + pub fn SetAbbr(&self, _abbr: &Option) -> ErrorResult { Ok(()) } - pub fn Scope(&self) -> DOMString { + pub fn Scope(&self) -> Option { None } - pub fn SetScope(&self, _abbr: &DOMString) -> ErrorResult { + pub fn SetScope(&self, _abbr: &Option) -> ErrorResult { Ok(()) } - pub fn Align(&self) -> DOMString { + pub fn Align(&self) -> Option { None } - pub fn SetAlign(&self, _align: &DOMString) -> ErrorResult { + pub fn SetAlign(&self, _align: &Option) -> ErrorResult { Ok(()) } - pub fn Axis(&self) -> DOMString { + pub fn Axis(&self) -> Option { None } - pub fn SetAxis(&self, _axis: &DOMString) -> ErrorResult { + pub fn SetAxis(&self, _axis: &Option) -> ErrorResult { Ok(()) } - pub fn Height(&self) -> DOMString { + pub fn Height(&self) -> Option { None } - pub fn SetHeight(&self, _height: &DOMString) -> ErrorResult { + pub fn SetHeight(&self, _height: &Option) -> ErrorResult { Ok(()) } - pub fn Width(&self) -> DOMString { + pub fn Width(&self) -> Option { None } - pub fn SetWidth(&self, _width: &DOMString) -> ErrorResult { + pub fn SetWidth(&self, _width: &Option) -> ErrorResult { Ok(()) } - pub fn Ch(&self) -> DOMString { + pub fn Ch(&self) -> Option { None } - pub fn SetCh(&self, _ch: &DOMString) -> ErrorResult { + pub fn SetCh(&self, _ch: &Option) -> ErrorResult { Ok(()) } - pub fn ChOff(&self) -> DOMString { + pub fn ChOff(&self) -> Option { None } - pub fn SetChOff(&self, _ch_off: &DOMString) -> ErrorResult { + pub fn SetChOff(&self, _ch_off: &Option) -> ErrorResult { Ok(()) } @@ -124,19 +124,19 @@ impl HTMLTableCellElement { Ok(()) } - pub fn VAlign(&self) -> DOMString { + pub fn VAlign(&self) -> Option { None } - pub fn SetVAlign(&self, _valign: &DOMString) -> ErrorResult { + pub fn SetVAlign(&self, _valign: &Option) -> ErrorResult { Ok(()) } - pub fn BgColor(&self) -> DOMString { + pub fn BgColor(&self) -> Option { None } - pub fn SetBgColor(&self, _bg_color: &DOMString) -> ErrorResult { + pub fn SetBgColor(&self, _bg_color: &Option) -> ErrorResult { Ok(()) } } diff --git a/src/components/script/dom/htmltablecolelement.rs b/src/components/script/dom/htmltablecolelement.rs index 633e40e60f8..ddce6ff8a75 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) -> DOMString { + pub fn Align(&self) -> Option { None } - pub fn SetAlign(&mut self, _align: &DOMString) -> ErrorResult { + pub fn SetAlign(&mut self, _align: &Option) -> ErrorResult { Ok(()) } - pub fn Ch(&self) -> DOMString { + pub fn Ch(&self) -> Option { None } - pub fn SetCh(&mut self, _ch: &DOMString) -> ErrorResult { + pub fn SetCh(&mut self, _ch: &Option) -> ErrorResult { Ok(()) } - pub fn ChOff(&self) -> DOMString { + pub fn ChOff(&self) -> Option { None } - pub fn SetChOff(&mut self, _ch_off: &DOMString) -> ErrorResult { + pub fn SetChOff(&mut self, _ch_off: &Option) -> ErrorResult { Ok(()) } - pub fn VAlign(&self) -> DOMString { + pub fn VAlign(&self) -> Option { None } - pub fn SetVAlign(&mut self, _v_align: &DOMString) -> ErrorResult { + pub fn SetVAlign(&mut self, _v_align: &Option) -> ErrorResult { Ok(()) } - pub fn Width(&self) -> DOMString { + pub fn Width(&self) -> Option { None } - pub fn SetWidth(&mut self, _width: &DOMString) -> ErrorResult { + pub fn SetWidth(&mut self, _width: &Option) -> ErrorResult { Ok(()) } } diff --git a/src/components/script/dom/htmltableelement.rs b/src/components/script/dom/htmltableelement.rs index 9456c8554ed..b06e0d7c220 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) -> DOMString { + pub fn Align(&self) -> Option { None } - pub fn SetAlign(&self, _align: &DOMString) -> ErrorResult { + pub fn SetAlign(&self, _align: &Option) -> ErrorResult { Ok(()) } - pub fn Border(&self) -> DOMString { + pub fn Border(&self) -> Option { None } - pub fn SetBorder(&self, _border: &DOMString) -> ErrorResult { + pub fn SetBorder(&self, _border: &Option) -> ErrorResult { Ok(()) } - pub fn Frame(&self) -> DOMString { + pub fn Frame(&self) -> Option { None } - pub fn SetFrame(&self, _frame: &DOMString) -> ErrorResult { + pub fn SetFrame(&self, _frame: &Option) -> ErrorResult { Ok(()) } - pub fn Rules(&self) -> DOMString { + pub fn Rules(&self) -> Option { None } - pub fn SetRules(&self, _rules: &DOMString) -> ErrorResult { + pub fn SetRules(&self, _rules: &Option) -> ErrorResult { Ok(()) } - pub fn Summary(&self) -> DOMString { + pub fn Summary(&self) -> Option { None } - pub fn SetSummary(&self, _summary: &DOMString) -> ErrorResult { + pub fn SetSummary(&self, _summary: &Option) -> ErrorResult { Ok(()) } - pub fn Width(&self) -> DOMString { + pub fn Width(&self) -> Option { None } - pub fn SetWidth(&self, _width: &DOMString) -> ErrorResult { + pub fn SetWidth(&self, _width: &Option) -> ErrorResult { Ok(()) } - pub fn BgColor(&self) -> DOMString { + pub fn BgColor(&self) -> Option { None } - pub fn SetBgColor(&self, _bg_color: &DOMString) -> ErrorResult { + pub fn SetBgColor(&self, _bg_color: &Option) -> ErrorResult { Ok(()) } - pub fn CellPadding(&self) -> DOMString { + pub fn CellPadding(&self) -> Option { None } - pub fn SetCellPadding(&self, _cell_padding: &DOMString) -> ErrorResult { + pub fn SetCellPadding(&self, _cell_padding: &Option) -> ErrorResult { Ok(()) } - pub fn CellSpacing(&self) -> DOMString { + pub fn CellSpacing(&self) -> Option { None } - pub fn SetCellSpacing(&self, _cell_spacing: &DOMString) -> ErrorResult { + pub fn SetCellSpacing(&self, _cell_spacing: &Option) -> ErrorResult { Ok(()) } } diff --git a/src/components/script/dom/htmltablerowelement.rs b/src/components/script/dom/htmltablerowelement.rs index de22597d057..d363192707d 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) -> DOMString { + pub fn Align(&self) -> Option { None } - pub fn SetAlign(&self, _align: &DOMString) -> ErrorResult { + pub fn SetAlign(&self, _align: &Option) -> ErrorResult { Ok(()) } - pub fn Ch(&self) -> DOMString { + pub fn Ch(&self) -> Option { None } - pub fn SetCh(&self, _ch: &DOMString) -> ErrorResult { + pub fn SetCh(&self, _ch: &Option) -> ErrorResult { Ok(()) } - pub fn ChOff(&self) -> DOMString { + pub fn ChOff(&self) -> Option { None } - pub fn SetChOff(&self, _ch_off: &DOMString) -> ErrorResult { + pub fn SetChOff(&self, _ch_off: &Option) -> ErrorResult { Ok(()) } - pub fn VAlign(&self) -> DOMString { + pub fn VAlign(&self) -> Option { None } - pub fn SetVAlign(&self, _v_align: &DOMString) -> ErrorResult { + pub fn SetVAlign(&self, _v_align: &Option) -> ErrorResult { Ok(()) } - pub fn BgColor(&self) -> DOMString { + pub fn BgColor(&self) -> Option { None } - pub fn SetBgColor(&self, _bg_color: &DOMString) -> ErrorResult { + pub fn SetBgColor(&self, _bg_color: &Option) -> ErrorResult { Ok(()) } } diff --git a/src/components/script/dom/htmltablesectionelement.rs b/src/components/script/dom/htmltablesectionelement.rs index 8133e768ea3..90a1d0f0bcb 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) -> DOMString { + pub fn Align(&self) -> Option { None } - pub fn SetAlign(&mut self, _align: &DOMString) -> ErrorResult { + pub fn SetAlign(&mut self, _align: &Option) -> ErrorResult { Ok(()) } - pub fn Ch(&self) -> DOMString { + pub fn Ch(&self) -> Option { None } - pub fn SetCh(&mut self, _ch: &DOMString) -> ErrorResult { + pub fn SetCh(&mut self, _ch: &Option) -> ErrorResult { Ok(()) } - pub fn ChOff(&self) -> DOMString { + pub fn ChOff(&self) -> Option { None } - pub fn SetChOff(&mut self, _ch_off: &DOMString) -> ErrorResult { + pub fn SetChOff(&mut self, _ch_off: &Option) -> ErrorResult { Ok(()) } - pub fn VAlign(&self) -> DOMString { + pub fn VAlign(&self) -> Option { None } - pub fn SetVAlign(&mut self, _v_align: &DOMString) -> ErrorResult { + pub fn SetVAlign(&mut self, _v_align: &Option) -> ErrorResult { Ok(()) } } diff --git a/src/components/script/dom/htmltextareaelement.rs b/src/components/script/dom/htmltextareaelement.rs index 5065d90a76e..e92fb1cc7c4 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) -> DOMString { + pub fn Name(&self) -> Option { None } - pub fn SetName(&mut self, _name: &DOMString) -> ErrorResult { + pub fn SetName(&mut self, _name: &Option) -> ErrorResult { Ok(()) } - pub fn Placeholder(&self) -> DOMString { + pub fn Placeholder(&self) -> Option { None } - pub fn SetPlaceholder(&mut self, _placeholder: &DOMString) -> ErrorResult { + pub fn SetPlaceholder(&mut self, _placeholder: &Option) -> ErrorResult { Ok(()) } @@ -99,34 +99,34 @@ impl HTMLTextAreaElement { Ok(()) } - pub fn Wrap(&self) -> DOMString { + pub fn Wrap(&self) -> Option { None } - pub fn SetWrap(&mut self, _wrap: &DOMString) -> ErrorResult { + pub fn SetWrap(&mut self, _wrap: &Option) -> ErrorResult { Ok(()) } - pub fn Type(&self) -> DOMString { + pub fn Type(&self) -> Option { None } - pub fn SetType(&mut self, _type: &DOMString) { + pub fn SetType(&mut self, _type: &Option) { } - pub fn DefaultValue(&self) -> DOMString { + pub fn DefaultValue(&self) -> Option { None } - pub fn SetDefaultValue(&mut self, _default_value: &DOMString) -> ErrorResult { + pub fn SetDefaultValue(&mut self, _default_value: &Option) -> ErrorResult { Ok(()) } - pub fn Value(&self) -> DOMString { + pub fn Value(&self) -> Option { None } - pub fn SetValue(&mut self, _value: &DOMString) { + pub fn SetValue(&mut self, _value: &Option) { } pub fn TextLength(&self) -> u32 { @@ -145,7 +145,7 @@ impl HTMLTextAreaElement { Ok(()) } - pub fn ValidationMessage(&self) -> DOMString { + pub fn ValidationMessage(&self) -> Option { None } @@ -153,7 +153,7 @@ impl HTMLTextAreaElement { false } - pub fn SetCustomValidity(&self, _error: &DOMString) { + pub fn SetCustomValidity(&self, _error: &Option) { } pub fn Select(&self) { @@ -175,14 +175,14 @@ impl HTMLTextAreaElement { Ok(()) } - pub fn GetSelectionDirection(&self) -> Fallible { + pub fn GetSelectionDirection(&self) -> Fallible> { Ok(None) } - pub fn SetSelectionDirection(&self, _selection_direction: &DOMString) -> ErrorResult { + pub fn SetSelectionDirection(&self, _selection_direction: &Option) -> ErrorResult { Ok(()) } - pub fn SetRangeText(&self, _replacement: &DOMString) { + pub fn SetRangeText(&self, _replacement: &Option) { } } diff --git a/src/components/script/dom/htmltimeelement.rs b/src/components/script/dom/htmltimeelement.rs index 93c6081cb62..bb3328808e6 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) -> DOMString { + pub fn DateTime(&self) -> Option { None } - pub fn SetDateTime(&mut self, _dateTime: &DOMString) -> ErrorResult { + pub fn SetDateTime(&mut self, _dateTime: &Option) -> ErrorResult { Ok(()) } } diff --git a/src/components/script/dom/htmltitleelement.rs b/src/components/script/dom/htmltitleelement.rs index fd646b5b797..eb0831e519a 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) -> DOMString { + pub fn Text(&self) -> Option { None } - pub fn SetText(&mut self, _text: &DOMString) -> ErrorResult { + pub fn SetText(&mut self, _text: &Option) -> ErrorResult { Ok(()) } } diff --git a/src/components/script/dom/htmltrackelement.rs b/src/components/script/dom/htmltrackelement.rs index 1a5a2072356..d6aacdb3b45 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) -> DOMString { + pub fn Kind(&self) -> Option { None } - pub fn SetKind(&mut self, _kind: &DOMString) -> ErrorResult { + pub fn SetKind(&mut self, _kind: &Option) -> ErrorResult { Ok(()) } - pub fn Src(&self) -> DOMString { + pub fn Src(&self) -> Option { None } - pub fn SetSrc(&mut self, _src: &DOMString) -> ErrorResult { + pub fn SetSrc(&mut self, _src: &Option) -> ErrorResult { Ok(()) } - pub fn Srclang(&self) -> DOMString { + pub fn Srclang(&self) -> Option { None } - pub fn SetSrclang(&mut self, _srclang: &DOMString) -> ErrorResult { + pub fn SetSrclang(&mut self, _srclang: &Option) -> ErrorResult { Ok(()) } - pub fn Label(&self) -> DOMString { + pub fn Label(&self) -> Option { None } - pub fn SetLabel(&mut self, _label: &DOMString) -> ErrorResult { + pub fn SetLabel(&mut self, _label: &Option) -> ErrorResult { Ok(()) } diff --git a/src/components/script/dom/htmlulistelement.rs b/src/components/script/dom/htmlulistelement.rs index ee7df48009a..d559ae60ff1 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) -> DOMString { + pub fn Type(&self) -> Option { None } - pub fn SetType(&mut self, _type: &DOMString) -> ErrorResult { + pub fn SetType(&mut self, _type: &Option) -> ErrorResult { Ok(()) } } diff --git a/src/components/script/dom/htmlvideoelement.rs b/src/components/script/dom/htmlvideoelement.rs index b78e13947e8..f5d34487ff3 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) -> DOMString { + pub fn Poster(&self) -> Option { None } - pub fn SetPoster(&mut self, _poster: &DOMString) -> ErrorResult { + pub fn SetPoster(&mut self, _poster: &Option) -> ErrorResult { Ok(()) } } diff --git a/src/components/script/dom/mouseevent.rs b/src/components/script/dom/mouseevent.rs index 30dae36521e..bcc69a7ebac 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_: &DOMString, + type_: &Option, 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: &DOMString) -> bool { + pub fn GetModifierState(&self, _keyArg: &Option) -> bool { //TODO false } pub fn InitMouseEvent(&mut self, - typeArg: &DOMString, + typeArg: &Option, canBubbleArg: bool, cancelableArg: bool, viewArg: Option<@mut WindowProxy>, diff --git a/src/components/script/dom/namespace.rs b/src/components/script/dom/namespace.rs index 7fe8e68e232..5603c67f410 100644 --- a/src/components/script/dom/namespace.rs +++ b/src/components/script/dom/namespace.rs @@ -17,7 +17,7 @@ pub enum Namespace { } impl Namespace { - pub fn from_str(url: &DOMString) -> Namespace { + pub fn from_str(url: &Option) -> Namespace { match null_str_as_empty_ref(url) { &"http://www.w3.org/1999/xhtml" => HTML, &"http://www.w3.org/XML/1998/namespace" => XML, @@ -29,7 +29,7 @@ impl Namespace { ns => Other(ns.to_owned()) } } - pub fn to_str(&self) -> DOMString { + pub fn to_str(&self) -> Option { match *self { Null => None, HTML => Some(~"http://www.w3.org/1999/xhtml"), diff --git a/src/components/script/dom/navigator.rs b/src/components/script/dom/navigator.rs index 7dbd81959b5..7fd782c9731 100644 --- a/src/components/script/dom/navigator.rs +++ b/src/components/script/dom/navigator.rs @@ -22,23 +22,23 @@ impl Navigator { reflect_dom_object(@mut Navigator::new_inherited(), window, NavigatorBinding::Wrap) } - pub fn DoNotTrack(&self) -> DOMString { + pub fn DoNotTrack(&self) -> Option { Some(~"unspecified") } - pub fn Vendor(&self) -> DOMString { + pub fn Vendor(&self) -> Option { Some(~"") // Like Gecko } - pub fn VendorSub(&self) -> DOMString { + pub fn VendorSub(&self) -> Option { Some(~"") // Like Gecko } - pub fn Product(&self) -> DOMString { + pub fn Product(&self) -> Option { Some(~"Gecko") // This is supposed to be constant, see webidl. } - pub fn ProductSub(&self) -> DOMString { + pub fn ProductSub(&self) -> Option { None } @@ -46,7 +46,7 @@ impl Navigator { false } - pub fn GetBuildID(&self) -> Fallible { + pub fn GetBuildID(&self) -> Fallible> { Ok(None) } @@ -58,27 +58,27 @@ impl Navigator { false } - pub fn AppName(&self) -> DOMString { + pub fn AppName(&self) -> Option { Some(~"Netscape") // Like Gecko/Webkit } - pub fn GetAppCodeName(&self) -> Fallible { + pub fn GetAppCodeName(&self) -> Fallible> { Ok(Some(~"Mozilla")) // Like Gecko/Webkit } - pub fn GetAppVersion(&self) -> Fallible { + pub fn GetAppVersion(&self) -> Fallible> { Ok(None) } - pub fn GetPlatform(&self) -> Fallible { + pub fn GetPlatform(&self) -> Fallible> { Ok(None) } - pub fn GetUserAgent(&self) -> Fallible { + pub fn GetUserAgent(&self) -> Fallible> { Ok(None) } - pub fn GetLanguage(&self) -> DOMString { + pub fn GetLanguage(&self) -> Option { None } diff --git a/src/components/script/dom/node.rs b/src/components/script/dom/node.rs index a6cf77d0c19..9b3468688d2 100644 --- a/src/components/script/dom/node.rs +++ b/src/components/script/dom/node.rs @@ -561,7 +561,7 @@ impl Node { } } - pub fn NodeName(&self, abstract_self: AbstractNode) -> DOMString { + pub fn NodeName(&self, abstract_self: AbstractNode) -> Option { Some(match self.type_id { ElementNodeTypeId(*) => { do abstract_self.with_imm_element |element| { @@ -580,7 +580,7 @@ impl Node { }) } - pub fn GetBaseURI(&self) -> DOMString { + pub fn GetBaseURI(&self) -> Option { None } @@ -623,7 +623,7 @@ impl Node { self.next_sibling } - pub fn GetNodeValue(&self, abstract_self: AbstractNode) -> DOMString { + pub fn GetNodeValue(&self, abstract_self: AbstractNode) -> Option { match self.type_id { // ProcessingInstruction CommentNodeTypeId | TextNodeTypeId => { @@ -637,11 +637,11 @@ impl Node { } } - pub fn SetNodeValue(&mut self, _abstract_self: AbstractNode, _val: &DOMString) -> ErrorResult { + pub fn SetNodeValue(&mut self, _abstract_self: AbstractNode, _val: &Option) -> ErrorResult { Ok(()) } - pub fn GetTextContent(&self, abstract_self: AbstractNode) -> DOMString { + pub fn GetTextContent(&self, abstract_self: AbstractNode) -> Option { match self.type_id { DocumentFragmentNodeTypeId | ElementNodeTypeId(*) => { let mut content = ~""; @@ -939,7 +939,7 @@ impl Node { pub fn SetTextContent(&mut self, abstract_self: AbstractNode, - value: &DOMString) -> ErrorResult { + value: &Option) -> ErrorResult { let is_empty = match value { &Some(~"") | &None => true, _ => false @@ -1019,27 +1019,27 @@ impl Node { false } - pub fn LookupPrefix(&self, _prefix: &DOMString) -> DOMString { + pub fn LookupPrefix(&self, _prefix: &Option) -> Option { None } - pub fn LookupNamespaceURI(&self, _namespace: &DOMString) -> DOMString { + pub fn LookupNamespaceURI(&self, _namespace: &Option) -> Option { None } - pub fn IsDefaultNamespace(&self, _namespace: &DOMString) -> bool { + pub fn IsDefaultNamespace(&self, _namespace: &Option) -> bool { false } - pub fn GetNamespaceURI(&self) -> DOMString { + pub fn GetNamespaceURI(&self) -> Option { None } - pub fn GetPrefix(&self) -> DOMString { + pub fn GetPrefix(&self) -> Option { None } - pub fn GetLocalName(&self) -> DOMString { + pub fn GetLocalName(&self) -> Option { None } diff --git a/src/components/script/dom/text.rs b/src/components/script/dom/text.rs index e0fd493d887..b7b49ad3d3d 100644 --- a/src/components/script/dom/text.rs +++ b/src/components/script/dom/text.rs @@ -26,7 +26,7 @@ impl Text { Node::reflect_node(@mut node, document, TextBinding::Wrap) } - pub fn Constructor(owner: @mut Window, text: &DOMString) -> Fallible> { + pub fn Constructor(owner: @mut Window, text: &Option) -> Fallible> { Ok(Text::new(null_str_as_empty(text), owner.Document())) } @@ -34,7 +34,7 @@ impl Text { fail!("unimplemented") } - pub fn GetWholeText(&self) -> Fallible { + pub fn GetWholeText(&self) -> Fallible> { Ok(None) } } diff --git a/src/components/script/dom/uievent.rs b/src/components/script/dom/uievent.rs index b3a48c69d2b..313f658ee20 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_: &DOMString, + type_: &Option, 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_: &DOMString, + type_: &Option, 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 b4a804464f5..d35dcd92ec7 100644 --- a/src/components/script/dom/window.rs +++ b/src/components/script/dom/window.rs @@ -72,7 +72,7 @@ pub struct TimerData { } impl Window { - pub fn Alert(&self, s: &DOMString) { + pub fn Alert(&self, s: &Option) { // Right now, just print to the console println(format!("ALERT: {:s}", null_str_as_empty(s))); } @@ -85,18 +85,18 @@ impl Window { self.page.frame.unwrap().document } - pub fn Name(&self) -> DOMString { + pub fn Name(&self) -> Option { None } - pub fn SetName(&self, _name: &DOMString) { + pub fn SetName(&self, _name: &Option) { } - pub fn Status(&self) -> DOMString { + pub fn Status(&self) -> Option { None } - pub fn SetStatus(&self, _status: &DOMString) { + pub fn SetStatus(&self, _status: &Option) { } pub fn Closed(&self) -> bool { @@ -123,18 +123,18 @@ impl Window { self.navigator.unwrap() } - pub fn Confirm(&self, _message: &DOMString) -> bool { + pub fn Confirm(&self, _message: &Option) -> bool { false } - pub fn Prompt(&self, _message: &DOMString, _default: &DOMString) -> DOMString { + pub fn Prompt(&self, _message: &Option, _default: &Option) -> Option { None } pub fn Print(&self) { } - pub fn ShowModalDialog(&self, _cx: *JSContext, _url: &DOMString, _argument: JSVal) -> JSVal { + pub fn ShowModalDialog(&self, _cx: *JSContext, _url: &Option, _argument: JSVal) -> JSVal { JSVAL_NULL } }