mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
Don't pass nullable strings to native DOM methods that want non-nullable strings. Fixes #1207.
This commit is contained in:
parent
803cd4b7cf
commit
08afc6d19d
75 changed files with 968 additions and 966 deletions
|
@ -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(())
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue