Commit Graph

7 Commits

Author SHA1 Message Date
Jonathan Schwender
4b2e8c38d1 script bindings: Fix warning about unused span. (#42850)
The span needs to be assigned to a variable, so that it drops at the end
of scope.
This was introduced in #42715. 
Additionally also switch tho the profile_traits macro to simplify the
statement.

Testing: Manually verified the warning is fixed.

Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
2026-02-25 18:30:40 +00:00
Sam
6c334f2811 script: Replace RAII of CallSetup and AutoEntryScript with a function wrapper (#42715)
As mentioned in #40600 we will need this to properly handle &mut
JSContext (we cannot pass it to drop) and I think this wrappers are
preferred ways of doing this in rust as it is safe to forget (not call
drop) which is unsound in this case (due to realm stack at least).

Revieable per commits.

Testing: Just a refactor, but should be covered by WPT

---------

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
2026-02-25 09:13:18 +00:00
Sam
3e2f14c455 script: Pass down &mut JSContext in servoparser and event loop. (#42635)
I only wanted to get `&mut JSContext` in microtask chunk and checkpoint,
but this in turn needed `&mut JSContext` in servoparser, which then
caused need for even more changes in script.

I tried to limit the size by putting some `temp_cx` in:
- drops of `LoadBlocker`, `GenericAutoEntryScript`
- methods of `VirtualMethods`
- methods of `FetchResponseListener`

Testing: Just refactor, but should be covered by WPT tests.
Part of #40600

---------

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
2026-02-25 07:14:23 +00:00
WaterWhisperer
2a759ed6de Replace allow(crown::unrooted_must_root) with expect(crown::unrooted_must_root) (#41815)
Testing: `./mach build -d --use-crown` with no warnings
Fixes: #41761

Signed-off-by: WaterWhisperer <waterwhisperer24@qq.com>
2026-01-10 08:05:49 +00:00
WaterWhisperer
241bff962d Change some #[allow]s to #[expect]s (#40458)
Removes some unneeded lints.

Testing: Refactor
Part of: #40383

Signed-off-by: WaterWhisperer <waterwhisperer24@qq.com>
2025-11-06 12:31:48 +00:00
Simon Wülker
785e7e51ab script: Prepare to run script and callback before invoking CE constructor (#39013)
Additionally, this change adjusts the step numbers around the code
because they were outdated.

Testing: ???
Fixes https://github.com/servo/servo/issues/39004
Probably fixes https://github.com/servo/servo/issues/32977

---------

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
2025-10-23 03:16:30 +00:00
Josh Matthews
b4079b3ff3 Move generated bindings to script_bindings (#36323)
This is the final step of #1799, where the majority of the generated
code for the JS bindings is now compiled as part of the script_bindings
build step. The remaining pieces in script must live there because they
refer to concrete DOM types; all code in script_bindings is generic over
the
[DomTypes](https://doc.servo.org/script/dom/bindings/codegen/DomTypes/trait.DomTypes.html)
trait.

My testing with incremental builds shows me a 12 second reduction in
build times on my 2024 M4 Macbook Pro when modifying code in the script
crate after these changes. Before this PR those changes took 20 seconds
to rebuild Servo, and now they take 8 seconds.

Testing: Existing WPT tests ensure no regressions.
Fixes: #1799

---------

Signed-off-by: Josh Matthews <josh@joshmatthews.net>
2025-04-04 06:45:08 +00:00