Commit graph

328 commits

Author SHA1 Message Date
Anthony Ramine
b45f1918d1 Remove JS::from_rooted 2016-05-31 14:43:58 +02:00
bors-servo
2f9796fa69 Auto merge of #11329 - c-rhodes:11320, r=jdm
Report use statements that use {} with only one entry

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 --faster` does not report any errors
- [X ] These changes fix #11320  (github issue number if applicable).

Either:
- [X] There are tests for these changes OR
- [ ] These changes do not require tests because _____

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="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/11329)
<!-- Reviewable:end -->
2016-05-27 07:11:17 -05:00
Cullen Rhodes
40acd24e8f Report use statements that use {} with only one entry 2016-05-27 10:18:44 +01:00
Anthony Ramine
34dfc28e98 Move mozbrowser_enabled to util::prefs 2016-05-27 00:55:04 +02:00
Anthony Ramine
cdc7bca944 Move DOMString back to script
This entirely removes the 'non-geckolib' feature of the util crate.
2016-05-24 10:54:57 +02:00
Rahul Sharma
3766cd1673 adding interface for custom responses 2016-05-20 12:11:56 +05:30
Zhen Zhang
a51db4cfa8 Implement trait-based ResourceThreads and clean up related naming issues
Changes include:

- Introduce an IpcSend trait to abstract over a collection of IpcSenders
- Implement ResourceThreads collection to abstract the resource-related
  sub threads across the component
- Rename original ResourceThread and ControlMsg into an unifed CoreResource__
  to accommodate above changes and avoid confusions
2016-05-20 08:00:16 +08:00
Per Lundberg
2f7ed1d73e Removed unused imports
This fixes #11185.
2016-05-15 22:24:26 +03:00
Zhen Zhang
f43009333f Rewrite Blob constructor interface 2016-05-10 20:19:10 +08:00
Keith Yeung
33acb1937c Remove extraneous script_chan parameter from Trusted::new 2016-04-28 10:52:44 +02:00
bors-servo
21c1773115 Auto merge of #10838 - bd339:iss9551, r=KiChjang
Implement step 3 according to spec

Goes towards fixing #9551

<!-- 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/10838)
<!-- Reviewable:end -->
2016-04-27 00:16:08 -07:00
bd339
ac88c5e16b Implement step 3 according to spec 2016-04-27 07:45:38 +02:00
Ramana Venkata
f56bd3a6f3 Allow setting withCredentials in synchronous XMLHttpRequest
closes #10839
2016-04-26 17:08:39 +05:30
Rebecca
526525b835 Add referrer policy pass-through and referrer header logic
add pass-through from doc to http-loader for referrer_policy, ref_URL
add logic for setting referer header
add script pass-through for referrer
add unit tests for setting referer header
2016-04-25 16:41:06 -04:00
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