Commit graph

8579 commits

Author SHA1 Message Date
bors-servo
f2e6f34a2b
Auto merge of #27173 - kunalmohan:gpu-queue-write, r=kvark
Implement GPUQueue write methods and update wgpu-core

<!-- Please describe your changes on the following line: -->
Implements `GPUQueue.writeBuffer` and `GPUQueue.writeTexture`.

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-07-04 21:32:43 -04:00
Kunal Mohan
fae66089fa Implement GPUQueue.writeBuffer and GPUQueue.writeTexture 2020-07-04 21:49:32 +05:30
Kunal Mohan
8ef7f24541 Update wgpu-core and wgpu-types 2020-07-04 13:59:30 +05:30
bors-servo
8916a42180
Auto merge of #27163 - alarsyo:23053-layout-queries-disconnected-frames-panic, r=jdm
Return Option for Window's layout channel

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

`Window::layout_chan()` now returns an `Option<Sender<Msg>>`, returning `None` if the window is dead.

FIX #26969
FIX #26429
FIX #21208
FIX #19092
FIX #22559
FIX #22584
FIX #22652

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

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

This is my first contribution, I'm trying to figure things out!

This fix passes the test case shown in #23053, however I don't know what the behavior should be in `Document` and `ScriptThread` if `Window::is_alive()` is false : simply ignore it, don't do anything ? Or is this something that should not happen now that we return false in `Window::force_reflow()` ?

I'm not sure about the directory where the test case should go, any advice?
2020-07-04 01:30:27 -04:00
bors-servo
7fafd91593
Auto merge of #27154 - kunalmohan:async-presentation, r=kvark
WebGPU update presentation data asynchronously

<!-- Please describe your changes on the following line: -->
This PR aims to make updating Webrender presentation data non-blocking.
A callback is passed to the `buffer_map_async()` fn wherein the data is read and a message sent to the server itself to write the data into the shared `PresentationData` struct object.

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-07-03 14:01:55 -04:00
Antoine Martin
36fbbea2b5 Return Option for Window's layout channel 2020-07-03 20:00:26 +02:00
bors-servo
8800452e34
Auto merge of #27104 - utsavoza:ugo/issue-27030/28-06-2020, r=gterzian
Update referrer computation

The PR updates the request's referrer computation in consideration with the recent changes in [w3c/webappsec-referrer-policy#135](https://github.com/w3c/webappsec-referrer-policy/pull/135).

---
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix #27030 and fix #14505
- [x] There are tests for these changes
2020-07-03 11:39:07 -04:00
Kunal Mohan
b672b78e19 WebGPU update presentation data asynchronously 2020-07-03 15:42:08 +05:30
bors-servo
4504eebdc3
Auto merge of #27143 - Manishearth:streamnodes, r=ferjm
Implement MediaStreamAudioDestinationNode, MediaStreamAudioSourceNode, MediaStreamTrackAudioSourceNode

Progress in https://github.com/servo/servo/issues/26097

This is a draft since we need the data channels stuff to land first

(also I need to make sure we're passing WPT)
2020-07-03 01:48:52 -04:00
bors-servo
ee56d5d212
Auto merge of #27149 - paulrouget:key_events2, r=jdm
UWP: support virtual keyboard

Fix #26898 and fix #26680.

@jdm: can you test on the device?
2020-07-03 00:25:05 -04:00
Manish Goregaokar
718304709e Add AudioContext constructors for media stream nodes 2020-07-02 13:26:55 -07:00
Manish Goregaokar
0b998a1d1c Unpref MediaStream and MediaStreamTrack 2020-07-02 13:26:55 -07:00
Manish Goregaokar
6143173858 Add MediaStreamTrackAudioSourceNode 2020-07-02 13:26:55 -07:00
Manish Goregaokar
bc2267fb77 Add MediaStreamAudioSourceNode 2020-07-02 13:26:55 -07:00
Manish Goregaokar
2a838d935b Add MedaStreamAudioDestinationNode::stream 2020-07-02 13:26:55 -07:00
Manish Goregaokar
bf9614edf7 Add MediaStream::new_single() 2020-07-02 13:26:55 -07:00
Manish Goregaokar
6a001e7523 Add MediaStreamAudioDestinationNode 2020-07-02 13:26:55 -07:00
bors-servo
3bc4a935f8
Auto merge of #27100 - muodov:master, r=gterzian
Implement HTMLFormElement.requestSubmit()

<!-- Please describe your changes on the following line: -->
This PR contains an implementation of [HTMLFormElement.requestSubmit()](https://html.spec.whatwg.org/multipage/forms.html#dom-form-requestsubmit)

This is literally my first hundred lines of Rust code, so if I crossed a few sacred lines here and there, please go easy on me :)

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

<!-- Either: -->
- [x] [WPT tests](https://github.com/servo/servo/blob/master/tests/wpt/web-platform-tests/html/semantics/forms/the-form-element/form-requestsubmit.html) for these changes
There are two tests that still fail because we don't support `:invalid` CSS selector (see #10781). I verified that they pass if you change them to not use `:invalid`. Should be unlocked by #26729.

<!-- 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-07-02 09:54:47 -04:00
Maxim Tsoy
8194da2752 Implement HTMLFormElement.requestSubmit()Also includes a fix for reentrant form submission behavior 2020-07-02 12:33:21 +02:00
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
Paul Rouget
34265c872e UWP: support virtual keyboard 2020-07-02 10:57:34 +02:00
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
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
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
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