diff --git a/components/script/dom/document.rs b/components/script/dom/document.rs index 5383ea6df33..4f4b43437e7 100644 --- a/components/script/dom/document.rs +++ b/components/script/dom/document.rs @@ -279,12 +279,12 @@ pub trait DocumentHelpers<'a> { fn set_current_script(self, script: Option<&HTMLScriptElement>); fn trigger_mozbrowser_event(self, event: MozBrowserEvent); - /// https://w3c.github.io/animation-timing/#dom-windowanimationtiming-requestanimationframe + /// https://html.spec.whatwg.org/multipage/#dom-window-requestanimationframe fn request_animation_frame(self, callback: Box) -> i32; - /// https://w3c.github.io/animation-timing/#dom-windowanimationtiming-cancelanimationframe + /// https://html.spec.whatwg.org/multipage/#dom-window-cancelanimationframe fn cancel_animation_frame(self, ident: i32); - /// https://w3c.github.io/animation-timing/#dfn-invoke-callbacks-algorithm - fn invoke_animation_callbacks(self); + /// https://html.spec.whatwg.org/multipage/#run-the-animation-frame-callbacks + fn run_the_animation_frame_callbacks(self); fn prepare_async_load(self, load: LoadType) -> PendingAsyncLoad; fn load_async(self, load: LoadType, listener: AsyncResponseTarget); fn load_sync(self, load: LoadType) -> Result<(Metadata, Vec), String>; @@ -907,7 +907,7 @@ impl<'a> DocumentHelpers<'a> for &'a Document { } } - /// https://w3c.github.io/animation-timing/#dom-windowanimationtiming-requestanimationframe + /// https://html.spec.whatwg.org/multipage/#dom-window-requestanimationframe fn request_animation_frame(self, callback: Box) -> i32 { let window = self.window.root(); let window = window.r(); @@ -925,7 +925,7 @@ impl<'a> DocumentHelpers<'a> for &'a Document { ident } - /// https://w3c.github.io/animation-timing/#dom-windowanimationtiming-cancelanimationframe + /// https://html.spec.whatwg.org/multipage/#dom-window-cancelanimationframe fn cancel_animation_frame(self, ident: i32) { self.animation_frame_list.borrow_mut().remove(&ident); if self.animation_frame_list.borrow().len() == 0 { @@ -938,8 +938,8 @@ impl<'a> DocumentHelpers<'a> for &'a Document { } } - /// https://w3c.github.io/animation-timing/#dfn-invoke-callbacks-algorithm - fn invoke_animation_callbacks(self) { + /// https://html.spec.whatwg.org/multipage/#run-the-animation-frame-callbacks + fn run_the_animation_frame_callbacks(self) { let animation_frame_list; { let mut list = self.animation_frame_list.borrow_mut(); diff --git a/components/script/dom/webidls/Window.webidl b/components/script/dom/webidls/Window.webidl index 1fa85ffbe63..b5417eee057 100644 --- a/components/script/dom/webidls/Window.webidl +++ b/components/script/dom/webidls/Window.webidl @@ -56,6 +56,9 @@ //void print(); //any showModalDialog(DOMString url, optional any argument); + long requestAnimationFrame(FrameRequestCallback callback); + void cancelAnimationFrame(long handle); + //void postMessage(any message, DOMString targetOrigin, optional sequence transfer); // also has obsolete members @@ -159,9 +162,5 @@ interface WindowLocalStorage { }; Window implements WindowLocalStorage; -// https://w3c.github.io/animation-timing/#Window-interface-extensions -partial interface Window { - long requestAnimationFrame(FrameRequestCallback callback); - void cancelAnimationFrame(long handle); -}; +// http://w3c.github.io/animation-timing/#framerequestcallback callback FrameRequestCallback = void (DOMHighResTimeStamp time); diff --git a/components/script/dom/window.rs b/components/script/dom/window.rs index ba86c85b3ac..d31eb3d3527 100644 --- a/components/script/dom/window.rs +++ b/components/script/dom/window.rs @@ -519,7 +519,7 @@ impl<'a> WindowMethods for &'a Window { base64_atob(atob) } - /// https://w3c.github.io/animation-timing/#dom-windowanimationtiming-requestanimationframe + /// https://html.spec.whatwg.org/multipage/#dom-window-requestanimationframe fn RequestAnimationFrame(self, callback: Rc) -> i32 { let doc = self.Document(); @@ -531,7 +531,7 @@ impl<'a> WindowMethods for &'a Window { doc.r().request_animation_frame(Box::new(callback)) } - /// https://w3c.github.io/animation-timing/#dom-windowanimationtiming-cancelanimationframe + /// https://html.spec.whatwg.org/multipage/#dom-window-cancelanimationframe fn CancelAnimationFrame(self, ident: i32) { let doc = self.Document(); doc.r().cancel_animation_frame(ident); diff --git a/components/script/script_task.rs b/components/script/script_task.rs index b3ea5b16818..832024a1c03 100644 --- a/components/script/script_task.rs +++ b/components/script/script_task.rs @@ -1329,7 +1329,7 @@ impl ScriptTask { fn handle_tick_all_animations(&self, id: PipelineId) { let page = get_page(&self.root_page(), id); let document = page.document(); - document.r().invoke_animation_callbacks(); + document.r().run_the_animation_frame_callbacks(); } /// The entry point to document loading. Defines bindings, sets up the window and document