aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/htmlimageelement.rs
diff options
context:
space:
mode:
authorbors-servo <metajack+bors@gmail.com>2015-08-27 15:08:41 -0600
committerbors-servo <metajack+bors@gmail.com>2015-08-27 15:08:41 -0600
commit71b277d5675556e61a82ae9dbf3105449c3a8275 (patch)
tree89f726bf207325eea8a8ca316f6d77d8c88432cb /components/script/dom/htmlimageelement.rs
parent856fda7f2e3fe4abd6de247e8bdaf8cedf3764c2 (diff)
parent709d347872e37ab2358e057d24557b9977238ecd (diff)
downloadservo-71b277d5675556e61a82ae9dbf3105449c3a8275.tar.gz
servo-71b277d5675556e61a82ae9dbf3105449c3a8275.zip
Auto merge of #7416 - nox:methods-ref, r=frewsxcv
Make the traits for the IDL interfaces take &self <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7416) <!-- Reviewable:end -->
Diffstat (limited to 'components/script/dom/htmlimageelement.rs')
-rw-r--r--components/script/dom/htmlimageelement.rs18
1 files changed, 9 insertions, 9 deletions
diff --git a/components/script/dom/htmlimageelement.rs b/components/script/dom/htmlimageelement.rs
index bfd13057f25..147bbc3e19c 100644
--- a/components/script/dom/htmlimageelement.rs
+++ b/components/script/dom/htmlimageelement.rs
@@ -197,7 +197,7 @@ impl LayoutHTMLImageElementHelpers for LayoutJS<HTMLImageElement> {
}
}
-impl<'a> HTMLImageElementMethods for &'a HTMLImageElement {
+impl HTMLImageElementMethods for HTMLImageElement {
make_getter!(Alt);
make_setter!(SetAlt, "alt");
@@ -213,39 +213,39 @@ impl<'a> HTMLImageElementMethods for &'a HTMLImageElement {
make_bool_getter!(IsMap);
// https://html.spec.whatwg.org/multipage/#dom-img-ismap
- fn SetIsMap(self, is_map: bool) {
+ fn SetIsMap(&self, is_map: bool) {
let element = ElementCast::from_ref(self);
element.set_string_attribute(&atom!("ismap"), is_map.to_string())
}
// https://html.spec.whatwg.org/multipage/#dom-img-width
- fn Width(self) -> u32 {
+ fn Width(&self) -> u32 {
let node = NodeCast::from_ref(self);
let rect = node.get_bounding_content_box();
rect.size.width.to_px() as u32
}
// https://html.spec.whatwg.org/multipage/#dom-img-width
- fn SetWidth(self, width: u32) {
+ fn SetWidth(&self, width: u32) {
let elem = ElementCast::from_ref(self);
elem.set_uint_attribute(&atom!("width"), width)
}
// https://html.spec.whatwg.org/multipage/#dom-img-height
- fn Height(self) -> u32 {
+ fn Height(&self) -> u32 {
let node = NodeCast::from_ref(self);
let rect = node.get_bounding_content_box();
rect.size.height.to_px() as u32
}
// https://html.spec.whatwg.org/multipage/#dom-img-height
- fn SetHeight(self, height: u32) {
+ fn SetHeight(&self, height: u32) {
let elem = ElementCast::from_ref(self);
elem.set_uint_attribute(&atom!("height"), height)
}
// https://html.spec.whatwg.org/multipage/#dom-img-naturalwidth
- fn NaturalWidth(self) -> u32 {
+ fn NaturalWidth(&self) -> u32 {
let image = self.image.borrow();
match *image {
@@ -255,7 +255,7 @@ impl<'a> HTMLImageElementMethods for &'a HTMLImageElement {
}
// https://html.spec.whatwg.org/multipage/#dom-img-naturalheight
- fn NaturalHeight(self) -> u32 {
+ fn NaturalHeight(&self) -> u32 {
let image = self.image.borrow();
match *image {
@@ -265,7 +265,7 @@ impl<'a> HTMLImageElementMethods for &'a HTMLImageElement {
}
// https://html.spec.whatwg.org/multipage/#dom-img-complete
- fn Complete(self) -> bool {
+ fn Complete(&self) -> bool {
let image = self.image.borrow();
image.is_some()
}