Commit graph

8815 commits

Author SHA1 Message Date
bors-servo
58c61d3aed
Auto merge of #24315 - notriddle:GH-4577, r=nox
Add simple implementation of content-security-policy on network requests

This needs a lot more hooks before it'll actually be a good implementation, but for a start it can help get some feedback on if this is the right way to go about it.

Part of servo/servo#4577 but we should probably track the rest of the implementation somewhere.

---
<!-- 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] There are tests for these changes (before merging, this PR should fix at least some of the WPT tests for CSP)

<!-- 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/24315)
<!-- Reviewable:end -->
2019-10-17 10:44:00 -04:00
bors-servo
9b59a11b7c
Auto merge of #24408 - servo:jdm-patch-31, r=Manishearth
Synchronize WebGL layer creation with underlying GL APIs

I believe the underlying cause of #24373 is that the XR callbacks can end up executing before the XR WebGL layer setup has occurred. This was observed in the following symptom:
* a DOM exception would be thrown from inside the renderVR function, which is only called from XR's requestAnimationFrame callback
* following this, the webgl thread would panic with a GL error when executing the GL operations invoked from XRWebGLLayer::Constructor

This indicates that _somehow_ the XR rAF callback that raised an exception would have been operating on GL state that was not actually the state intended.

<!-- 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/24408)
<!-- Reviewable:end -->
2019-10-17 02:22:31 -04:00
Michael Howell
b8f3e8bb2e Add simple implementation of content-security-policy on scripts / styles
This needs a lot more hooks before it'll actually be a good
implementation, but for a start it can help get some feedback on if this
is the right way to go about it.

Part of servo/servo#4577
2019-10-16 19:46:45 +00:00
Manish Goregaokar
24bfca9b71 Always request new XR frames 2019-10-15 11:21:17 -07:00
Manish Goregaokar
5e098e3a2a Unconditionally set up rAF loop on initialization 2019-10-15 11:21:17 -07:00
bors-servo
aa916ad20e
Auto merge of #24429 - saschanaz:getpropertykeys, r=jdm
Return false when GetPropertyKeys fails

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

As stated in https://github.com/servo/servo/pull/24377#discussion_r333844560.

---
<!-- 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
- [ ] 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. -->
2019-10-15 11:59:09 -04:00
bors-servo
c5d6bb604d
Auto merge of #24377 - saschanaz:record-support, r=nox
Support WebIDL `record<>`

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

Rebased @taki-zaro's work (#20318).

---
<!-- 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 #15012 and closes #20318. Possibly also closes #21463.

<!-- Either: -->
- [x] There are tests for these changes

<!-- 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/24377)
<!-- Reviewable:end -->
2019-10-15 08:33:46 -04:00
Kagami Sascha Rosylight
b697621b05 Support WebIDL record<> 2019-10-15 17:14:00 +09:00
Kagami Sascha Rosylight
764f1a3724 Return false when GetPropertyKeys fails 2019-10-12 18:57:05 +09:00
Manish Goregaokar
49a8ed0e9e Expose onvisibilitychange 2019-10-11 16:12:37 -07:00
Manish Goregaokar
d90317cfe4 Fire visibilitychange event appropriately 2019-10-11 16:02:30 -07:00
Manish Goregaokar
75c763120f Expose XRSession.visibilityState 2019-10-11 16:01:12 -07:00
Manish Goregaokar
26b2f02210 Report correct environmentblendmode 2019-10-11 13:09:13 -07:00
Manish Goregaokar
66fea73289 Remove XRSession.mode 2019-10-11 12:42:49 -07:00
bors-servo
723df4abcf
Auto merge of #24379 - PeaceRebel:dom_response_check_opaque_filter, r=jdm
Dom response check opaque filter

<!-- Please describe your changes on the following line: -->
Added setters for url_list, status, and body in `Response`. Response members are set for [Network Error](https://fetch.spec.whatwg.org/#concept-network-error), [Opaque](https://fetch.spec.whatwg.org/#concept-filtered-response-opaque) and [Opaque-redirect](https://fetch.spec.whatwg.org/#concept-filtered-response-opaque-redirect) responses.

---
<!-- 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 #24372 (GitHub issue number if applicable)

<!-- Either: -->
- [x] There are tests for these changes

<!-- 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/24379)
<!-- Reviewable:end -->
2019-10-11 10:45:58 -04:00
peacerebel
0f1ddc6fea Set DOM response members as per the spec for opaque, opaque-redirect and error responses
Signed-off-by: Bipin <peacerebel@protonmail.com>
2019-10-11 10:06:29 +00:00
bors-servo
d28d9fe273
Auto merge of #23990 - tomasdivito:add-secure-connection-start, r=jdm
Add secure connection start

Implementing `secure_connection_start` as well as we can, this is related to #21268

We are setting the value as well as we can since we don't have a way to know if we are currently using a secure transport or where the handshake before the connection is done as the spec says on the step 15 [https://w3c.github.io/resource-timing/#sec-process](https://w3c.github.io/resource-timing/#sec-process)

Regarding the Timing Allow Check, that's being done on another PR by another person which will take care of setting the rest of the values on `PerformaceResourceTiming` to Zero and prevent them to set them any other way.

I'm currently setting the `secure_connection_time` using `precise_time_ms()` as the `connection_start` and `connection_end` are set that way... but other attributes inside `PerformanceResourceTiming` are set using `precise_time

Another thing, the issue talks about setting `redirect_start` but I'm not really sure if it's related, if so I can look up into that too... I might have just read and thought it was all about secure connection start.

---
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [ ] These changes fix #21268

<!-- Either: -->
- [ ] There are tests for these changes OR
- [ ] These changes do not require tests because ___

<!-- 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/23990)
<!-- Reviewable:end -->
2019-10-10 22:16:27 -04:00
bors-servo
b3a97f29e8
Auto merge of #24312 - SiddharthaMishra:master, r=jdm
don't send progress event for empty blob

<!-- 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: -->
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #24289 (GitHub issue number if applicable)

<!-- 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/24312)
<!-- Reviewable:end -->
2019-10-10 17:50:37 -04:00
Siddhartha Mishra
6735b68a00 don't send progress event for empty blob 2019-10-10 23:27:05 +05:30
Tomas Di Vito
bd0c0b65ba implemented secure_connection_start 2019-10-10 14:30:03 -03:00
bors-servo
ab8d99856e
Auto merge of #24386 - jdm:no-preserve-drawing-buffer, r=nox
webgl: Clear the drawing buffer when preserveDrawingBuffer is false.

This adds an explicit clear operation to a webgl canvas when the preserveDrawingBuffer attribute is false when creating the context. Because we're not using double buffering this may end up making some demos worse (ie. a clear operation at a random time while drawing a frame), but this problem is expected to go away when #24256 is fixed and we move to a multi-buffered frame setup. This change is important at this time because so many babylon.js demos rely on the engine clearing the frame, per the specification.

---
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix #21132
- [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/24386)
<!-- Reviewable:end -->
2019-10-10 12:09:32 -04:00
Josh Matthews
c53680b282 webgl: Lazily clear the canvas right before the first webgl command of the next frame. 2019-10-10 09:57:20 -04:00
Manish Goregaokar
c521d8ec01 Support grip spaces in WebXR 2019-10-09 14:00:03 -07:00
Josh Matthews
6ce5c25b72
xr: Synchronize WebGL layer creation with underlying GL APIs. 2019-10-09 09:42:26 -04:00
bors-servo
ec408e9a57
Auto merge of #24397 - Manishearth:inputarray, r=jdm
Support new way of doing input source arrays

Fixes https://github.com/servo/servo/issues/24395

r? @jdm

<!-- 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/24397)
<!-- Reviewable:end -->
2019-10-08 21:16:10 -04:00
Manish Goregaokar
8ae1c2e0ad Hook XRInputSourceArray into XRSession 2019-10-08 15:34:20 -07:00
Manish Goregaokar
868e5cbd62 Add methods to XRInputSourceArray 2019-10-08 15:34:20 -07:00
Manish Goregaokar
0777233412 Store inputs array in XRInputSourceArray 2019-10-08 15:34:20 -07:00
Manish Goregaokar
b5b852be75 Add empty XRInputSourceArray interface 2019-10-08 15:34:20 -07:00
bors-servo
a7d48dca80
Auto merge of #24333 - mmatyas:webgl_fns_samplers, r=jdm
Add WebGLSampler support

Reference: https://www.khronos.org/registry/webgl/specs/latest/2.0/#3.7.13

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

cc @jdm @zakorgy

---
<!-- 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
- [ ] These changes fix #___ (GitHub issue number if applicable)

<!-- 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/24333)
<!-- Reviewable:end -->
2019-10-08 11:56:11 -04:00
Mátyás Mustoha
26df1962c3 Add WebGLSampler support
Reference: https://www.khronos.org/registry/webgl/specs/latest/2.0/#3.7.13
2019-10-08 16:21:43 +02:00
bors-servo
75548f40c6
Auto merge of #24340 - jdm:image-cache-cors, r=Manishearth
Allow using CORS filtered image responses as WebGL textures

More specifically, this makes the "is this image same origin?" check consider the CORS status of the original response, rather than relying on an overly-strict "is this image's response's URL same-origin with a particular global?" check. To do this, we make the image cache double keyed based on the requested URL as well as the requesting origin, and store the CORS status of the eventual response with the final image that eventually gets sent to the HTMLImageElement consumer.

---
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix #24330 and fix #24368
- [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/24340)
<!-- Reviewable:end -->
2019-10-07 18:39:36 -04:00
Otávio Pace
a1acd29339 response: remove text from default statusCode
According to the specification the text of the
default statusCode should be empty.

Reference: https://fetch.spec.whatwg.org/#concept-response-status-message
2019-10-07 08:23:44 -03:00
Josh Matthews
a241232c2b Add useful debug output for HTTP response and image cache. 2019-10-04 15:08:40 -04:00
Josh Matthews
1df8d57dc6 Support CORS attributes for image elements. 2019-10-04 15:08:40 -04:00
Víctor Manuel Jáquez Leal
b75d454162 implement get_image_pixels() for video element 2019-10-04 18:08:06 +02:00
Víctor Manuel Jáquez Leal
bc07154e05 Always hold current frame
Regardless if it contains raw data or a gl texture.

It is required to hold current frame because it can be used for
webgl's get_image_pixels
2019-10-04 18:08:06 +02:00
Josh Matthews
583536c940 Use the paint worklet's base URL for the 2d canvas' origin checks. 2019-10-04 09:22:21 -04:00
Josh Matthews
81a67aed9e Double key image cache by requesting origin, and store CORS status with cached images. 2019-10-04 09:22:21 -04:00
Manish Goregaokar
b094ceb076 Add event handlers for sessionend events 2019-10-03 14:13:51 -07:00
Manish Goregaokar
2e577f7eec Fire selection events from XR input sources 2019-10-03 14:13:51 -07:00
Manish Goregaokar
50b1ddf065 Add XRInputSourceEvent 2019-10-03 12:22:41 -07:00
Manish Goregaokar
4c4cfb9834 Update webxr 2019-10-03 12:22:41 -07:00
Manish Goregaokar
1062249fd8 Make poses nullable 2019-10-03 12:22:15 -07:00
Kagami Sascha Rosylight
2660f35925 Remove [PrimaryGlobal] 2019-10-03 14:25:23 +09:00
bors-servo
84693d8117
Auto merge of #24344 - saschanaz:vslatest, r=jdm
Support `--features vslatestinstalled`

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

Matches https://github.com/servo/rust-mozjs/pull/477.

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

<!-- 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/24344)
<!-- Reviewable:end -->
2019-10-02 23:27:20 -04:00
bors-servo
f54c15bc48
Auto merge of #24345 - saschanaz:remove-constructor, r=jdm
Migrate to new constructor operation syntax

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

Marking everything as `[Throws]` for simplicity sake (and this matches the previous codegen behavior), but we'll want to unmark some of them as not everything throws.

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

<!-- Either: -->
- [x] There are tests for these changes

<!-- 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/24345)
<!-- Reviewable:end -->
2019-10-02 19:55:43 -04:00
bors-servo
d1b16afe04
Auto merge of #24342 - petosorus:null_responseXml, r=jdm
XMLHttpRequest.responseXML returns null when a network error occurs

<!-- 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: -->
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix #24285 (GitHub issue number if applicable)

<!-- Either: -->
- [x] There are tests for these changes OR
- [ ] These changes do not require tests because tests ___

<!-- 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/24342)
<!-- Reviewable:end -->
2019-10-02 17:38:46 -04:00
bors-servo
218a2aefc5
Auto merge of #24265 - sreeise:track_selection, r=jdm
Integrates media track selection

<!-- Please describe your changes on the following line: -->
Updates audio/video track selection to use the servo media player track selection methods.

This is technically only a partial fix because only one audio track can be set at a time and servo_media needs to be updated to handle multiple audio tracks. Once/if this goes through I can file follow up issue for that.

I believe this also inadvertently covers at least some of #22912

---
<!-- 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 #22799 (GitHub issue number if applicable)

<!-- Either: -->
- [ ] There are tests for these changes OR
- [x] These changes do not require tests because -  This probably should have a test case. But I am not aware of a way, at least not from servo, to test that the actual audio or video changed in the underlying player or on screen.

<!-- 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/24265)
<!-- Reviewable:end -->
2019-10-02 10:53:53 -04:00
Kagami Sascha Rosylight
9ce82ea1ae Migrate to new constructor operation syntax 2019-10-02 21:45:30 +09:00