Update Animation Timing links and terminology to the HTML specification.

This commit is contained in:
Ms2ger 2015-08-05 09:21:08 +02:00
parent ac533b1466
commit d2077dd245
4 changed files with 15 additions and 16 deletions

View file

@ -279,12 +279,12 @@ pub trait DocumentHelpers<'a> {
fn set_current_script(self, script: Option<&HTMLScriptElement>); fn set_current_script(self, script: Option<&HTMLScriptElement>);
fn trigger_mozbrowser_event(self, event: MozBrowserEvent); 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<Fn(f64, )>) -> i32; fn request_animation_frame(self, callback: Box<Fn(f64, )>) -> 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); fn cancel_animation_frame(self, ident: i32);
/// https://w3c.github.io/animation-timing/#dfn-invoke-callbacks-algorithm /// https://html.spec.whatwg.org/multipage/#run-the-animation-frame-callbacks
fn invoke_animation_callbacks(self); fn run_the_animation_frame_callbacks(self);
fn prepare_async_load(self, load: LoadType) -> PendingAsyncLoad; fn prepare_async_load(self, load: LoadType) -> PendingAsyncLoad;
fn load_async(self, load: LoadType, listener: AsyncResponseTarget); fn load_async(self, load: LoadType, listener: AsyncResponseTarget);
fn load_sync(self, load: LoadType) -> Result<(Metadata, Vec<u8>), String>; fn load_sync(self, load: LoadType) -> Result<(Metadata, Vec<u8>), 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<Fn(f64, )>) -> i32 { fn request_animation_frame(self, callback: Box<Fn(f64, )>) -> i32 {
let window = self.window.root(); let window = self.window.root();
let window = window.r(); let window = window.r();
@ -925,7 +925,7 @@ impl<'a> DocumentHelpers<'a> for &'a Document {
ident 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) { fn cancel_animation_frame(self, ident: i32) {
self.animation_frame_list.borrow_mut().remove(&ident); self.animation_frame_list.borrow_mut().remove(&ident);
if self.animation_frame_list.borrow().len() == 0 { 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 /// https://html.spec.whatwg.org/multipage/#run-the-animation-frame-callbacks
fn invoke_animation_callbacks(self) { fn run_the_animation_frame_callbacks(self) {
let animation_frame_list; let animation_frame_list;
{ {
let mut list = self.animation_frame_list.borrow_mut(); let mut list = self.animation_frame_list.borrow_mut();

View file

@ -56,6 +56,9 @@
//void print(); //void print();
//any showModalDialog(DOMString url, optional any argument); //any showModalDialog(DOMString url, optional any argument);
long requestAnimationFrame(FrameRequestCallback callback);
void cancelAnimationFrame(long handle);
//void postMessage(any message, DOMString targetOrigin, optional sequence<Transferable> transfer); //void postMessage(any message, DOMString targetOrigin, optional sequence<Transferable> transfer);
// also has obsolete members // also has obsolete members
@ -159,9 +162,5 @@ interface WindowLocalStorage {
}; };
Window implements WindowLocalStorage; Window implements WindowLocalStorage;
// https://w3c.github.io/animation-timing/#Window-interface-extensions // http://w3c.github.io/animation-timing/#framerequestcallback
partial interface Window {
long requestAnimationFrame(FrameRequestCallback callback);
void cancelAnimationFrame(long handle);
};
callback FrameRequestCallback = void (DOMHighResTimeStamp time); callback FrameRequestCallback = void (DOMHighResTimeStamp time);

View file

@ -519,7 +519,7 @@ impl<'a> WindowMethods for &'a Window {
base64_atob(atob) 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<FrameRequestCallback>) -> i32 { fn RequestAnimationFrame(self, callback: Rc<FrameRequestCallback>) -> i32 {
let doc = self.Document(); let doc = self.Document();
@ -531,7 +531,7 @@ impl<'a> WindowMethods for &'a Window {
doc.r().request_animation_frame(Box::new(callback)) 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) { fn CancelAnimationFrame(self, ident: i32) {
let doc = self.Document(); let doc = self.Document();
doc.r().cancel_animation_frame(ident); doc.r().cancel_animation_frame(ident);

View file

@ -1329,7 +1329,7 @@ impl ScriptTask {
fn handle_tick_all_animations(&self, id: PipelineId) { fn handle_tick_all_animations(&self, id: PipelineId) {
let page = get_page(&self.root_page(), id); let page = get_page(&self.root_page(), id);
let document = page.document(); 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 /// The entry point to document loading. Defines bindings, sets up the window and document