diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/components/script/dom/blob.rs | 8 | ||||
-rw-r--r-- | src/components/script/dom/clientrect.rs | 9 | ||||
-rw-r--r-- | src/components/script/dom/file.rs | 6 |
3 files changed, 9 insertions, 14 deletions
diff --git a/src/components/script/dom/blob.rs b/src/components/script/dom/blob.rs index f78c3e2f5f5..1a7d2a21636 100644 --- a/src/components/script/dom/blob.rs +++ b/src/components/script/dom/blob.rs @@ -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) } diff --git a/src/components/script/dom/clientrect.rs b/src/components/script/dom/clientrect.rs index b80d6a8853b..3d1af37fb9f 100644 --- a/src/components/script/dom/clientrect.rs +++ b/src/components/script/dom/clientrect.rs @@ -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) } } diff --git a/src/components/script/dom/file.rs b/src/components/script/dom/file.rs index 765ab731228..c4c07e03399 100644 --- a/src/components/script/dom/file.rs +++ b/src/components/script/dom/file.rs @@ -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) } |