Commit graph

9799 commits

Author SHA1 Message Date
Utsav Oza
dd57641987 Propagate referrer policy during about:srcdoc page load 2020-07-02 14:29:27 +05:30
Utsav Oza
310821d3b0 Update referrer computation
Update unit tests for determine_requests_referrer

Update wpt metadata

Add missing spec links
2020-07-02 14:29:26 +05:30
Kunal Mohan
891a3bd30e Encapsulate buffer map fields in a separate struct 2020-07-01 23:58:55 +05:30
Kunal Mohan
575036bb88 Implement GPUBuffer.getMappedRange() 2020-07-01 20:37:17 +05:30
bors-servo
4b034ede46
Auto merge of #26752 - ferjm:datachannel, r=Manishearth
WebRTC data channels support

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

This depends on https://github.com/servo/media/pull/350 and contains the basic pieces to make a  simple test like https://ferjm.github.io/samples/src/content/datachannel/basic/ work
2020-06-30 13:53:32 -04:00
Fernando Jiménez Moreno
27f439a71c Hide interfaces behind webrtc pref 2020-06-30 15:58:39 +02:00
bors-servo
db00c1f96e
Auto merge of #27114 - paulrouget:key_events, r=jdm
[UWP] Key events

This is the initial work required for proper keyboard events.
The text controller implementation is very basic, just enough to show the virtual keyboard when it's needed, and have basic key events.
2020-06-30 09:41:15 -04:00
bors-servo
b9404fcd48
Auto merge of #27016 - gterzian:fix_closing_window, r=jdm,paulrouget
Ensure clean shutdown of JS threads

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

FIX https://github.com/servo/servo/issues/26685
FIX https://github.com/servo/servo/issues/26996
FIX https://github.com/servo/servo/issues/9672
FIX #27027

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: -->
- [ ] `./mach build -d` does not report any errors
- [ ] `./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. -->
2020-06-30 02:06:57 -04:00
Gregory Terzian
44ebca72da ensure clean shutdown of all threads running JS 2020-06-30 13:22:38 +08:00
Fernando Jiménez Moreno
6ebb73d9a4 Fix rooting issue 2020-06-29 16:53:50 +02:00
Fernando Jiménez Moreno
7eb44f81f2 Fix data channels borrowing errors 2020-06-29 16:53:50 +02:00
Fernando Jiménez Moreno
b968852456 Do not register data channel twice 2020-06-29 16:53:50 +02:00
Fernando Jiménez Moreno
820ea452e7 Set data channels as closed on peer connection close 2020-06-29 16:53:49 +02:00
Fernando Jiménez Moreno
2dedcaeaaf Allow receiving binary data channel messages 2020-06-29 16:53:48 +02:00
Fernando Jiménez Moreno
f855fbb604 Allow sending binary messages 2020-06-29 16:53:48 +02:00
Fernando Jiménez Moreno
7db485aeb2 RTCDataChannel.readyState getter 2020-06-29 16:53:48 +02:00
Fernando Jiménez Moreno
9d456d5d17 Use data channel ids 2020-06-29 16:53:48 +02:00
Fernando Jiménez Moreno
960b010d30 Cleanups and tidy fixes 2020-06-29 16:53:48 +02:00
Fernando Jiménez Moreno
ace0d7795e Fix rooting issues with data channels callbacks 2020-06-29 16:53:48 +02:00
Fernando Jiménez Moreno
f5c930087e Implement ondatachannel event 2020-06-29 16:53:48 +02:00
Fernando Jiménez Moreno
2c5fc3b3c8 Allow sending strings through data channels 2020-06-29 16:53:47 +02:00
Fernando Jiménez Moreno
82260a9d2b On data channel message handler 2020-06-29 16:53:47 +02:00
Fernando Jiménez Moreno
5c6dcbf54e Trigger RTCErrorEvent on data channel error 2020-06-29 16:53:47 +02:00
Fernando Jiménez Moreno
84598a5173 Introduce RTCError and RTCErrorEvent 2020-06-29 16:53:47 +02:00
Fernando Jiménez Moreno
4e6d3e7cec WebRTCDataChannel initial support 2020-06-29 16:53:47 +02:00
Paul Rouget
7653c6c9fc update keyboard-types crate 2020-06-29 10:27:54 +02:00
Alan Jeffrey
349619ed2d Support for webxr layer management 2020-06-28 16:37:45 -05:00
Kunal Mohan
db2d313a1b Fix ArrayBuffer creation in buffer mapping 2020-06-27 21:32:18 +05:30
Kunal Mohan
b484836dbc Ensure proper unmap of buffer 2020-06-27 20:27:18 +05:30
Kunal Mohan
ef3b141406 address review comments 2020-06-27 20:27:18 +05:30
Kunal Mohan
b74cea3a46 Implement GPUBuffer.mapAsync and update wgpu-core 2020-06-27 20:27:17 +05:30
bors-servo
6659e9004d
Auto merge of #27032 - mrobinson:fractional-iteration, r=jdm
animations: Finish support for fractional iteration counts

This change also improves support for creating animations with negative
delays, as that is necessary to test support for fractional iteration
lengths.

Fixes: #14858

<!-- 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 #14858
- [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. -->
2020-06-24 15:54:27 -04:00
Martin Robinson
954b5177f0 animations: Finish support for fractional iteration counts
This change also improves support for creating animations with negative
delays, as that is necessary to test support for fractional iteration
lengths.

This change also adjusts existing Servo animation tests which assumed
that advancing to the exact moment of the end of the animation would be
considered "before the end." With this change, this moment is "after the
end."

Fixes: #14858
2020-06-24 17:19:25 +02:00
bors-servo
c76d1318f3
Auto merge of #27034 - CYBAI:fix-nested-modules, r=Manishearth
Fix nested modules while imported under more than 3 levels

This is kind of workaround to fix the issue but #26903 should provide much better solution to remove the checking.

---
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix #27029
- [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. -->
2020-06-22 22:22:44 -04:00
CYBAI
a7221fd74c Rollback to recursively check dependency status
In https://github.com/servo/servo/pull/26395/files#diff-3fe97584f564214ec8e7ebbf91747e03L253-R318,
we moved from `recursive checking` of dependency status to check only the
_current module_'s dependency status and its descendant dependency status and
also circular dependency status.

However, it will cause an issue.

For example, if the module dependency is like following

```
a -> b -> c -> d -> e
f -> g -> h -> c -> d -> e
```

In this example, if the d module is still under fetching but g is trying
to advance to finish. Then, it will cause a panic because module d is
g's grand-grand-grand-descendant which means it's still under fetching
and we can't instantiate module g.

Ideally, we should get rid of the checking in #26903 so, before #26903
fixed, we can just move back to the recursive checking way which will
ensure all descendants are not fetching.
2020-06-23 10:01:46 +09:00
bors-servo
0916ae3b3a
Auto merge of #27042 - KallynGowdy:js-backtrace-build-fix, r=jdm
Fix building with --feature js_backtrace

This PR fixes an build error that I ran into when using the `--features js_backtrace` flag.

In particular, the error I ran into was this:
```
error[E0061]: this function takes 2 arguments but 1 argument was supplied
   --> components\script\dom\bindings\error.rs:113:45
    |
113 |         let js_stack = stack.and_then(|s| s.as_string(None));
    |                                             ^^^^^^^^^ ---- supplied 1 argument
    |                                             |
    |                                             expected 2 arguments
```

It seems that the `mozjs` crate updated the [`as_string()` method on `CapturedJSStack`](https://doc.servo.org/mozjs/rust/struct.CapturedJSStack.html#method.as_string) to take two parameters. I've chosen to use `StackFormat::Default` because that will presumably preserve the original intended behavior.

I additionally had to make the block wrapping the feature unsafe as I ran into a "must be marked as unsafe to call unsafe code" build error after fixing the above issue. Seems that this commit (0703a1ad6d) forgot that part.

#### Other Notes

After these changes, I was able to build but ran into an access violation error during runtime. When a JS error hit [`throw_dom_exception()`](https://github.com/servo/servo/blob/master/components/script/dom/bindings/error.rs#L109) and the JS stack was pulled, some sort of issue was hit inside mozjs and [`MOZ_NoReturn()`](bdccbdc656/mozjs/mfbt/Assertions.h (L235)) was called, which will obviously cause an issue.

It is worth noting that this only happened on my test platform (Hololens 2) and not on MacOS or in the Hololens 2 emulator. Additionally, the debug logs were not particularly helpful at identifying the culprit. Maybe it is worth making a full issue for?

Here's the full details:

Error message:
```
Exception thrown at 0x00007FFBCDD16784 (simpleservo.dll) in ServoApp.exe: 0xC0000005: Access violation writing location 0x0000000000000000.
```

Stack Trace:
```
simpleservo.dll!MOZ_NoReturn(int aLine) Line 236
	at E:\Projects\Yeti\servo\target\aarch64-uwp-windows-msvc\debug\build\mozjs_sys-aa48eb6c20c205d4\out\build\dist\include\mozilla\Assertions.h(236)
simpleservo.dll!js::SavedStacks::insertFrames(JSContext * cx, JS::MutableHandle<js::SavedFrame *> frame, mozilla::Variant<JS::AllFrames,JS::MaxFrames,JS::FirstSubsumedFrame> && capture) Line 0
	at E:\.cargo\git\checkouts\mozjs-fa11ffc7d4f1cc2d\9a6d8fc\mozjs\js\src\vm\SavedStacks.cpp(0)
simpleservo.dll!js::SavedStacks::saveCurrentStack(JSContext * cx, JS::MutableHandle<js::SavedFrame *> frame, mozilla::Variant<JS::AllFrames,JS::MaxFrames,JS::FirstSubsumedFrame> && capture) Line 1292
	at E:\.cargo\git\checkouts\mozjs-fa11ffc7d4f1cc2d\9a6d8fc\mozjs\js\src\vm\SavedStacks.cpp(1292)
simpleservo.dll!JS::CaptureCurrentStack(JSContext * cx, JS::MutableHandle<JSObject *> stackp, mozilla::Variant<JS::AllFrames,JS::MaxFrames,JS::FirstSubsumedFrame> && capture) Line 5926
	at E:\.cargo\git\checkouts\mozjs-fa11ffc7d4f1cc2d\9a6d8fc\mozjs\js\src\jsapi.cpp(5926)
simpleservo.dll!mozjs::rust::CapturedJSStack::new(mozjs::rust::RootedGuard<mut mozjs_sys::generated::root::JSObject*> cx, core::option::Option<u32> guard) Line 1337
	at E:\.cargo\git\checkouts\rust-mozjs-8611526964119dd6\28248e1\src\rust.rs(1337)
simpleservo.dll!script::dom::bindings::error::throw_dom_exception(script::script_runtime::JSContext cx, script::dom::globalscope::GlobalScope * global, script::dom::bindings::error::Error result) Line 114
	at E:\Projects\Yeti\servo\components\script\dom\bindings\error.rs(114)
```

Repro:

1. Make a build on Windows for the Hololens 2.
    -   This is the command I used: `C:\Python27\python.exe mach build -d --uwp --win-arm64 --features js_backtrace`
2. Open the project in Visual Studio.
3. Change the default URL in `DefaultUrl.h` to `"http://yeticgi.casualos.com/?story=test1&pagePortal=home"`.
    - Note the lack of HTTPS. There's a separate issue that causes a websocket error. Was trying to debug when I ran into this  issue.
    - The same issue occurs if you load from a build of this [this repository](https://github.com/casual-simulation/casualos). Follow the instructions in [`DEVELOPERS.md`](https://github.com/casual-simulation/casualos/blob/develop/DEVELOPERS.md) if you do.
2. Run on the [Hololens 2 via Visual Studio](https://docs.microsoft.com/en-us/windows/mixed-reality/using-visual-studio#deploying-an-app-over-wi-fi---hololens-2).
    -   If the default URL doesn't take effect, you may have to uninstall the app from the Hololens 2 and reinstall.
3. Wait for it to load and stop at a breakpoint for `SavedStacks.cpp`.
    -   It will say the source cannot be found but its actually because the breakpoint doesn't have a related line in the source code.
    -   If you continue then it will run into the access violation exception.

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

<!-- Either: -->
- [ ] There are tests for these changes OR
- [x] These changes do not require tests because they fix a build error.

<!-- 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. -->
2020-06-22 20:05:40 -04:00
Kallyn Gowdy
6a5a77a968 Fix building with --feature js_backtrace
- mozjs::jsapi::CapturedJSStack::as_string() (https://doc.servo.org/mozjs/rust/struct.CapturedJSStack.html#method.as_string) was updated to accept a second parameter which specifies which Stacktrace format to use. The default has been specified to preserve the (presumably) original behavior.
- The related code has also been placed in an unsafe block since the capture_stack macro calling the unsafe mozjs::jsapi::CapturedJSStack::new() function. Seems that this commit (0703a1ad6d) forgot this part.
2020-06-22 16:14:04 -04:00
bors-servo
77a75403db
Auto merge of #26984 - kunalmohan:gpu-bind-group, r=kvark
Add GPUSampler and GPUTextureView to BindingResources and update wgpu-core

<!-- Please describe your changes on the following line: -->
This also completes validation for `GPUBindGroup` and `GPUBindGroupLayout`.
`entry_map` is stored in `GPUBindGroupLayout` for validating `createBindGroup()`.

r?@kvark

---
<!-- 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. -->
2020-06-22 13:40:29 -04:00
bors-servo
f35f671f45
Auto merge of #26953 - mrobinson:cancel-reparent, r=nox
Cancel animations for nodes which are removed from the DOM

This includes nodes which are being reparented.

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

<!-- 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. -->
2020-06-22 10:28:19 -04:00
bors-servo
1dc41b3277
Auto merge of #26983 - jdm:websocket-panic, r=nox
Silently ignore failures to queue websocket tasks

- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix #26977
- [x] There are tests for these changes
2020-06-22 08:15:48 -04:00
Paul Rouget
b5b8d462f2 Send LoadStart event when the actual pipeline is loading 2020-06-22 07:20:15 +02:00
Kagami Sascha Rosylight
2a2e037a4d Fix incorrect string joining 2020-06-21 05:42:42 +02:00
Kagami Sascha Rosylight
d01648d637 Fix remaining flake8 warnings 2020-06-21 03:34:32 +02:00
Kunal Mohan
f973099020 Remove validation for GPUBindGroup, GPUBindGroupLayout, GPUPipelineLayout 2020-06-19 21:35:30 +05:30
bors-servo
854cc79386
Auto merge of #26926 - MDeiml:referrer-26570, r=jdm
Make url for "client" referrer mandatory

<!-- Please describe your changes on the following line: -->
I added a url attribute to `Referrer::Client` so that the referrer header can be set accordingly when fetching.

`Referrer::Client` has to be kept separate from `Referrer::ReferrerUrl` as they differ in this method
6b0d9afd6f/components/script/dom/request.rs (L566-L576)

---
<!-- 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 #26570 (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. -->
2020-06-19 11:57:05 -04:00
Josh Matthews
2498808d10 dom: Silently ignore failures to queue websocket tasks. 2020-06-19 01:45:02 -04:00
Kunal Mohan
48ef306bd3 Update wgpu-core and wgpu-types 2020-06-19 11:12:50 +05:30
Josh Matthews
da3b3e3985
Fix refcell_backtrace feature. 2020-06-18 12:56:33 -04:00
bors-servo
1b55ab5804
Auto merge of #26787 - szeged:texi2d_3, r=jdm
Add support for WebGL2 TexImage2D

Adds initial support for one of the WebGL2 `TexImage2D` call.

I've enabled the `tests/wpt/webgl/tests/deqp/` tests.

---
<!-- 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 part of #26512
- [x] There are tests for these changes

@mmatyas @zakorgy @jdm
<!-- 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. -->
2020-06-18 09:58:55 -04:00
Istvan Miklos
6591fa54f9 Add support for WebGL2 TexImage2D
Adds initial support for one of the WebGL2 `TexImage2D` call.
2020-06-18 09:59:04 +02:00