mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Cancel animations that affect nodes that do not participate in layout.
This commit is contained in:
parent
8fb1b567fa
commit
ed74b898a5
9 changed files with 89 additions and 10 deletions
|
@ -173,3 +173,8 @@ partial interface Window {
|
|||
readonly attribute TestRunner testRunner;
|
||||
//readonly attribute EventSender eventSender;
|
||||
};
|
||||
|
||||
partial interface Window {
|
||||
[Pref="css.animations.testing.enabled"]
|
||||
readonly attribute unsigned long runningAnimationCount;
|
||||
};
|
||||
|
|
|
@ -74,7 +74,7 @@ use devtools_traits::{ScriptToDevtoolsControlMsg, TimelineMarker, TimelineMarker
|
|||
use dom_struct::dom_struct;
|
||||
use embedder_traits::EmbedderMsg;
|
||||
use euclid::{Point2D, Rect, Size2D, TypedPoint2D, TypedScale, TypedSize2D, Vector2D};
|
||||
use ipc_channel::ipc::IpcSender;
|
||||
use ipc_channel::ipc::{channel, IpcSender};
|
||||
use ipc_channel::router::ROUTER;
|
||||
use js::jsapi::JSAutoCompartment;
|
||||
use js::jsapi::JSContext;
|
||||
|
@ -1144,6 +1144,12 @@ impl WindowMethods for Window {
|
|||
self.test_runner.or_init(|| TestRunner::new(self.upcast()))
|
||||
}
|
||||
|
||||
fn RunningAnimationCount(&self) -> u32 {
|
||||
let (sender, receiver) = channel().unwrap();
|
||||
let _ = self.layout_chan.send(Msg::GetRunningAnimations(sender));
|
||||
receiver.recv().unwrap_or(0) as u32
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/#dom-name
|
||||
fn SetName(&self, name: DOMString) {
|
||||
self.window_proxy().set_name(name);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue