Implementation of HTTP Redirect Fetch step
I've made a first draft of a complete implementation of HTTP Redirect Fetch, most of which is just refactored out of HTTP Fetch. I've also made some minor changes in a few other steps, all collected in the second commit, based on recent changes to the Fetch Standard. Since HTTP Redirect Fetch is so new, I figured now would be a fine time to make those other changes.
The biggest thing on my mind right now is how the spec says[1] "This algorithm will be used by HTML's "navigate" algorithm in addition to HTTP fetch above." This makes me think that this function, as well as HTTP Fetch, need to public, or at least have a public-facing function- since each Fetch function takes an Rc<Request>, which might be weird to require callers to supply.
[1] https://fetch.spec.whatwg.org/#http-redirect-fetch
<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.svg" height="40" alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9608)
<!-- Reviewable:end -->
Issue #9561 continued - renamed *_thread_source to *_task_source
components/script/dom/bindings/global.rs modified -> all *_thread_source occurrences renamed to *_task_source to comply with spec
<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.svg" height="40" alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9683)
<!-- Reviewable:end -->
Implement RootedReference<T> for Option<JS<T>>
A basic implementation of `RootedReference for Option<JS<T>>` based off of
other implementations of `RootedReference` for `Option` wrapped types.
Really I just wanted an excuse to read more in `bindings` 😄 Let me know
if you have any comments or critiques.
Fixes #9654
<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.svg" height="40" alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9664)
<!-- Reviewable:end -->
CORS Preflight Logic Fix
Fix check to set flag if any header is not a simple header, rather than only if all
headers are simple headers.
Fix failing tests to allow merge in advance of @nikkibee's changes
as per @jdm's direction via IRC.
<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.svg" height="40" alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9667)
<!-- Reviewable:end -->
Fix a broken reftest.
The strong element has a different font weight by default. This means that the line height
is slightly different from the ref test. In normal Servo this doesn't matter due to how the
default snapping works.
However, in both WebRender and Firefox, this results in the reftests being one pixel different.
Setting the font weight to be normal makes the reftest pass in Servo, WebRender and FF.
<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.svg" height="40" alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9665)
<!-- Reviewable:end -->
Fix check to set flag if any header is a simple header.
Fix failing tests to allow merge in advance of @nikkibee's changes
as per @jdm's direction via IRC
The <strong> element has a different font weight by default. This means that the line height
is slightly different from the ref test. In normal Servo this doesn't matter due to how the
default snapping works.
However, in both WebRender and Firefox, this results in the reftests being one pixel different.
Setting the font weight to be normal makes the reftest pass in Servo, WebRender and FF.
Add informative error messages when parsing command line options returns an error
The background behind why I'm submitting this PR is slightly embarrassing. After running `./mach` with some servo options I got the following stack backtrace.
```
thread '<main>' panicked at 'called `Result::unwrap()` on an `Err` value: ParseIntError { kind: InvalidDigit }', ../src/libcore/result.rs:746
stack backtrace:
1: 0x56459001b0b0 - sys::backtrace::tracing:👿:write::hb120982054a416e35nu
2: 0x56459001e02b - panicking::default_handler::_$u7b$$u7b$closure$u7d$$u7d$::closure.42840
3: 0x56459001dc96 - panicking::default_handler::h7ae2e4523ef4c187IFy
4: 0x56459000760c - sys_common::unwind::begin_unwind_inner::h5fb19481d14902dbDgt
5: 0x564590007cf8 - sys_common::unwind::begin_unwind_fmt::hd62d57279546b0f2Jft
6: 0x56459001a701 - rust_begin_unwind
7: 0x56459004c01f - panicking::panic_fmt::h27f7225e08792f40qYL
8: 0x56458f393901 - result::unwrap_failed::h18215968003310890981
at ../src/libcore/macros.rs:29
9: 0x56458f3937b9 - result::Result<T, E>::unwrap::h10319050269194353824
at ../src/libcore/result.rs:687
10: 0x56458f383701 - opts::from_cmdline_args::h8ea8d8c87dc6ee726lg
at /home/drobertson/git/servo/components/util/opts.rs:599
11: 0x56458d1f8cdf - main::h8517eb49d15e90fbNaa
at /home/drobertson/git/servo/components/servo/main.rs:53
12: 0x56459001d8f4 - sys_common::unwind::try::try_fn::h9076850075504893162
13: 0x56459001a68b - __rust_try
14: 0x56459001d36e - rt::lang_start::h58a22f304b0c1e19Oxy
15: 0x56458d2f4aa9 - main
16: 0x7f370496360f - __libc_start_main
17: 0x56458d1c04a8 - _start
18: 0x0 - <unknown>
Servo exited with return value 101
```
I immediately opened up `gdb` and got to work only to realize that the error was due to a typo in an option that had been `unwrap`ed at [components/util/opts.rs:599](https://github.com/servo/servo/blob/master/components/util/opts.rs#L599). Perhaps some more informative error messages will help prevent some future face-palm moments like mine 😄
I couldn't think of a good way to add tests for this. Please let me know if I missed something. Comments and critiques are welcome!
<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.svg" height="40" alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9600)
<!-- Reviewable:end -->
Implement Blob response for XMLHttpRequest: #9623
My first attempt at implementing the Blob response for XMLHttpRequest. The expected result for the response `tests/wpt/web-platform-test/HMLHttpRequest/response-blob-data.htm` is also changed to `PASS`. Please let me know if you see any areas in which I can improve this PR!
Fixes#9623
<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.svg" height="40" alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9629)
<!-- Reviewable:end -->