aboutsummaryrefslogtreecommitdiffstats
path: root/components/shared/devtools/lib.rs
Commit message (Collapse)AuthorAgeFilesLines
* Create HttpStatus to safely deal with HTTP responses status. (#33581)webbeef2024-09-291-1/+2
| | | Signed-off-by: webbeef <me@webbeef.org>
* Stop using `time@0.1` in Servo (#33394)Martin Robinson2024-09-111-25/+6
| | | | | | | | 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>
* script: Create a `CrossProcessInstant` to enable serializable monotonic time ↵Martin Robinson2024-09-051-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (#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>
* DevTools: Inspect node styles (#33025)eri2024-08-251-2/+50
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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>
* DevTools: Allow modification of attributes (#32888)eri2024-08-051-1/+1
| | | | | | | | | | | | | | | | | | | | | | | * 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>
* DevTools: Inline text and clean whitespace (#32884)eri2024-07-301-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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>
* DevTools: Show HTML tree (#32655)eri2024-07-261-8/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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>
* DevTools: Display console messages and errors (#32727)eri2024-07-091-7/+5
| | | | | | | | | | | | | | | | | * 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>
* DevTools: Replace camel case variable names (#32726)eri2024-07-081-47/+49
| | | | | | | | | * refactor: rename to snake case * refactor: more renaming * chore: format * chore: clean
* Move non-gfx things out of `gfx_traits` and create a `base` crate (#32296)Martin Robinson2024-05-171-1/+1
| | | | | | | | | | | | | | | | | | | | | | | For a long time, `gfx_traits` has held a lot of things unrelated to graphics and also unrelated to the `gfx` crate (which is mostly about fonts). This is a cleanup which does a few things: 1. Move non `gfx` crate things out of `gfx_traits`. This is important in order to prevent dependency cycles with a different integration between layout, script, and fonts. 2. Rename the `msg` crate to `base`. It didn't really contain anything to do with messages and instead mostly holds ids, which are used across many different crates in Servo. This new crate will hold the *rare* data types that are widely used. Details: - All BackgroundHangMonitor-related things from base to a new `background_hang_monitor_api` crate. - Moved `TraversalDirection` to `script_traits` - Moved `Epoch`-related things from `gfx_traits` to `base`. - Moved `PrintTree` to base. This should be widely useful in Servo. - Moved `WebrenderApi` from `base` to `webrender_traits` and renamed it to `WebRenderFontApi`.
* Replace time with std::time in components/devtools (#30927)Taym Haddadi2024-01-031-3/+3
| | | Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com>
* Move `*_traits` and other shared types to `shared`Martin Robinson2023-11-031-0/+372
This is the start of the organization of types that are in their own crates in order to break dependency cycles between other crates. The idea here is that putting these packages into their own directory is the first step toward cleaning them up. They have grown organically and it is difficult to explain to new folks where to put new shared types. Many of these crates contain more than traits or don't contain traits at all. Notably, `script_traits` isn't touched because it is vendored from Gecko. Eventually this will move to `third_party`.