mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Make all task source runnables cancellable
Implement all Runnable methods on CancellableRunnable to redirect to their inner runnable
This commit is contained in:
parent
afc0ccb48d
commit
5f7324a9a5
14 changed files with 69 additions and 58 deletions
|
@ -19,7 +19,6 @@ use script_thread::Runnable;
|
|||
use std::cell::Cell;
|
||||
use string_cache::Atom;
|
||||
use task_source::TaskSource;
|
||||
use task_source::dom_manipulation::DOMManipulationTask;
|
||||
|
||||
#[dom_struct]
|
||||
pub struct HTMLDetailsElement {
|
||||
|
@ -72,14 +71,13 @@ impl VirtualMethods for HTMLDetailsElement {
|
|||
self.toggle_counter.set(counter);
|
||||
|
||||
let window = window_from_node(self);
|
||||
let window = window.r();
|
||||
let task_source = window.dom_manipulation_task_source();
|
||||
let details = Trusted::new(self);
|
||||
let runnable = box DetailsNotificationRunnable {
|
||||
let runnable = DetailsNotificationRunnable {
|
||||
element: details,
|
||||
toggle_number: counter
|
||||
};
|
||||
let _ = task_source.queue(DOMManipulationTask(runnable));
|
||||
let _ = task_source.queue(runnable, window.r());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue