Make DOMString represent a non-nullable string.

This commit is contained in:
Ms2ger 2013-11-09 21:30:41 +01:00
parent 2975cb69e3
commit 803cd4b7cf
75 changed files with 632 additions and 632 deletions

View file

@ -16,7 +16,7 @@ pub struct Attr {
value: ~str,
name: ~str,
namespace: Namespace,
prefix: DOMString
prefix: Option<DOMString>
}
impl Reflectable for Attr {
@ -69,27 +69,27 @@ impl Attr {
}
}
pub fn LocalName(&self) -> DOMString {
pub fn LocalName(&self) -> Option<DOMString> {
Some(self.local_name().to_owned())
}
pub fn Value(&self) -> DOMString {
pub fn Value(&self) -> Option<DOMString> {
Some(self.value.clone())
}
pub fn SetValue(&mut self, value: &DOMString) {
pub fn SetValue(&mut self, value: &Option<DOMString>) {
self.value = null_str_as_empty(value);
}
pub fn Name(&self) -> DOMString {
pub fn Name(&self) -> Option<DOMString> {
Some(self.name.clone())
}
pub fn GetNamespaceURI(&self) -> DOMString {
pub fn GetNamespaceURI(&self) -> Option<DOMString> {
self.namespace.to_str()
}
pub fn GetPrefix(&self) -> DOMString {
pub fn GetPrefix(&self) -> Option<DOMString> {
self.prefix.clone()
}
}