mirror of
https://github.com/servo/servo.git
synced 2025-07-24 15:50:21 +01:00
Update Animation Timing links and terminology to the HTML specification.
This commit is contained in:
parent
ac533b1466
commit
d2077dd245
4 changed files with 15 additions and 16 deletions
|
@ -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<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);
|
||||
/// 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<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 {
|
||||
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();
|
||||
|
|
|
@ -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<Transferable> 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);
|
||||
|
|
|
@ -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<FrameRequestCallback>) -> 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);
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue