mirror of
https://github.com/servo/servo.git
synced 2025-06-06 16:45:39 +00:00
style: Add a new Timer structure to the shared style context, and basic infrastructure for controlling animations.
This commit is contained in:
parent
2e68821014
commit
0b67b218d0
20 changed files with 178 additions and 26 deletions
|
@ -581,6 +581,10 @@ impl TestBindingMethods for TestBinding {
|
|||
}
|
||||
}
|
||||
|
||||
fn AdvanceClock(&self, ms: i32) {
|
||||
self.global().r().as_window().advance_animation_clock(ms);
|
||||
}
|
||||
|
||||
fn Panic(&self) { panic!("explicit panic from script") }
|
||||
}
|
||||
|
||||
|
|
|
@ -424,6 +424,8 @@ interface TestBinding {
|
|||
static void prefControlledStaticMethodDisabled();
|
||||
[Pref="dom.testbinding.prefcontrolled.enabled"]
|
||||
const unsigned short prefControlledConstDisabled = 0;
|
||||
[Pref="layout.animations.test.enabled"]
|
||||
void advanceClock(long millis);
|
||||
|
||||
[Pref="dom.testbinding.prefcontrolled2.enabled"]
|
||||
readonly attribute boolean prefControlledAttributeEnabled;
|
||||
|
|
|
@ -1030,6 +1030,12 @@ impl Window {
|
|||
recv.recv().unwrap_or((Size2D::zero(), Point2D::zero()))
|
||||
}
|
||||
|
||||
/// 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();
|
||||
}
|
||||
|
||||
/// Reflows the page unconditionally if possible and not suppressed. This
|
||||
/// method will wait for the layout thread to complete (but see the `TODO`
|
||||
/// below). If there is no window size yet, the page is presumed invisible
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue