Make the traits for the IDL interfaces take &self

This commit is contained in:
Anthony Ramine 2015-08-27 22:15:54 +02:00
parent 856fda7f2e
commit 709d347872
99 changed files with 1192 additions and 1192 deletions

View file

@ -40,35 +40,35 @@ impl DOMRect {
}
}
impl<'a> DOMRectMethods for &'a DOMRect {
impl DOMRectMethods for DOMRect {
// https://drafts.fxtf.org/geometry/#dom-domrectreadonly-top
fn Top(self) -> Finite<f32> {
fn Top(&self) -> Finite<f32> {
Finite::wrap(self.top)
}
// https://drafts.fxtf.org/geometry/#dom-domrectreadonly-bottom
fn Bottom(self) -> Finite<f32> {
fn Bottom(&self) -> Finite<f32> {
Finite::wrap(self.bottom)
}
// https://drafts.fxtf.org/geometry/#dom-domrectreadonly-left
fn Left(self) -> Finite<f32> {
fn Left(&self) -> Finite<f32> {
Finite::wrap(self.left)
}
// https://drafts.fxtf.org/geometry/#dom-domrectreadonly-right
fn Right(self) -> Finite<f32> {
fn Right(&self) -> Finite<f32> {
Finite::wrap(self.right)
}
// https://drafts.fxtf.org/geometry/#dom-domrectreadonly-width
fn Width(self) -> Finite<f32> {
fn Width(&self) -> Finite<f32> {
let result = (self.right - self.left).abs();
Finite::wrap(result)
}
// https://drafts.fxtf.org/geometry/#dom-domrectreadonly-height
fn Height(self) -> Finite<f32> {
fn Height(&self) -> Finite<f32> {
let result = (self.bottom - self.top).abs();
Finite::wrap(result)
}