mirror of
https://github.com/servo/servo.git
synced 2025-08-05 13:40:08 +01:00
Remove unused windows/globals
This commit is contained in:
parent
70e70fd1d9
commit
deed48a759
3 changed files with 9 additions and 14 deletions
|
@ -3,7 +3,7 @@
|
|||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
use dom::bindings::codegen::InheritTypes::FileDerived;
|
||||
use dom::bindings::global::{GlobalRef, GlobalField};
|
||||
use dom::bindings::global::GlobalRef;
|
||||
use dom::bindings::js::Temporary;
|
||||
use dom::bindings::utils::{Reflectable, Reflector, reflect_dom_object};
|
||||
use dom::bindings::error::Fallible;
|
||||
|
@ -18,21 +18,19 @@ pub enum BlobType {
|
|||
#[deriving(Encodable)]
|
||||
pub struct Blob {
|
||||
reflector_: Reflector,
|
||||
global: GlobalField,
|
||||
type_: BlobType
|
||||
}
|
||||
|
||||
impl Blob {
|
||||
pub fn new_inherited(global: &GlobalRef) -> Blob {
|
||||
pub fn new_inherited() -> Blob {
|
||||
Blob {
|
||||
reflector_: Reflector::new(),
|
||||
global: GlobalField::from_rooted(global),
|
||||
type_: BlobTypeId
|
||||
}
|
||||
}
|
||||
|
||||
pub fn new(global: &GlobalRef) -> Temporary<Blob> {
|
||||
reflect_dom_object(box Blob::new_inherited(global),
|
||||
reflect_dom_object(box Blob::new_inherited(),
|
||||
global,
|
||||
BlobBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
use dom::bindings::codegen::Bindings::ClientRectBinding;
|
||||
use dom::bindings::codegen::Bindings::ClientRectBinding::ClientRectMethods;
|
||||
use dom::bindings::global::Window;
|
||||
use dom::bindings::js::{JS, JSRef, Temporary};
|
||||
use dom::bindings::js::{JSRef, Temporary};
|
||||
use dom::bindings::utils::{Reflectable, Reflector, reflect_dom_object};
|
||||
use dom::window::Window;
|
||||
use servo_util::geometry::Au;
|
||||
|
@ -17,12 +17,10 @@ pub struct ClientRect {
|
|||
bottom: f32,
|
||||
left: f32,
|
||||
right: f32,
|
||||
window: JS<Window>,
|
||||
}
|
||||
|
||||
impl ClientRect {
|
||||
pub fn new_inherited(window: &JSRef<Window>,
|
||||
top: Au, bottom: Au,
|
||||
pub fn new_inherited(top: Au, bottom: Au,
|
||||
left: Au, right: Au) -> ClientRect {
|
||||
ClientRect {
|
||||
top: top.to_nearest_px() as f32,
|
||||
|
@ -30,14 +28,13 @@ impl ClientRect {
|
|||
left: left.to_nearest_px() as f32,
|
||||
right: right.to_nearest_px() as f32,
|
||||
reflector_: Reflector::new(),
|
||||
window: JS::from_rooted(window),
|
||||
}
|
||||
}
|
||||
|
||||
pub fn new(window: &JSRef<Window>,
|
||||
top: Au, bottom: Au,
|
||||
left: Au, right: Au) -> Temporary<ClientRect> {
|
||||
let rect = ClientRect::new_inherited(window, top, bottom, left, right);
|
||||
let rect = ClientRect::new_inherited(top, bottom, left, right);
|
||||
reflect_dom_object(box rect, &Window(*window), ClientRectBinding::Wrap)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -18,9 +18,9 @@ pub struct File {
|
|||
}
|
||||
|
||||
impl File {
|
||||
pub fn new_inherited(global: &GlobalRef, _file_bits: &JSRef<Blob>, name: DOMString) -> File {
|
||||
pub fn new_inherited(_file_bits: &JSRef<Blob>, name: DOMString) -> File {
|
||||
File {
|
||||
blob: Blob::new_inherited(global),
|
||||
blob: Blob::new_inherited(),
|
||||
name: name,
|
||||
type_: FileTypeId
|
||||
}
|
||||
|
@ -29,7 +29,7 @@ impl File {
|
|||
}
|
||||
|
||||
pub fn new(global: &GlobalRef, file_bits: &JSRef<Blob>, name: DOMString) -> Temporary<File> {
|
||||
reflect_dom_object(box File::new_inherited(global, file_bits, name),
|
||||
reflect_dom_object(box File::new_inherited(file_bits, name),
|
||||
global,
|
||||
FileBinding::Wrap)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue