mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Make the traits for the IDL interfaces take &self
This commit is contained in:
parent
856fda7f2e
commit
709d347872
99 changed files with 1192 additions and 1192 deletions
|
@ -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)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue