mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +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
|
@ -79,7 +79,7 @@ impl VirtualMethods for HTMLDetailsElement {
|
|||
element: details,
|
||||
toggle_number: counter
|
||||
};
|
||||
let _ = task_source.queue(DOMManipulationTask::FireToggleEvent(runnable));
|
||||
let _ = task_source.queue(DOMManipulationTask::Runnable(runnable));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -484,8 +484,7 @@ impl HTMLFormElement {
|
|||
};
|
||||
|
||||
// Step 3
|
||||
window.dom_manipulation_task_source().queue(
|
||||
DOMManipulationTask::PlannedNavigation(nav)).unwrap();
|
||||
window.dom_manipulation_task_source().queue(DOMManipulationTask::Runnable(nav)).unwrap();
|
||||
}
|
||||
|
||||
/// Interactively validate the constraints of form elements
|
||||
|
|
|
@ -183,7 +183,7 @@ impl HTMLImageElement {
|
|||
src: src.into(),
|
||||
});
|
||||
let task = window.dom_manipulation_task_source();
|
||||
let _ = task.queue(DOMManipulationTask::Miscellaneous(runnable));
|
||||
let _ = task.queue(DOMManipulationTask::Runnable(runnable));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -242,7 +242,7 @@ impl HTMLMediaElement {
|
|||
elem: Trusted::new(self),
|
||||
};
|
||||
let win = window_from_node(self);
|
||||
let _ = win.dom_manipulation_task_source().queue(DOMManipulationTask::MediaTask(box task));
|
||||
let _ = win.dom_manipulation_task_source().queue(DOMManipulationTask::Runnable(box task));
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/#internal-pause-steps step 2.2
|
||||
|
@ -266,13 +266,13 @@ impl HTMLMediaElement {
|
|||
elem: Trusted::new(self),
|
||||
};
|
||||
let win = window_from_node(self);
|
||||
let _ = win.dom_manipulation_task_source().queue(DOMManipulationTask::MediaTask(box task));
|
||||
let _ = win.dom_manipulation_task_source().queue(DOMManipulationTask::Runnable(box task));
|
||||
}
|
||||
|
||||
fn queue_fire_simple_event(&self, type_: &'static str) {
|
||||
let win = window_from_node(self);
|
||||
let task = FireSimpleEventTask::new(self, type_);
|
||||
let _ = win.dom_manipulation_task_source().queue(DOMManipulationTask::MediaTask(box task));
|
||||
let _ = win.dom_manipulation_task_source().queue(DOMManipulationTask::Runnable(box task));
|
||||
}
|
||||
|
||||
fn fire_simple_event(&self, type_: &str) {
|
||||
|
@ -497,7 +497,7 @@ impl HTMLMediaElement {
|
|||
|
||||
fn queue_dedicated_media_source_failure_steps(&self) {
|
||||
let _ = window_from_node(self).dom_manipulation_task_source().queue(
|
||||
DOMManipulationTask::MediaTask(box DedicatedMediaSourceFailureTask::new(self)));
|
||||
DOMManipulationTask::Runnable(box DedicatedMediaSourceFailureTask::new(self)));
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/#dedicated-media-source-failure-steps
|
||||
|
|
|
@ -17,7 +17,7 @@ use dom::urlhelper::UrlHelper;
|
|||
use ipc_channel::ipc::{self, IpcSender};
|
||||
use net_traits::IpcSend;
|
||||
use net_traits::storage_thread::{StorageThreadMsg, StorageType};
|
||||
use script_thread::{MainThreadRunnable, ScriptThread};
|
||||
use script_thread::{Runnable, ScriptThread};
|
||||
use task_source::TaskSource;
|
||||
use task_source::dom_manipulation::DOMManipulationTask;
|
||||
use url::Url;
|
||||
|
@ -161,7 +161,7 @@ impl Storage {
|
|||
let global_ref = global_root.r();
|
||||
let task_source = global_ref.as_window().dom_manipulation_task_source();
|
||||
let trusted_storage = Trusted::new(self);
|
||||
task_source.queue(DOMManipulationTask::SendStorageNotification(
|
||||
task_source.queue(DOMManipulationTask::Runnable(
|
||||
box StorageEventRunnable::new(trusted_storage, key, old_value, new_value))).unwrap();
|
||||
}
|
||||
}
|
||||
|
@ -180,8 +180,8 @@ impl StorageEventRunnable {
|
|||
}
|
||||
}
|
||||
|
||||
impl MainThreadRunnable for StorageEventRunnable {
|
||||
fn handler(self: Box<StorageEventRunnable>, script_thread: &ScriptThread) {
|
||||
impl Runnable for StorageEventRunnable {
|
||||
fn main_thread_handler(self: Box<StorageEventRunnable>, script_thread: &ScriptThread) {
|
||||
let this = *self;
|
||||
let storage_root = this.element.root();
|
||||
let storage = storage_root.r();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue