Commit graph

337 commits

Author SHA1 Message Date
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
Simon Wülker
8608e328a1
devtools: Allow highlighting elements from the inspector (#35822)
This change connects the `HighlighterActor` from the devtools with the
document, which will draw a blue rectangle over any highlighted dom
node.



https://github.com/user-attachments/assets/571b2dab-497f-4102-9e55-517cdcc040ba




---
<!-- 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 do not require tests because we don't have devtools
tests

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
2025-05-05 10:10:25 +00:00
Simon Wülker
cfc7115867
Send info about the DocumentType node to the devtools inspector (#36787)
This makes the DOCTYPE tag show up correctly in the inspector.

Before:

![image](https://github.com/user-attachments/assets/fd101337-95ce-45ee-8ac5-ae701109eb94)

After:

![image](https://github.com/user-attachments/assets/4e80f4c0-6ae4-4c53-88ca-614803caa032)


Testing: We don't have devtools tests

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
2025-05-01 06:37:23 +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
atbrakhi
15301df799
DevTools: worker_id shoud be id & thread for workers should be thread (#36631)
This is part of https://github.com/servo/servo/pull/36562, where I
discovered that we are sending thread as `context` and `id` for worker
is called `worked_id`. In this PR, I have renamed the `worker_id` to
`id` and thread is sent as `thread` and not context. These chages were
tested in #36562

Some logs for context(this logs are from firefox instance)

`worker_id` should be `id`
```
{"_from": "server1.conn0.watcher35", "message": {"from": "server1.conn0.watcher35", "target": {"actor": "server1.conn0.watcher34.process7//workerTarget21/workerTarget5", "consoleActor": "server1.conn0.watcher34.process7//workerTarget21/console2", "id": "f454ea34-c76a-4b6e-a079-43ee3128881e", "name": "", "objectsManagerActor": "server1.conn0.watcher34.process7//workerTarget21/objects-manager4", "relatedDocumentInnerWindowId": 15032385539, "targetType": "worker", "threadActor": "server1.conn0.watcher34.process7//workerTarget21/thread1", "tracerActor": "server1.conn0.watcher34.process7//workerTarget21/tracer3", "traits": {"supportsTopLevelTargetFlag": false}, "type": 0, "url": "http://localhost:8000/Documents/codespace/servo/worker.js"}, "type": "target-available-form"}}
```

Thread should be `thread` and not `context`
```
{"_from": "server1.conn0.watcher35", "message": {"from": "server1.conn0.watcher35", "target": {"actor": "server1.conn0.watcher34.process7//workerTarget21/workerTarget5", "consoleActor": "server1.conn0.watcher34.process7//workerTarget21/console2", "id": "f454ea34-c76a-4b6e-a079-43ee3128881e", "name": "", "objectsManagerActor": "server1.conn0.watcher34.process7//workerTarget21/objects-manager4", "relatedDocumentInnerWindowId": 15032385539, "targetType": "worker", "threadActor": "server1.conn0.watcher34.process7//workerTarget21/thread1", "tracerActor": "server1.conn0.watcher34.process7//workerTarget21/tracer3", "traits": {"supportsTopLevelTargetFlag": false}, "type": 0, "url": "http://localhost:8000/Documents/codespace/servo/worker.js"}, "type": "target-available-form"}}
```


- [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-21 15:43:56 +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
Usman Yahaya Baba
fab5e02972
Process colorSchemeSimulation in TargetConfigurationActor (#36297)
Implements Steps 1,4&6 of https://github.com/servo/servo/issues/35867:
- Adds `pub simulate_color_scheme` to `BrowsingContextActor` using
`script_chan`.
- Processes `colorSchemeSimulation` flag in `TargetConfigurationActor`’s
`updateConfiguration`.
- Routes `colorSchemeSimulation` from `RootActor` via
`TabDescriptorActor` to `BrowsingContextActor`.

Testing: Compiles and lints clean.
Fixes: https://github.com/servo/servo/issues/35867

---------

Signed-off-by: Uthman Yahaya Baba <uthmanyahayababa@gmail.com>
2025-04-06 14:19:42 +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
Usman Yahaya Baba
f9831f2bea
Track the active tab and browsing context for devtools (#36168)
<!-- Please describe your changes on the following line: -->


---Part of #35867, per Step 5 suggestion. This PR:
- Adds active_tab (via RefCell) to RootActor, updated in
get_tab_msg_by_browser_id.
- Adds browsing_context() helper to TabDescriptorActor.
- Adds actor()`getter to TabDescriptorActorMsg for  access in root.rs.
-Creates the chain (Root - Tab - BrowsingContext) for routing
colorSchemeSimulation.
<!-- 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
- [ ] These changes fix #___ (GitHub issue number if applicable)

<!-- Either: -->
- [ ] There are tests for these changes OR
- [X] These changes do not require tests because they’re structural
setup for the actor chain and don’t change the system's behavior yet.

<!-- 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: Uthman Yahaya Baba <uthmanyahayababa@gmail.com>
2025-03-31 17:51:28 +00:00
Alex Touchet
1aac377e62
Organize component Cargo.toml dependencies (#36224)
Signed-off-by: Alex Touchet <26315797+atouchet@users.noreply.github.com>
2025-03-30 19:03:54 +00:00
Jerens Lensun
02375809b0
devtools: refactor network related (#36093)
* devtools: extract network related into new file

Signed-off-by: jerensl <54782057+jerensl@users.noreply.github.com>

* devtools: fix missing license and linting error

Signed-off-by: jerensl <54782057+jerensl@users.noreply.github.com>

* fixup! devtools: extract network related into new file

Signed-off-by: jerensl <54782057+jerensl@users.noreply.github.com>

---------

Signed-off-by: jerensl <54782057+jerensl@users.noreply.github.com>
2025-03-22 14:46:57 +00:00
atbrakhi
2362e4c134
devtools: Use webview_id as browser_id (#35956)
* use `webview_id` as `browser_id`

Signed-off-by: atbrakhi <atbrakhi@igalia.com>

* use correct webview id

Signed-off-by: atbrakhi <atbrakhi@igalia.com>

* fmt

Signed-off-by: atbrakhi <atbrakhi@igalia.com>

* review fix

Signed-off-by: atbrakhi <atbrakhi@igalia.com>

---------

Signed-off-by: atbrakhi <atbrakhi@igalia.com>
2025-03-19 08:59:38 +00:00
atbrakhi
959720db0a
devtools: use correct id for browser_id and outer_window_id (#35884)
Signed-off-by: atbrakhi <atbrakhi@igalia.com>
2025-03-13 11:39:06 +00:00
atbrakhi
eb2ca42824
devtools: improve ID Naming for better readability and context (#35942)
Signed-off-by: atbrakhi <atbrakhi@igalia.com>
2025-03-13 07:36:54 +00:00
Stephen Muss
79e25a3e77
Show correctly computed element display type in devtools (#35870)
Signed-off-by: Stephen Muss <stephenmuss@gmail.com>
2025-03-10 12:32:30 +00:00
Simon Wülker
48aacc43b7
Register iframes with the devtools (#35874)
Previously, the devtools didn't know about
<iframe>s. They either ignored messages coming from
iframes or crashed.

This reverts https://github.com/servo/servo/pull/34032
and then filters out non-tab globals in the "listTabs"
message to the root actor.

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
2025-03-09 20:42:39 +00:00
atbrakhi
8cf3e3842a
devtools: update targeted firefox version. (#35792)
Currently connected version is old(130.0). The minimum
supported version is (133.0a1).

Signed-off-by: atbrakhi <atbrakhi@igalia.com>
2025-03-05 06:08:40 +00:00
Simon Wülker
3d320fa96a
Update rustfmt to the 2024 style edition (#35764)
* Use 2024 style edition

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>

* Reformat all code

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>

---------

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
2025-03-03 11:26:53 +00:00
Simon Wülker
e7e8ccea20
Respond to the connect message from a devtools client (#35745)
* Respond to the "connect" message

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>

* Bump log levels in devtools implementation a bit

If everything is "debug" then nothing stands out.

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>

---------

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
2025-03-02 12:16:51 +00:00
Simon Wülker
18de59dd63
Refactor devtools server (#35735)
Previously, the devtools code was structured like this (in pseudocode):
```rust
fn run() {
    let member_1;
    let member_2;

    fn foo(&member_1) {
        // ...
    }

    fn bar(&member_1, &member_2) {
        // ...
    }

    loop {
        match get_message() {
            Message1 => foo(&member_1),
            Message2 => bar(&member_1, &member_2),

        }
    }
}
```

This is not very idiomatic rust. And, more importantly, it makes it hard
to edit this code with an IDE, because "find all references" and similar
actions don't properly work. (member_1 inside "foo" is a different
variable than member_1 inside "bar" or "run").

Instead, the code is now structured (roughly) like this:

```rust
struct DevtoolsInstance {
    member_1,
    member_2,
}

impl DevtoolsInstance {
    fn foo(&self) {
        // ...
    }

    fn bar(&self) {
        // ...
    }

    fn run(&self) {
        loop {
            match get_message() {
                Message1 => self.foo(),
                Message2 => self.bar(),

            }
        }
    }
}
```

In my opinion, this is an improvement and should make future additions
to the devtools server easier. No behaviour change is intended.

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
2025-03-01 20:13:22 +00:00
Martin Robinson
f51a5661f8
libservo: Flesh out permissions API (#35396)
- Update the script crate to better reflect the modern Permission
  specifcation -- removing the necessity for an `Insecure` variant of
  the permissions prompt.
- Have all allow/deny type requests in the internal API use an
  `AllowOrDeny` enum for clarity.
- Expose `PermissionsRequest` and `PermissionFeature` data types to the
  API and use them in the delegate method.
- Update both servoshell implementations to use the API.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Co-authored-by: Mukilan Thiyagarajan <mukilan@igalia.com>
2025-02-10 15:50:33 +00:00
Simon Wülker
09bfaf51b0
Inform the devtools about shadow roots on a node (#35294)
Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
2025-02-05 13:16:36 +00:00
Delan Azabani
5e9de2cb61
Include WebViewId into EmbedderMsg variants where possible (#35211)
`EmbedderMsg` was previously paired with an implicit
`Option<WebViewId>`, even though almost all variants were either always
`Some` or always `None`, depending on whether there was a `WebView
involved.

This patch adds the `WebViewId` to as many `EmbedderMsg` variants as
possible, so we can call their associated `WebView` delegate methods
without needing to check and unwrap the `Option`. In many cases, this
required more changes to plumb through the `WebViewId`.

Notably, all `Request`s now explicitly need a `WebView` or not, in order
to ensure that it is passed when appropriate.

Signed-off-by: Delan Azabani <dazabani@igalia.com>
Co-authored-by: Martin Robinson <mrobinson@igalia.com>
2025-01-30 11:15:35 +00:00
Martin Robinson
0e616e0c5d
api: Flatten and simplify Servo preferences (#34966)
Flatten and simplify Servo's preferences code. In addition, have both
preferences and options passed in as arguments to `Servo::new()` and
make sure not to use the globally set preferences in `servoshell` (as
much as possible now).

Instead of a complex procedural macro to generate preferences, just
expose a very simple derive macro that adds string based getters and
setters.

- All command-line parsing is moved to servoshell.
- There is no longer the concept of a missing preference.
- Preferences no longer have to be part of the resources bundle because
  they now have reasonable default values.
- servoshell specific preferences are no longer part of the preferences
  exposed by the Servo API.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2025-01-14 13:54:06 +00:00
Simon Wülker
b252f238d1
Support syntax highlighting of arguments in the devtools console (#34810)
* Implement Builder struct for console messages

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>

* Support integer arguments for console methods

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>

* Support floating point arguments to console methods in devtools

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>

* Fix warnings

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>

* Tidy

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>

---------

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
2025-01-02 18:47:52 +00:00
Simon Wülker
28e330c9b6
Implement console.trace (#34629)
* Include unimplemented console methods in idl file

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>

* Fix console.assert signature

The condition is optional and there can be multiple messages.

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>

* Implement console.trace

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>

* ./mach fmt

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>

* Log stack trace when calling console.trace

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>

* Update wpt expectations

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>

* Include line/column info in console.trace logs

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>

* Move option out of constant

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>

* Update mozjs

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>

---------

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
2024-12-18 23:45:06 +00:00
Jay Oster
53612dab90
Fix devtools timeout with Firefox 133 (#34602)
Signed-off-by: Jay Oster <jay@kodewerx.org>
2024-12-12 23:38:24 +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
Antony Nyagah
a2b27012a5
clippy: Use flat_map instead of map in components/devtools (#33724)
* clippy: fix rewrite filter_map with map warning in `components/devtools/actors/inspector/page_style.rs`

Signed-off-by: Antony Nyagah <tony.m.nyagah@gmail.com>

* clippy: Use `flat_map` instead `map` in `components/devtools`

Signed-off-by: Antony Nyagah <tony.m.nyagah@gmail.com>

---------

Signed-off-by: Antony Nyagah <tony.m.nyagah@gmail.com>
2024-10-09 04:33:36 +00:00
komuhangi
028026bebe
Fixed some clippy warnings in components/script and components/devtools (#33689)
Signed-off-by: jahielkomu <ktumuhairwe24@gmail.com>
2024-10-07 16:32:48 +00:00
tanishka
56f0abeb89
clippy: Fix warnings in components/devtools/actors/inspector (#33618)
Signed-off-by: taniishkaaa <tanishkasingh2004@gmail.com>
2024-10-02 13:36:59 +00:00
webbeef
58f34ad7a3
Create HttpStatus to safely deal with HTTP responses status. (#33581)
Signed-off-by: webbeef <me@webbeef.org>
2024-09-29 18:23:48 +00:00
Martin Robinson
aa0029c11c
Add rust-version to all Cargo.toml files (#33483)
This is another step preparing for building Servo without `mach`.

Fixes #33430.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2024-09-17 16:39:07 +00:00
Martin Robinson
bc8d8b62c3
Stop using time@0.1 in Servo (#33394)
This removes the last few uses of `time@0.1` in Servo. There are still
dependencies from `style` and `webrender`, but they will be removed soon
as well. The uses of this version of `time` are replaced with
`std::time` types and `time@0.3` when negative `Duration` is necessary.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2024-09-11 07:09:56 +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
Taym Haddadi
a43e296436
Fix devtool crashs after clicking Enable connection prompt (#33305)
* Fix devtool crashs after clicking Enable connection prompt

Signed-off-by: Taym <haddadi.taym@gmail.com>

* Use early error return

Signed-off-by: Taym <haddadi.taym@gmail.com>

---------

Signed-off-by: Taym <haddadi.taym@gmail.com>
2024-09-07 20:58:16 +00:00
Martin Robinson
312cf0df08
script: Create a CrossProcessInstant to enable serializable monotonic time (#33282)
Up until now, Servo was using a very old version of time to get a
cross-process monotonic timestamp (using `time::precise_time_ns()`).
This change replaces the usage of old time with a new serializable
monotonic time called `CrossProcessInstant` and uses it where `u64`
timestamps were stored before. The standard library doesn't provide this
functionality because it isn't something you can do reliably on all
platforms. The idea is that we do our best and then fall back
gracefully.

This is a big change, because Servo was using `u64` timestamps all over
the place some as raw values taken from `time::precise_time_ns()` and
some as relative offsets from the "navigation start," which is a concept
similar to DOM's `timeOrigin` (but not exactly the same). It's very
difficult to fix this situation without fixing it everywhere as the
`Instant` concept is supposed to be opaque. The good thing is that this
change clears up all ambiguity when passing times as a `time::Duration`
is unit agnostic and a `CrossProcessInstant` represents an absolute
moment in time.

The `time` version of `Duration` is used because it can both be negative
and is also serializable.

Good things:
 - No need too pass around `time` and `time_precise` any longer.
   `CrossProcessInstant` is also precise and monotonic.
 - The distinction between a time that is unset or at `0` (at some kind
   of timer epoch) is now gone.

There still a lot of work to do to clean up timing, but this is the
first step. In general, I've tried to preserve existing behavior, even
when not spec compliant, as much as possible. I plan to submit followup
PRs fixing some of the issues I've noticed.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2024-09-05 18:50:09 +00:00
Callum Leslie
ef42ac0dfc
Fix several clippy warnings in components/devtools (#33227)
Signed-off-by: Callum Leslie <git@cleslie.uk>
2024-08-28 16:36:43 +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
Martin Robinson
6be99241c6
Fix warnings after latest rust upgrade (#33043)
This fixes various unused code warnings after the recent rust upgrade.
Some of the dead code is maintained, as it is quite likely that it will
be used in future changes.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2024-08-14 07:00:16 +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
babc844c93
DevTools: Allow modification of attributes (#32888)
* feat: allow modification of attributes

Signed-off-by: eri <eri@inventati.org>

* fix: tidiness

Signed-off-by: eri <eri@inventati.org>

* feat: clean walker name generation

Co-authored-by: Martin Robinson <mrobinson@igalia.com>
Signed-off-by: eri <eri@inventati.org>

* fix: missed out parameter

Signed-off-by: eri <eri@inventati.org>

---------

Signed-off-by: eri <eri@inventati.org>
Co-authored-by: Martin Robinson <mrobinson@igalia.com>
2024-08-05 10:24:01 +00:00
eri
c06a6a764e
DevTools: Inline text and clean whitespace (#32884)
* feat: inline text contents

Signed-off-by: eri <eri@inventati.org>

* feat: filter whitespace only nodes

Signed-off-by: eri <eri@inventati.org>

* chore: cleanup

Signed-off-by: eri <eri@inventati.org>

* fix: url fix

Signed-off-by: eri <eri@inventati.org>

* fix: review fixes

Signed-off-by: eri <eri@inventati.org>
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Co-authored-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-30 10:18:21 +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
Rodion Borovyk
4bf5024ee0
fix a couple of simple clipy warnings (#32813)
Signed-off-by: Rodion Borovyk <rodion.borovyk@gmail.com>
2024-07-19 13:18:34 +00:00
eri
33f3c34d28
DevTools: Display console messages and errors (#32727)
* feat: add streams to browsing context

* feat: console now works!

* feat: order console messages

* feat: add streams to new browsing contexts

* fix: apply suggestions

Co-authored-by: Martin Robinson <mrobinson@igalia.com>

---------

Co-authored-by: Martin Robinson <mrobinson@igalia.com>
2024-07-09 18:27:47 +00:00
石蕊 (Pi-Cla)
f29dd64a7b
Fix more clippy (#32740) 2024-07-09 04:47:43 +00:00
eri
2888193cfe
DevTools: Replace camel case variable names (#32726)
* refactor: rename to snake case

* refactor: more renaming

* chore: format

* chore: clean
2024-07-08 11:18:35 +00:00