This patch fixes the source panel in the DevTools that was broken due to
missing breakpoint actor implementation. The client was sending messages
to the breakpoint actor that didn't exist in Servo, resulting in
"unknown actor"
warnings in the logs(See logs in issue description)
To fix this this patch implements the `BreakpointListActor` that handles
`setBreakpoint` and `setActiveEventBreakpoints` messages with empty
replies. This PR does not implement `breakpoint` functionality
<img width="1512" alt="image"
src="https://github.com/user-attachments/assets/ac4985a6-9fd3-4854-a491-b39241e19d13"
/>
Fixes: https://github.com/servo/servo/issues/37196
Signed-off-by: atbrakhi <atbrakhi@igalia.com>
This patch improves the `resource_available` trait to handle multiple
connections. In this patch we also remove the redundant
`resource_available` from worker actor
Testing: Existing tests in DevTools already tests for this. We do not
need to add new test
Fixes: part of #36027
Signed-off-by: atbrakhi <atbrakhi@igalia.com>
Co-authored-by: Delan Azabani <dazabani@igalia.com>
This patch adds support for listing `worker scripts` in `debugger >
source` panel
For example:
```
<!-- test.html -->
<!doctype html><meta charset=utf-8>
<script>
setTimeout(() => {
console.log("inline classic");
new Worker("worker.js");
const blob = new Blob([`console.log("blob worker");`], { type: "text/javascript" });
const blobURL = URL.createObjectURL(blob);
new Worker(blobURL);
}, 2000);
</script>
```
```
// worker.js
console.log("external classic worker");
```
```
./mach run --devtools=6080 http://127.0.0.1:3000/test.html
```

Another example:
```
./mach run --devtools=6080 https://charming.daz.cat/
```

- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes partially implement #36027
- [x] These changes require tests, but they are blocked on
https://github.com/servo/servo/issues/36325
---------
Signed-off-by: atbrakhi <atbrakhi@igalia.com>
Currently Source related code exists in watcher.rs and thread.rs. This
change moves source-related code to a dedicated source.rs file. This is
in preparation for adding support for showing source code in the
Debugger > Source panel.
- [x] Testing: These changes should not affect current functionality as
it only moves the existing code
- [x] Fixes: part of https://github.com/servo/servo/issues/36027
---------
Signed-off-by: atbrakhi <atbrakhi@igalia.com>
These PR adds `resource_available` as a common shared util
- [x] ./mach build -d does not report any errors
- [x] ./mach test-tidy does not report any errors
- [x] These changes partially implement
https://github.com/servo/servo/issues/36027
---------
Signed-off-by: atbrakhi <atbrakhi@igalia.com>
This patch adds support for listing scripts in the Sources panel.
Classic scripts, both external and inline, are implemented, but worker
scripts and imported module scripts are not yet implemented.
For example:
```html
<!-- sources.html -->
<!doctype html><meta charset=utf-8>
<script src="classic.js"></script>
<script>
console.log("inline classic");
new Worker("worker.js");
</script>
<script type="module">
import module from "./module.js";
console.log("inline module");
</script>
<script src="https://servo.org/js/load-table.js"></script>
```
```js
// classic.js
console.log("external classic");
```
```js
// worker.js
console.log("external classic worker");
```
```js
// module.js
export default 1;
console.log("external module");
```

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by
`[X]` when the step is complete, and replace `___` with appropriate
data: -->
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes partially implement #36027
<!-- Either: -->
- [ ] There are tests for these changes OR
- [x] These changes require tests, but they are blocked on #36325
Signed-off-by: Delan Azabani <dazabani@igalia.com>
Co-authored-by: atbrakhi <atbrakhi@igalia.com>
Devtools clients need a `browserId`, `browsingContextID`, and
`outerWindowID`, which correspond to WebViewId, BrowsingContextId, and
PipelineId in Servo. These u32 values were previously derived from our
sharded (u32,u32) id values by taking only the `index` (second u32) and
ignoring the `namespace_id` (first u32), leading to collisions.
This patch fixes that by mapping those Servo ids to sequential u32
values.
---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by
`[X]` when the step is complete, and replace `___` with appropriate
data: -->
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix#35954
<!-- Either: -->
- [x] There are tests for these changes OR
- [ ] These changes do not require tests because ___
<!-- Also, please make sure that "Allow edits from maintainers" checkbox
is checked, so that we can help you if you get stuck somewhere along the
way.-->
<!-- Pull requests that do not address these steps are welcome, but they
will require additional verification as part of the review process. -->
---------
Signed-off-by: Delan Azabani <dazabani@igalia.com>
This change fixes all rustdoc errors and also adds a tidy check for a
very common rustdoc URL issue. Eventually rustdoc warnings should likely
cause the build to fail, but this catches those issues sooner in order
to not waste so much developer time.
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
* feat: retrieve applied styles
Signed-off-by: eri <eri@inventati.org>
* feat: preliminary style showing
Signed-off-by: eri <eri@inventati.org>
* chore: some style tests
Signed-off-by: eri <eri@inventati.org>
* feat: edit style rules
Signed-off-by: eri <eri@inventati.org>
* feat: css database
Signed-off-by: eri <eri@inventati.org>
* feat: computed styles
Signed-off-by: eri <eri@inventati.org>
* feat: inherited styles
Signed-off-by: eri <eri@inventati.org>
* feat: get stylesheet styles
Signed-off-by: eri <eri@inventati.org>
* feat: all styles in inspector
Signed-off-by: eri <eri@inventati.org>
* feat: multiple stylesheets
Signed-off-by: eri <eri@inventati.org>
* refactor: clean up
Signed-off-by: eri <eri@inventati.org>
* Some minor cleanup
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
---------
Signed-off-by: eri <eri@inventati.org>
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Co-authored-by: Martin Robinson <mrobinson@igalia.com>
* feat: watch root node
Signed-off-by: eri <eri@inventati.org>
* reafactor: divide inspector in components
Signed-off-by: eri <eri@inventati.org>
* feat: add css properties actor
Signed-off-by: eri <eri@inventati.org>
* feat: accesibility actor
Signed-off-by: eri <eri@inventati.org>
* feat: layout actor
Signed-off-by: eri <eri@inventati.org>
* feat: network parent and refactor
Signed-off-by: eri <eri@inventati.org>
* feat: progress on the inspector messages
Signed-off-by: eri <eri@inventati.org>
* feat: more progress on inspector
Signed-off-by: eri <eri@inventati.org>
* feat: try to fix nodes showing
Signed-off-by: eri <eri@inventati.org>
* feat: initial dom tree
Signed-off-by: eri <eri@inventati.org>
* feat: some more messages
Signed-off-by: eri <eri@inventati.org>
* feat: clean and add documentation
Signed-off-by: eri <eri@inventati.org>
* refactor: add more docs and clean
Signed-off-by: eri <eri@inventati.org>
* fix: restore deleted node attributes field
Signed-off-by: eri <eri@inventati.org>
* Apply suggestions from code review
Fix a few nits in comments
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
---------
Signed-off-by: eri <eri@inventati.org>
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Co-authored-by: Martin Robinson <mrobinson@igalia.com>