mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
layout: Expand animation test mode to support not force-ticking layout.
This commit is contained in:
parent
805988e839
commit
0e3d4ab407
5 changed files with 16 additions and 12 deletions
|
@ -613,8 +613,8 @@ impl TestBindingMethods for TestBinding {
|
|||
}
|
||||
}
|
||||
|
||||
fn AdvanceClock(&self, ms: i32) {
|
||||
self.global().r().as_window().advance_animation_clock(ms);
|
||||
fn AdvanceClock(&self, ms: i32, tick: bool) {
|
||||
self.global().r().as_window().advance_animation_clock(ms, tick);
|
||||
}
|
||||
|
||||
fn Panic(&self) { panic!("explicit panic from script") }
|
||||
|
|
|
@ -439,7 +439,7 @@ interface TestBinding {
|
|||
[Pref="dom.testbinding.prefcontrolled.enabled"]
|
||||
const unsigned short prefControlledConstDisabled = 0;
|
||||
[Pref="layout.animations.test.enabled"]
|
||||
void advanceClock(long millis);
|
||||
void advanceClock(long millis, optional boolean forceLayoutTick = true);
|
||||
|
||||
[Pref="dom.testbinding.prefcontrolled2.enabled"]
|
||||
readonly attribute boolean prefControlledAttributeEnabled;
|
||||
|
|
|
@ -1074,9 +1074,9 @@ impl Window {
|
|||
}
|
||||
|
||||
/// Advances the layout animation clock by `delta` milliseconds, and then
|
||||
/// forces a reflow.
|
||||
pub fn advance_animation_clock(&self, delta: i32) {
|
||||
self.layout_chan.send(Msg::AdvanceClockMs(delta)).unwrap();
|
||||
/// forces a reflow if `tick` is true.
|
||||
pub fn advance_animation_clock(&self, delta: i32, tick: bool) {
|
||||
self.layout_chan.send(Msg::AdvanceClockMs(delta, tick)).unwrap();
|
||||
}
|
||||
|
||||
/// Reflows the page unconditionally if possible and not suppressed. This
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue