Commit graph

214 commits

Author SHA1 Message Date
Simon Sapin
7932ab6ac2 Upgrade to rust-url 1.0 and hyper 0.9 2016-04-23 20:27:58 +02:00
Ravi Shankar
5e6f32a59b Propagating the load errors from network loader 2016-04-20 12:38:35 -04:00
Josh Matthews
dd5e28e0e6 Do not support XHR.responseXML in worker globals. Fixes #8931. 2016-04-13 13:56:07 -04:00
bors-servo
07304235cc Auto merge of #10502 - KiChjang:fix-open-url-base, r=Ms2ger
Add API base url method to global objects

This adds an `api_base_url` function to global objects, which fixes `open-url-base.htm` under XMLHttpRequest.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/10502)
<!-- Reviewable:end -->
2016-04-11 17:57:02 +05:30
Keith Yeung
c75079eff3 Add API base url method to global objects 2016-04-11 07:49:31 -04:00
Nazım Can Altınova
d49a84c762 Replaced SendParam with BodyInit 2016-04-10 01:02:04 +03:00
Rahul Sharma
2caa9a2a76 refactors entities from script_thread into script_runtime 2016-04-06 12:46:49 +05:30
Eitan Mosenkis
ae56187d48 Allow XHR to fetch about: and data: URLs.
This was intended to fix #8015 but the tests are all still failing as of
this commit.
2016-04-01 16:15:54 -10:00
Josh Matthews
2cfedc7288 Report errors from ScriptPort trait methods. 2016-03-31 17:14:23 +02:00
Paul Rouget
dd08e904eb Disable cross origin check for mozbrowser-enabled top level pipelines 2016-03-28 10:29:31 +02:00
Shing Lyu
f55b0765d1 Bug 8830 - Implemented XMLHttpRequest.responseURL 2016-03-22 13:56:31 +08:00
Ms2ger
b1cd28e9c6 Store the encoding in the Document rather than its name. 2016-03-18 16:22:52 +01:00
Arpad Borsos
c880c97b1b rename deprecated utf16_units to encode_utf16 2016-03-07 16:14:04 +01:00
Chandler Abraham
7c3a8d3f5b swap w3c spec link for whatwg, removed user-agent from disallowed headers 2016-02-26 11:04:34 -05:00
Chandler Abraham
c375ad5e95 disallow restricted XMLHttpRequest header prefixes 2016-02-26 11:04:33 -05:00
Tim Neumann
fac4c31b42 implement XHR::SetRequestHeader Step 3 2016-02-23 15:22:37 +01:00
Tim Neumann
746f7dd29e move method from ByteString to module where it was used 2016-02-23 15:21:35 +01:00
Tim Neumann
3af3926d63 remove rarely used is_token method from ByteString 2016-02-23 15:21:35 +01:00
Ms2ger
2547fcb1e9 Remove an unused import from xmlhttprequest. 2016-02-23 13:59:02 +01:00
benshu
f2d4a7bbca Clean up of script timer code.
The code was split into the following two abstractions.
 - OneshotTimers can be used to schedule arbitrary oneshot timers, such
   as XHR-Timeouts.
 - JsTimers (`setTimeout` and `setInterval`) which use OneshotTimers to
   schedule individual callbacks.

With this change the implementation (of JsTimers in particular) is in
much closer alignment with the specification.
2016-02-20 22:43:16 +01:00
bors-servo
94d28bfecf Auto merge of #9700 - servo:xhr-to-owned, r=KiChjang
Avoid some spurious string copies in XHR.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.svg" height="40" alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9700)
<!-- Reviewable:end -->
2016-02-19 22:23:35 +05:30
bors-servo
aae6525f7d Auto merge of #9684 - danlrobertson:i9655, r=KiChjang
Add methods to move ByteStrings underlying bytes

Add methods to move the underlying `Vec<u8>` for `ByteString`.

I saw this as at least two methods. One to "move and replace with and empty Vec<u8> (`bytes`), and one to take ownership of the whole object (`own_bytes`). I typically also don't like adding methods with out unit tests. If you think they're unnecessary, just let me know.

As always, please let me know if you have any comments, critiques, or nits!

Fixes #9655

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.svg" height="40" alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9684)
<!-- Reviewable:end -->
2016-02-19 17:21:14 +05:30
bors-servo
361bb24a49 Auto merge of #9610 - liviuba:Fix-9553, r=KiChjang
Bypass GetResponseXML to better match spec

Resolves https://github.com/servo/servo/issues/9553

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.svg" height="40" alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9610)
<!-- Reviewable:end -->
2016-02-19 15:39:59 +05:30
liviuba
347f3c15b2 Add caching to document_response 2016-02-19 11:30:09 +02:00
Ms2ger
18e6a63851 Avoid some spurious string copies in XHR. 2016-02-19 09:31:35 +01:00
bors-servo
ee158cc65f Auto merge of #9603 - Ms2ger:document-bc, r=jdm
Store a pointer to the browsing context in the Document.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.svg" height="40" alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9603)
<!-- Reviewable:end -->
2016-02-19 12:49:35 +05:30
bors-servo
96d185359d Auto merge of #9383 - KiChjang:xhr-cleanup, r=Ms2ger
Clean up XHR API

I've also added annotations about the steps that we're performing within each method.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9383)
<!-- Reviewable:end -->
2016-02-19 02:25:18 +05:30
Daniel Robertson
d23774d3d7 Add methods to move ByteStrings underlying bytes
Add methods to move the underlying Vec<u8> for ByteString.
2016-02-18 19:40:24 +00:00
Kamil Muszyński
c6dfd7e2fa Issue #9561 continued - renamed *_thread_source to *_task_source in global.rs and related files 2016-02-17 21:25:12 +01:00
Keith Yeung
066c5ea73a Clean up XHR API 2016-02-17 12:44:54 -05:00
bors-servo
c388c83dcd Auto merge of #9625 - danlrobertson:i9547, r=KiChjang
Implement step 9 of XHR Open method

Implement step 9 of the [XMLHttpRequest Open](https://xhr.spec.whatwg.org/#dom-xmlhttprequest-open) method. Thanks to @KiChjang for all the help!

As always, comments and critiques are welcomed!

Fix: #9547

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.svg" height="40" alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9625)
<!-- Reviewable:end -->
2016-02-17 02:51:44 +05:30
Daniel Robertson
10e7af50fe Implement step 9 of XHR open method
Implement step 9 of the Open method for XMLHttpRequest.
2016-02-15 04:57:24 +00:00
Keith Yeung
6be5218d3c Cache XHR JSON responses 2016-02-14 23:55:43 -05:00
Daniel Robertson
0b0e1473cd Implement Blob response for XMLHttpRequest: #9623
In response to #9623 implement the Blob response for XML HttpRequest and
change the expected result for the script test.
2016-02-14 20:00:30 +00:00
Ms2ger
152cec69eb Store a pointer to the browsing context in the Document. 2016-02-11 13:08:11 +01:00
Ms2ger
bc6548fa80 Stop importing XMLHttpRequestResponseType variants. 2016-02-09 10:10:01 +01:00
bors-servo
28ecb0bba3 Auto merge of #9543 - alopatindev:enums_constructors_codingstyle_fix, r=KiChjang
Fix #9508: Beautify our union enums constructors

Solves #9508
@jdm Please review. Thanks!

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.svg" height="40" alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9543)
<!-- Reviewable:end -->
2016-02-07 05:59:57 +05:30
Alexander Lopatin
2be49404be Fix #9508: Beautify our union enums constructors 2016-02-07 02:55:21 +03:00
Tim van der Meij
816c65aab0 Make step 3 of XHR's SetResponseType method match the specification 2016-02-06 22:33:42 +01:00
bors-servo
b3bbea8be8 Auto merge of #9536 - Ms2ger:dead, r=nox
Remove a dead_code annotation from a live method.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.svg" height="40" alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9536)
<!-- Reviewable:end -->
2016-02-05 10:02:25 +05:30
Anthony Ramine
cb5cd8d881 Say farewell to in-tree HeapSizeOf 2016-02-04 22:03:32 +01:00
Ms2ger
31dbb29895 Remove a dead_code annotation from a live method. 2016-02-04 15:17:09 +01:00
St.Spyder
763b99258f Update XHR BodyInit, update extract method impl 2016-01-18 02:26:13 +05:30
Keith Yeung
a64f832e57 Change all DOMStrings to USV strings for XHR 2016-01-16 08:51:34 -05:00
Chad Kimes
ce6075825d Add global default method for Reflectable trait 2016-01-11 20:23:47 -05:00
Chad Kimes
9371c041a3 Remove global field from XMLHttpRequest 2016-01-10 22:34:44 -05:00
rohan.prinja
1f02c4ebbb task -> thread 2016-01-10 17:58:13 +09:00
Johannes Linke
6b215f38ee Fix a bunch of clippy lints 2016-01-02 23:27:15 +01:00
David Rajchenbach-Teller
1e81b8c133 Resolves #4183 - Implemementing context-based MIME type sniffing
The version of the standard is not finalized at the time of this writing.
Specifications may be found here: https://mimesniff.spec.whatwg.org/#context-specific-sniffing .
2015-12-31 07:45:03 -05:00
Mathieu Agopian
11234f5370 Use Url.join instead of UrlParser.base_url(...).parse (#9002) 2015-12-18 17:02:41 +01:00