Commit graph

21 commits

Author SHA1 Message Date
Josh Matthews
c94d909a86
script: Limit public exports. (#34915)
* script: Restrict reexport visibility of DOM types.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

* script: Mass pub->pub(crate) conversion.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

* script: Hide existing dead code warnings.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

* Formatting.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

* Fix clippy warnings.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

* Formatting.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

* Fix unit tests.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

* Fix clippy.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

* More formatting.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

---------

Signed-off-by: Josh Matthews <josh@joshmatthews.net>
2025-01-10 08:19:19 +00:00
Ali
ed6b1b5e6a
clippy: Fix suggestions in script, libservo, and servoshell (#33453)
* fix clone on copy warning in servoshell

Signed-off-by: Ali Zein Yousuf <azy5030@gmail.com>

* Remove unecessary borrow in libservo

Signed-off-by: Ali Zein Yousuf <azy5030@gmail.com>

* Ignore too many arguments warning on create_constellation()

Signed-off-by: Ali Zein Yousuf <azy5030@gmail.com>

* fix explicit auto-deref warning

Signed-off-by: Ali Zein Yousuf <azy5030@gmail.com>

* Autofix multiple clippy warnings in components/script

Signed-off-by: Ali Zein Yousuf <azy5030@gmail.com>

---------

Signed-off-by: Ali Zein Yousuf <azy5030@gmail.com>
2024-09-14 08:41:13 +00:00
Martin Robinson
3398fc017b
Move non-gfx things out of gfx_traits and create a base crate (#32296)
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`.
2024-05-17 12:28:58 +00:00
Gregory Terzian
1d66ea2b27
script: Start rework to better match the specification HTML event loop (#31505)
* 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>
2024-05-13 09:23:03 +00:00
Rosemary Ajayi
058319aa0b
clippy: Fix some clippy problems in components/script (#31778)
* 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
2024-03-20 18:41:07 +00:00
Richard Dushime
01ca220f83
clippy: Fix many warnings in components/script (#31717)
* Fix Several clippy warnings

* Fix Build errors

* Fix Unused import

* Fix requested changes

* Fix rustfmt

* Minor fixes

---------

Co-authored-by: Martin Robinson <mrobinson@igalia.com>
2024-03-19 16:05:56 +00:00
Martin Robinson
5c1723c983
rustdoc: Fix many rustdoc errors (#31147)
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.
2024-01-22 13:13:48 +00:00
Martin Robinson
8de4629a3c
Remove usage of drain_filter (#30742)
This is a step on the way toward supporting stable rust.
2023-11-17 10:28:33 +00:00
Samson
aad2dccc9c
Strict import formatting (grouping and granularity) (#30325)
* strict imports formatting

* Reformat all imports
2023-09-11 19:16:54 +00:00
Gregory Terzian
ecfb9c639a in BC event-loop, only run tasks related to fully-active documents 2019-03-06 14:18:18 +08:00
Jan Andre Ikenmeyer
a1a14459c1
Update MPL license to https (part 3) 2018-11-19 14:47:12 +01:00
Bastien Orivel
9a7eeb349a Update crossbeam-channel to 0.3 2018-11-18 19:33:19 +01:00
Simon Sapin
2012be4a8b cargo fix --edition-idioms 2018-11-08 09:28:00 +01:00
Pyfisch
9e92eb205a Reorder imports 2018-11-06 22:35:07 +01:00
Pyfisch
cb07debcb6 Format remaining files 2018-11-06 22:30:31 +01:00
Simon Sapin
76e59a46d3 Sort use statements 2018-11-06 15:26:02 +01:00
Simon Sapin
45f7199eee cargo fix --edition 2018-11-06 15:26:02 +01:00
chansuke
c37a345dc9 Format script component 2018-09-19 17:40:47 -04:00
Simon Sapin
2a996fbc8f Replace mpsc with crossbeam/servo channel, update ipc-channel
Co-authored-by: Gregory Terzian <gterzian@users.noreply.github.com>
2018-09-12 13:33:32 +08:00
Agustin Chiappe Berrini
e286fdcc53 Add the TaskSourceName to CommonScriptMsg::Task
Update QueuedTaskConversion and the TaskQueue to use it
2018-09-04 09:17:11 -04:00
Gregory Terzian
ca6306c430 introduce task-queues, and throttling the performance-timeline task-source, in script and worker threads.
queue
2018-08-31 02:10:34 +08:00