aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/script/dom/htmlimageelement.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/components/script/dom/htmlimageelement.rs')
-rw-r--r--src/components/script/dom/htmlimageelement.rs32
1 files changed, 16 insertions, 16 deletions
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) {