diff options
Diffstat (limited to 'components/script/dom')
-rw-r--r-- | components/script/dom/bindings/trace.rs | 3 | ||||
-rw-r--r-- | components/script/dom/document.rs | 7 |
2 files changed, 6 insertions, 4 deletions
diff --git a/components/script/dom/bindings/trace.rs b/components/script/dom/bindings/trace.rs index 29172c64198..7b9a7999706 100644 --- a/components/script/dom/bindings/trace.rs +++ b/components/script/dom/bindings/trace.rs @@ -64,6 +64,7 @@ use net_traits::image::base::Image; use profile_traits::mem::ProfilerChan; use util::str::{LengthOrPercentageOrAuto}; use selectors::parser::PseudoElement; +use std::boxed::FnBox; use std::cell::{Cell, UnsafeCell, RefCell}; use std::collections::{HashMap, HashSet}; use std::collections::hash_state::HashState; @@ -313,7 +314,7 @@ impl JSTraceable for Box<ScriptChan+Send> { } } -impl JSTraceable for Box<Fn(f64, )> { +impl JSTraceable for Box<FnBox(f64, )> { #[inline] fn trace(&self, _trc: *mut JSTracer) { // Do nothing diff --git a/components/script/dom/document.rs b/components/script/dom/document.rs index b765cc829e7..dd0e4baf6bc 100644 --- a/components/script/dom/document.rs +++ b/components/script/dom/document.rs @@ -94,6 +94,7 @@ use js::jsapi::{JSContext, JSObject, JSRuntime}; use num::ToPrimitive; use std::iter::FromIterator; use std::borrow::ToOwned; +use std::boxed::FnBox; use std::collections::HashMap; use std::collections::hash_map::Entry::{Occupied, Vacant}; use std::ascii::AsciiExt; @@ -148,7 +149,7 @@ pub struct Document { /// https://html.spec.whatwg.org/multipage/#list-of-animation-frame-callbacks /// List of animation frame callbacks #[ignore_heap_size_of = "closures are hard"] - animation_frame_list: RefCell<HashMap<i32, Box<Fn(f64)>>>, + animation_frame_list: RefCell<HashMap<i32, Box<FnBox(f64)>>>, /// Tracks all outstanding loads related to this document. loader: DOMRefCell<DocumentLoader>, /// The current active HTML parser, to allow resuming after interruptions. @@ -292,7 +293,7 @@ pub trait DocumentHelpers<'a> { fn set_current_script(self, script: Option<&HTMLScriptElement>); fn trigger_mozbrowser_event(self, event: MozBrowserEvent); /// https://html.spec.whatwg.org/multipage/#dom-window-requestanimationframe - fn request_animation_frame(self, callback: Box<Fn(f64, )>) -> i32; + fn request_animation_frame(self, callback: Box<FnBox(f64, )>) -> i32; /// https://html.spec.whatwg.org/multipage/#dom-window-cancelanimationframe fn cancel_animation_frame(self, ident: i32); /// https://html.spec.whatwg.org/multipage/#run-the-animation-frame-callbacks @@ -949,7 +950,7 @@ impl<'a> DocumentHelpers<'a> for &'a Document { } /// https://html.spec.whatwg.org/multipage/#dom-window-requestanimationframe - fn request_animation_frame(self, callback: Box<Fn(f64, )>) -> i32 { + fn request_animation_frame(self, callback: Box<FnBox(f64)>) -> i32 { let window = self.window.root(); let window = window.r(); let ident = self.animation_frame_ident.get() + 1; |