aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/htmlelement.rs
diff options
context:
space:
mode:
authorAnthony Ramine <n.oxyde@gmail.com>2015-08-27 22:15:54 +0200
committerAnthony Ramine <n.oxyde@gmail.com>2015-08-27 22:27:43 +0200
commit709d347872e37ab2358e057d24557b9977238ecd (patch)
tree89f726bf207325eea8a8ca316f6d77d8c88432cb /components/script/dom/htmlelement.rs
parent856fda7f2e3fe4abd6de247e8bdaf8cedf3764c2 (diff)
downloadservo-709d347872e37ab2358e057d24557b9977238ecd.tar.gz
servo-709d347872e37ab2358e057d24557b9977238ecd.zip
Make the traits for the IDL interfaces take &self
Diffstat (limited to 'components/script/dom/htmlelement.rs')
-rw-r--r--components/script/dom/htmlelement.rs26
1 files changed, 13 insertions, 13 deletions
diff --git a/components/script/dom/htmlelement.rs b/components/script/dom/htmlelement.rs
index e525e8d81e5..e7c9a37887b 100644
--- a/components/script/dom/htmlelement.rs
+++ b/components/script/dom/htmlelement.rs
@@ -124,9 +124,9 @@ impl HTMLElement {
}
}
-impl<'a> HTMLElementMethods for &'a HTMLElement {
+impl HTMLElementMethods for HTMLElement {
// https://html.spec.whatwg.org/multipage/#the-style-attribute
- fn Style(self) -> Root<CSSStyleDeclaration> {
+ fn Style(&self) -> Root<CSSStyleDeclaration> {
self.style_decl.or_init(|| {
let global = window_from_node(self);
CSSStyleDeclaration::new(global.r(), ElementCast::from_ref(self), None, CSSModificationAccess::ReadWrite)
@@ -146,12 +146,12 @@ impl<'a> HTMLElementMethods for &'a HTMLElement {
global_event_handlers!(NoOnload);
// https://html.spec.whatwg.org/multipage/#dom-dataset
- fn Dataset(self) -> Root<DOMStringMap> {
+ fn Dataset(&self) -> Root<DOMStringMap> {
self.dataset.or_init(|| DOMStringMap::new(self))
}
// https://html.spec.whatwg.org/multipage/#handler-onload
- fn GetOnload(self) -> Option<Rc<EventHandlerNonNull>> {
+ fn GetOnload(&self) -> Option<Rc<EventHandlerNonNull>> {
if self.is_body_or_frameset() {
let win = window_from_node(self);
win.r().GetOnload()
@@ -162,7 +162,7 @@ impl<'a> HTMLElementMethods for &'a HTMLElement {
}
// https://html.spec.whatwg.org/multipage/#handler-onload
- fn SetOnload(self, listener: Option<Rc<EventHandlerNonNull>>) {
+ fn SetOnload(&self, listener: Option<Rc<EventHandlerNonNull>>) {
if self.is_body_or_frameset() {
let win = window_from_node(self);
win.r().SetOnload(listener)
@@ -173,7 +173,7 @@ impl<'a> HTMLElementMethods for &'a HTMLElement {
}
// https://html.spec.whatwg.org/multipage/#dom-click
- fn Click(self) {
+ fn Click(&self) {
let maybe_input: Option<&HTMLInputElement> = HTMLInputElementCast::to_ref(self);
if let Some(i) = maybe_input {
if i.Disabled() {
@@ -186,7 +186,7 @@ impl<'a> HTMLElementMethods for &'a HTMLElement {
}
// https://html.spec.whatwg.org/multipage/#dom-focus
- fn Focus(self) {
+ fn Focus(&self) {
// TODO: Mark the element as locked for focus and run the focusing steps.
// https://html.spec.whatwg.org/multipage/#focusing-steps
let element = ElementCast::from_ref(self);
@@ -198,7 +198,7 @@ impl<'a> HTMLElementMethods for &'a HTMLElement {
}
// https://html.spec.whatwg.org/multipage/#dom-blur
- fn Blur(self) {
+ fn Blur(&self) {
// TODO: Run the unfocusing steps.
let node = NodeCast::from_ref(self);
if !node.get_focus_state() {
@@ -212,7 +212,7 @@ impl<'a> HTMLElementMethods for &'a HTMLElement {
}
// https://drafts.csswg.org/cssom-view/#extensions-to-the-htmlelement-interface
- fn GetOffsetParent(self) -> Option<Root<Element>> {
+ fn GetOffsetParent(&self) -> Option<Root<Element>> {
if self.is_htmlbodyelement() || self.is_htmlhtmlelement() {
return None;
}
@@ -225,7 +225,7 @@ impl<'a> HTMLElementMethods for &'a HTMLElement {
}
// https://drafts.csswg.org/cssom-view/#extensions-to-the-htmlelement-interface
- fn OffsetTop(self) -> i32 {
+ fn OffsetTop(&self) -> i32 {
if self.is_htmlbodyelement() {
return 0;
}
@@ -238,7 +238,7 @@ impl<'a> HTMLElementMethods for &'a HTMLElement {
}
// https://drafts.csswg.org/cssom-view/#extensions-to-the-htmlelement-interface
- fn OffsetLeft(self) -> i32 {
+ fn OffsetLeft(&self) -> i32 {
if self.is_htmlbodyelement() {
return 0;
}
@@ -251,7 +251,7 @@ impl<'a> HTMLElementMethods for &'a HTMLElement {
}
// https://drafts.csswg.org/cssom-view/#extensions-to-the-htmlelement-interface
- fn OffsetWidth(self) -> i32 {
+ fn OffsetWidth(&self) -> i32 {
let node = NodeCast::from_ref(self);
let window = window_from_node(self);
let (_, rect) = window.offset_parent_query(node.to_trusted_node_address());
@@ -260,7 +260,7 @@ impl<'a> HTMLElementMethods for &'a HTMLElement {
}
// https://drafts.csswg.org/cssom-view/#extensions-to-the-htmlelement-interface
- fn OffsetHeight(self) -> i32 {
+ fn OffsetHeight(&self) -> i32 {
let node = NodeCast::from_ref(self);
let window = window_from_node(self);
let (_, rect) = window.offset_parent_query(node.to_trusted_node_address());