diff options
Diffstat (limited to 'src')
69 files changed, 434 insertions, 460 deletions
diff --git a/src/components/script/dom/bindings/codegen/CodegenRust.py b/src/components/script/dom/bindings/codegen/CodegenRust.py index 8c3e650b01a..e4b293ec2c0 100644 --- a/src/components/script/dom/bindings/codegen/CodegenRust.py +++ b/src/components/script/dom/bindings/codegen/CodegenRust.py @@ -1049,7 +1049,7 @@ for (uint32_t i = 0; i < length; ++i) { # "if (!ConvertJSValueToString(cx, ${val}, ${valPtr}, %s, %s, %s)) {\n" # " return false;\n" # "}" % (nullBehavior, undefinedBehavior, varName)) - strval = "str(strval.unwrap())" + strval = "Some(strval.unwrap())" if isOptional: strval = "Some(%s)" % strval conversionCode = ( @@ -1068,7 +1068,7 @@ for (uint32_t i = 0; i < length; ++i) { return handleDefault( conversionCode, ("static data: [u8, ..%s] = [ %s ];\n" - "%s = str(str::from_utf8(data));" % + "%s = Some(str::from_utf8(data));" % (len(defaultValue.value) + 1, ", ".join(["'" + char + "' as u8" for char in defaultValue.value] + ["0"]), varName))) @@ -3721,7 +3721,7 @@ class CGDOMJSProxyHandler_getOwnPropertyDescriptor(CGAbstractExternMethod): " if strval.is_err() {\n" + " return 0;\n" + " }\n" + - " let name = str(strval.unwrap());\n" + + " let name = Some(strval.unwrap());\n" + "\n" + " let this: *%s = UnwrapProxy(proxy);\n" + CGIndenter(CGProxyNamedGetter(self.descriptor, templateValues)).define() + "\n" + @@ -3790,7 +3790,7 @@ class CGDOMJSProxyHandler_defineProperty(CGAbstractExternMethod): " if strval.is_err() {\n" + " return 0;\n" + " }\n" + - " let name = str(strval.unwrap());\n" + + " let name = Some(strval.unwrap());\n" + "\n" + " let this: *%s = UnwrapProxy(proxy);\n" + CGIndenter(CGProxyNamedSetter(self.descriptor)).define() + "\n" + @@ -3806,7 +3806,7 @@ class CGDOMJSProxyHandler_defineProperty(CGAbstractExternMethod): " if strval.is_err() {\n" + " return 0;\n" + " }\n" + - " let name = str(strval.unwrap());\n" + + " let name = Some(strval.unwrap());\n" + " let this: %%s = UnwrapProxy(proxy);\n" + CGIndenter(CGProxyNamedGetter(self.descriptor)).define() + " if (found) {\n" @@ -3852,7 +3852,7 @@ class CGDOMJSProxyHandler_hasOwn(CGAbstractExternMethod): " if strval.is_err() {\n" + " return 0;\n" + " }\n" + - " let name = str(strval.unwrap());\n" + + " let name = Some(strval.unwrap());\n" + "\n" + " let this: *%s = UnwrapProxy(proxy);\n" + CGIndenter(CGProxyNamedGetter(self.descriptor)).define() + "\n" + diff --git a/src/components/script/dom/bindings/utils.rs b/src/components/script/dom/bindings/utils.rs index e37f1d68153..8593125e821 100644 --- a/src/components/script/dom/bindings/utils.rs +++ b/src/components/script/dom/bindings/utils.rs @@ -83,39 +83,26 @@ extern fn InterfaceObjectToString(cx: *JSContext, _argc: c_uint, vp: *mut JSVal) } let name = jsval_to_str(cx, *v).unwrap(); - let retval = str(~"function " + name + "() {\n [native code]\n}"); + let retval = Some(~"function " + name + "() {\n [native code]\n}"); *vp = domstring_to_jsval(cx, &retval); return 1; } } -#[deriving(Clone)] -pub enum DOMString { - str(~str), - null_string -} - -impl DOMString { - pub fn to_str(&self) -> ~str { - match *self { - str(ref s) => s.clone(), - null_string => ~"" - } - } +pub type DOMString = Option<~str>; - pub fn get_ref<'a>(&'a self) -> &'a str { - match *self { - str(ref s) => s.as_slice(), - null_string => &'a "", - } +pub fn null_str_as_empty(s: &DOMString) -> ~str { + // We don't use map_default because it would allocate ~"" even for Some. + match *s { + Some(ref s) => s.clone(), + None => ~"" } +} - // XXX This is temporary until issue #875 is fixed. - pub fn unwrap(&self) -> ~str { - match self { - &str(ref s) => s.clone(), - &null_string => fail!("Cannot unwrap a null string.") - } +pub fn null_str_as_empty_ref<'a>(s: &'a DOMString) -> &'a str { + match *s { + Some(ref s) => s.as_slice(), + None => &'a "" } } @@ -223,10 +210,10 @@ pub fn jsval_to_str(cx: *JSContext, v: JSVal) -> Result<~str, ()> { #[fixed_stack_segment] pub unsafe fn domstring_to_jsval(cx: *JSContext, string: &DOMString) -> JSVal { match string { - &null_string => { + &None => { JSVAL_NULL } - &str(ref s) => { + &Some(ref s) => { do s.as_imm_buf |buf, len| { let cbuf = cast::transmute(buf); RUST_STRING_TO_JSVAL(JS_NewStringCopyN(cx, cbuf, len as libc::size_t)) diff --git a/src/components/script/dom/characterdata.rs b/src/components/script/dom/characterdata.rs index 04c9ceead32..2dbf0bdf085 100644 --- a/src/components/script/dom/characterdata.rs +++ b/src/components/script/dom/characterdata.rs @@ -4,7 +4,7 @@ //! DOM bindings for `CharacterData`. -use dom::bindings::utils::{DOMString, str, ErrorResult}; +use dom::bindings::utils::{DOMString, ErrorResult}; use dom::bindings::utils::{BindingObject, CacheableWrapper, WrapperCache}; use dom::node::{Node, NodeTypeId, ScriptView}; use js::jsapi::{JSObject, JSContext}; @@ -23,11 +23,11 @@ impl CharacterData { } pub fn Data(&self) -> DOMString { - str(self.data.clone()) + Some(self.data.clone()) } pub fn SetData(&mut self, arg: &DOMString, _rv: &mut ErrorResult) { - self.data = arg.unwrap(); + self.data = arg.get_ref().clone(); } pub fn Length(&self) -> u32 { @@ -35,11 +35,11 @@ impl CharacterData { } pub fn SubstringData(&self, offset: u32, count: u32, _rv: &mut ErrorResult) -> DOMString { - str(self.data.slice(offset as uint, count as uint).to_str()) + Some(self.data.slice(offset as uint, count as uint).to_str()) } pub fn AppendData(&mut self, arg: &DOMString, _rv: &mut ErrorResult) { - self.data.push_str(arg.unwrap()); + self.data.push_str(arg.get_ref().clone()); } pub fn InsertData(&mut self, _offset: u32, _arg: &DOMString, _rv: &mut ErrorResult) { diff --git a/src/components/script/dom/comment.rs b/src/components/script/dom/comment.rs index 126178ca5d0..c72dc529a40 100644 --- a/src/components/script/dom/comment.rs +++ b/src/components/script/dom/comment.rs @@ -2,7 +2,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -use dom::bindings::utils::{DOMString, str, null_string, ErrorResult}; +use dom::bindings::utils::{DOMString, ErrorResult, null_str_as_empty}; use dom::characterdata::CharacterData; use dom::node::{AbstractNode, ScriptView, CommentNodeTypeId, Node}; use dom::window::Window; @@ -21,10 +21,7 @@ impl Comment { } pub fn Constructor(owner: @mut Window, data: &DOMString, _rv: &mut ErrorResult) -> AbstractNode<ScriptView> { - let s = match *data { - str(ref s) => s.clone(), - null_string => ~"" - }; + let s = null_str_as_empty(data); unsafe { let compartment = (*owner.page).js_info.get_ref().js_compartment; Node::as_abstract_node(compartment.cx.ptr, @Comment::new(s)) diff --git a/src/components/script/dom/document.rs b/src/components/script/dom/document.rs index 137ba6cf1e9..8cc00559dcb 100644 --- a/src/components/script/dom/document.rs +++ b/src/components/script/dom/document.rs @@ -3,9 +3,9 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ use dom::bindings::codegen::DocumentBinding; -use dom::bindings::utils::{DOMString, WrapperCache, ErrorResult, null_string, str}; +use dom::bindings::utils::{DOMString, WrapperCache, ErrorResult}; use dom::bindings::utils::{BindingObject, CacheableWrapper, rust_box, DerivedWrapper}; -use dom::bindings::utils::{is_valid_element_name, InvalidCharacter, Traceable}; +use dom::bindings::utils::{is_valid_element_name, InvalidCharacter, Traceable, null_str_as_empty}; use dom::element::{Element}; use dom::element::{HTMLHtmlElementTypeId, HTMLHeadElementTypeId, HTMLTitleElementTypeId}; use dom::event::Event; @@ -187,23 +187,23 @@ impl BindingObject for Document { impl Document { pub fn URL(&self) -> DOMString { - null_string + None } pub fn DocumentURI(&self) -> DOMString { - null_string + None } pub fn CompatMode(&self) -> DOMString { - null_string + None } pub fn CharacterSet(&self) -> DOMString { - null_string + None } pub fn ContentType(&self) -> DOMString { - null_string + None } pub fn GetDocumentElement(&self) -> Option<AbstractNode<ScriptView>> { @@ -224,7 +224,7 @@ impl Document { } pub fn GetElementsByTagName(&self, tag: &DOMString) -> @mut HTMLCollection { - self.createHTMLCollection(|elem| eq_slice(elem.tag_name, tag.to_str())) + self.createHTMLCollection(|elem| eq_slice(elem.tag_name, null_str_as_empty(tag))) } pub fn GetElementsByTagNameNS(&self, _ns: &DOMString, _tag: &DOMString) -> @mut HTMLCollection { @@ -243,7 +243,7 @@ impl Document { pub fn CreateElement(&self, local_name: &DOMString, rv: &mut ErrorResult) -> AbstractNode<ScriptView> { let cx = self.get_cx(); - let local_name = local_name.to_str(); + let local_name = null_str_as_empty(local_name); if !is_valid_element_name(local_name) { *rv = Err(InvalidCharacter); // FIXME #909: what to return here? @@ -259,7 +259,7 @@ impl Document { pub fn CreateTextNode(&self, data: &DOMString) -> AbstractNode<ScriptView> { let cx = self.get_cx(); - unsafe { Node::as_abstract_node(cx, @Text::new(data.to_str())) } + unsafe { Node::as_abstract_node(cx, @Text::new(null_str_as_empty(data))) } } pub fn CreateEvent(&self, _interface: &DOMString, _rv: &mut ErrorResult) -> @mut Event { @@ -267,19 +267,19 @@ impl Document { } pub fn GetInputEncoding(&self) -> DOMString { - null_string + None } pub fn Referrer(&self) -> DOMString { - null_string + None } pub fn LastModified(&self) -> DOMString { - null_string + None } pub fn ReadyState(&self) -> DOMString { - null_string + None } pub fn Title(&self) -> DOMString { @@ -297,7 +297,7 @@ impl Document { if child.is_text() { do child.with_imm_text() |text| { let s = text.parent.Data(); - title = title + s.to_str(); + title = title + null_str_as_empty(&s); } } } @@ -308,7 +308,7 @@ impl Document { let v: ~[&str] = title.word_iter().collect(); title = v.connect(" "); title = title.trim().to_owned(); - str(title) + Some(title) } pub fn SetTitle(&self, title: &DOMString, _rv: &mut ErrorResult) { @@ -351,7 +351,7 @@ impl Document { } pub fn Dir(&self) -> DOMString { - null_string + None } pub fn SetDir(&self, _dir: &DOMString) { @@ -408,18 +408,18 @@ impl Document { } pub fn GetSelectedStyleSheetSet(&self) -> DOMString { - null_string + None } pub fn SetSelectedStyleSheetSet(&self, _sheet: &DOMString) { } pub fn GetLastStyleSheetSet(&self) -> DOMString { - null_string + None } pub fn GetPreferredStyleSheetSet(&self) -> DOMString { - null_string + None } pub fn EnableStyleSheetsForSet(&self, _name: &DOMString) { @@ -435,7 +435,7 @@ impl Document { pub fn GetElementsByName(&self, name: &DOMString) -> @mut HTMLCollection { self.createHTMLCollection(|elem| - elem.get_attr("name").is_some() && eq_slice(elem.get_attr("name").unwrap(), name.to_str())) + elem.get_attr("name").is_some() && eq_slice(elem.get_attr("name").unwrap(), null_str_as_empty(name))) } pub fn createHTMLCollection(&self, callback: &fn(elem: &Element) -> bool) -> @mut HTMLCollection { diff --git a/src/components/script/dom/documenttype.rs b/src/components/script/dom/documenttype.rs index 3ac1d1f0db0..1a4fa918550 100644 --- a/src/components/script/dom/documenttype.rs +++ b/src/components/script/dom/documenttype.rs @@ -2,7 +2,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -use dom::bindings::utils::{DOMString, str, null_string}; +use dom::bindings::utils::DOMString; use dom::node::{ScriptView, Node, DoctypeNodeTypeId}; /// The `DOCTYPE` tag. @@ -31,20 +31,14 @@ impl DocumentType<ScriptView> { } pub fn Name(&self) -> DOMString { - str(self.name.clone()) + Some(self.name.clone()) } pub fn PublicId(&self) -> DOMString { - match self.public_id { - Some(ref s) => str(s.clone()), - None => null_string - } + self.public_id.clone() } pub fn SystemId(&self) -> DOMString { - match self.system_id { - Some(ref s) => str(s.clone()), - None => null_string - } + self.system_id.clone() } } diff --git a/src/components/script/dom/element.rs b/src/components/script/dom/element.rs index 50bd41358e2..3fbcde1ed9a 100644 --- a/src/components/script/dom/element.rs +++ b/src/components/script/dom/element.rs @@ -4,8 +4,8 @@ //! Element nodes. -use dom::bindings::utils::{null_string, str}; use dom::bindings::utils::{BindingObject, CacheableWrapper, DOMString, ErrorResult, WrapperCache}; +use dom::bindings::utils::{null_str_as_empty, null_str_as_empty_ref}; use dom::htmlcollection::HTMLCollection; use dom::clientrect::ClientRect; use dom::clientrectlist::ClientRectList; @@ -143,8 +143,8 @@ impl<'self> Element { abstract_self: AbstractNode<ScriptView>, raw_name: &DOMString, raw_value: &DOMString) { - let name = raw_name.to_str(); - let value_cell = Cell::new(raw_value.to_str()); + let name = null_str_as_empty(raw_name); + let value_cell = Cell::new(null_str_as_empty(raw_value)); let mut found = false; for attr in self.attrs.mut_iter() { if eq_slice(attr.name, name) { @@ -161,7 +161,7 @@ impl<'self> Element { self.style_attribute = Some( Stylesheet::from_attribute( FromStr::from_str("http://www.example.com/").unwrap(), - raw_value.get_ref())); + null_str_as_empty_ref(raw_value))); } //XXXjdm We really need something like a vtable so we can call AfterSetAttr. @@ -198,25 +198,22 @@ impl<'self> Element { impl Element { pub fn TagName(&self) -> DOMString { - str(self.tag_name.to_owned().to_ascii_upper()) + Some(self.tag_name.to_owned().to_ascii_upper()) } pub fn Id(&self) -> DOMString { - null_string + None } pub fn SetId(&self, _id: &DOMString) { } pub fn GetAttribute(&self, name: &DOMString) -> DOMString { - match self.get_attr(name.get_ref()) { - Some(val) => str(val.to_owned()), - None => null_string - } + self.get_attr(null_str_as_empty_ref(name)).map(|s| s.to_owned()) } pub fn GetAttributeNS(&self, _namespace: &DOMString, _localname: &DOMString) -> DOMString { - null_string + None } pub fn SetAttribute(&mut self, @@ -392,14 +389,14 @@ impl Element { } pub fn GetInnerHTML(&self, _rv: &mut ErrorResult) -> DOMString { - null_string + None } pub fn SetInnerHTML(&mut self, _value: &DOMString, _rv: &mut ErrorResult) { } pub fn GetOuterHTML(&self, _rv: &mut ErrorResult) -> DOMString { - null_string + None } pub fn SetOuterHTML(&mut self, _value: &DOMString, _rv: &mut ErrorResult) { diff --git a/src/components/script/dom/formdata.rs b/src/components/script/dom/formdata.rs index 4bac8e18966..008f524091e 100644 --- a/src/components/script/dom/formdata.rs +++ b/src/components/script/dom/formdata.rs @@ -3,7 +3,7 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ use dom::bindings::utils::{CacheableWrapper, BindingObject, DerivedWrapper}; -use dom::bindings::utils::{WrapperCache, DOMString, str}; +use dom::bindings::utils::{WrapperCache, DOMString, null_str_as_empty}; use dom::bindings::codegen::FormDataBinding; use dom::blob::Blob; use script_task::{page_from_context}; @@ -39,13 +39,13 @@ impl FormData { pub fn Append(&mut self, name: &DOMString, value: @mut Blob, filename: Option<DOMString>) { let blob = BlobData { blob: value, - name: filename.unwrap_or_default(str(~"default")) + name: filename.unwrap_or_default(Some(~"default")) }; - self.data.insert(name.to_str(), blob); + self.data.insert(null_str_as_empty(name), blob); } pub fn Append_(&mut self, name: &DOMString, value: &DOMString) { - self.data.insert(name.to_str(), StringData((*value).clone())); + 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 4c8160b0c1b..7c5b6dcc4ee 100644 --- a/src/components/script/dom/htmlanchorelement.rs +++ b/src/components/script/dom/htmlanchorelement.rs @@ -3,7 +3,7 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ use dom::htmlelement::HTMLElement; -use dom::bindings::utils::{DOMString, null_string, ErrorResult}; +use dom::bindings::utils::{DOMString, ErrorResult}; pub struct HTMLAnchorElement { parent: HTMLElement @@ -11,91 +11,91 @@ pub struct HTMLAnchorElement { impl HTMLAnchorElement { pub fn Href(&self) -> DOMString { - null_string + None } pub fn SetHref(&mut self, _href: &DOMString, _rv: &mut ErrorResult) { } pub fn Target(&self) -> DOMString { - null_string + None } pub fn SetTarget(&self, _target: &DOMString, _rv: &mut ErrorResult) { } pub fn Download(&self) -> DOMString { - null_string + None } pub fn SetDownload(&self, _download: &DOMString, _rv: &mut ErrorResult) { } pub fn Ping(&self) -> DOMString { - null_string + None } pub fn SetPing(&self, _ping: &DOMString, _rv: &mut ErrorResult) { } pub fn Rel(&self) -> DOMString { - null_string + None } pub fn SetRel(&self, _rel: &DOMString, _rv: &mut ErrorResult) { } pub fn Hreflang(&self) -> DOMString { - null_string + None } pub fn SetHreflang(&self, _href_lang: &DOMString, _rv: &mut ErrorResult) { } pub fn Type(&self) -> DOMString { - null_string + None } pub fn SetType(&mut self, _type: &DOMString, _rv: &mut ErrorResult) { } pub fn Text(&self) -> DOMString { - null_string + None } pub fn SetText(&mut self, _text: &DOMString, _rv: &mut ErrorResult) { } pub fn Coords(&self) -> DOMString { - null_string + None } pub fn SetCoords(&mut self, _coords: &DOMString, _rv: &mut ErrorResult) { } pub fn Charset(&self) -> DOMString { - null_string + None } pub fn SetCharset(&mut self, _charset: &DOMString, _rv: &mut ErrorResult) { } pub fn Name(&self) -> DOMString { - null_string + None } pub fn SetName(&mut self, _name: &DOMString, _rv: &mut ErrorResult) { } pub fn Rev(&self) -> DOMString { - null_string + None } pub fn SetRev(&mut self, _rev: &DOMString, _rv: &mut ErrorResult) { } pub fn Shape(&self) -> DOMString { - null_string + None } pub fn SetShape(&mut self, _shape: &DOMString, _rv: &mut ErrorResult) { diff --git a/src/components/script/dom/htmlappletelement.rs b/src/components/script/dom/htmlappletelement.rs index 8c8ee5e6cf1..0c1deee508c 100644 --- a/src/components/script/dom/htmlappletelement.rs +++ b/src/components/script/dom/htmlappletelement.rs @@ -2,7 +2,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -use dom::bindings::utils::{DOMString, null_string, ErrorResult}; +use dom::bindings::utils::{DOMString, ErrorResult}; use dom::htmlelement::HTMLElement; pub struct HTMLAppletElement { @@ -11,42 +11,42 @@ pub struct HTMLAppletElement { impl HTMLAppletElement { pub fn Align(&self) -> DOMString { - null_string + None } pub fn SetAlign(&mut self, _align: &DOMString, _rv: &mut ErrorResult) { } pub fn Alt(&self) -> DOMString { - null_string + None } pub fn SetAlt(&self, _alt: &DOMString, _rv: &mut ErrorResult) { } pub fn Archive(&self) -> DOMString { - null_string + None } pub fn SetArchive(&self, _archive: &DOMString, _rv: &mut ErrorResult) { } pub fn Code(&self) -> DOMString { - null_string + None } pub fn SetCode(&self, _code: &DOMString, _rv: &mut ErrorResult) { } pub fn CodeBase(&self) -> DOMString { - null_string + None } pub fn SetCodeBase(&self, _code_base: &DOMString, _rv: &mut ErrorResult) { } pub fn Height(&self) -> DOMString { - null_string + None } pub fn SetHeight(&self, _height: &DOMString, _rv: &mut ErrorResult) { @@ -60,14 +60,14 @@ impl HTMLAppletElement { } pub fn Name(&self) -> DOMString { - null_string + None } pub fn SetName(&mut self, _name: &DOMString, _rv: &mut ErrorResult) { } pub fn Object(&self) -> DOMString { - null_string + None } pub fn SetObject(&mut self, _object: &DOMString, _rv: &mut ErrorResult) { @@ -81,7 +81,7 @@ impl HTMLAppletElement { } pub fn Width(&self) -> DOMString { - null_string + None } pub fn SetWidth(&mut self, _width: &DOMString, _rv: &mut ErrorResult) { diff --git a/src/components/script/dom/htmlareaelement.rs b/src/components/script/dom/htmlareaelement.rs index 8dd146d4b71..f28de8a6909 100644 --- a/src/components/script/dom/htmlareaelement.rs +++ b/src/components/script/dom/htmlareaelement.rs @@ -2,7 +2,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -use dom::bindings::utils::{DOMString, null_string, ErrorResult}; +use dom::bindings::utils::{DOMString, ErrorResult}; use dom::htmlelement::HTMLElement; pub struct HTMLAreaElement { @@ -11,49 +11,49 @@ pub struct HTMLAreaElement { impl HTMLAreaElement { pub fn Alt(&self) -> DOMString { - null_string + None } pub fn SetAlt(&self, _alt: &DOMString, _rv: &mut ErrorResult) { } pub fn Coords(&self) -> DOMString { - null_string + None } pub fn SetCoords(&self, _coords: &DOMString, _rv: &mut ErrorResult) { } pub fn Shape(&self) -> DOMString { - null_string + None } pub fn SetShape(&self, _shape: &DOMString, _rv: &mut ErrorResult) { } pub fn Href(&self) -> DOMString { - null_string + None } pub fn SetHref(&self, _href: &DOMString, _rv: &mut ErrorResult) { } pub fn Target(&self) -> DOMString { - null_string + None } pub fn SetTarget(&self, _target: &DOMString, _rv: &mut ErrorResult) { } pub fn Download(&self) -> DOMString { - null_string + None } pub fn SetDownload(&self, _download: &DOMString, _rv: &mut ErrorResult) { } pub fn Ping(&self) -> DOMString { - null_string + None } pub fn SetPing(&self, _ping: &DOMString, _rv: &mut ErrorResult) { diff --git a/src/components/script/dom/htmlbaseelement.rs b/src/components/script/dom/htmlbaseelement.rs index 6df670c9bdb..67950190616 100644 --- a/src/components/script/dom/htmlbaseelement.rs +++ b/src/components/script/dom/htmlbaseelement.rs @@ -2,7 +2,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -use dom::bindings::utils::{DOMString, null_string, ErrorResult}; +use dom::bindings::utils::{DOMString, ErrorResult}; use dom::htmlelement::HTMLElement; pub struct HTMLBaseElement { @@ -11,14 +11,14 @@ pub struct HTMLBaseElement { impl HTMLBaseElement { pub fn Href(&self) -> DOMString { - null_string + None } pub fn SetHref(&self, _href: &DOMString, _rv: &mut ErrorResult) { } pub fn Target(&self) -> DOMString { - null_string + None } pub fn SetTarget(&self, _target: &DOMString, _rv: &mut ErrorResult) { diff --git a/src/components/script/dom/htmlbodyelement.rs b/src/components/script/dom/htmlbodyelement.rs index f6781d3bbc9..6d305f45bc3 100644 --- a/src/components/script/dom/htmlbodyelement.rs +++ b/src/components/script/dom/htmlbodyelement.rs @@ -2,7 +2,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -use dom::bindings::utils::{DOMString, null_string, ErrorResult}; +use dom::bindings::utils::{DOMString, ErrorResult}; use dom::htmlelement::HTMLElement; pub struct HTMLBodyElement { @@ -11,42 +11,42 @@ pub struct HTMLBodyElement { impl HTMLBodyElement { pub fn Text(&self) -> DOMString { - null_string + None } pub fn SetText(&mut self, _text: &DOMString, _rv: &mut ErrorResult) { } pub fn Link(&self) -> DOMString { - null_string + None } pub fn SetLink(&self, _link: &DOMString, _rv: &mut ErrorResult) { } pub fn VLink(&self) -> DOMString { - null_string + None } pub fn SetVLink(&self, _v_link: &DOMString, _rv: &mut ErrorResult) { } pub fn ALink(&self) -> DOMString { - null_string + None } pub fn SetALink(&self, _a_link: &DOMString, _rv: &mut ErrorResult) { } pub fn BgColor(&self) -> DOMString { - null_string + None } pub fn SetBgColor(&self, _bg_color: &DOMString, _rv: &mut ErrorResult) { } pub fn Background(&self) -> DOMString { - null_string + None } pub fn SetBackground(&self, _background: &DOMString, _rv: &mut ErrorResult) { diff --git a/src/components/script/dom/htmlbrelement.rs b/src/components/script/dom/htmlbrelement.rs index e89bedff047..faa7f1d758b 100644 --- a/src/components/script/dom/htmlbrelement.rs +++ b/src/components/script/dom/htmlbrelement.rs @@ -2,7 +2,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -use dom::bindings::utils::{DOMString, null_string, ErrorResult}; +use dom::bindings::utils::{DOMString, ErrorResult}; use dom::htmlelement::HTMLElement; pub struct HTMLBRElement { @@ -11,7 +11,7 @@ pub struct HTMLBRElement { impl HTMLBRElement { pub fn Clear(&self) -> DOMString { - null_string + None } pub fn SetClear(&mut self, _text: &DOMString, _rv: &mut ErrorResult) { diff --git a/src/components/script/dom/htmlbuttonelement.rs b/src/components/script/dom/htmlbuttonelement.rs index fa831c67fd3..c2e3fd1f3f2 100644 --- a/src/components/script/dom/htmlbuttonelement.rs +++ b/src/components/script/dom/htmlbuttonelement.rs @@ -2,7 +2,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -use dom::bindings::utils::{DOMString, null_string, ErrorResult}; +use dom::bindings::utils::{DOMString, ErrorResult}; use dom::htmlelement::HTMLElement; use dom::node::{AbstractNode, ScriptView}; use dom::validitystate::ValidityState; @@ -31,21 +31,21 @@ impl HTMLButtonElement { } pub fn FormAction(&self) -> DOMString { - null_string + None } pub fn SetFormAction(&mut self, _formaction: &DOMString, _rv: &mut ErrorResult) { } pub fn FormEnctype(&self) -> DOMString { - null_string + None } pub fn SetFormEnctype(&mut self, _formenctype: &DOMString, _rv: &mut ErrorResult) { } pub fn FormMethod(&self) -> DOMString { - null_string + None } pub fn SetFormMethod(&mut self, _formmethod: &DOMString, _rv: &mut ErrorResult) { @@ -59,28 +59,28 @@ impl HTMLButtonElement { } pub fn FormTarget(&self) -> DOMString { - null_string + None } pub fn SetFormTarget(&mut self, _formtarget: &DOMString, _rv: &mut ErrorResult) { } pub fn Name(&self) -> DOMString { - null_string + None } pub fn SetName(&mut self, _name: &DOMString, _rv: &mut ErrorResult) { } pub fn Type(&self) -> DOMString { - null_string + None } pub fn SetType(&mut self, _type: &DOMString, _rv: &mut ErrorResult) { } pub fn Value(&self) -> DOMString { - null_string + None } pub fn SetValue(&mut self, _value: &DOMString, _rv: &mut ErrorResult) { @@ -101,7 +101,7 @@ impl HTMLButtonElement { } pub fn ValidationMessage(&self) -> DOMString { - null_string + None } pub fn SetValidationMessage(&mut self, _message: &DOMString, _rv: &mut ErrorResult) { diff --git a/src/components/script/dom/htmldataelement.rs b/src/components/script/dom/htmldataelement.rs index dd2ed31a6da..d90007af17e 100644 --- a/src/components/script/dom/htmldataelement.rs +++ b/src/components/script/dom/htmldataelement.rs @@ -2,7 +2,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -use dom::bindings::utils::{DOMString, null_string, ErrorResult}; +use dom::bindings::utils::{DOMString, ErrorResult}; use dom::htmlelement::HTMLElement; pub struct HTMLDataElement { @@ -11,7 +11,7 @@ pub struct HTMLDataElement { impl HTMLDataElement { pub fn Value(&self) -> DOMString { - null_string + None } pub fn SetValue(&mut self, _value: &DOMString, _rv: &mut ErrorResult) { diff --git a/src/components/script/dom/htmldivelement.rs b/src/components/script/dom/htmldivelement.rs index b46281234e7..a9af75f17e9 100644 --- a/src/components/script/dom/htmldivelement.rs +++ b/src/components/script/dom/htmldivelement.rs @@ -2,7 +2,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -use dom::bindings::utils::{DOMString, null_string, ErrorResult}; +use dom::bindings::utils::{DOMString, ErrorResult}; use dom::htmlelement::HTMLElement; pub struct HTMLDivElement { @@ -11,7 +11,7 @@ pub struct HTMLDivElement { impl HTMLDivElement { pub fn Align(&self) -> DOMString { - null_string + None } pub fn SetAlign(&mut self, _align: &DOMString, _rv: &mut ErrorResult) { diff --git a/src/components/script/dom/htmldlistelement.rs b/src/components/script/dom/htmldlistelement.rs index ff6908746ec..87c51145d38 100644 --- a/src/components/script/dom/htmldlistelement.rs +++ b/src/components/script/dom/htmldlistelement.rs @@ -2,7 +2,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -use dom::bindings::utils::{DOMString, null_string, ErrorResult}; +use dom::bindings::utils::{DOMString, ErrorResult}; use dom::htmlelement::HTMLElement; pub struct HTMLDListElement { @@ -18,7 +18,7 @@ impl HTMLDListElement { } pub fn Type(&self) -> DOMString { - null_string + None } pub fn SetType(&mut self, _type: &DOMString, _rv: &mut ErrorResult) { diff --git a/src/components/script/dom/htmldocument.rs b/src/components/script/dom/htmldocument.rs index abdd9646cea..037ba0cf8a2 100644 --- a/src/components/script/dom/htmldocument.rs +++ b/src/components/script/dom/htmldocument.rs @@ -3,7 +3,7 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ use dom::bindings::codegen::HTMLDocumentBinding; -use dom::bindings::utils::{DOMString, ErrorResult, null_string}; +use dom::bindings::utils::{DOMString, ErrorResult}; use dom::bindings::utils::{CacheableWrapper, BindingObject, WrapperCache}; use dom::document::{AbstractDocument, Document, WrappableDocument, HTML}; use dom::element::HTMLHeadElementTypeId; @@ -54,14 +54,14 @@ impl HTMLDocument { } pub fn GetDomain(&self, _rv: &mut ErrorResult) -> DOMString { - null_string + None } pub fn SetDomain(&self, _domain: &DOMString, _rv: &mut ErrorResult) { } pub fn GetCookie(&self, _rv: &mut ErrorResult) -> DOMString { - null_string + None } pub fn SetCookie(&self, _cookie: &DOMString, _rv: &mut ErrorResult) { @@ -108,7 +108,7 @@ impl HTMLDocument { } pub fn DesignMode(&self) -> DOMString { - null_string + None } pub fn SetDesignMode(&self, _mode: &DOMString, _rv: &mut ErrorResult) { @@ -135,39 +135,39 @@ impl HTMLDocument { } pub fn QueryCommandValue(&self, _command_id: &DOMString, _rv: &mut ErrorResult) -> DOMString { - null_string + None } pub fn FgColor(&self) -> DOMString { - null_string + None } pub fn SetFgColor(&self, _color: &DOMString) { } pub fn LinkColor(&self) -> DOMString { - null_string + None } pub fn SetLinkColor(&self, _color: &DOMString) { } pub fn VlinkColor(&self) -> DOMString { - null_string + None } pub fn SetVlinkColor(&self, _color: &DOMString) { } pub fn AlinkColor(&self) -> DOMString { - null_string + None } pub fn SetAlinkColor(&self, _color: &DOMString) { } pub fn BgColor(&self) -> DOMString { - null_string + None } pub fn SetBgColor(&self, _color: &DOMString) { diff --git a/src/components/script/dom/htmlelement.rs b/src/components/script/dom/htmlelement.rs index a28c87afad5..80ec901e657 100644 --- a/src/components/script/dom/htmlelement.rs +++ b/src/components/script/dom/htmlelement.rs @@ -3,7 +3,7 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ use dom::bindings::codegen::HTMLElementBinding; -use dom::bindings::utils::{DOMString, null_string, ErrorResult}; +use dom::bindings::utils::{DOMString, ErrorResult}; use dom::bindings::utils::{CacheableWrapper, BindingObject, WrapperCache}; use dom::element::{Element, ElementTypeId}; use dom::node::{AbstractNode, ScriptView}; @@ -24,21 +24,21 @@ impl HTMLElement { impl HTMLElement { pub fn Title(&self) -> DOMString { - null_string + None } pub fn SetTitle(&mut self, _title: &DOMString) { } pub fn Lang(&self) -> DOMString { - null_string + None } pub fn SetLang(&mut self, _lang: &DOMString) { } pub fn Dir(&self) -> DOMString { - null_string + None } pub fn SetDir(&mut self, _dir: &DOMString, _rv: &mut ErrorResult) { @@ -75,14 +75,14 @@ impl HTMLElement { } pub fn AccessKey(&self) -> DOMString { - null_string + None } pub fn SetAccessKey(&self, _key: &DOMString, _rv: &mut ErrorResult) { } pub fn AccessKeyLabel(&self) -> DOMString { - null_string + None } pub fn Draggable(&self) -> bool { @@ -93,7 +93,7 @@ impl HTMLElement { } pub fn ContentEditable(&self) -> DOMString { - null_string + None } pub fn SetContentEditable(&mut self, _val: &DOMString, _rv: &mut ErrorResult) { @@ -111,7 +111,7 @@ impl HTMLElement { } pub fn ClassName(&self) -> DOMString { - null_string + None } pub fn SetClassName(&self, _class: &DOMString) { diff --git a/src/components/script/dom/htmlembedelement.rs b/src/components/script/dom/htmlembedelement.rs index 2d86fa6f2e7..b5b5e9833d5 100644 --- a/src/components/script/dom/htmlembedelement.rs +++ b/src/components/script/dom/htmlembedelement.rs @@ -2,7 +2,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -use dom::bindings::utils::{DOMString, null_string, ErrorResult}; +use dom::bindings::utils::{DOMString, ErrorResult}; use dom::document::AbstractDocument; use dom::htmlelement::HTMLElement; @@ -12,42 +12,42 @@ pub struct HTMLEmbedElement { impl HTMLEmbedElement { pub fn Src(&self) -> DOMString { - null_string + None } pub fn SetSrc(&mut self, _src: &DOMString, _rv: &mut ErrorResult) { } pub fn Type(&self) -> DOMString { - null_string + None } pub fn SetType(&mut self, _type: &DOMString, _rv: &mut ErrorResult) { } pub fn Width(&self) -> DOMString { - null_string + None } pub fn SetWidth(&mut self, _width: &DOMString, _rv: &mut ErrorResult) { } pub fn Height(&self) -> DOMString { - null_string + None } pub fn SetHeight(&mut self, _height: &DOMString, _rv: &mut ErrorResult) { } pub fn Align(&self) -> DOMString { - null_string + None } pub fn SetAlign(&mut self, _type: &DOMString, _rv: &mut ErrorResult) { } pub fn Name(&self) -> DOMString { - null_string + None } pub fn SetName(&mut self, _type: &DOMString, _rv: &mut ErrorResult) { diff --git a/src/components/script/dom/htmlfieldsetelement.rs b/src/components/script/dom/htmlfieldsetelement.rs index 67518289d86..42f23dba530 100644 --- a/src/components/script/dom/htmlfieldsetelement.rs +++ b/src/components/script/dom/htmlfieldsetelement.rs @@ -2,7 +2,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -use dom::bindings::utils::{DOMString, null_string, ErrorResult, CacheableWrapper}; +use dom::bindings::utils::{DOMString, ErrorResult, CacheableWrapper}; use dom::htmlcollection::HTMLCollection; use dom::htmlelement::HTMLElement; use dom::node::{AbstractNode, ScriptView}; @@ -27,14 +27,14 @@ impl HTMLFieldSetElement { } pub fn Name(&self) -> DOMString { - null_string + None } pub fn SetName(&mut self, _name: &DOMString, _rv: &mut ErrorResult) { } pub fn Type(&self) -> DOMString { - null_string + None } fn get_scope_and_cx(&self) -> (*JSObject, *JSContext) { @@ -60,7 +60,7 @@ impl HTMLFieldSetElement { } pub fn ValidationMessage(&self) -> DOMString { - null_string + None } pub fn CheckValidity(&self) -> bool { diff --git a/src/components/script/dom/htmlfontelement.rs b/src/components/script/dom/htmlfontelement.rs index eff3d85ae3b..1d1158b6de4 100644 --- a/src/components/script/dom/htmlfontelement.rs +++ b/src/components/script/dom/htmlfontelement.rs @@ -2,7 +2,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -use dom::bindings::utils::{DOMString, null_string, ErrorResult}; +use dom::bindings::utils::{DOMString, ErrorResult}; use dom::htmlelement::HTMLElement; pub struct HTMLFontElement { @@ -11,21 +11,21 @@ pub struct HTMLFontElement { impl HTMLFontElement { pub fn Color(&self) -> DOMString { - null_string + None } pub fn SetColor(&mut self, _color: &DOMString, _rv: &mut ErrorResult) { } pub fn Face(&self) -> DOMString { - null_string + None } pub fn SetFace(&mut self, _face: &DOMString, _rv: &mut ErrorResult) { } pub fn Size(&self) -> DOMString { - null_string + None } pub fn SetSize(&mut self, _size: &DOMString, _rv: &mut ErrorResult) { diff --git a/src/components/script/dom/htmlformelement.rs b/src/components/script/dom/htmlformelement.rs index f83d544425c..0b1a8e96a9f 100644 --- a/src/components/script/dom/htmlformelement.rs +++ b/src/components/script/dom/htmlformelement.rs @@ -2,7 +2,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -use dom::bindings::utils::{CacheableWrapper, DOMString, ErrorResult, null_string}; +use dom::bindings::utils::{CacheableWrapper, DOMString, ErrorResult}; use dom::element::HTMLFormElementTypeId; use dom::htmlcollection::HTMLCollection; use dom::htmlelement::HTMLElement; @@ -25,49 +25,49 @@ impl HTMLFormElement { } pub fn AcceptCharset(&self) -> DOMString { - null_string + None } pub fn SetAcceptCharset(&mut self, _accept_charset: &DOMString, _rv: &mut ErrorResult) { } pub fn Action(&self) -> DOMString { - null_string + None } pub fn SetAction(&mut self, _action: &DOMString, _rv: &mut ErrorResult) { } pub fn Autocomplete(&self) -> DOMString { - null_string + None } pub fn SetAutocomplete(&mut self, _autocomplete: &DOMString, _rv: &mut ErrorResult) { } pub fn Enctype(&self) -> DOMString { - null_string + None } pub fn SetEnctype(&mut self, _enctype: &DOMString, _rv: &mut ErrorResult) { } pub fn Encoding(&self) -> DOMString { - null_string + None } pub fn SetEncoding(&mut self, _encoding: &DOMString, _rv: &mut ErrorResult) { } pub fn Method(&self) -> DOMString { - null_string + None } pub fn SetMethod(&mut self, _method: &DOMString, _rv: &mut ErrorResult) { } pub fn Name(&self) -> DOMString { - null_string + None } pub fn SetName(&mut self, _name: &DOMString, _rv: &mut ErrorResult) { @@ -81,7 +81,7 @@ impl HTMLFormElement { } pub fn Target(&self) -> DOMString { - null_string + None } pub fn SetTarget(&mut self, _target: &DOMString, _rv: &mut ErrorResult) { diff --git a/src/components/script/dom/htmlframeelement.rs b/src/components/script/dom/htmlframeelement.rs index 64ce1537363..4dc263f7cb2 100644 --- a/src/components/script/dom/htmlframeelement.rs +++ b/src/components/script/dom/htmlframeelement.rs @@ -2,7 +2,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -use dom::bindings::utils::{DOMString, null_string, ErrorResult}; +use dom::bindings::utils::{DOMString, ErrorResult}; use dom::document::AbstractDocument; use dom::htmlelement::HTMLElement; use dom::windowproxy::WindowProxy; @@ -13,35 +13,35 @@ pub struct HTMLFrameElement { impl HTMLFrameElement { pub fn Name(&self) -> DOMString { - null_string + None } pub fn SetName(&mut self, _name: &DOMString, _rv: &mut ErrorResult) { } pub fn Scrolling(&self) -> DOMString { - null_string + None } pub fn SetScrolling(&mut self, _scrolling: &DOMString, _rv: &mut ErrorResult) { } pub fn Src(&self) -> DOMString { - null_string + None } pub fn SetSrc(&mut self, _src: &DOMString, _rv: &mut ErrorResult) { } pub fn FrameBorder(&self) -> DOMString { - null_string + None } pub fn SetFrameBorder(&mut self, _frameborder: &DOMString, _rv: &mut ErrorResult) { } pub fn LongDesc(&self) -> DOMString { - null_string + None } pub fn SetLongDesc(&mut self, _longdesc: &DOMString, _rv: &mut ErrorResult) { @@ -63,14 +63,14 @@ impl HTMLFrameElement { } pub fn MarginHeight(&self) -> DOMString { - null_string + None } pub fn SetMarginHeight(&mut self, _height: &DOMString, _rv: &mut ErrorResult) { } pub fn MarginWidth(&self) -> DOMString { - null_string + None } pub fn SetMarginWidth(&mut self, _height: &DOMString, _rv: &mut ErrorResult) { diff --git a/src/components/script/dom/htmlframesetelement.rs b/src/components/script/dom/htmlframesetelement.rs index ff483633083..eac14207dc0 100644 --- a/src/components/script/dom/htmlframesetelement.rs +++ b/src/components/script/dom/htmlframesetelement.rs @@ -2,7 +2,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -use dom::bindings::utils::{DOMString, null_string, ErrorResult}; +use dom::bindings::utils::{DOMString, ErrorResult}; use dom::htmlelement::HTMLElement; pub struct HTMLFrameSetElement { @@ -11,14 +11,14 @@ pub struct HTMLFrameSetElement { impl HTMLFrameSetElement { pub fn Cols(&self) -> DOMString { - null_string + None } pub fn SetCols(&mut self, _cols: &DOMString, _rv: &mut ErrorResult) { } pub fn Rows(&self) -> DOMString { - null_string + None } pub fn SetRows(&mut self, _rows: &DOMString, _rv: &mut ErrorResult) { diff --git a/src/components/script/dom/htmlheadingelement.rs b/src/components/script/dom/htmlheadingelement.rs index d94bd06dab4..33231737bb7 100644 --- a/src/components/script/dom/htmlheadingelement.rs +++ b/src/components/script/dom/htmlheadingelement.rs @@ -2,7 +2,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -use dom::bindings::utils::{DOMString, null_string}; +use dom::bindings::utils::DOMString; use dom::htmlelement::HTMLElement; pub enum HeadingLevel { @@ -21,7 +21,7 @@ pub struct HTMLHeadingElement { impl HTMLHeadingElement { pub fn Align(&self) -> DOMString { - null_string + None } pub fn SetAlign(&mut self, _align: &DOMString) { diff --git a/src/components/script/dom/htmlhrelement.rs b/src/components/script/dom/htmlhrelement.rs index d1a3bb0348e..95e2b34e3f3 100644 --- a/src/components/script/dom/htmlhrelement.rs +++ b/src/components/script/dom/htmlhrelement.rs @@ -2,7 +2,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -use dom::bindings::utils::{DOMString, null_string, ErrorResult}; +use dom::bindings::utils::{DOMString, ErrorResult}; use dom::htmlelement::HTMLElement; pub struct HTMLHRElement { @@ -11,14 +11,14 @@ pub struct HTMLHRElement { impl HTMLHRElement { pub fn Align(&self) -> DOMString { - null_string + None } pub fn SetAlign(&mut self, _align: &DOMString, _rv: &mut ErrorResult) { } pub fn Color(&self) -> DOMString { - null_string + None } pub fn SetColor(&mut self, _color: &DOMString, _rv: &mut ErrorResult) { @@ -32,14 +32,14 @@ impl HTMLHRElement { } pub fn Size(&self) -> DOMString { - null_string + None } pub fn SetSize(&mut self, _size: &DOMString, _rv: &mut ErrorResult) { } pub fn Width(&self) -> DOMString { - null_string + None } pub fn SetWidth(&mut self, _width: &DOMString, _rv: &mut ErrorResult) { diff --git a/src/components/script/dom/htmlhtmlelement.rs b/src/components/script/dom/htmlhtmlelement.rs index 7aa36abb90c..4221f9c679f 100644 --- a/src/components/script/dom/htmlhtmlelement.rs +++ b/src/components/script/dom/htmlhtmlelement.rs @@ -2,7 +2,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -use dom::bindings::utils::{DOMString, null_string, ErrorResult}; +use dom::bindings::utils::{DOMString, ErrorResult}; use dom::htmlelement::HTMLElement; pub struct HTMLHtmlElement { @@ -11,7 +11,7 @@ pub struct HTMLHtmlElement { impl HTMLHtmlElement { pub fn Version(&self) -> DOMString { - null_string + None } pub fn SetVersion(&mut self, _version: &DOMString, _rv: &mut ErrorResult) { diff --git a/src/components/script/dom/htmliframeelement.rs b/src/components/script/dom/htmliframeelement.rs index 27a6dee1601..6a42197b8c6 100644 --- a/src/components/script/dom/htmliframeelement.rs +++ b/src/components/script/dom/htmliframeelement.rs @@ -2,7 +2,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -use dom::bindings::utils::{DOMString, null_string, ErrorResult, str}; +use dom::bindings::utils::{DOMString, ErrorResult, null_str_as_empty}; use dom::document::AbstractDocument; use dom::htmlelement::HTMLElement; use dom::node::{AbstractNode, ScriptView}; @@ -60,40 +60,40 @@ impl HTMLIFrameElement { impl HTMLIFrameElement { pub fn Src(&self) -> DOMString { - null_string + None } pub fn SetSrc(&mut self, _src: &DOMString, _rv: &mut ErrorResult) { } pub fn Srcdoc(&self) -> DOMString { - null_string + None } pub fn SetSrcdoc(&mut self, _srcdoc: &DOMString, _rv: &mut ErrorResult) { } pub fn Name(&self) -> DOMString { - null_string + None } pub fn SetName(&mut self, _name: &DOMString, _rv: &mut ErrorResult) { } pub fn Sandbox(&self, _abstract_self: AbstractNode<ScriptView>) -> DOMString { - self.parent.parent.GetAttribute(&str(~"sandbox")) + self.parent.parent.GetAttribute(&Some(~"sandbox")) } pub fn SetSandbox(&mut self, abstract_self: AbstractNode<ScriptView>, sandbox: &DOMString) { let mut rv = Ok(()); - self.parent.parent.SetAttribute(abstract_self, &str(~"sandbox"), sandbox, &mut rv); + self.parent.parent.SetAttribute(abstract_self, &Some(~"sandbox"), sandbox, &mut rv); } pub fn AfterSetAttr(&mut self, name: &DOMString, value: &DOMString) { - let name = name.to_str(); + let name = null_str_as_empty(name); if "sandbox" == name { let mut modes = AllowNothing as u8; - let words = value.to_str(); + let words = null_str_as_empty(value); for word in words.split_iter(' ') { modes |= match word.to_ascii_lower().as_slice() { "allow-same-origin" => AllowSameOrigin, @@ -117,14 +117,14 @@ impl HTMLIFrameElement { } pub fn Width(&self) -> DOMString { - null_string + None } pub fn SetWidth(&mut self, _width: &DOMString, _rv: &mut ErrorResult) { } pub fn Height(&self) -> DOMString { - null_string + None } pub fn SetHeight(&mut self, _height: &DOMString, _rv: &mut ErrorResult) { @@ -139,42 +139,42 @@ impl HTMLIFrameElement { } pub fn Align(&self) -> DOMString { - null_string + None } pub fn SetAlign(&mut self, _align: &DOMString, _rv: &mut ErrorResult) { } pub fn Scrolling(&self) -> DOMString { - null_string + None } pub fn SetScrolling(&mut self, _scrolling: &DOMString, _rv: &mut ErrorResult) { } pub fn FrameBorder(&self) -> DOMString { - null_string + None } pub fn SetFrameBorder(&mut self, _frameborder: &DOMString, _rv: &mut ErrorResult) { } pub fn LongDesc(&self) -> DOMString { - null_string + None } pub fn SetLongDesc(&mut self, _longdesc: &DOMString, _rv: &mut ErrorResult) { } pub fn MarginHeight(&self) -> DOMString { - null_string + None } pub fn SetMarginHeight(&mut self, _marginheight: &DOMString, _rv: &mut ErrorResult) { } pub fn MarginWidth(&self) -> DOMString { - null_string + None } pub fn SetMarginWidth(&mut self, _marginwidth: &DOMString, _rv: &mut ErrorResult) { diff --git a/src/components/script/dom/htmlimageelement.rs b/src/components/script/dom/htmlimageelement.rs index 1ab87a62368..84f5d0d7d90 100644 --- a/src/components/script/dom/htmlimageelement.rs +++ b/src/components/script/dom/htmlimageelement.rs @@ -2,7 +2,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -use dom::bindings::utils::{DOMString, str, null_string, ErrorResult}; +use dom::bindings::utils::{DOMString, ErrorResult, null_str_as_empty}; use dom::htmlelement::HTMLElement; use dom::node::{ScriptView, AbstractNode}; use extra::url::Url; @@ -40,7 +40,7 @@ impl HTMLImageElement { } pub fn AfterSetAttr(&mut self, name: &DOMString, _value: &DOMString) { - let name = name.to_str(); + let name = null_str_as_empty(name); if "src" == name { let doc = self.parent.parent.parent.owner_doc; for doc in doc.iter() { @@ -55,14 +55,14 @@ impl HTMLImageElement { } pub fn Alt(&self) -> DOMString { - null_string + None } pub fn SetAlt(&mut self, _alt: &DOMString, _rv: &mut ErrorResult) { } pub fn Src(&self, _abstract_self: AbstractNode<ScriptView>) -> DOMString { - null_string + None } pub fn SetSrc(&mut self, @@ -71,19 +71,19 @@ impl HTMLImageElement { _rv: &mut ErrorResult) { let node = &mut self.parent.parent; node.set_attr(abstract_self, - &str(~"src"), - &str(src.to_str())); + &Some(~"src"), + &Some(null_str_as_empty(src))); } pub fn CrossOrigin(&self) -> DOMString { - null_string + None } pub fn SetCrossOrigin(&mut self, _cross_origin: &DOMString, _rv: &mut ErrorResult) { } pub fn UseMap(&self) -> DOMString { - null_string + None } pub fn SetUseMap(&mut self, _use_map: &DOMString, _rv: &mut ErrorResult) { @@ -129,8 +129,8 @@ impl HTMLImageElement { _rv: &mut ErrorResult) { let node = &mut self.parent.parent; node.set_attr(abstract_self, - &str(~"width"), - &str(width.to_str())); + &Some(~"width"), + &Some(width.to_str())); } pub fn Height(&self, abstract_self: AbstractNode<ScriptView>) -> u32 { @@ -166,8 +166,8 @@ impl HTMLImageElement { _rv: &mut ErrorResult) { let node = &mut self.parent.parent; node.set_attr(abstract_self, - &str(~"height"), - &str(height.to_str())); + &Some(~"height"), + &Some(height.to_str())); } pub fn NaturalWidth(&self) -> u32 { @@ -183,14 +183,14 @@ impl HTMLImageElement { } pub fn Name(&self) -> DOMString { - null_string + None } pub fn SetName(&mut self, _name: &DOMString, _rv: &mut ErrorResult) { } pub fn Align(&self) -> DOMString { - null_string + None } pub fn SetAlign(&mut self, _align: &DOMString, _rv: &mut ErrorResult) { @@ -211,14 +211,14 @@ impl HTMLImageElement { } pub fn LongDesc(&self) -> DOMString { - null_string + None } pub fn SetLongDesc(&mut self, _longdesc: &DOMString, _rv: &mut ErrorResult) { } pub fn Border(&self) -> DOMString { - null_string + None } pub fn SetBorder(&mut self, _border: &DOMString, _rv: &mut ErrorResult) { diff --git a/src/components/script/dom/htmlinputelement.rs b/src/components/script/dom/htmlinputelement.rs index 8dbcc1826e9..415de3ae32c 100644 --- a/src/components/script/dom/htmlinputelement.rs +++ b/src/components/script/dom/htmlinputelement.rs @@ -2,7 +2,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -use dom::bindings::utils::{DOMString, null_string, ErrorResult}; +use dom::bindings::utils::{DOMString, ErrorResult}; use dom::htmlelement::HTMLElement; pub struct HTMLInputElement { @@ -11,21 +11,21 @@ pub struct HTMLInputElement { impl HTMLInputElement { pub fn Accept(&self) -> DOMString { - null_string + None } pub fn SetAccept(&mut self, _accept: &DOMString, _rv: &mut ErrorResult) { } pub fn Alt(&self) -> DOMString { - null_string + None } pub fn SetAlt(&mut self, _alt: &DOMString, _rv: &mut ErrorResult) { } pub fn Autocomplete(&self) -> DOMString { - null_string + None } pub fn SetAutocomplete(&mut self, _autocomple: &DOMString, _rv: &mut ErrorResult) { @@ -60,21 +60,21 @@ impl HTMLInputElement { } pub fn FormAction(&self) -> DOMString { - null_string + None } pub fn SetFormAction(&mut self, _form_action: &DOMString, _rv: &mut ErrorResult) { } pub fn FormEnctype(&self) -> DOMString { - null_string + None } pub fn SetFormEnctype(&mut self, _form_enctype: &DOMString, _rv: &mut ErrorResult) { } pub fn FormMethod(&self) -> DOMString { - null_string + None } pub fn SetFormMethod(&mut self, _form_method: &DOMString, _rv: &mut ErrorResult) { @@ -88,7 +88,7 @@ impl HTMLInputElement { } pub fn FormTarget(&self) -> DOMString { - null_string + None } pub fn SetFormTarget(&mut self, _form_target: &DOMString, _rv: &mut ErrorResult) { @@ -109,14 +109,14 @@ impl HTMLInputElement { } pub fn InputMode(&self) -> DOMString { - null_string + None } pub fn SetInputMode(&mut self, _input_mode: &DOMString, _rv: &mut ErrorResult) { } pub fn Max(&self) -> DOMString { - null_string + None } pub fn SetMax(&mut self, _max: &DOMString, _rv: &mut ErrorResult) { @@ -130,7 +130,7 @@ impl HTMLInputElement { } pub fn Min(&self) -> DOMString { - null_string + None } pub fn SetMin(&mut self, _min: &DOMString, _rv: &mut ErrorResult) { @@ -144,21 +144,21 @@ impl HTMLInputElement { } pub fn Name(&self) -> DOMString { - null_string + None } pub fn SetName(&mut self, _name: &DOMString, _rv: &mut ErrorResult) { } pub fn Pattern(&self) -> DOMString { - null_string + None } pub fn SetPattern(&mut self, _pattern: &DOMString, _rv: &mut ErrorResult) { } pub fn Placeholder(&self) -> DOMString { - null_string + None } pub fn SetPlaceholder(&mut self, _placeholder: &DOMString, _rv: &mut ErrorResult) { @@ -186,35 +186,35 @@ impl HTMLInputElement { } pub fn Src(&self) -> DOMString { - null_string + None } pub fn SetSrc(&mut self, _src: &DOMString, _rv: &mut ErrorResult) { } pub fn Step(&self) -> DOMString { - null_string + None } pub fn SetStep(&mut self, _step: &DOMString, _rv: &mut ErrorResult) { } pub fn Type(&self) -> DOMString { - null_string + None } pub fn SetType(&mut self, _type: &DOMString, _rv: &mut ErrorResult) { } pub fn DefaultValue(&self) -> DOMString { - null_string + None } pub fn SetDefaultValue(&mut self, _default_value: &DOMString, _rv: &mut ErrorResult) { } pub fn Value(&self) -> DOMString { - null_string + None } pub fn SetValue(&mut self, _value: &DOMString, _rv: &mut ErrorResult) { @@ -235,7 +235,7 @@ impl HTMLInputElement { } pub fn GetValidationMessage(&self, _rv: &mut ErrorResult) -> DOMString { - null_string + None } pub fn CheckValidity(&self) -> bool { @@ -263,21 +263,21 @@ impl HTMLInputElement { } pub fn GetSelectionDirection(&self, _rv: &mut ErrorResult) -> DOMString { - null_string + None } pub fn SetSelectionDirection(&mut self, _selection_direction: &DOMString, _rv: &mut ErrorResult) { } pub fn Align(&self) -> DOMString { - null_string + None } pub fn SetAlign(&mut self, _align: &DOMString, _rv: &mut ErrorResult) { } pub fn UseMap(&self) -> DOMString { - null_string + None } pub fn SetUseMap(&mut self, _align: &DOMString, _rv: &mut ErrorResult) { diff --git a/src/components/script/dom/htmllabelelement.rs b/src/components/script/dom/htmllabelelement.rs index 1df3924cff2..17d2c98b5a8 100644 --- a/src/components/script/dom/htmllabelelement.rs +++ b/src/components/script/dom/htmllabelelement.rs @@ -2,7 +2,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -use dom::bindings::utils::{DOMString, null_string}; +use dom::bindings::utils::DOMString; use dom::htmlelement::HTMLElement; pub struct HTMLLabelElement { @@ -11,7 +11,7 @@ pub struct HTMLLabelElement { impl HTMLLabelElement { pub fn HtmlFor(&self) -> DOMString { - null_string + None } pub fn SetHtmlFor(&mut self, _html_for: &DOMString) { diff --git a/src/components/script/dom/htmllegendelement.rs b/src/components/script/dom/htmllegendelement.rs index f7f67e87265..9774c799f0d 100644 --- a/src/components/script/dom/htmllegendelement.rs +++ b/src/components/script/dom/htmllegendelement.rs @@ -2,7 +2,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -use dom::bindings::utils::{DOMString, null_string, ErrorResult}; +use dom::bindings::utils::{DOMString, ErrorResult}; use dom::htmlelement::HTMLElement; pub struct HTMLLegendElement { @@ -11,7 +11,7 @@ pub struct HTMLLegendElement { impl HTMLLegendElement { pub fn Align(&self) -> DOMString { - null_string + None } pub fn SetAlign(&mut self, _align: &DOMString, _rv: &mut ErrorResult) { diff --git a/src/components/script/dom/htmllielement.rs b/src/components/script/dom/htmllielement.rs index facc81d9a37..58c7ab9618c 100644 --- a/src/components/script/dom/htmllielement.rs +++ b/src/components/script/dom/htmllielement.rs @@ -2,7 +2,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -use dom::bindings::utils::{DOMString, null_string, ErrorResult}; +use dom::bindings::utils::{DOMString, ErrorResult}; use dom::htmlelement::HTMLElement; pub struct HTMLLIElement { @@ -18,7 +18,7 @@ impl HTMLLIElement { } pub fn Type(&self) -> DOMString { - null_string + None } pub fn SetType(&mut self, _type: &DOMString, _rv: &mut ErrorResult) { diff --git a/src/components/script/dom/htmllinkelement.rs b/src/components/script/dom/htmllinkelement.rs index 6d7adf3f11a..f6e2170cec8 100644 --- a/src/components/script/dom/htmllinkelement.rs +++ b/src/components/script/dom/htmllinkelement.rs @@ -2,7 +2,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -use dom::bindings::utils::{DOMString, null_string, ErrorResult}; +use dom::bindings::utils::{DOMString, ErrorResult}; use dom::htmlelement::HTMLElement; pub struct HTMLLinkElement { @@ -18,63 +18,63 @@ impl HTMLLinkElement { } pub fn Href(&self) -> DOMString { - null_string + None } pub fn SetHref(&mut self, _href: &DOMString, _rv: &mut ErrorResult) { } pub fn CrossOrigin(&self) -> DOMString { - null_string + None } pub fn SetCrossOrigin(&mut self, _cross_origin: &DOMString, _rv: &mut ErrorResult) { } pub fn Rel(&self) -> DOMString { - null_string + None } pub fn SetRel(&mut self, _rel: &DOMString, _rv: &mut ErrorResult) { } pub fn Media(&self) -> DOMString { - null_string + None } pub fn SetMedia(&mut self, _media: &DOMString, _rv: &mut ErrorResult) { } pub fn Hreflang(&self) -> DOMString { - null_string + None } pub fn SetHreflang(&mut self, _href: &DOMString, _rv: &mut ErrorResult) { } pub fn Type(&self) -> DOMString { - null_string + None } pub fn SetType(&mut self, _type: &DOMString, _rv: &mut ErrorResult) { } pub fn Charset(&self) -> DOMString { - null_string + None } pub fn SetCharset(&mut self, _charset: &DOMString, _rv: &mut ErrorResult) { } pub fn Rev(&self) -> DOMString { - null_string + None } pub fn SetRev(&mut self, _rev: &DOMString, _rv: &mut ErrorResult) { } pub fn Target(&self) -> DOMString { - null_string + None } pub fn SetTarget(&mut self, _target: &DOMString, _rv: &mut ErrorResult) { diff --git a/src/components/script/dom/htmlmapelement.rs b/src/components/script/dom/htmlmapelement.rs index f4157f2d65a..71a91dcd2a6 100644 --- a/src/components/script/dom/htmlmapelement.rs +++ b/src/components/script/dom/htmlmapelement.rs @@ -2,7 +2,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -use dom::bindings::utils::{DOMString, null_string, ErrorResult, CacheableWrapper}; +use dom::bindings::utils::{DOMString, ErrorResult, CacheableWrapper}; use dom::htmlcollection::HTMLCollection; use dom::htmlelement::HTMLElement; use js::jsapi::{JSObject, JSContext}; @@ -13,7 +13,7 @@ pub struct HTMLMapElement { impl HTMLMapElement { pub fn Name(&self) -> DOMString { - null_string + None } pub fn SetName(&mut self, _name: &DOMString, _rv: &mut ErrorResult) { diff --git a/src/components/script/dom/htmlmediaelement.rs b/src/components/script/dom/htmlmediaelement.rs index 009940ac926..85cfd3b2f77 100644 --- a/src/components/script/dom/htmlmediaelement.rs +++ b/src/components/script/dom/htmlmediaelement.rs @@ -2,7 +2,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -use dom::bindings::utils::{DOMString, null_string, ErrorResult}; +use dom::bindings::utils::{DOMString, ErrorResult}; use dom::element::ElementTypeId; use dom::htmlelement::HTMLElement; @@ -20,25 +20,25 @@ impl HTMLMediaElement { impl HTMLMediaElement { pub fn Src(&self) -> DOMString { - null_string + None } pub fn SetSrc(&mut self, _src: &DOMString, _rv: &mut ErrorResult) { } pub fn CurrentSrc(&self) -> DOMString { - null_string + None } pub fn CrossOrigin(&self) -> DOMString { - null_string + None } pub fn SetCrossOrigin(&mut self, _cross_origin: &DOMString, _rv: &mut ErrorResult) { } pub fn Preload(&self) -> DOMString { - null_string + None } pub fn SetPreload(&mut self, _preload: &DOMString, _rv: &mut ErrorResult) { @@ -48,7 +48,7 @@ impl HTMLMediaElement { } pub fn CanPlayType(&self, _type: &DOMString) -> DOMString { - null_string + None } pub fn ReadyState(&self) -> u16 { diff --git a/src/components/script/dom/htmlmetaelement.rs b/src/components/script/dom/htmlmetaelement.rs index aad56ca5c58..d172bab3184 100644 --- a/src/components/script/dom/htmlmetaelement.rs +++ b/src/components/script/dom/htmlmetaelement.rs @@ -2,7 +2,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -use dom::bindings::utils::{DOMString, null_string, ErrorResult}; +use dom::bindings::utils::{DOMString, ErrorResult}; use dom::htmlelement::HTMLElement; pub struct HTMLMetaElement { @@ -11,28 +11,28 @@ pub struct HTMLMetaElement { impl HTMLMetaElement { pub fn Name(&self) -> DOMString { - null_string + None } pub fn SetName(&mut self, _name: &DOMString, _rv: &mut ErrorResult) { } pub fn HttpEquiv(&self) -> DOMString { - null_string + None } pub fn SetHttpEquiv(&mut self, _http_equiv: &DOMString, _rv: &mut ErrorResult) { } pub fn Content(&self) -> DOMString { - null_string + None } pub fn SetContent(&mut self, _content: &DOMString, _rv: &mut ErrorResult) { } pub fn Scheme(&self) -> DOMString { - null_string + None } pub fn SetScheme(&mut self, _scheme: &DOMString, _rv: &mut ErrorResult) { diff --git a/src/components/script/dom/htmlmodelement.rs b/src/components/script/dom/htmlmodelement.rs index aec788fc674..5c046922d83 100644 --- a/src/components/script/dom/htmlmodelement.rs +++ b/src/components/script/dom/htmlmodelement.rs @@ -2,7 +2,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -use dom::bindings::utils::{DOMString, null_string, ErrorResult}; +use dom::bindings::utils::{DOMString, ErrorResult}; use dom::htmlelement::HTMLElement; pub struct HTMLModElement { @@ -11,14 +11,14 @@ pub struct HTMLModElement { impl HTMLModElement { pub fn Cite(&self) -> DOMString { - null_string + None } pub fn SetCite(&mut self, _cite: &DOMString, _rv: &mut ErrorResult) { } pub fn DateTime(&self) -> DOMString { - null_string + None } pub fn SetDateTime(&mut self, _datetime: &DOMString, _rv: &mut ErrorResult) { diff --git a/src/components/script/dom/htmlobjectelement.rs b/src/components/script/dom/htmlobjectelement.rs index 9246c631184..635d2dfa61c 100644 --- a/src/components/script/dom/htmlobjectelement.rs +++ b/src/components/script/dom/htmlobjectelement.rs @@ -2,7 +2,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -use dom::bindings::utils::{DOMString, null_string, ErrorResult}; +use dom::bindings::utils::{DOMString, ErrorResult}; use dom::document::AbstractDocument; use dom::htmlelement::HTMLElement; use dom::node::{AbstractNode, ScriptView}; @@ -15,28 +15,28 @@ pub struct HTMLObjectElement { impl HTMLObjectElement { pub fn Data(&self) -> DOMString { - null_string + None } pub fn SetData(&mut self, _data: &DOMString, _rv: &mut ErrorResult) { } pub fn Type(&self) -> DOMString { - null_string + None } pub fn SetType(&mut self, _type: &DOMString, _rv: &mut ErrorResult) { } pub fn Name(&self) -> DOMString { - null_string + None } pub fn SetName(&mut self, _name: &DOMString, _rv: &mut ErrorResult) { } pub fn UseMap(&self) -> DOMString { - null_string + None } pub fn SetUseMap(&mut self, _use_map: &DOMString, _rv: &mut ErrorResult) { @@ -47,14 +47,14 @@ impl HTMLObjectElement { } pub fn Width(&self) -> DOMString { - null_string + None } pub fn SetWidth(&mut self, _width: &DOMString, _rv: &mut ErrorResult) { } pub fn Height(&self) -> DOMString { - null_string + None } pub fn SetHeight(&mut self, _height: &DOMString, _rv: &mut ErrorResult) { @@ -77,7 +77,7 @@ impl HTMLObjectElement { } pub fn ValidationMessage(&self) -> DOMString { - null_string + None } pub fn CheckValidity(&self) -> bool { @@ -88,21 +88,21 @@ impl HTMLObjectElement { } pub fn Align(&self) -> DOMString { - null_string + None } pub fn SetAlign(&mut self, _align: &DOMString, _rv: &mut ErrorResult) { } pub fn Archive(&self) -> DOMString { - null_string + None } pub fn SetArchive(&mut self, _archive: &DOMString, _rv: &mut ErrorResult) { } pub fn Code(&self) -> DOMString { - null_string + None } pub fn SetCode(&mut self, _code: &DOMString, _rv: &mut ErrorResult) { @@ -123,7 +123,7 @@ impl HTMLObjectElement { } pub fn Standby(&self) -> DOMString { - null_string + None } pub fn SetStandby(&mut self, _standby: &DOMString, _rv: &mut ErrorResult) { @@ -137,21 +137,21 @@ impl HTMLObjectElement { } pub fn CodeBase(&self) -> DOMString { - null_string + None } pub fn SetCodeBase(&mut self, _codebase: &DOMString, _rv: &mut ErrorResult) { } pub fn CodeType(&self) -> DOMString { - null_string + None } pub fn SetCodeType(&mut self, _codetype: &DOMString, _rv: &mut ErrorResult) { } pub fn Border(&self) -> DOMString { - null_string + None } pub fn SetBorder(&mut self, _border: &DOMString, _rv: &mut ErrorResult) { diff --git a/src/components/script/dom/htmlolistelement.rs b/src/components/script/dom/htmlolistelement.rs index 970bfa9e7c9..a5db8a1d5d5 100644 --- a/src/components/script/dom/htmlolistelement.rs +++ b/src/components/script/dom/htmlolistelement.rs @@ -2,7 +2,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -use dom::bindings::utils::{DOMString, null_string, ErrorResult}; +use dom::bindings::utils::{DOMString, ErrorResult}; use dom::htmlelement::HTMLElement; pub struct HTMLOListElement { @@ -25,7 +25,7 @@ impl HTMLOListElement { } pub fn Type(&self) -> DOMString { - null_string + None } pub fn SetType(&mut self, _type: &DOMString, _rv: &mut ErrorResult) { diff --git a/src/components/script/dom/htmloptgroupelement.rs b/src/components/script/dom/htmloptgroupelement.rs index a5beb9155e0..99b4d770057 100644 --- a/src/components/script/dom/htmloptgroupelement.rs +++ b/src/components/script/dom/htmloptgroupelement.rs @@ -2,7 +2,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -use dom::bindings::utils::{DOMString, ErrorResult, null_string}; +use dom::bindings::utils::{DOMString, ErrorResult}; use dom::htmlelement::HTMLElement; pub struct HTMLOptGroupElement { @@ -18,7 +18,7 @@ impl HTMLOptGroupElement { } pub fn Label(&self) -> DOMString { - null_string + None } pub fn SetLabel(&mut self, _label: &DOMString, _rv: &mut ErrorResult) { diff --git a/src/components/script/dom/htmloptionelement.rs b/src/components/script/dom/htmloptionelement.rs index c8453f85747..90144fe1eb0 100644 --- a/src/components/script/dom/htmloptionelement.rs +++ b/src/components/script/dom/htmloptionelement.rs @@ -2,7 +2,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -use dom::bindings::utils::{DOMString, ErrorResult, null_string}; +use dom::bindings::utils::{DOMString, ErrorResult}; use dom::htmlelement::HTMLElement; use dom::node::{AbstractNode, ScriptView}; @@ -23,7 +23,7 @@ impl HTMLOptionElement { } pub fn Label(&self) -> DOMString { - null_string + None } pub fn SetLabel(&mut self, _label: &DOMString, _rv: &mut ErrorResult) { @@ -44,14 +44,14 @@ impl HTMLOptionElement { } pub fn Value(&self) -> DOMString { - null_string + None } pub fn SetValue(&mut self, _value: &DOMString, _rv: &mut ErrorResult) { } pub fn Text(&self) -> DOMString { - null_string + None } pub fn SetText(&mut self, _text: &DOMString, _rv: &mut ErrorResult) { diff --git a/src/components/script/dom/htmloutputelement.rs b/src/components/script/dom/htmloutputelement.rs index 934cf23883b..47a43f75cc3 100644 --- a/src/components/script/dom/htmloutputelement.rs +++ b/src/components/script/dom/htmloutputelement.rs @@ -2,7 +2,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -use dom::bindings::utils::{DOMString, ErrorResult, null_string}; +use dom::bindings::utils::{DOMString, ErrorResult}; use dom::htmlelement::HTMLElement; use dom::node::{AbstractNode, ScriptView}; use dom::validitystate::ValidityState; @@ -17,25 +17,25 @@ impl HTMLOutputElement { } pub fn Name(&self) -> DOMString { - null_string + None } pub fn SetName(&mut self, _name: &DOMString, _rv: &mut ErrorResult) { } pub fn Type(&self) -> DOMString { - null_string + None } pub fn DefaultValue(&self) -> DOMString { - null_string + None } pub fn SetDefaultValue(&mut self, _value: &DOMString, _rv: &mut ErrorResult) { } pub fn Value(&self) -> DOMString { - null_string + None } pub fn SetValue(&mut self, _value: &DOMString, _rv: &mut ErrorResult) { @@ -56,7 +56,7 @@ impl HTMLOutputElement { } pub fn ValidationMessage(&self) -> DOMString { - null_string + None } pub fn SetValidationMessage(&mut self, _message: &DOMString, _rv: &mut ErrorResult) { diff --git a/src/components/script/dom/htmlparagraphelement.rs b/src/components/script/dom/htmlparagraphelement.rs index 618a22d94d9..d09b4d6bc0a 100644 --- a/src/components/script/dom/htmlparagraphelement.rs +++ b/src/components/script/dom/htmlparagraphelement.rs @@ -2,7 +2,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -use dom::bindings::utils::{DOMString, null_string, ErrorResult}; +use dom::bindings::utils::{DOMString, ErrorResult}; use dom::htmlelement::HTMLElement; pub struct HTMLParagraphElement { @@ -11,7 +11,7 @@ pub struct HTMLParagraphElement { impl HTMLParagraphElement { pub fn Align(&self) -> DOMString { - null_string + None } pub fn SetAlign(&mut self, _align: &DOMString, _rv: &mut ErrorResult) { diff --git a/src/components/script/dom/htmlparamelement.rs b/src/components/script/dom/htmlparamelement.rs index 3ec1e4ee798..90409046f98 100644 --- a/src/components/script/dom/htmlparamelement.rs +++ b/src/components/script/dom/htmlparamelement.rs @@ -2,7 +2,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -use dom::bindings::utils::{DOMString, ErrorResult, null_string}; +use dom::bindings::utils::{DOMString, ErrorResult}; use dom::htmlelement::HTMLElement; pub struct HTMLParamElement { @@ -11,28 +11,28 @@ pub struct HTMLParamElement { impl HTMLParamElement { pub fn Name(&self) -> DOMString { - null_string + None } pub fn SetName(&mut self, _name: &DOMString, _rv: &mut ErrorResult) { } pub fn Value(&self) -> DOMString { - null_string + None } pub fn SetValue(&mut self, _value: &DOMString, _rv: &mut ErrorResult) { } pub fn Type(&self) -> DOMString { - null_string + None } pub fn SetType(&mut self, _type: &DOMString, _rv: &mut ErrorResult) { } pub fn ValueType(&self) -> DOMString { - null_string + None } pub fn SetValueType(&mut self, _value_type: &DOMString, _rv: &mut ErrorResult) { diff --git a/src/components/script/dom/htmlquoteelement.rs b/src/components/script/dom/htmlquoteelement.rs index 3201ee15094..fd82fa9351f 100644 --- a/src/components/script/dom/htmlquoteelement.rs +++ b/src/components/script/dom/htmlquoteelement.rs @@ -2,7 +2,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -use dom::bindings::utils::{DOMString, null_string, ErrorResult}; +use dom::bindings::utils::{DOMString, ErrorResult}; use dom::htmlelement::HTMLElement; pub struct HTMLQuoteElement { @@ -11,7 +11,7 @@ pub struct HTMLQuoteElement { impl HTMLQuoteElement { pub fn Cite(&self) -> DOMString { - null_string + None } pub fn SetCite(&self, _cite: &DOMString, _rv: &mut ErrorResult) { diff --git a/src/components/script/dom/htmlscriptelement.rs b/src/components/script/dom/htmlscriptelement.rs index 9556955eabe..18d28967893 100644 --- a/src/components/script/dom/htmlscriptelement.rs +++ b/src/components/script/dom/htmlscriptelement.rs @@ -2,7 +2,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -use dom::bindings::utils::{DOMString, null_string, ErrorResult}; +use dom::bindings::utils::{DOMString, ErrorResult}; use dom::htmlelement::HTMLElement; pub struct HTMLScriptElement { @@ -11,21 +11,21 @@ pub struct HTMLScriptElement { impl HTMLScriptElement { pub fn Src(&self) -> DOMString { - null_string + None } pub fn SetSrc(&mut self, _src: &DOMString, _rv: &mut ErrorResult) { } pub fn Type(&self) -> DOMString { - null_string + None } pub fn SetType(&mut self, _type: &DOMString, _rv: &mut ErrorResult) { } pub fn Charset(&self) -> DOMString { - null_string + None } pub fn SetCharset(&mut self, _charset: &DOMString, _rv: &mut ErrorResult) { @@ -46,28 +46,28 @@ impl HTMLScriptElement { } pub fn CrossOrigin(&self) -> DOMString { - null_string + None } pub fn SetCrossOrigin(&mut self, _cross_origin: &DOMString, _rv: &mut ErrorResult) { } pub fn Text(&self) -> DOMString { - null_string + None } pub fn SetText(&mut self, _text: &DOMString, _rv: &mut ErrorResult) { } pub fn Event(&self) -> DOMString { - null_string + None } pub fn SetEvent(&mut self, _event: &DOMString, _rv: &mut ErrorResult) { } pub fn HtmlFor(&self) -> DOMString { - null_string + None } pub fn SetHtmlFor(&mut self, _html_for: &DOMString, _rv: &mut ErrorResult) { diff --git a/src/components/script/dom/htmlselectelement.rs b/src/components/script/dom/htmlselectelement.rs index b3ef7871325..2db41902bef 100644 --- a/src/components/script/dom/htmlselectelement.rs +++ b/src/components/script/dom/htmlselectelement.rs @@ -2,7 +2,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -use dom::bindings::utils::{DOMString, ErrorResult, null_string}; +use dom::bindings::utils::{DOMString, ErrorResult}; use dom::htmlelement::HTMLElement; use dom::node::{AbstractNode, ScriptView}; use dom::validitystate::ValidityState; @@ -38,7 +38,7 @@ impl HTMLSelectElement { } pub fn Name(&self) -> DOMString { - null_string + None } pub fn SetName(&mut self, _name: &DOMString, _rv: &mut ErrorResult) { @@ -59,7 +59,7 @@ impl HTMLSelectElement { } pub fn Type(&self) -> DOMString { - null_string + None } pub fn Length(&self) -> u32 { @@ -98,7 +98,7 @@ impl HTMLSelectElement { } pub fn Value(&self) -> DOMString { - null_string + None } pub fn SetValue(&mut self, _value: &DOMString) { @@ -119,7 +119,7 @@ impl HTMLSelectElement { } pub fn ValidationMessage(&self) -> DOMString { - null_string + None } pub fn SetValidationMessage(&mut self, _message: &DOMString, _rv: &mut ErrorResult) { diff --git a/src/components/script/dom/htmlsourceelement.rs b/src/components/script/dom/htmlsourceelement.rs index 8c57fb78256..ad2549e0dc3 100644 --- a/src/components/script/dom/htmlsourceelement.rs +++ b/src/components/script/dom/htmlsourceelement.rs @@ -2,7 +2,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -use dom::bindings::utils::{DOMString, null_string, ErrorResult}; +use dom::bindings::utils::{DOMString, ErrorResult}; use dom::htmlelement::HTMLElement; pub struct HTMLSourceElement { @@ -11,21 +11,21 @@ pub struct HTMLSourceElement { impl HTMLSourceElement { pub fn Src(&self) -> DOMString { - null_string + None } pub fn SetSrc(&mut self, _src: &DOMString, _rv: &mut ErrorResult) { } pub fn Type(&self) -> DOMString { - null_string + None } pub fn SetType(&mut self, _type: &DOMString, _rv: &mut ErrorResult) { } pub fn Media(&self) -> DOMString { - null_string + None } pub fn SetMedia(&mut self, _media: &DOMString, _rv: &mut ErrorResult) { diff --git a/src/components/script/dom/htmlstyleelement.rs b/src/components/script/dom/htmlstyleelement.rs index f79b8da679d..1384f8b5dcc 100644 --- a/src/components/script/dom/htmlstyleelement.rs +++ b/src/components/script/dom/htmlstyleelement.rs @@ -2,7 +2,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -use dom::bindings::utils::{DOMString, null_string, ErrorResult}; +use dom::bindings::utils::{DOMString, ErrorResult}; use dom::htmlelement::HTMLElement; pub struct HTMLStyleElement { @@ -18,14 +18,14 @@ impl HTMLStyleElement { } pub fn Media(&self) -> DOMString { - null_string + None } pub fn SetMedia(&mut self, _media: &DOMString, _rv: &mut ErrorResult) { } pub fn Type(&self) -> DOMString { - null_string + None } pub fn SetType(&mut self, _type: &DOMString, _rv: &mut ErrorResult) { diff --git a/src/components/script/dom/htmltablecaptionelement.rs b/src/components/script/dom/htmltablecaptionelement.rs index 3cb48190d69..ed114eefe9a 100644 --- a/src/components/script/dom/htmltablecaptionelement.rs +++ b/src/components/script/dom/htmltablecaptionelement.rs @@ -2,7 +2,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -use dom::bindings::utils::{DOMString, null_string, ErrorResult}; +use dom::bindings::utils::{DOMString, ErrorResult}; use dom::htmlelement::HTMLElement; pub struct HTMLTableCaptionElement { @@ -11,7 +11,7 @@ pub struct HTMLTableCaptionElement { impl HTMLTableCaptionElement { pub fn Align(&self) -> DOMString { - null_string + None } pub fn SetAlign(&mut self, _align: &DOMString, _rv: &mut ErrorResult) { diff --git a/src/components/script/dom/htmltablecellelement.rs b/src/components/script/dom/htmltablecellelement.rs index 5a57a9ccb6d..a65411b39d3 100644 --- a/src/components/script/dom/htmltablecellelement.rs +++ b/src/components/script/dom/htmltablecellelement.rs @@ -2,7 +2,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -use dom::bindings::utils::{DOMString, null_string, ErrorResult}; +use dom::bindings::utils::{DOMString, ErrorResult}; use dom::htmlelement::HTMLElement; pub struct HTMLTableCellElement { @@ -25,7 +25,7 @@ impl HTMLTableCellElement { } pub fn Headers(&self) -> DOMString { - null_string + None } pub fn SetHeaders(&self, _headers: &DOMString, _rv: &mut ErrorResult) { @@ -39,56 +39,56 @@ impl HTMLTableCellElement { } pub fn Abbr(&self) -> DOMString { - null_string + None } pub fn SetAbbr(&self, _abbr: &DOMString, _rv: &mut ErrorResult) { } pub fn Scope(&self) -> DOMString { - null_string + None } pub fn SetScope(&self, _abbr: &DOMString, _rv: &mut ErrorResult) { } pub fn Align(&self) -> DOMString { - null_string + None } pub fn SetAlign(&self, _align: &DOMString, _rv: &mut ErrorResult) { } pub fn Axis(&self) -> DOMString { - null_string + None } pub fn SetAxis(&self, _axis: &DOMString, _rv: &mut ErrorResult) { } pub fn Height(&self) -> DOMString { - null_string + None } pub fn SetHeight(&self, _height: &DOMString, _rv: &mut ErrorResult) { } pub fn Width(&self) -> DOMString { - null_string + None } pub fn SetWidth(&self, _width: &DOMString, _rv: &mut ErrorResult) { } pub fn Ch(&self) -> DOMString { - null_string + None } pub fn SetCh(&self, _ch: &DOMString, _rv: &mut ErrorResult) { } pub fn ChOff(&self) -> DOMString { - null_string + None } pub fn SetChOff(&self, _ch_off: &DOMString, _rv: &mut ErrorResult) { @@ -102,14 +102,14 @@ impl HTMLTableCellElement { } pub fn VAlign(&self) -> DOMString { - null_string + None } pub fn SetVAlign(&self, _valign: &DOMString, _rv: &mut ErrorResult) { } pub fn BgColor(&self) -> DOMString { - null_string + None } pub fn SetBgColor(&self, _bg_color: &DOMString, _rv: &mut ErrorResult) { diff --git a/src/components/script/dom/htmltablecolelement.rs b/src/components/script/dom/htmltablecolelement.rs index fa27da84c18..64670c51f98 100644 --- a/src/components/script/dom/htmltablecolelement.rs +++ b/src/components/script/dom/htmltablecolelement.rs @@ -2,7 +2,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -use dom::bindings::utils::{DOMString, null_string, ErrorResult}; +use dom::bindings::utils::{DOMString, ErrorResult}; use dom::htmlelement::HTMLElement; pub struct HTMLTableColElement { @@ -18,35 +18,35 @@ impl HTMLTableColElement { } pub fn Align(&self) -> DOMString { - null_string + None } pub fn SetAlign(&mut self, _align: &DOMString, _rv: &mut ErrorResult) { } pub fn Ch(&self) -> DOMString { - null_string + None } pub fn SetCh(&mut self, _ch: &DOMString, _rv: &mut ErrorResult) { } pub fn ChOff(&self) -> DOMString { - null_string + None } pub fn SetChOff(&mut self, _ch_off: &DOMString, _rv: &mut ErrorResult) { } pub fn VAlign(&self) -> DOMString { - null_string + None } pub fn SetVAlign(&mut self, _v_align: &DOMString, _rv: &mut ErrorResult) { } pub fn Width(&self) -> DOMString { - null_string + None } pub fn SetWidth(&mut self, _width: &DOMString, _rv: &mut ErrorResult) { diff --git a/src/components/script/dom/htmltableelement.rs b/src/components/script/dom/htmltableelement.rs index 85c038caf06..5e322edb02d 100644 --- a/src/components/script/dom/htmltableelement.rs +++ b/src/components/script/dom/htmltableelement.rs @@ -2,7 +2,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -use dom::bindings::utils::{DOMString, null_string, ErrorResult}; +use dom::bindings::utils::{DOMString, ErrorResult}; use dom::htmlelement::HTMLElement; pub struct HTMLTableElement { @@ -34,63 +34,63 @@ impl HTMLTableElement { } pub fn Align(&self) -> DOMString { - null_string + None } pub fn SetAlign(&self, _align: &DOMString, _rv: &mut ErrorResult) { } pub fn Border(&self) -> DOMString { - null_string + None } pub fn SetBorder(&self, _border: &DOMString, _rv: &mut ErrorResult) { } pub fn Frame(&self) -> DOMString { - null_string + None } pub fn SetFrame(&self, _frame: &DOMString, _rv: &mut ErrorResult) { } pub fn Rules(&self) -> DOMString { - null_string + None } pub fn SetRules(&self, _rules: &DOMString, _rv: &mut ErrorResult) { } pub fn Summary(&self) -> DOMString { - null_string + None } pub fn SetSummary(&self, _summary: &DOMString, _rv: &mut ErrorResult) { } pub fn Width(&self) -> DOMString { - null_string + None } pub fn SetWidth(&self, _width: &DOMString, _rv: &mut ErrorResult) { } pub fn BgColor(&self) -> DOMString { - null_string + None } pub fn SetBgColor(&self, _bg_color: &DOMString, _rv: &mut ErrorResult) { } pub fn CellPadding(&self) -> DOMString { - null_string + None } pub fn SetCellPadding(&self, _cell_padding: &DOMString, _rv: &mut ErrorResult) { } pub fn CellSpacing(&self) -> DOMString { - null_string + None } pub fn SetCellSpacing(&self, _cell_spacing: &DOMString, _rv: &mut ErrorResult) { diff --git a/src/components/script/dom/htmltablerowelement.rs b/src/components/script/dom/htmltablerowelement.rs index 8286cd5ac4a..3833d389475 100644 --- a/src/components/script/dom/htmltablerowelement.rs +++ b/src/components/script/dom/htmltablerowelement.rs @@ -2,7 +2,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -use dom::bindings::utils::{DOMString, null_string, ErrorResult}; +use dom::bindings::utils::{DOMString, ErrorResult}; use dom::htmlelement::HTMLElement; pub struct HTMLTableRowElement { @@ -30,35 +30,35 @@ impl HTMLTableRowElement { } pub fn Align(&self) -> DOMString { - null_string + None } pub fn SetAlign(&self, _align: &DOMString, _rv: &mut ErrorResult) { } pub fn Ch(&self) -> DOMString { - null_string + None } pub fn SetCh(&self, _ch: &DOMString, _rv: &mut ErrorResult) { } pub fn ChOff(&self) -> DOMString { - null_string + None } pub fn SetChOff(&self, _ch_off: &DOMString, _rv: &mut ErrorResult) { } pub fn VAlign(&self) -> DOMString { - null_string + None } pub fn SetVAlign(&self, _v_align: &DOMString, _rv: &mut ErrorResult) { } pub fn BgColor(&self) -> DOMString { - null_string + None } pub fn SetBgColor(&self, _bg_color: &DOMString, _rv: &mut ErrorResult) { diff --git a/src/components/script/dom/htmltablesectionelement.rs b/src/components/script/dom/htmltablesectionelement.rs index bf0bda484d6..2fc93212068 100644 --- a/src/components/script/dom/htmltablesectionelement.rs +++ b/src/components/script/dom/htmltablesectionelement.rs @@ -2,7 +2,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -use dom::bindings::utils::{DOMString, null_string, ErrorResult}; +use dom::bindings::utils::{DOMString, ErrorResult}; use dom::htmlelement::HTMLElement; pub struct HTMLTableSectionElement { @@ -14,28 +14,28 @@ impl HTMLTableSectionElement { } pub fn Align(&self) -> DOMString { - null_string + None } pub fn SetAlign(&mut self, _align: &DOMString, _rv: &mut ErrorResult) { } pub fn Ch(&self) -> DOMString { - null_string + None } pub fn SetCh(&mut self, _ch: &DOMString, _rv: &mut ErrorResult) { } pub fn ChOff(&self) -> DOMString { - null_string + None } pub fn SetChOff(&mut self, _ch_off: &DOMString, _rv: &mut ErrorResult) { } pub fn VAlign(&self) -> DOMString { - null_string + None } pub fn SetVAlign(&mut self, _v_align: &DOMString, _rv: &mut ErrorResult) { diff --git a/src/components/script/dom/htmltextareaelement.rs b/src/components/script/dom/htmltextareaelement.rs index 55bbb9ee4da..301fd2af44d 100644 --- a/src/components/script/dom/htmltextareaelement.rs +++ b/src/components/script/dom/htmltextareaelement.rs @@ -2,7 +2,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -use dom::bindings::utils::{DOMString, null_string, ErrorResult}; +use dom::bindings::utils::{DOMString, ErrorResult}; use dom::htmlelement::HTMLElement; pub struct HTMLTextAreaElement { @@ -39,14 +39,14 @@ impl HTMLTextAreaElement { } pub fn Name(&self) -> DOMString { - null_string + None } pub fn SetName(&mut self, _name: &DOMString, _rv: &mut ErrorResult) { } pub fn Placeholder(&self) -> DOMString { - null_string + None } pub fn SetPlaceholder(&mut self, _placeholder: &DOMString, _rv: &mut ErrorResult) { @@ -74,28 +74,28 @@ impl HTMLTextAreaElement { } pub fn Wrap(&self) -> DOMString { - null_string + None } pub fn SetWrap(&mut self, _wrap: &DOMString, _rv: &mut ErrorResult) { } pub fn Type(&self) -> DOMString { - null_string + None } pub fn SetType(&mut self, _type: &DOMString) { } pub fn DefaultValue(&self) -> DOMString { - null_string + None } pub fn SetDefaultValue(&mut self, _default_value: &DOMString, _rv: &mut ErrorResult) { } pub fn Value(&self) -> DOMString { - null_string + None } pub fn SetValue(&mut self, _value: &DOMString) { @@ -116,7 +116,7 @@ impl HTMLTextAreaElement { } pub fn ValidationMessage(&self) -> DOMString { - null_string + None } pub fn CheckValidity(&self) -> bool { @@ -144,7 +144,7 @@ impl HTMLTextAreaElement { } pub fn GetSelectionDirection(&self, _rv: &mut ErrorResult) -> DOMString { - null_string + None } pub fn SetSelectionDirection(&self, _selection_direction: &DOMString, _rv: &mut ErrorResult) { diff --git a/src/components/script/dom/htmltimeelement.rs b/src/components/script/dom/htmltimeelement.rs index 2b3b5be795d..0e0320a3bf1 100644 --- a/src/components/script/dom/htmltimeelement.rs +++ b/src/components/script/dom/htmltimeelement.rs @@ -2,7 +2,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -use dom::bindings::utils::{DOMString, null_string, ErrorResult}; +use dom::bindings::utils::{DOMString, ErrorResult}; use dom::htmlelement::HTMLElement; pub struct HTMLTimeElement { @@ -11,7 +11,7 @@ pub struct HTMLTimeElement { impl HTMLTimeElement { pub fn DateTime(&self) -> DOMString { - null_string + None } pub fn SetDateTime(&mut self, _dateTime: &DOMString, _rv: &mut ErrorResult) { diff --git a/src/components/script/dom/htmltitleelement.rs b/src/components/script/dom/htmltitleelement.rs index aa5c920dc18..76adcc1f8f4 100644 --- a/src/components/script/dom/htmltitleelement.rs +++ b/src/components/script/dom/htmltitleelement.rs @@ -2,7 +2,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -use dom::bindings::utils::{DOMString, null_string, ErrorResult}; +use dom::bindings::utils::{DOMString, ErrorResult}; use dom::htmlelement::HTMLElement; pub struct HTMLTitleElement { @@ -11,7 +11,7 @@ pub struct HTMLTitleElement { impl HTMLTitleElement { pub fn Text(&self) -> DOMString { - null_string + None } pub fn SetText(&mut self, _text: &DOMString, _rv: &mut ErrorResult) { diff --git a/src/components/script/dom/htmltrackelement.rs b/src/components/script/dom/htmltrackelement.rs index 40ba4e0f4cb..4a7ff5b71cb 100644 --- a/src/components/script/dom/htmltrackelement.rs +++ b/src/components/script/dom/htmltrackelement.rs @@ -2,7 +2,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -use dom::bindings::utils::{DOMString, null_string, ErrorResult}; +use dom::bindings::utils::{DOMString, ErrorResult}; use dom::htmlelement::HTMLElement; pub struct HTMLTrackElement { @@ -11,28 +11,28 @@ pub struct HTMLTrackElement { impl HTMLTrackElement { pub fn Kind(&self) -> DOMString { - null_string + None } pub fn SetKind(&mut self, _kind: &DOMString, _rv: &mut ErrorResult) { } pub fn Src(&self) -> DOMString { - null_string + None } pub fn SetSrc(&mut self, _src: &DOMString, _rv: &mut ErrorResult) { } pub fn Srclang(&self) -> DOMString { - null_string + None } pub fn SetSrclang(&mut self, _srclang: &DOMString, _rv: &mut ErrorResult) { } pub fn Label(&self) -> DOMString { - null_string + None } pub fn SetLabel(&mut self, _label: &DOMString, _rv: &mut ErrorResult) { diff --git a/src/components/script/dom/htmlulistelement.rs b/src/components/script/dom/htmlulistelement.rs index 9299d723b9c..a85e178af77 100644 --- a/src/components/script/dom/htmlulistelement.rs +++ b/src/components/script/dom/htmlulistelement.rs @@ -2,7 +2,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -use dom::bindings::utils::{DOMString, null_string, ErrorResult}; +use dom::bindings::utils::{DOMString, ErrorResult}; use dom::htmlelement::HTMLElement; pub struct HTMLUListElement { @@ -18,7 +18,7 @@ impl HTMLUListElement { } pub fn Type(&self) -> DOMString { - null_string + None } pub fn SetType(&mut self, _type: &DOMString, _rv: &mut ErrorResult) { diff --git a/src/components/script/dom/htmlvideoelement.rs b/src/components/script/dom/htmlvideoelement.rs index 19a6a546fed..68f34b28665 100644 --- a/src/components/script/dom/htmlvideoelement.rs +++ b/src/components/script/dom/htmlvideoelement.rs @@ -2,7 +2,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -use dom::bindings::utils::{DOMString, null_string, ErrorResult}; +use dom::bindings::utils::{DOMString, ErrorResult}; use dom::htmlmediaelement::HTMLMediaElement; pub struct HTMLVideoElement { @@ -33,7 +33,7 @@ impl HTMLVideoElement { } pub fn Poster(&self) -> DOMString { - null_string + None } pub fn SetPoster(&mut self, _poster: &DOMString, _rv: &ErrorResult) { diff --git a/src/components/script/dom/navigator.rs b/src/components/script/dom/navigator.rs index f6a98b59a89..cab048ff30b 100644 --- a/src/components/script/dom/navigator.rs +++ b/src/components/script/dom/navigator.rs @@ -3,7 +3,7 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ use dom::bindings::utils::{WrapperCache, BindingObject, CacheableWrapper}; -use dom::bindings::utils::{DOMString, ErrorResult, str, null_string}; +use dom::bindings::utils::{DOMString, ErrorResult}; use dom::bindings::codegen::NavigatorBinding; use script_task::{page_from_context}; @@ -23,23 +23,23 @@ impl Navigator { } pub fn DoNotTrack(&self) -> DOMString { - str(~"unspecified") + Some(~"unspecified") } pub fn Vendor(&self) -> DOMString { - str(~"") // Like Gecko + Some(~"") // Like Gecko } pub fn VendorSub(&self) -> DOMString { - str(~"") // Like Gecko + Some(~"") // Like Gecko } pub fn Product(&self) -> DOMString { - str(~"Gecko") // This is supposed to be constant, see webidl. + Some(~"Gecko") // This is supposed to be constant, see webidl. } pub fn ProductSub(&self) -> DOMString { - null_string + None } pub fn CookieEnabled(&self) -> bool { @@ -47,7 +47,7 @@ impl Navigator { } pub fn GetBuildID(&self, _rv: &mut ErrorResult) -> DOMString { - null_string + None } pub fn JavaEnabled(&self, _rv: &mut ErrorResult) -> bool { @@ -59,27 +59,27 @@ impl Navigator { } pub fn AppName(&self) -> DOMString { - str(~"Netscape") // Like Gecko/Webkit + Some(~"Netscape") // Like Gecko/Webkit } pub fn GetAppCodeName(&self, _rv: &mut ErrorResult) -> DOMString { - str(~"Mozilla") // Like Gecko/Webkit + Some(~"Mozilla") // Like Gecko/Webkit } pub fn GetAppVersion(&self, _rv: &mut ErrorResult) -> DOMString { - null_string + None } pub fn GetPlatform(&self, _rv: &mut ErrorResult) -> DOMString { - null_string + None } pub fn GetUserAgent(&self, _rv: &mut ErrorResult) -> DOMString { - null_string + None } pub fn GetLanguage(&self) -> DOMString { - null_string + None } pub fn OnLine(&self) -> bool { @@ -105,4 +105,4 @@ impl BindingObject for Navigator { Some((*page).frame.get_ref().window as @mut CacheableWrapper) } } -}
\ No newline at end of file +} diff --git a/src/components/script/dom/node.rs b/src/components/script/dom/node.rs index 289d571ea86..6f6edb2524b 100644 --- a/src/components/script/dom/node.rs +++ b/src/components/script/dom/node.rs @@ -5,8 +5,8 @@ //! The core DOM types. Defines the basic DOM hierarchy as well as all the HTML elements. use dom::bindings::node; -use dom::bindings::utils::{WrapperCache, DOMString, null_string, str, ErrorResult, NotFound, HierarchyRequest}; -use dom::bindings::utils::{BindingObject, CacheableWrapper, rust_box}; +use dom::bindings::utils::{WrapperCache, DOMString, ErrorResult, NotFound, HierarchyRequest}; +use dom::bindings::utils::{BindingObject, CacheableWrapper, rust_box, null_str_as_empty}; use dom::bindings; use dom::characterdata::CharacterData; use dom::document::AbstractDocument; @@ -516,11 +516,11 @@ impl Node<ScriptView> { } pub fn NodeName(&self) -> DOMString { - null_string + None } pub fn GetBaseURI(&self) -> DOMString { - null_string + None } pub fn GetOwnerDocument(&self) -> Option<AbstractDocument> { @@ -556,7 +556,7 @@ impl Node<ScriptView> { } pub fn GetNodeValue(&self) -> DOMString { - null_string + None } pub fn SetNodeValue(&mut self, _val: &DOMString, _rv: &mut ErrorResult) { @@ -570,11 +570,11 @@ impl Node<ScriptView> { if node.is_text() { do node.with_imm_text() |text| { let s = text.parent.Data(); - content = content + s.to_str(); + content = content + null_str_as_empty(&s); } } } - str(content) + Some(content) } CommentNodeTypeId | TextNodeTypeId => { do abstract_self.with_imm_characterdata() |characterdata| { @@ -582,7 +582,7 @@ impl Node<ScriptView> { } } DoctypeNodeTypeId => { - null_string + None } } } @@ -609,7 +609,7 @@ impl Node<ScriptView> { value: &DOMString, _rv: &mut ErrorResult) { let is_empty = match value { - &str(~"") | &null_string => true, + &Some(~"") | &None => true, _ => false }; match self.type_id { @@ -628,7 +628,7 @@ impl Node<ScriptView> { self.wait_until_safe_to_modify_dom(); do abstract_self.with_mut_characterdata() |characterdata| { - characterdata.data = value.to_str(); + characterdata.data = null_str_as_empty(value); // Notify the document that the content of this node is different for doc in self.owner_doc.iter() { @@ -749,11 +749,11 @@ impl Node<ScriptView> { } pub fn LookupPrefix(&self, _prefix: &DOMString) -> DOMString { - null_string + None } pub fn LookupNamespaceURI(&self, _namespace: &DOMString) -> DOMString { - null_string + None } pub fn IsDefaultNamespace(&self, _namespace: &DOMString) -> bool { @@ -761,15 +761,15 @@ impl Node<ScriptView> { } pub fn GetNamespaceURI(&self) -> DOMString { - null_string + None } pub fn GetPrefix(&self) -> DOMString { - null_string + None } pub fn GetLocalName(&self) -> DOMString { - null_string + None } pub fn HasAttributes(&self) -> bool { diff --git a/src/components/script/dom/text.rs b/src/components/script/dom/text.rs index 456e1084538..5ceedbe7fc0 100644 --- a/src/components/script/dom/text.rs +++ b/src/components/script/dom/text.rs @@ -2,7 +2,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -use dom::bindings::utils::{DOMString, ErrorResult, null_string}; +use dom::bindings::utils::{DOMString, ErrorResult, null_str_as_empty}; use dom::characterdata::CharacterData; use dom::node::{AbstractNode, ScriptView, Node, TextNodeTypeId}; use dom::window::Window; @@ -22,7 +22,7 @@ impl Text { pub fn Constructor(owner: @mut Window, text: &DOMString, _rv: &mut ErrorResult) -> AbstractNode<ScriptView> { let cx = owner.page.js_info.get_ref().js_compartment.cx.ptr; - unsafe { Node::as_abstract_node(cx, @Text::new(text.to_str())) } + unsafe { Node::as_abstract_node(cx, @Text::new(null_str_as_empty(text))) } } pub fn SplitText(&self, _offset: u32, _rv: &mut ErrorResult) -> AbstractNode<ScriptView> { @@ -30,6 +30,6 @@ impl Text { } pub fn GetWholeText(&self, _rv: &mut ErrorResult) -> DOMString { - null_string + None } } diff --git a/src/components/script/dom/window.rs b/src/components/script/dom/window.rs index ec2db1bf4ac..79b5003cf54 100644 --- a/src/components/script/dom/window.rs +++ b/src/components/script/dom/window.rs @@ -3,8 +3,8 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ use dom::bindings::codegen::WindowBinding; -use dom::bindings::utils::{WrapperCache, DOMString, null_string, Traceable}; -use dom::bindings::utils::{CacheableWrapper, BindingObject}; +use dom::bindings::utils::{WrapperCache, DOMString, Traceable}; +use dom::bindings::utils::{CacheableWrapper, BindingObject, null_str_as_empty}; use dom::document::AbstractDocument; use dom::node::{AbstractNode, ScriptView}; use dom::navigator::Navigator; @@ -65,7 +65,7 @@ pub struct TimerData { impl Window { pub fn Alert(&self, s: &DOMString) { // Right now, just print to the console - io::println(fmt!("ALERT: %s", s.to_str())); + io::println(fmt!("ALERT: %s", null_str_as_empty(s))); } pub fn Close(&self) { @@ -77,14 +77,14 @@ impl Window { } pub fn Name(&self) -> DOMString { - null_string + None } pub fn SetName(&self, _name: &DOMString) { } pub fn Status(&self) -> DOMString { - null_string + None } pub fn SetStatus(&self, _status: &DOMString) { @@ -119,7 +119,7 @@ impl Window { } pub fn Prompt(&self, _message: &DOMString, _default: &DOMString) -> DOMString { - null_string + None } pub fn Print(&self) { diff --git a/src/components/script/html/hubbub_html_parser.rs b/src/components/script/html/hubbub_html_parser.rs index d73db7f08cf..8696f594970 100644 --- a/src/components/script/html/hubbub_html_parser.rs +++ b/src/components/script/html/hubbub_html_parser.rs @@ -2,7 +2,6 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -use dom::bindings::utils::str; use dom::element::*; use dom::htmlelement::HTMLElement; use dom::htmlheadingelement::{Heading1, Heading2, Heading3, Heading4, Heading5, Heading6}; @@ -374,7 +373,7 @@ pub fn parse_html(cx: *JSContext, debug!("-- attach attrs"); do node.as_mut_element |element| { for attr in tag.attributes.iter() { - element.set_attr(node, &str(attr.name.clone()), &str(attr.value.clone())); + element.set_attr(node, &Some(attr.name.clone()), &Some(attr.value.clone())); } } |