mirror of
https://github.com/servo/servo.git
synced 2025-08-05 21:50:18 +01:00
auto merge of #4960 : pkondzior/servo/add-script-timers-suspend-resume-functionality, r=jdm
Adds free/thaw methods to script_task that let you send suspend/resume messages to web content timers. Fixes #4907
This commit is contained in:
commit
a3ea3eed47
6 changed files with 105 additions and 9 deletions
|
@ -335,6 +335,8 @@ pub trait WindowHelpers {
|
|||
fn load_url(self, href: DOMString);
|
||||
fn handle_fire_timer(self, timer_id: TimerId);
|
||||
fn IndexedGetter(self, _index: u32, _found: &mut bool) -> Option<Temporary<Window>>;
|
||||
fn thaw(self);
|
||||
fn freeze(self);
|
||||
}
|
||||
|
||||
pub trait ScriptHelpers {
|
||||
|
@ -405,6 +407,15 @@ impl<'a> WindowHelpers for JSRef<'a, Window> {
|
|||
fn IndexedGetter(self, _index: u32, _found: &mut bool) -> Option<Temporary<Window>> {
|
||||
None
|
||||
}
|
||||
|
||||
fn thaw(self) {
|
||||
self.timers.resume();
|
||||
}
|
||||
|
||||
fn freeze(self) {
|
||||
self.timers.suspend();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
impl Window {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue