This cleans up some visibility for the http-cache and removes an async
that was not used.
Testing: Does not change functionality so compilation and test
compilations are enough.
Signed-off-by: Narfinger <Narfinger@users.noreply.github.com>
Add initial support in `NetworkManager` for listing entries currently
stored
in the HTTP cache. Each returned entry is identified by its cache key
(URL).
The necessary support has been added to the net crate to expose cache
entry
information.
Testing: A new integration test has been added.
---------
Signed-off-by: Jan Varga <jvarga@igalia.com>
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Co-authored-by: Martin Robinson <mrobinson@igalia.com>
When constructing response for partial content request from previously
cached response with `Content-Range` Header (a.k.a Partial Response),
add a check whether the body length of this response match what it
claims in its `Content-Range` Header. Do not construct resposne from
this cached response if the two does not match.
Testing: http_cache unittest and does not affect any existing WPT test
result.
Fixes: https://github.com/servo/servo/issues/41174
---------
Signed-off-by: rayguo17 <rayguo17@gmail.com>
In the scenario of constructing response from cache resources after
successful validation of expired cache resouce, Instead of just copying
full body of the cached_resource, check if range header exist in
request, if so reuse handle_range_request function to construct
response.
Testing: Should past the manual test case in Issue
https://github.com/servo/servo/issues/40050
Fixes: https://github.com/servo/servo/issues/40050
---------
Signed-off-by: rayguo17 <rayguo17@gmail.com>
These changes add a custom servo:preferences URL that allows modifying
selected preferences at runtime. The goal of this work is to make it
easy to test pages while toggling experimental web platform features,
and support quickly changing the User-Agent header.
Testing: Manually verified that spacex.com loads correctly after
changing the user agent, and that https://polygon.io/ displays grid
elements correctly and no console errors with the experimental prefs
enabled.
Fixes: #35862
<img width="1136" height="880" alt="Screenshot 2025-07-18 at 1 06 23 AM"
src="https://github.com/user-attachments/assets/2d27c321-6ca0-43c3-a347-7bc4b55272df"
/>
---------
Signed-off-by: Josh Matthews <josh@joshmatthews.net>
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>
This is unfortuante, but it's the only way to stop making Stylo's
`malloc_size_of` depend on so many of Servo's dependencies. This is an
important step on the way toward releasing Stylo as standalone software.
When possible, we defer to the implementation of `MallocSizeOf` that is
in the base class.
One benefit of this change is that we start properly measure the size of
WebRender types, which before were always set to zero.
In addition the `Measurable` class is removed in favor of simply
manually implementing `MallocSizeOf`, which doesn't require
uncomfortably modifying the shape of data structures.
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Cache crossorigin test
This adds a test for #24356 to ensure that we don't regress our cache behaviour.
---
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] There are tests for these changes
<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/24370)
<!-- Reviewable:end -->
Various improvements and update to the http cache
<!-- Please describe your changes on the following line: -->
---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: -->
- [ ] `./mach build -d` does not report any errors
- [ ] `./mach test-tidy` does not report any errors
- [ ] These changes fix #___ (GitHub issue number if applicable)
<!-- Either: -->
- [ ] 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. -->
<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/23494)
<!-- Reviewable:end -->
refactoring with ResourceFetchMetadata
implemented deprecated window.timing functionality
created ResourceTimingListener trait
fixed w3c links in navigation timing
updated include.ini to run resource timing tests on ci