Commit graph

244 commits

Author SHA1 Message Date
Martin Robinson
f4d3af296c Move *_traits and other shared types to shared
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`.
2023-11-03 15:38:18 +00:00
Martin Robinson
28315ba48a
Rename messages forwarded from the constellation to the compositor (#30496)
The constellation forwards messages from other tasks to the compositor.
Mainly, these are passed to WebRender. This change updates the names of
these messages so it is clearer where they are coming from and where
they are going.
2023-10-05 16:40:44 +00:00
Samson
aad2dccc9c
Strict import formatting (grouping and granularity) (#30325)
* strict imports formatting

* Reformat all imports
2023-09-11 19:16:54 +00:00
Samson
711dbbd4af
remove extern crate (#30311)
* remove extern crate

* Update components/script_plugins/lib.rs

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

---------

Co-authored-by: Martin Robinson <mrobinson@igalia.com>
2023-09-08 12:11:31 +00:00
Delan Azabani
c3c6c95a9b
constellation: crash to a new “sad tab” error page (#30290)
* constellation: crash to a new “sad tab” page

* check in resources/crash.html

* use a separate enum variant instead of keying on reason

* fmt + tidy

* rename Resource::Crash to Resource::CrashHTML

* clean up crash page and add details (reason + backtrace)

* avoid repeating crash errors in script::script_thread warn log

* make new LoadData init more idiomatic

* clarify comments and new fields

* fix doc comment style
2023-09-06 09:52:37 +00:00
Martin Robinson
bce7622cde
Switch to rustls and webpki-roots (#30025)
This change replaces OpenSSL with rustls and also the manually curated
CA certs file with webpki-roots (effectively the same thing, but as a
crate).

Generally speaking the design of the network stack is the same. Changes:

- Code around certificate overrides needed to be refactored to work with
  rustls so the various thread-safe list of certificates is refactored
  into `CertificateErrorOverrideManager`
- hyper-rustls takes care of setting ALPN protocols for HTTP requests,
  so for WebSockets this is moved to the WebSocket code.
- The safe set of cypher suites is chosen, which seem to correspond to
  the "Modern" configuration from [1]. This can be adjusted later.
- Instead of passing a string of PEM CA certificates around, an enum is
  used that includes parsed Certificates (or the default which reads
  them from webpki-roots).
- Code for starting up an SSL server for testing is cleaned up a little,
  due to the fact that the certificates need to be overriden explicitly
  now. This is due to the fact that the `webpki` crate is more stringent
  with self-signed certificates than SSL (CA certificates cannot used as
  end-entity certificates). [2]

1. https://wiki.mozilla.org/Security/Server_Side_TLS
2. https://github.com/briansmith/webpki/issues/114

Fixes #7888.
Fixes #13749.
Fixes #26835.
Fixes #29291.
2023-08-08 14:00:10 +00:00
2shiori17
74ecc2bd64 Remove net from dependencies 2023-03-20 22:12:50 +09:00
Naveen Gattu
a48a111cee Upgrade Hyper 2022-01-16 09:34:17 -08:00
Josh Matthews
f030162ec3 Make reload button clear the network cache. 2020-07-27 22:34:07 -04:00
Utsav Oza
dd57641987 Propagate referrer policy during about:srcdoc page load 2020-07-02 14:29:27 +05:30
Josh Matthews
6a6662195e net: Add option to temporarily accept certs that failed the handshake. 2020-06-09 15:03:18 -04:00
Josh Matthews
0ce2aa917a net: Pass certs that fail the SSL handshake out of the network layer. 2020-06-09 15:03:18 -04:00
Josh Matthews
b7a640b517 net: Treat SSL handshake errors differently from other hyper errors. 2020-06-09 15:03:18 -04:00
Josh Matthews
eb2f7f7f0a Convert all uses of UpdateResources api to use webrender transactions. 2020-05-11 17:41:56 -04:00
bors-servo
6aec2c8594
Auto merge of #26450 - PeterZhizhin:add_referrerpolicy_to_list_of_relevant_mutations, r=jdm
Add referrerpolicy to list of relevant mutations

<!-- Please describe your changes on the following line: -->

`img.referrerPolicy` change now mutates the image.
Not all `referrerPolicy` attribute changes result in an image update event.
Only valid changes are reflected.

All referrerpolicy tests inside `relevant-mutations.html` WPT test now pass.

---
<!-- 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 #26388

<!-- Either: -->
- [x] These have tests:
```
./mach test-wpt tests/wpt/web-platform-tests/html/semantics/embedded-content/the-img-element/relevant-mutations.html
```
2020-05-07 08:45:12 -04:00
PeterZhizhin
f44c2c9bc5 Added referrerpolicy as relevant mutation for img
This fixes #26388. referrerPolicy is now calls onload for image
mutations. Not all referrerPolicy attribute changes result in an image
update event. Only valid changes are reflected.

Referrerpolicy tests now pass.
2020-05-07 10:12:53 +03:00
Bastien Orivel
ec665d9dce Properly set the url on the Response object when the response is an opaqueredirect 2020-05-06 20:08:26 +02:00
Bastien Orivel
aa43ce8cf3 Fix the redirected attribute for Response 2020-05-05 20:43:56 +02:00
Gregory Terzian
1e017a7082 allow for a service worker network mediator per origin 2020-04-05 22:43:37 +08:00
Simon Sapin
fdcc7653f2 Fix some warnings in future Rust nightlies 2020-01-02 19:22:03 +01:00
Josh Matthews
564c16d754 Use non-IPC webrender API over explicit IPC channels. 2019-11-27 20:47:53 -05:00
Tommy Lincoln
fcad88cddd Add start_time to resource timing. 2019-10-20 07:28:11 -07:00
Tomas Di Vito
bd0c0b65ba implemented secure_connection_start 2019-10-10 14:30:03 -03:00
Javed Nissar
bb8166bb97 Add PerformanceResourceTiming: TimingAllowCheck
The purpose of this commit is to implement https://w3c.github.io/resource-timing/#dfn-timing-allow-check
2019-09-18 11:54:28 -04:00
Alan Jeffrey
49a5e84fb1 Responding to review comments 2019-09-11 11:40:50 -05:00
Alan Jeffrey
1aeb97b281 Prefetch img and scripts during parsing 2019-09-10 16:13:49 -05:00
Simon Sapin
734fa6da2b Update to percent-encoding 2.0 2019-08-17 10:03:44 +02:00
Simon Sapin
9392180007 Update to url 2.0 2019-08-17 10:03:44 +02:00
Thomas Delacour
18178fa107
ISSUE-21257: set redirectEnd on PerformanceResourceTiming 2019-07-19 21:36:24 +02:00
Kamil Niski
d84513cc50 Add PerformanceResourceTiming: domainLookupStart
Remove wpt tests for domainLookupStart

Set ResourceAttribute::DomainLookupTime

Move DomainLookupStart timing before HTTP request initialization

Change label of domainLookupStart TAO zero test to PASS

Adjust the from_resource_timing method to initialize domain_lookup_start value

Restore domainLookupsStart test
2019-06-30 00:20:26 +02:00
Josh Matthews
b1510d9ad5 Upgrade headers, headers-core, and hyper_serde. 2019-06-13 11:08:16 -04:00
est31
fe58aca75d Remove unused code from net and net_traits crates 2019-06-02 02:44:37 +02:00
bors-servo
208d6cb99e
Auto merge of #23323 - nehalem501:master, r=jdm
Implement connectStart in PerformanceResourceTiming

<!-- Please describe your changes on the following line: -->
- Added connectStart where needed (```ResourceFetchTiming```, ```ResourceAttribute```) in ```components/net_traits/lib.rs ```
- Before calling ```client.request``` in ```obtain_response```, we now add the ```connectStart``` attribute (```components/net/http_loader.rs```)
- Updated tests to reflect those changes

---
<!-- 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 #21261 (at least partially)

<!-- 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. -->

<!-- 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/23323)
<!-- Reviewable:end -->
2019-05-17 18:10:09 -04:00
pylbrecht
e5217eed0e Create resource timing entry for sync network fetch 2019-05-08 17:33:39 +02:00
Tomek LECOCQ
a11684460d Add connectStart in PerformanceResourceTiming 2019-05-03 21:47:00 +02:00
Thomas Delacour
fdbec9835c ISSUE-21263: implemented attribute setting in http loader 2019-04-23 12:33:28 -04:00
aditj
64961cc9c1 Add webdriver deletecookies function 2019-04-19 13:15:50 +05:30
Lucas Fantacuci
6b2be9b31d Implementing the builder pattern for RequestInit 2019-04-10 14:01:30 -03:00
pylbrecht
f478357567 Add connectEnd attribute to PerformanceResourceTiming interface 2019-04-04 07:19:25 +02:00
kkpoon
d470373e1c Add PerformanceResourceTiming: redirectStart 2019-02-01 14:55:37 +08:00
Adit Jain
77c9285780 Added fetch_start functionality in http_fetch
Added spec link for webidl.
Added fetch_start functionality to PRT .
Changed the fetch_start location
2019-01-24 23:18:54 +05:30
Simon Sapin
be69f9c3e6 Rustfmt has changed its default style :/ 2018-12-28 13:17:47 +01:00
Anthony Ramine
dbef324e48 Use Mime::get_param 2018-12-12 11:29:14 +01:00
George Roman
73f11d69ea Change Response's statusText default value from 'Ok' to an empty string 2018-11-27 19:26:40 +02:00
ddh
26007fddd3 refactored performance timing to align with updated spec
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
2018-11-20 16:21:32 +00:00
Jan Andre Ikenmeyer
1d6fe65401
Update MPL license to https (part 4) 2018-11-19 14:47:27 +01:00
Simon Sapin
2012be4a8b cargo fix --edition-idioms 2018-11-08 09:28:00 +01:00
Pyfisch
9e92eb205a Reorder imports 2018-11-06 22:35:07 +01:00
Simon Sapin
76e59a46d3 Sort use statements 2018-11-06 15:26:02 +01:00
Simon Sapin
45f7199eee cargo fix --edition 2018-11-06 15:26:02 +01:00