mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
Emit TransitionEnd events in the layout thread and process it in the script thread
This commit is contained in:
parent
752c6e6019
commit
668163ec5c
21 changed files with 103 additions and 62 deletions
|
@ -444,6 +444,14 @@ impl<T: Reflectable> LayoutJS<T> {
|
|||
debug_assert!(thread_state::get().is_layout());
|
||||
*self.ptr
|
||||
}
|
||||
|
||||
/// Returns a reference to the interior of this JS object. This method is
|
||||
/// safe to call because it originates from the layout thread, and it cannot
|
||||
/// mutate DOM nodes.
|
||||
pub fn get_for_script(&self) -> &T {
|
||||
debug_assert!(thread_state::get().is_script());
|
||||
unsafe { &**self.ptr }
|
||||
}
|
||||
}
|
||||
|
||||
/// Get an `&T` out of a `Rc<T>`
|
||||
|
|
|
@ -472,6 +472,7 @@ macro_rules! global_event_handlers(
|
|||
event_handler!(suspend, GetOnsuspend, SetOnsuspend);
|
||||
event_handler!(timeupdate, GetOntimeupdate, SetOntimeupdate);
|
||||
event_handler!(toggle, GetOntoggle, SetOntoggle);
|
||||
event_handler!(transitionend, GetOntransitionend, SetOntransitionend);
|
||||
event_handler!(volumechange, GetOnvolumechange, SetOnvolumechange);
|
||||
event_handler!(waiting, GetOnwaiting, SetOnwaiting);
|
||||
)
|
||||
|
|
|
@ -89,6 +89,11 @@ interface GlobalEventHandlers {
|
|||
attribute EventHandler onwaiting;
|
||||
};
|
||||
|
||||
// https://drafts.csswg.org/css-transitions/#interface-globaleventhandlers-idl
|
||||
partial interface GlobalEventHandlers {
|
||||
attribute EventHandler ontransitionend;
|
||||
};
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/#windoweventhandlers
|
||||
[NoInterfaceObject, Exposed=(Window,Worker)]
|
||||
interface WindowEventHandlers {
|
||||
|
|
|
@ -6,7 +6,8 @@
|
|||
* https://dom.spec.whatwg.org/#event
|
||||
*/
|
||||
|
||||
[Constructor(DOMString type, optional TransitionEventInit transitionEventInitDict)]
|
||||
[Constructor(DOMString type, optional TransitionEventInit transitionEventInitDict),
|
||||
Exposed=Window]
|
||||
interface TransitionEvent : Event {
|
||||
readonly attribute DOMString propertyName;
|
||||
readonly attribute float elapsedTime;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue