Don't pass nullable strings to native DOM methods that want non-nullable strings. Fixes #1207.

This commit is contained in:
Ms2ger 2013-11-10 14:11:15 +01:00
parent 803cd4b7cf
commit 08afc6d19d
75 changed files with 968 additions and 966 deletions

View file

@ -28,27 +28,30 @@ impl HTMLScriptElement {
}
impl HTMLScriptElement {
pub fn Src(&self) -> Option<DOMString> {
self.htmlelement.element.get_attr("src").map(|s| s.to_str())
pub fn Src(&self) -> DOMString {
match self.htmlelement.element.get_attr("src") {
Some(s) => s.to_owned(),
None => ~""
}
}
pub fn SetSrc(&mut self, _src: &Option<DOMString>) -> ErrorResult {
pub fn SetSrc(&mut self, _src: &DOMString) -> ErrorResult {
Ok(())
}
pub fn Type(&self) -> Option<DOMString> {
None
pub fn Type(&self) -> DOMString {
~""
}
pub fn SetType(&mut self, _type: &Option<DOMString>) -> ErrorResult {
pub fn SetType(&mut self, _type: &DOMString) -> ErrorResult {
Ok(())
}
pub fn Charset(&self) -> Option<DOMString> {
None
pub fn Charset(&self) -> DOMString {
~""
}
pub fn SetCharset(&mut self, _charset: &Option<DOMString>) -> ErrorResult {
pub fn SetCharset(&mut self, _charset: &DOMString) -> ErrorResult {
Ok(())
}
@ -68,35 +71,35 @@ impl HTMLScriptElement {
Ok(())
}
pub fn CrossOrigin(&self) -> Option<DOMString> {
None
pub fn CrossOrigin(&self) -> DOMString {
~""
}
pub fn SetCrossOrigin(&mut self, _cross_origin: &Option<DOMString>) -> ErrorResult {
pub fn SetCrossOrigin(&mut self, _cross_origin: &DOMString) -> ErrorResult {
Ok(())
}
pub fn Text(&self) -> Option<DOMString> {
None
pub fn Text(&self) -> DOMString {
~""
}
pub fn SetText(&mut self, _text: &Option<DOMString>) -> ErrorResult {
pub fn SetText(&mut self, _text: &DOMString) -> ErrorResult {
Ok(())
}
pub fn Event(&self) -> Option<DOMString> {
None
pub fn Event(&self) -> DOMString {
~""
}
pub fn SetEvent(&mut self, _event: &Option<DOMString>) -> ErrorResult {
pub fn SetEvent(&mut self, _event: &DOMString) -> ErrorResult {
Ok(())
}
pub fn HtmlFor(&self) -> Option<DOMString> {
None
pub fn HtmlFor(&self) -> DOMString {
~""
}
pub fn SetHtmlFor(&mut self, _html_for: &Option<DOMString>) -> ErrorResult {
pub fn SetHtmlFor(&mut self, _html_for: &DOMString) -> ErrorResult {
Ok(())
}
}