mirror of
https://github.com/servo/servo.git
synced 2025-07-23 07:13:52 +01:00
Combined DOMManipulationTask runnable variants into a single variant
This commit is contained in:
parent
68fb9ebc41
commit
d6f4dc06df
7 changed files with 22 additions and 36 deletions
|
@ -200,11 +200,8 @@ impl<T: Runnable + Send> Runnable for CancellableRunnable<T> {
|
|||
|
||||
pub trait Runnable {
|
||||
fn is_cancelled(&self) -> bool { false }
|
||||
fn handler(self: Box<Self>);
|
||||
}
|
||||
|
||||
pub trait MainThreadRunnable {
|
||||
fn handler(self: Box<Self>, script_thread: &ScriptThread);
|
||||
fn handler(self: Box<Self>) {}
|
||||
fn main_thread_handler(self: Box<Self>, _script_thread: &ScriptThread) { self.handler(); }
|
||||
}
|
||||
|
||||
enum MixedMessage {
|
||||
|
@ -1223,7 +1220,7 @@ impl ScriptThread {
|
|||
|
||||
// https://html.spec.whatwg.org/multipage/#the-end step 7
|
||||
let handler = box DocumentProgressHandler::new(Trusted::new(doc));
|
||||
self.dom_manipulation_task_source.queue(DOMManipulationTask::DocumentProgress(handler)).unwrap();
|
||||
self.dom_manipulation_task_source.queue(DOMManipulationTask::Runnable(handler)).unwrap();
|
||||
|
||||
self.constellation_chan.send(ConstellationMsg::LoadComplete(pipeline)).unwrap();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue