diff options
author | Luis de Bethencourt <luis@debethencourt.com> | 2013-09-19 18:05:48 -0400 |
---|---|---|
committer | Luis de Bethencourt <luis@debethencourt.com> | 2013-09-19 19:39:38 -0400 |
commit | 2dbd065d91b19924ada276249ae9997bf4496e31 (patch) | |
tree | 36bbf5c90b462c2dbd63419935c7df28f470df2a /src/components/script/dom/htmlimageelement.rs | |
parent | 0ca4c19b57a6c444aecb4e8fbdd42cd7ff575c1c (diff) | |
download | servo-2dbd065d91b19924ada276249ae9997bf4496e31.tar.gz servo-2dbd065d91b19924ada276249ae9997bf4496e31.zip |
Rename the element field of the DOM Node hierarchy
Renamed htmlelement, and element
Fixes #924
Diffstat (limited to 'src/components/script/dom/htmlimageelement.rs')
-rw-r--r-- | src/components/script/dom/htmlimageelement.rs | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/components/script/dom/htmlimageelement.rs b/src/components/script/dom/htmlimageelement.rs index 661d14ef891..7cfc91ee0fc 100644 --- a/src/components/script/dom/htmlimageelement.rs +++ b/src/components/script/dom/htmlimageelement.rs @@ -13,7 +13,7 @@ use servo_net::image_cache_task::ImageCacheTask; use servo_util::url::make_url; pub struct HTMLImageElement { - parent: HTMLElement, + htmlelement: HTMLElement, image: Option<Url>, } @@ -21,7 +21,7 @@ impl HTMLImageElement { /// Makes the local `image` member match the status of the `src` attribute and starts /// prefetching the image. This method must be called after `src` is changed. pub fn update_image(&mut self, image_cache: ImageCacheTask, url: Option<Url>) { - let elem = &mut self.parent.parent; + let elem = &mut self.htmlelement.element; let src_opt = elem.get_attr("src").map(|x| x.to_str()); match src_opt { None => {} @@ -42,7 +42,7 @@ impl HTMLImageElement { pub fn AfterSetAttr(&mut self, name: &DOMString, _value: &DOMString) { let name = null_str_as_empty(name); if "src" == name { - let doc = self.parent.parent.parent.owner_doc; + let doc = self.htmlelement.element.element.owner_doc; for doc in doc.iter() { do doc.with_base |doc| { for window in doc.window.iter() { @@ -69,7 +69,7 @@ impl HTMLImageElement { pub fn SetSrc(&mut self, abstract_self: AbstractNode<ScriptView>, src: &DOMString) -> ErrorResult { - let node = &mut self.parent.parent; + let node = &mut self.htmlelement.element; node.set_attr(abstract_self, &Some(~"src"), &Some(null_str_as_empty(src))); @@ -101,7 +101,7 @@ impl HTMLImageElement { } pub fn Width(&self, abstract_self: AbstractNode<ScriptView>) -> u32 { - let node = &self.parent.parent.parent; + let node = &self.htmlelement.element.element; match node.owner_doc { Some(doc) => { match doc.with_base(|doc| doc.window) { @@ -130,7 +130,7 @@ impl HTMLImageElement { pub fn SetWidth(&mut self, abstract_self: AbstractNode<ScriptView>, width: u32) -> ErrorResult { - let node = &mut self.parent.parent; + let node = &mut self.htmlelement.element; node.set_attr(abstract_self, &Some(~"width"), &Some(width.to_str())); @@ -138,7 +138,7 @@ impl HTMLImageElement { } pub fn Height(&self, abstract_self: AbstractNode<ScriptView>) -> u32 { - let node = &self.parent.parent.parent; + let node = &self.htmlelement.element.element; match node.owner_doc { Some(doc) => { match doc.with_base(|doc| doc.window) { @@ -167,7 +167,7 @@ impl HTMLImageElement { pub fn SetHeight(&mut self, abstract_self: AbstractNode<ScriptView>, height: u32) -> ErrorResult { - let node = &mut self.parent.parent; + let node = &mut self.htmlelement.element; node.set_attr(abstract_self, &Some(~"height"), &Some(height.to_str())); |