- `PauseActor` is passed as a generic for only `new_name`
- Update the variable `pause` to `pause_name`
**Testing**: Tested locally with `mach test-devtools`
```
Ran 60 tests in 74.781s
OK (expected failures=6)
```
**Fixes**: A part of #43606
Signed-off-by: Niya Gupta <niyabits@disroot.org>
Co-authored-by: Niya Gupta <niyabits@disroot.org>
Renamed FrameActor variable names to match standards in thread & lib.rs
Testing: No testing required.
Fixes: Part of #43606
Signed-off-by: Sabb <sarafaabbas@gmail.com>
Renamed ThreadConfigurationActor variable names in watcher.rs.
Testing: No testing required.
Fixes: Part of #43606
Signed-off-by: Sabb <sarafaabbas@gmail.com>
Renamed InspectorActor variable names in browsing_context, inspector &
lib.rs
Testing: No testing required.
Fixes: Part of #43606
Signed-off-by: Sabb <sarafaabbas@gmail.com>
Renamed CssPropertiesActor variable names in browsing_context
Testing: No testing required.
Fixes: Part of #43606
Signed-off-by: Sabb <sarafaabbas@gmail.com>
Renamed HighlighterActor variable names in inspector.rs.
Testing: No testing required
Fixes: Part of #43606
Signed-off-by: Sabb <sarafaabbas@gmail.com>
Renamed LayoutInspectorActor variable names in walker.rs
Testing: No testing required
Fixes: Part of #43606
Signed-off-by: Sabb <sarafaabbas@gmail.com>
Renamed AccessibilityActor variable names in browsing_context
Testing: No testing required
Fixes: Part of #43606
Signed-off-by: Sabb <sarafaabbas@gmail.com>
Renamed StyleSheetsActor variable names in browsing_context
Testing: Ran `./mach test-devtools` locally.
Fixes: Part of #43606
---------
Signed-off-by: Sabb <sarafaabbas@gmail.com>
Renamed NetworkEventActor variables in network_handler & lib.rs
Testing: No testing required
Fixes: Part of #43606
Signed-off-by: Sabb <sarafaabbas@gmail.com>
Renamed BrowsingContext in tab, network_event, watcher actors & lib.rs
Testing: No testing required - only renaming done
Fixes: Part o #43606
Signed-off-by: Sabb <sarafaabbas@gmail.com>
The WebIDLs for values were duplicated in PropertyDescriptor and
EvalResultValue, with duplicated handlers across the code.
General cleanup of how debugger values are passed from debugger.js and
how the conversion from JS and to JSON happens.
There shouldn't be a behaviour change.
Testing: Existing devtools tests and manual testing
Part of: #36027
---------
Signed-off-by: eri <eri@igalia.com>
Co-authored-by: atbrakhi <atbrakhi@igalia.com>
Renamed WorkerActor variables in watcher, console, root and lib.rs
Testing: No testing required
Fixes: Part of #43606
Signed-off-by: Sabb <sarafaabbas@gmail.com>
This update makes service workers properly show up in DevTools and
behave more like dedicated workers.
- Added an is_service_worker field to DevtoolsPageInfo so the devtools
server can tell service workers apart from dedicated workers
- Triggered a NewGlobal message when a service worker is created in
serviceworker_manager.rs, similar to what already happens for dedicated
workers
- Routed service workers to root.service_workers so they appear under
"Service Workers" in about:debugging instead of "Other Workers"
- Implemented listServiceWorkerRegistrations with the expected response
format (activeWorker, installingWorker, waitingWorker, evaluatingWorker)
to match Firefox’s LegacyServiceWorkersWatcher
- Added support for getPushSubscription in WorkerActor, currently
returning subscription: null
Enabled the service_worker target type in the watcher’s SessionContext
and handled watchTargets("service_worker")
Testing
Start Servo with:
`RUST_LOG="error,devtools=debug" ./mach run --
--pref=dom_serviceworker_enabled --devtools=6080
"https://mdn.github.io/dom-examples/service-worker/simple-service-worker/"
`
In Firefox, go to about:debugging and connect to localhost:6080
Confirm the service worker shows up under "Service Workers"
Fixes#43574
---------
Signed-off-by: CynthiaOketch <cynthiaoketch6@gmail.com>
Rename page_style in inspector .
Testing: ran `./mach test-devtools`.
Fixes: Part of #43606
Signed-off-by: Jayanta Pradhan <pradhanjayanta91@gmail.com>
Introduces a new type `DevtoolsConnection`, which implements the
`JsonPacketStream` trait with proper coordination of I/O across threads.
This replaces the implementation of `JsonPacketStream` for raw
`TcpStream`s, which was susceptible to interleaving writes when cloned
across threads.
`DevtoolsConnection` also defensively synchronizes read operations.
These are less likely to cause issues: in practice actors should never
independently pull incoming messages without centralized coordination.
Testing: No new tests, as interleaving writes are difficult to evoke
deterministically. Removing the `JsonPacketStream` implementation for
`TcpStream` should discourage regressions due to improper use of raw
streams.
---------
Signed-off-by: Brent Schroeter <contact@brentsch.com>
Co-authored-by: eri <eri@igalia.com>
Rename `DeviceActor` local variable in `root.rs` from `device` to
`device_actor` for naming consistency across the devtools crate.
This follows the convention discussed in #43557:
- `{}_actor` for variables holding the actor
- `{}_name` for variables holding the actor name string
The `device_actor` field in the `GlobalActors` struct was not renamed,
as it is part of a `#[derive(Serialize)]` struct used for devtools
message serialization.
Testing: `./mach test-devtools` all 60 tests pass (6 expected failures).
One unrelated flaky test
(`test_breakpoint_at_invalid_entry_point_does_not_crash`) occasionally
fails due to a race condition tracked separately. opened an isssue for
it at #43667
fixes part of #43606
Signed-off-by: staysafe020 <jambongralpher@gmail.com>
Renamed TabDescriptorActor variable names in browsing_context, root &
target_configuration
Cleaned up a few more names as suggested by eerii
Testing: No testing required
Fixes: Part of #43606
Signed-off-by: Sabb <sarafaabbas@gmail.com>
Rename NetworkParent in watcher actors.
Testing: ran `./mach test-devtools`.
Fixes: Part of #43606
---------
Signed-off-by: Jayanta Pradhan <pradhanjayanta91@gmail.com>
Rename console_actor and console in actors.
Testing: ran `./mach test-devtools`.
Fixes: Part of #43606
---------
Signed-off-by: Jayanta Pradhan <pradhanjayanta91@gmail.com>
Renamed ReflowActor in browsing_context actor.
Testing: `./mach test-devtools`, All test passed.
Fixes: Part of #43606
Signed-off-by: arabson99 <arabiusman99@gmail.com>
Refactored the lib.rs file to replace ``actors``` & ```self.actors```
variables with ```registry``` and ```self.registry```
No testing required, compiles successfully.
Part o the #43605
---------
Signed-off-by: Sabb <sarafaabbas@gmail.com>
Renamed actors to registry in source, node, & network_handler.
Testing: No tests were required, however compilation was successful
Part of #43605
Signed-off-by: Sabb <sarafaabbas@gmail.com>
Renamed BrowsingContext in breakpoint, console & thread actors
Testing: No testing required.
Fixes: Part of #43606
Signed-off-by: Sabb <sarafaabbas@gmail.com>
Renamed `actors` to `registry` in `actors/tab.rs`, `actors/watcher.rs`
and `actors/browsing_context.rs`.
Testing: No tests were required, however compilation was successful
Part of: #43605
Signed-off-by: Sabb <sarafaabbas@gmail.com>
Follow up of #43526. This addresses Nico's comment:
https://github.com/servo/servo/pull/43526#issuecomment-4104953308
- `bluetooth_traits` -> `servo_bluetooth_traits`
- `base` -> `servo_base`
- `bluetooth` -> `servo_bluetooth`
- `background_hang_monitor` -> `servo_background_hang_monitor`
Testing: This should not change any behaviour.
---------
Signed-off-by: Euclid Ye <yezhizhenjiakang@gmail.com>
Previously arrays were falling back to Object previewer which was
showing indices as properties- which was not correct. This PR implements
dedicated `ArrayPreviewer` that follows Firefox's `ArrayLike` pattern.
Currently array preview support only length display, it does not
implement showing array items yet.
Now(Correct and follows Firefox pattern, Array items coming in a
follow-up PR):
<img width="510" height="167" alt="image"
src="https://github.com/user-attachments/assets/a51f04d4-333c-4d7c-8159-18121c967670"
/>
Before(We shouldn't see these values- it's incorrect):
<img width="1294" height="721" alt="image"
src="https://github.com/user-attachments/assets/2218a622-c791-4436-958e-1a5553de7864"
/>
Testing: Current tests are passing.
Fixes: Part of #36027
Signed-off-by: atbrakhi <atbrakhi@igalia.com>
This fixes a warning of `cargo publish`:
```
warning: manifest has no description, documentation, homepage or repository
```
Testing: Compiling. Manual testing of `cargo publish --dry-run` (with
some additional patches, and until the next error, shows this warning
has been fixed)
Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
Implement `PropertyIteratorActor` boilerplate
This is prerequisite for implementing object property enumeration in the
debugger. It is part of popup preview work in debugger.
Testing: Should not change behavior
Fixes: part of #36027
Signed-off-by: atbrakhi <atbrakhi@igalia.com>
This change implements showing scope variable in Debugger tab. This is
still early and we have more work to do.
Next step is building correct data structure and showing different types
of variables.
Testing: Manual as well as current tests are passing.
Fixes: part of #36027
Signed-off-by: atbrakhi <atbrakhi@igalia.com>
Co-authored-by: eri <eri@igalia.com>
In order to prepare for publishing this PR does the following steps (see
commits):
- Move all `path` dependencies to the workspace Cargo.toml, and
reference that.
- Move all path dependencies in the workspace Cargo.toml into a
dedicated section, to make bumping version numbers easier later.
- Add the version requirement. Note that we currently only version bump
servoshell. There was agreement to version everything with the same
version as servoshell, but that be done in a follow-up. The diff is
already large enough as is.
- Add a tidy lint to catch `path` usages outside the root Cargo.toml. I
switched to [`tomllib`] (which was added to the python stdlib in 3.11),
since the third-party `toml` library failed to parse Cargo.toml files
with `workspace.version` (did not like the `.` in a `key`).
[`tomllib`]: https://docs.python.org/3/library/tomllib.html
Testing: Should be covered by regular CI testing.
---------
Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
`reply_unchecked` was added in #42007 since `getEnvironment` from the
frame actor has a `type` field but it already counts as a final reply,
unlike every other message like it. Since it is only used there, we can
revert the `reply_unchecked` change and use the new `mark_handled`
instead.
Depends on: #43230
Testing: DevTools tests
Signed-off-by: eri <eri@igalia.com>
Some Remote Debugging Protocol message types are specified as `oneway`,
meaning that they expect no reply. Sending anything—including an
error—in response to these messages throws the devtools client and actor
out of sync.
As noted in the `ClientRequest` docstring, most client messages expect
exactly one reply, so `ClientRequest::handle()` includes a fail-safe
that automatically sends an error message if none of the `reply()`,
`reply_unchecked()`, or `reply_final()` methods have been called.
This change introduces an additional method,
`ClientRequest::mark_handled()`, which allows the actor handling the
request to disarm the fail-safe without sending a reply over the wire,
and it adds handling logic for 3 one-way message types that are
frequently emitted by the Firefox Toolbox.
Testing: This change introduces no new tests. Unless we take the unusual
step of enumerating all supported one-way message types and validating
each, automated tests provide little assurance of correctness.
Meaningfully testing this feature would be cumbersome, and it would
likely hamper future development more than it would help.
Signed-off-by: Brent Schroeter <contact@brentsch.com>
The `InspectorActor` and its children now query the
`BrowsingContextActor` for the active pipeline ID and script sender
instead of storing their own copies, which become outdated on
navigation. Previously, the inspector remained permanently stuck to the
pipeline that was active upon launch. Now, connecting a fresh devtools
client session after navigation allows inspection of each
`BrowsingContext`'s active DOM.
Navigation within a continuous remote debugging session still breaks the
Firefox inspector panel. This is due to multiple compatibility issues
with the protocol implementation, which will be addressed in separate
PRs.
This PR does not touch `TimelineActor` or `FramerateActor`. These are
theoretically affected by the same issue as the `InspectorActor`, but in
practice neither is ever instantiated. It seems both have been
effectively unreachable code since 1aab10f2 and will require more
extensive work and testing that is beyond the scope of this change.
Testing: Updates to the `WalkerActor` and `BrowsingContextActor` are
unit tested via the new `test_walker_observes_new_dom_after_nav` case in
`devtools_tests.py`. There are no existing unit tests to reference for
the highlighter and style actors; these have been tested manually but
this PR does not introduce further automated tests. This PR also
improves handling of `tabNavigated` messages to simplify the unit test
written for 4c69d85.
---------
Signed-off-by: Brent Schroeter <contact@brentsch.com>
Initial work to support scopes in the debugger. They don't show at the
moment since we are not processing variables yet. Depends on #43166.
Testing: Ran `mach test-devtools` and manual testing.
Part of: #36027
Signed-off-by: eri <eri@igalia.com>
Co-authored-by: atbrakhi <atbrakhi@igalia.com>
This functionality will be used in a follow up patch to implement the
getEnvironment message.
Testing: Check `mach test-devtools` and manual test
Part of: #36027
Signed-off-by: eri <eri@igalia.com>
Co-authored-by: atbrakhi <atbrakhi@igalia.com>