Added a `register` method to `NodeActor` following the same pattern used
by other actors in the devtools codebase. Updated
`NodeInfoToProtocol::get_or_register_node_actor` to use it instead of
constructing `NodeActor` directly.
Testing:
Ran `./mach try linux-unit-tests` and `./mach test-devtools`. No new
failures introduced.
Fixes:part of #43800
---------
Signed-off-by: Emmanuel Paul Elom <elomemmanuel007@gmail.com>
Added a `register` method to `PageStyleActor` following the same pattern
used by other actors in the devtools codebase. Updated
`InspectorActor::register` to use it instead of constructing
`PageStyleActor` directly.
Testing:
Ran `./mach try linux-unit-tests` and `./mach test-devtools`. No new
failures introduced.
Fixes:part of #43800
Signed-off-by: Emmanuel Paul Elom <elomemmanuel007@gmail.com>
Signed-off-by: eri <eri@igalia.com>
Co-authored-by: eri <eri@igalia.com>
Added a `register` method to `HighlighterActor` following the same
pattern used by other actors in the devtools codebase. Updated
`InspectorActor::register` to use it instead of onstructing
`HighlighterActor` directly.
Testing:
Ran `./mach try linux-unit-tests` and `./mach test-devtools`. No new
failures introduced.
Fixes:part of #43800
---------
Signed-off-by: CynthiaOketch <cynthiaoketch6@gmail.com>
Make `isAsync` and `isGenerator` optional
Testing: Current tests as passing
Fixes: part of #36027
Signed-off-by: atbrakhi <atbrakhi@igalia.com>
Signed-off-by: eri <eri@igalia.com>
Co-authored-by: eri <eri@igalia.com>
DevTools was collecting CSS rules by walking stylesheets and matching
selector text. This ignored cascade order and did not correctly handle
rules inside layer blocks.
This change uses computed values (rule tree) to get the actual applied
rules in cascade order. It then maps those rules back to CSSStyleRule
using the declaration block identity, and walks the CSSOM to get
selector text and layer ancestry.
This fills ancestor_data with layer names and lets the inspector show
layered rules correctly.
Testing:
- Verified using the minimized testcase from the issue
- Verified on https://www.sharyap.com/
- Confirmed that rules inside layer blocks are now shown with correct
order and hierarchy.
Fixes: #43541
Signed-off-by: arabson99 <arabiusman99@gmail.com>
Renames local variables holding a `ThreadActor` instance to
`thread_actor`, following the `{}_actor` convention for actor variables
as described in #43606.
Changes:
- `actors/thread.rs`: `actor` → `thread_actor` in
`ThreadActor::register()`
- `lib.rs`: `thread` → `thread_actor` in
`handle_notifyscriptinterrupted` and `handle_create_frame_actor`
Part of #43606.
Signed-off-by: thebabalola <t.babalolajoseph@gmail.com>
Signed-off-by: eri <eri@igalia.com>
Co-authored-by: eri <eri@igalia.com>
Renames local variable holding a `SourceActor` instance to
`source_actor`, following the `{}_actor` convention for actor variables
as described in #43606.
Changes:
- `actors/source.rs`: `actor` → `source_actor` in
`SourceActor::register()`
Part of #43606.
Signed-off-by: thebabalola <t.babalolajoseph@gmail.com>
Renames local variable `worker` to `worker_actor` in `lib.rs` and
`root.rs`, following the `{}_actor` convention for actor struct
variables and `{}_name` for actor name string variables established in
#43606.
Also adds a `WorkerActor::register()` method (part of #43800), replacing
the inline struct construction in `lib.rs` with a consistent pattern
pattern matching other actors like `ThreadActor` and `SourceActor`.
**Changes:**
- `actors/worker.rs`: Add `WorkerActor::register()` method
- `actors/root.rs`: Rename `worker` → `worker_actor` in
`listServiceWorkerRegistrations` handler
- `lib.rs`: Replace inline struct construction with
`WorkerActor::register()` call
**Testing:** No testing required, compiles successfully.
Fixes: Part of #43606
Fixes: Part of #43800
Signed-off-by: thebabalola <t.babalolajoseph@gmail.com>
Replaced new with register for LayoutInspectorActor in walker.rs &
layout.rs
Testing: No testing required, compiles successfully.
Fixes: Part of #43800
Signed-off-by: Sabb <sarafaabbas@gmail.com>
Replaced new with register for TargetConfigurationActor in
target_configuration.rs & watcher.rs
Testing: No testing required, compiles successfully.
Fixes: Part of #43800
Signed-off-by: Sabb <sarafaabbas@gmail.com>
Replaced new with register for AccessibleWalkerActor in accessibility.rs
Testing: No testing required, compiles successfully.
Fixes: Part of #43800
Signed-off-by: Sabb <sarafaabbas@gmail.com>
Replaced new with register for PauseActor in pause.rs & lib.rs
Testing: No testing required, compiles successfully.
Fixes: Part of #43800
Signed-off-by: Sabb <sarafaabbas@gmail.com>
Replaced new with register for WatcherActor in browsing_context &
watcher.rs
Testing: No testing required, compiles successfully.
Fixes: Part of #43800
---------
Signed-off-by: Sabb <sarafaabbas@gmail.com>
Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>
Co-authored-by: Mukilan Thiyagarajan <mukilan@igalia.com>
Replaced new with register for TabDescriptorActor in browsing_context &
tab.rs
Testing: No testing required, compiles successfully.
Fixes: Part of #43800
Signed-off-by: Sabb <sarafaabbas@gmail.com>
Replaced new with register for ThreadConfigurationActor in
thread_configuration.rs & watcher.rs
Testing: No testing required, compiles successfully.
Fixes: Part of #43800
Signed-off-by: Sabb <sarafaabbas@gmail.com>
Replaced new with register for ProcessActor in process.rs & root.rs
Testing: No testing required, compiles successfully.
Fixes: Part of #43800
Signed-off-by: Sabb <sarafaabbas@gmail.com>
Replaced new with register for AccessibilityActor in browsing_context &
accessibility.rs
Testing: No testing required, compiles successfully.
Fixes: Part of #43800
---------
Signed-off-by: Sabb <sarafaabbas@gmail.com>
Replaced new with register for NetworkEventActor in network_event.rs &
lib.rs
Testing: No testing required, compiles successfully.
Fixes: Part of #43800
Signed-off-by: Sabb <sarafaabbas@gmail.com>
Replaced new with register for BrowsingContextActor in
browsing_context.rs & lib.rs
Testing: No testing required, compiles successfully.
Fixes: Part of #43800
---------
Signed-off-by: Sabb <sarafaabbas@gmail.com>
Replaced new with register for PerformanceActor in performance.rs &
root.rs
Testing: No testing required, compiles successfully.
Fixes: Part of #43800
---------
Signed-off-by: Sabb <sarafaabbas@gmail.com>
Replaced new with register for ThreadActor in browsing_context,
thread.rs & lib.rs
Testing: No testing required, compiles successfully.
Fixes: Part of #43800
---------
Signed-off-by: Sabb <sarafaabbas@gmail.com>
Replaced new with register for BreakpointListActor in breakpoint.rs &
watcher.rs
Testing: No testing required, compiles successfully.
Fixes: Part of #43800
Signed-off-by: Sabb <sarafaabbas@gmail.com>
Replaced new with register for CssPropertiesActor in browsing_context &
css_properties.rs
Testing: No testing required, compiles successfully.
Fixes: Part of #43800
Signed-off-by: Sabb <sarafaabbas@gmail.com>
Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>
Co-authored-by: Mukilan Thiyagarajan <mukilan@igalia.com>
Replaced new with register for NetworkParentActor in network_parent.rs &
watcher.rs
Testing: No testing required, compiles successfully.
Fixes: Part of #43800
Signed-off-by: Sabb <sarafaabbas@gmail.com>
Replaced new with register for ReflowActor in browsing_context &
reflow.rs
Testing: No testing required, compiles successfully.
Fixes: Part of #43800
Signed-off-by: Sabb <sarafaabbas@gmail.com>
Part of a larger refactor to name all actors and variables consistently,
#43800.
Testing: not necessary beyond `mach test-devtools` per #43800 / #43606
Fixes: `#43800` ((not linking because it's one of many PR's).
Signed-off-by: Martijn Gribnau <garm@ilumeo.com>
Replace new with register for ConsoleActor in console & lib.rs
Testing: No testing required, compiles successfully.
Fixes: Part of #43800
Signed-off-by: Sabb <sarafaabbas@gmail.com>
Replace new with register for DeviceActor in device & root.rs
Testing: No testing required, compiles successfully.
Fixes: Part of #43800
Signed-off-by: Sabb <sarafaabbas@gmail.com>
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>