Replaced new with register for StyleSheetsActor in browsing_context &
stylesheets
Testing: No testing required, compiles successfully.
Fixes: Part of #43800
Signed-off-by: Sabb <sarafaabbas@gmail.com>
Rename variables associated with `PropertyIteratorActor`
Testing: Tested locally with `mach test-devtools`
Fixes: A part of #43606
Signed-off-by: Niya Gupta <niyabits@disroot.org>
Before we had seperate parsing functions for preview and scopes. In this
change we merge them into one.
Testing: current tests are passing, also tested manually.
Fixes: #36027
Signed-off-by: atbrakhi <atbrakhi@igalia.com>
Co-authored-by: eri <eri@igalia.com>
These were here 10 years ago.
1. All Actor names are already immutable:
- All actor implementations store a name: String field set at
construction and never mutate it.
- The name is only used as key by `ActorRegistry` to look up
2. There is no `register_later`
---------
Signed-off-by: Euclid Ye <yezhizhenjiakang@gmail.com>
Standardize variable naming in `WalkerActor` (`walker.rs`), renaming
`node` → `node_name` in `find_child` to follow the `{}_name` convention.
Testing: `./mach test-devtools`, all 60 tests pass.
Fixes: Part of #43606
Signed-off-by: Eli Bowman <asdfup@protonmail.com>
Changes `name` to `long_string_name`
`long_string` to `long_string_actor`
Testing: Tested locally with mach test-devtools
Fixes: A part of #43606
---------
Signed-off-by: Niya Gupta <niyabits@disroot.org>
Co-authored-by: Niya Gupta <niyabits@disroot.org>
Remove a duplicate `ObjectPreview` and use `ObjectActor::encode` for
serialization.
Testing: Ran mach test-devtools and manual tests.
Part of: #36027
Signed-off-by: eri <eri@igalia.com>
Co-authored-by: atbrakhi <atbrakhi@igalia.com>
Part of #43800 and #43606.
I removed the `new` method from `SourceActor` entirely, as it was only
used internally by `new_registered`. I renamed `new_registered` to
`register`, inlined the struct construction directly using `Self { ...
}`, and updated the registration call to use
`registry.register::<Self>(actor)` to match the standard pattern
established across other actors.
I also standardized variable names throughout `SourceActor` and its call
sites to follow the conventions set in #43606:
- Renamed `name` and `source` to `source_name` and `source_actor`
respectively in `SourceManager::find_source`
- Renamed `actor_name` to `source_name` in `SourceManager::source_forms`
- Renamed `actor_name` to `source_name` in
`handle_update_source_content` in lib.rs
Testing: Built with cargo and ran ./mach test-devtools. 59/60 tests
pass; the one failure (test_manual_pause) is a pre-existing intermittent
timeout unrelated to these changes.
Fixes: part of #43606 and #43800
Signed-off-by: CynthiaOketch <cynthiaoketch6@gmail.com>
- Changes `breakpoint_list` to `breakpoint_list_actor`
Testing: Tested locally with `mach test-devtools`
Fixes: A part of #43606
---------
Signed-off-by: Niya Gupta <niyabits@disroot.org>
Co-authored-by: Niya Gupta <niyabits@disroot.org>
- `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>