Commit graph

14 commits

Author SHA1 Message Date
atbrakhi
568d24d4e3
DevTools: Fix empty debugger > source panel (#37197)
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>
2025-05-31 06:51:03 +00:00
atbrakhi
2aaf9695df
DevTools: Improve resource_available to handle multiple connections (#36933)
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>
2025-05-09 12:06:33 +00:00
atbrakhi
b92542b756
Devtools: Support worker scripts in Debugger > Source panel (#36562)
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
```

![file1](https://github.com/user-attachments/assets/84dd94b9-95d8-4087-b4bb-ab936fca0023)


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


![blob](https://github.com/user-attachments/assets/a1341ee4-3a1c-4cca-ac04-658675cdcf39)


- [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>
2025-04-29 08:27:42 +00:00
atbrakhi
c16d86f7a4
DevTools: Move Source related code to dedicated source.rs file (#36667)
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>
2025-04-24 07:50:56 +00:00
atbrakhi
7c1e5918a8
DevTools: Add resource_available as a common shared util (#36632)
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>
2025-04-23 12:36:59 +00:00
delan azabani
95eedb997a
Devtools: initial Debugger > Sources panel (#36164)
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");
```


![image](https://github.com/user-attachments/assets/2f1d8d7c-501f-4fe5-bd07-085c95e504f2)

---
<!-- 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>
2025-04-08 09:22:53 +00:00
Delan Azabani
30b712aaf9
devtools: Fix id collisions by using incrementing counters (#35971)
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>
2025-04-01 09:00:40 +00:00
eri
af61b1a107
DevTools: Fix console in Firefox 131 (#33661)
* feat: remove deprecated resource-available-form

Signed-off-by: eri <epazos@igalia.com>

* chore: update targeted firefox version

Signed-off-by: eri <epazos@igalia.com>

---------

Signed-off-by: eri <epazos@igalia.com>
2024-10-09 12:09:06 +00:00
Martin Robinson
e70507ca40
tidy: Fix rustdoc warnings and add a tidy check for a common URL issue (#33366)
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>
2024-09-08 15:04:19 +00:00
eri
6357998ede
DevTools: Inspect node styles (#33025)
* 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>
2024-08-25 09:30:23 +00:00
Ashwin Naren
ea5cf75169
clippy: Fix various clippy warnings throughout the code (#33003)
* replace u64::max_value() with u64::MAX

Signed-off-by: Ashwin Naren <arihant2math@gmail.com>

* removed redundant import

Signed-off-by: Ashwin Naren <arihant2math@gmail.com>

* Fixed dereference

Signed-off-by: Ashwin Naren <arihant2math@gmail.com>

* Fixed a probable bug

Signed-off-by: Ashwin Naren <arihant2math@gmail.com>

* fixed imports

Signed-off-by: Ashwin Naren <arihant2math@gmail.com>

* fixed dereference

Signed-off-by: Ashwin Naren <arihant2math@gmail.com>

* dereference formatting

Signed-off-by: Ashwin Naren <arihant2math@gmail.com>

* removed unnessicary number imports

Signed-off-by: Ashwin Naren <arihant2math@gmail.com>

* removed unnessicary number imports

Signed-off-by: Ashwin Naren <arihant2math@gmail.com>

* removed excess borrow

Signed-off-by: Ashwin Naren <arihant2math@gmail.com>

* ran mach fmt

Signed-off-by: Ashwin Naren <arihant2math@gmail.com>

* fixed doc comment

Signed-off-by: Ashwin Naren <arihant2math@gmail.com>

* removed deref on an immutable reference

Signed-off-by: Ashwin Naren <arihant2math@gmail.com>

* fixed minor syntax error

Signed-off-by: Ashwin Naren <arihant2math@gmail.com>

* reverted clamping

Signed-off-by: Ashwin Naren <arihant2math@gmail.com>

* formatting

Signed-off-by: Ashwin Naren <arihant2math@gmail.com>

* reverted final clamp

Signed-off-by: Ashwin Naren <arihant2math@gmail.com>

---------

Signed-off-by: Ashwin Naren <arihant2math@gmail.com>
Co-authored-by: Ashwin Naren <ashwin@pixelators.org>
2024-08-13 05:16:47 +00:00
eri
902bf57331
DevTools: Show HTML tree (#32655)
* 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>
2024-07-26 15:17:54 +00:00
石蕊 (Pi-Cla)
f29dd64a7b
Fix more clippy (#32740) 2024-07-09 04:47:43 +00:00
eri
5eb8813448
DevTools: Implement watcher actor (#32509)
* feat: base for watcher

* feat: some more watcher tests

* feat: implement getWatcher

* refactor: clean up getWatcher

* feat: implement watchTargets

* feat: implement watchResources

* feat: very messy watchTargets fix

* refactor: clean browsing context

* feat: target configuration

* refactor: start cleanup

* refactor: more doc coments

* refactor: clean browsing context
2024-06-21 16:06:55 +00:00