aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/task_source/dom_manipulation.rs
Commit message (Collapse)AuthorAgeFilesLines
* script: Eliminate code duplication in the task queue (#34798)Martin Robinson2025-01-011-76/+0
| | | | | | | | | | | | | | | | Instead of creating a type for each `TaskSource` variety have each `TaskSource` hold the same kind of sender (this was inconsistent before, but each sender was effectively the same trait object), a pipeline, and a `TaskSourceName`. This elminates the need to reimplement the same queuing code for every task source. In addition, have workers hold their own `TaskManager`. This allows just exposing the manager on the `GlobalScope`. Currently the `TaskCanceller` is different, but this will also be eliminated in a followup change. This is a the first step toward having a shared set of `Sender`s on `GlobalScope`. Signed-off-by: Martin Robinson <mrobinson@igalia.com>
* script: Refactor channels in `ScriptThread` into receivers and senders (#34776)Martin Robinson2024-12-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Create two new data structures in the `script` crate to hold senders and receiver: - `ScriptThreadSenders`: holds all outgoing channels from the `ScriptThread` including a channel to the `ScriptThread` itself. The ultimate goal with this is to reduce duplication by giving a boxed version of this this to `Window`s. - `ScriptThradReceivers`: holds all incoming channels to the `ScriptThread`. This isn't cloenable like the senders. This is used to abstract away `recv()` and `try_recv()` methods used to make the `ScriptThread` event loop easier to read. In addition: - The many duplicated `ScriptThread` self-senders for the `TaskManager` have been removed and, in general, a lot of boilerplate is removed as well. - Visibilty of all methods affected by this change is changed to `pub(crate)` in order to take advantage of dead code detection. Some dead code produced from macros is removed. - Some conversion code is refactord into implementations of the `From` trait. - The names of channels uses a standard "sender" and "receiver" naming as well as trying to be descriptive of where they go in `ScriptThread` as well as `InitialScriptState` Signed-off-by: Martin Robinson <mrobinson@igalia.com>
* Move non-gfx things out of `gfx_traits` and create a `base` crate (#32296)Martin Robinson2024-05-171-1/+1
| | | | | | | | | | | | | | | | | | | | | | | For a long time, `gfx_traits` has held a lot of things unrelated to graphics and also unrelated to the `gfx` crate (which is mostly about fonts). This is a cleanup which does a few things: 1. Move non `gfx` crate things out of `gfx_traits`. This is important in order to prevent dependency cycles with a different integration between layout, script, and fonts. 2. Rename the `msg` crate to `base`. It didn't really contain anything to do with messages and instead mostly holds ids, which are used across many different crates in Servo. This new crate will hold the *rare* data types that are widely used. Details: - All BackgroundHangMonitor-related things from base to a new `background_hang_monitor_api` crate. - Moved `TraversalDirection` to `script_traits` - Moved `Epoch`-related things from `gfx_traits` to `base`. - Moved `PrintTree` to base. This should be widely useful in Servo. - Moved `WebrenderApi` from `base` to `webrender_traits` and renamed it to `WebRenderFontApi`.
* clippy: Fix redundant field names warnings (#31793)Oluwatobi Sofela2024-03-201-4/+4
|
* clippy: Fix some clippy problems in `components/script` (#31778)Rosemary Ajayi2024-03-201-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * fix clippy problems in stylesheet * fix clippy problems in task_manager * fix clippy problems in task_queue * fix clippy problems in task_queue * fix clippy problems in file_reading * fix clippy problems in dom_manipulation * fix clippy problems in gamepad * fix clippy problems in networking * fix clippy problems in performance * fix clippy problems in port_message * fix clippy problems in port_message * fix clippy problems in timer * fix clippy problems in stylesheet * fix clippy problems * fix clippy problems * fix clippy problems
* Strict import formatting (grouping and granularity) (#30325)Samson2023-09-111-4/+6
| | | | | * strict imports formatting * Reformat all imports
* No tracing of nop traceable fields (#29926)Samson2023-08-041-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add `no_trace` option to JSTraceable derive * NoTrace wrapper * Port some types to no_trace schematics * Fixing my unsafe mistakes (not tracing traceables) * Add docs & safety guards for no_trace Safety guards (trait shenanigans) guarantees safety usage of `no_trace` * Port canvas_traits to no_trace * Port servo_media to no_trace * Port net_traits to no_trace * Port style to no_trace * Port webgpu to no_trace * Port script_traits to no_trace * Port canvas_traits, devtools_traits, embedder_traits, profile_traits to no_trace * unrooted_must_root lint in seperate file * Add trace_in_no_trace_lint as script_plugin * Composable types in must_not_have_traceable * Introduced HashMapTracedValues wrapper * `HashMap<NoTrace<K>,V>`->`HashMapTracedValues<K,V>` * Port rest of servo's types to no_trace * Port html5ever, euclid, mime and http to no_trace * Port remaining externals to no_trace * Port webxr and Arc<Mutex<_>> * Fix spelling in notrace doc
* Update MPL license to https (part 3)Jan Andre Ikenmeyer2018-11-191-1/+1
|
* `cargo fix --edition-idioms`Simon Sapin2018-11-081-1/+1
|
* Sort `use` statementsSimon Sapin2018-11-061-3/+3
|
* `cargo fix --edition`Simon Sapin2018-11-061-8/+8
|
* Make first argument of DOMManipulationTaskSource as a Box<ScriptChan +CYBAI2018-10-181-8/+13
| | | | | | | | | | | Send> We don't have `window` for `workers`. So, if we use `global.as_window()` to get the DOMManipulationTaskSource, it will make worker panic. Instead, we should get the DOMManipulationTaskSource from each own thread. Ref: https://github.com/servo/servo/pull/20755#discussion_r193557746
* Format script componentchansuke2018-09-191-11/+9
|
* Replace mpsc with crossbeam/servo channel, update ipc-channelSimon Sapin2018-09-121-1/+1
| | | | Co-authored-by: Gregory Terzian <gterzian@users.noreply.github.com>
* Add the TaskSourceName to CommonScriptMsg::TaskAgustin Chiappe Berrini2018-09-041-2/+3
| | | | Update QueuedTaskConversion and the TaskQueue to use it
* introduce "per task source" ignoring of tasksGregory Terzian2018-07-101-1/+3
|
* added pipelines to all task sourcesddh2017-10-251-2/+3
| | | | changed task sources to accept pipeline ids
* added time to interactive metrics, refactored metrics to use traitsddh2017-10-241-0/+1
| | | | changed task macro to take pipeline info
* Remove use of unstable box syntax.Simon Sapin2017-10-161-1/+1
| | | | | | | | | | | | | | | | | | | | http://www.robohornet.org gives a score of 101.36 on master, and 102.68 with this PR. The latter is slightly better, but probably within noise level. So it looks like this PR does not affect DOM performance. This is expected since `Box::new` is defined as: ```rust impl<T> Box<T> { #[inline(always)] pub fn new(x: T) -> Box<T> { box x } } ``` With inlining, it should compile to the same as box syntax.
* Introduce TaskOnceAnthony Ramine2017-09-201-6/+6
| | | | | Having both TaskBox and TaskOnce allows us to remove the superfluous inner boxing from CancellableTask<T>.
* Rename Task to TaskBoxAnthony Ramine2017-09-201-2/+2
|
* Make Task require SendAnthony Ramine2017-09-201-1/+1
|
* Move Task to its own moduleAnthony Ramine2017-09-181-1/+2
|
* Introduce MainThreadScriptMsg::DispatchJobQueueAnthony Ramine2017-09-171-16/+0
| | | | This removes the last remaining use of Task::run_with_script_thread
* Send AsyncJobHandler as a MainThreadTaskAnthony Ramine2017-09-161-0/+16
|
* Rename Runnable to TaskAnthony Ramine2017-09-161-14/+10
| | | | | | | | | | | | The changes are: * `*Runnable` -> `*Task`; * `RunnableMsg` -> `Task`; * `RunnableWrapper` -> `TaskCanceller`; * `MainThreadRunnable` -> `MainThreadTask`; * `wrap_runnable` -> `wrap_task`; * `get_runnable_wrapper` -> `task_canceller`; * `handler` -> `run`; * `main_thread_handler` -> `run_with_script_thread`.
* Reformat some task-related functionsAnthony Ramine2017-09-081-5/+8
|
* Kill DOMManipulationTaskAnthony Ramine2017-09-081-17/+7
| | | | Just use a bare Runnable value.
* Kill Runnable::is_cancelled ⚔️Anthony Ramine2017-09-071-3/+1
|
* order derivable traits listsClément DAVID2017-08-231-1/+1
| | | | | | Ignoring : - **generated**.rs - python/tidy/servo_tidy_tests/rust_tidy.rs
* Added Debug implementations.Alan Jeffrey2017-06-131-0/+13
|
* Update to string-cache 0.3Simon Sapin2016-11-031-1/+1
|
* Make TaskSource::queue take a &GlobalScopeAnthony Ramine2016-10-061-3/+3
|
* Make task queue API usable from non-main threads.Josh Matthews2016-07-141-5/+10
|
* Move boxing to runnable initializationConnor Brewster2016-07-131-3/+3
|
* Make all task source runnables cancellableConnor Brewster2016-07-131-8/+11
| | | | Implement all Runnable methods on CancellableRunnable to redirect to their inner runnable
* Add event runnablesConnor Brewster2016-07-111-29/+16
| | | | Make tasks a wrapper over runnables
* Combined DOMManipulationTask runnable variants into a single variantConnor Brewster2016-07-061-18/+8
|
* Add Miscellaneous event type to DOM task sourceManish Goregaokar2016-07-051-2/+4
|
* Derive Clone for DOMManipulationTaskSource, UserInteractionTaskSource.Ms2ger2016-06-031-5/+1
|
* Clean up DOMManipulationTaskSourceKeith Yeung2016-06-021-6/+22
|
* Implement user interaction task sourceKeith Yeung2016-05-111-1/+3
|
* Rename DOM manipulation messages to tasksKeith Yeung2016-05-041-1/+1
|
* Add media tasks to the DOM manipulation task queue.Josh Matthews2016-05-031-0/+3
|
* change changes effecting verbosityfaineance2016-03-271-2/+1
|
* use self.0 instead of destructing single item tuple structsfaineance2016-03-271-3/+2
|
* Add task_source directoryKeith Yeung2016-03-101-0/+63
Use DOMManipulationTaskSource whenever possible