aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/task_source
Commit message (Collapse)AuthorAgeFilesLines
* Move non-gfx things out of `gfx_traits` and create a `base` crate (#32296)Martin Robinson2024-05-1713-13/+13
| | | | | | | | | | | | | | | | | | | | | | | 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`.
* script: Start rework to better match the specification HTML event loop (#31505)Gregory Terzian2024-05-132-0/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Fix the HTML event-loop: add a update the rendering task add rendering task source sketch structure to update the rendering resize steps composition events fix warnings in rendering task source refactor handling of composition events: put window and doc for pipeline on top set script as user interacting in update the rendering task fmt add todos for other steps, put all compositor handling logic in one place update the rendering: evaluate media queries and report changes update the rendering: update animations and send events update the rendering: run animation frames update the rendering: order docs put rendering related info on documents map tidy update the rendering: add issue numbers to todos update the rendering: reflow as last step update the rendering: add todo for top layer removals note rendering opportunity when ticking animations for testing fix double borrow crash in css/basic-transition fix faster reversing of transitions test undo ordering of docs bypass not fully-active pipeline task throttling for rendering tasks ensure tasks are dequed from task queue prioritize update the rendering task remove servo media stuff from set activity tidy debug update the rendering: perform microtask checkpoint after task tidy-up only run evaluate media queries if resized re-add evaluation of media queries for each rendering task, re-prioritize rendering tasks, re-add microtask checkpoint for all sequential messages re-structure resize steps, and their interaction with evaluating media queries and reacting to environment changes update the rendering: remove reflow call at the end update webmessaging expectations update to FAIL /html/browsers/browsing-the-web/navigating-across-documents/initial-empty-document/load-pageshow-events-iframe-contentWindow.html update to FAIL load-pageshow-events-window-open.html add issue number for ordering of docs nits move batching of mouse move event to document info nits add doc for mouse move event index reset mouse move event index when taking pending compositor events fix replacing mouse move event nits * move update the rendering related data to document * move re-taking of tasks to try_recv * address nits * change task queue try_recv into take_tasks_and_recv, with nits * refactor process_pending_compositor_events * when updating the rendering, return early if script cannot continue running * use an instant for the last render opportunity time * nits * remove handle_tick_all_animations * use a vec for pending resize and compositor events * fix spec links * Fix a few other nits before landing --------- Co-authored-by: Martin Robinson <mrobinson@igalia.com>
* 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-209-9/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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
* Implement non-XR Gamepad discovery and input (#31200)Daniel Adams2024-02-172-0/+50
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Create embedder event to send to constellation * Handle gamepad message in constellation, send to script thread * Handle GamepadEvent in script thread and dispatch event to document * Add missing Clones, fix event * Add gamepad task source * Adjust GamepadIndex type, remove unused imports * Add internal getter for gamepads list * Update gamepad new methods * Handle gamepad connect and disconnect events * Proto will be none, no need for HandleObject * Initialize buttons and axes to standard mapping * Adjust update type index types * Update GamepadButton update function * Adjust Gamepad mapping comments to match spec, add update logic * Amend comment * Update button and axis inputs on Updated event * Add GilRs as gamepad backend in servoshell * Add spec links, queue gamepad updates on task source * ./mach fmt * Fix comment length * Split out button init, update spec comments * Move gamepad event handling from document to global * Map and normalize axes/button values * Use std::time for gamepad timestamp * Adjust gamepad handling in event loop * Move button press/touch check into map+normalize function - Small change but is more in line with spec * ./mach fmt * Update comment spec links and warning messages * Doc comments -> regular comments * Add window event handlers for gamepad connect/disconnect * Adjust gamepad disconnect behavior * Add missing TODO's, adjust gamepad/gamepadbutton list methods and formatting * Update button handling from gilrs, add comments * Enable gamepad pref during WPT tests and update expectations * Update WPT expectations in meta-legacy-layout
* rustdoc: Fix many rustdoc errors (#31147)Martin Robinson2024-01-221-1/+1
| | | | This fixes many rustdoc errors that occur due to raw URLs in rustdoc comments as well as unescaped Rust code that should be in backticks.
* Strict import formatting (grouping and granularity) (#30325)Samson2023-09-1112-29/+48
| | | | | * strict imports formatting * Reformat all imports
* No tracing of nop traceable fields (#29926)Samson2023-08-0411-11/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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
* remove unnecessary thread in filereader, add stream TODOGregory Terzian2019-12-101-2/+1
|
* impl timer-task-source, dedicated time-out mechanism for service-workerGregory Terzian2019-11-192-0/+44
|
* continue messageport, transferable, postmessage optionsGregory Terzian2019-10-191-6/+2
|
* begin messageport, transferable objects, implKeith Yeung2019-10-192-0/+47
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Accept transfer argument for StructuredCloneData::write Allow structured clone reads to return a boolean Add Transferable trait Add basic skeletons to MessagePort Implement transfer and transfer-receiving steps on MessagePort Use transfer and transfer_receive in StructuredClone callbacks Implement MessageChannel Freeze the array object for the MessageEvent ports attribute Implement transfer argument on window.postMessage Use ReentrantMutex instead for MessagePortInternal Accept origin as a parameter in dispatch_jsval Fix BorrowMut crash with pending_port_message Detach port on closure and check for detached during transfer Enable webmessaging tests fix webidl fix
* Update MPL license to https (part 3)Jan Andre Ikenmeyer2018-11-1910-10/+10
|
* Update crossbeam-channel to 0.3Bastien Orivel2018-11-183-3/+3
|
* Unify the task source and task canceller APIAgustin Chiappe Berrini2018-11-141-17/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | I moved away from the `Window` struct all the logic to handle task sources, into a new struct called `TaskManager`. In a happy world, I'd be able to just have there two functions, of the types: ```rust fn task_source<T: TaskSource>(&self, name: TaskSourceName) -> Box<T> fn task_source_with_canceller<T: TaskSource>(&self, name: TaskSourceName) -> (Box<T>, TaskSourceCanceller) ``` And not so much duplicated code. However, because TaskSource can't be a trait object (because it has generic type parameters), that's not possible. Instead, I decided to reduce duplicated logic through macros. For reasons[1], I have to pass both the name of the function with canceller and the name of the function without, as I'm not able to concatenate them in the macro itself. I could probably use `concat_idents` to create both types already defined and reduce the amount of arguments by one, but that macro is nightly only. At the same time, not being able to declare macros inside `impl` forces me to pass `self` as an argument. All this makes this solution more verbose than it would be ideally. It does reduce duplication, but it doesn't reduce the size of the file. [1](https://github.com/rust-lang/rust/issues/29599)
* Implement TaskSource for HistoryTraversalAgustin Chiappe Berrini2018-11-131-5/+25
| | | | | And remove the method in window that returns it, because it isn't used so far.
* `cargo fix --edition-idioms`Simon Sapin2018-11-087-7/+7
|
* Reorder importsPyfisch2018-11-062-3/+3
|
* Sort `use` statementsSimon Sapin2018-11-069-18/+18
|
* `cargo fix --edition`Simon Sapin2018-11-0610-49/+49
|
* 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
* Add task source for media elementchansuke2018-10-102-0/+53
|
* Format script componentchansuke2018-09-199-63/+41
|
* Replace mpsc with crossbeam/servo channel, update ipc-channelSimon Sapin2018-09-123-3/+3
| | | | Co-authored-by: Gregory Terzian <gterzian@users.noreply.github.com>
* Add Websocket task sourceAgustin Chiappe Berrini2018-09-082-1/+40
| | | | | | | | According to the doc: https://html.spec.whatwg.org/multipage/web-sockets.html#network The task source for all tasks queued in the websocket section are the websocket task source, so this commit also updates those references to use the appropriate one.
* Add the TaskSourceName to CommonScriptMsg::TaskAgustin Chiappe Berrini2018-09-047-5/+12
| | | | Update QueuedTaskConversion and the TaskQueue to use it
* use remote-event task source in EventSourceGregory Terzian2018-07-132-1/+39
|
* introduce "per task source" ignoring of tasksGregory Terzian2018-07-106-6/+41
|
* added pipelines to all task sourcesddh2017-10-255-14/+19
| | | | changed task sources to accept pipeline ids
* added time to interactive metrics, refactored metrics to use traitsddh2017-10-245-1/+7
| | | | changed task macro to take pipeline info
* Remove use of unstable box syntax.Simon Sapin2017-10-166-7/+7
| | | | | | | | | | | | | | | | | | | | 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-206-35/+38
| | | | | Having both TaskBox and TaskOnce allows us to remove the superfluous inner boxing from CancellableTask<T>.
* Rename Task to TaskBoxAnthony Ramine2017-09-206-16/+16
|
* Make Task require SendAnthony Ramine2017-09-206-8/+11
|
* Use task! to notify performance observersAnthony Ramine2017-09-181-21/+7
|
* Move Task to its own moduleAnthony Ramine2017-09-186-6/+8
|
* 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
|
* Remove FileReadingRunnableAnthony Ramine2017-09-161-15/+3
|
* Rename Runnable to TaskAnthony Ramine2017-09-166-70/+83
| | | | | | | | | | | | 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-082-10/+16
|
* Kill UserInteractionTaskAnthony Ramine2017-09-081-17/+7
| | | | Just use a bare Runnable value.
* Kill DOMManipulationTaskAnthony Ramine2017-09-081-17/+7
| | | | Just use a bare Runnable value.
* Kill Runnable::is_cancelled ⚔️Anthony Ramine2017-09-072-6/+2
|
* Make Performance Timeline API work in WorkersFernando Jiménez Moreno2017-09-051-26/+38
|
* order derivable traits listsClément DAVID2017-08-233-3/+3
| | | | | | Ignoring : - **generated**.rs - python/tidy/servo_tidy_tests/rust_tidy.rs
* Performance Timeline APIFernando Jiménez Moreno2017-08-172-0/+59
|
* Added Debug implementations.Alan Jeffrey2017-06-132-0/+26
|
* Properly implement TaskSource for NetworkingTaskSourceKeith Yeung2016-11-111-9/+22
|
* Update to string-cache 0.3Simon Sapin2016-11-032-2/+2
|