Commit graph

9667 commits

Author SHA1 Message Date
Gregory Terzian
5174739244 turn serviceworker event-loop back on 2020-06-03 12:32:45 +08:00
Gregory Terzian
947fa8bbb7 add a control chan to workers, use to signal shutdown 2020-06-03 12:32:47 +08:00
Gregory Terzian
ed688fe2c1 add mechanism to join on service- and dedicated-worker threads 2020-05-29 18:24:47 +08:00
bors-servo
4094d16323
Auto merge of #26668 - CYBAI:fix-module-current-script, r=jdm
Set `currentScript` to `null` for module scripts

I misunderstood the test case when I worked on #23545. That test case is
actually not related to dynamic import; instead, the reason why it
crashes is, `currentScript` should be updated to `null`.

In spec, the step 6 of [execute-the-script-block](https://html.spec.whatwg.org/multipage/scripting.html#execute-the-script-block) only says `Assert: document's currentScript attribute is null.` but doesn't says it should be set to null. Not sure if it can be improved.

---
- [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)
- [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-05-27 08:58:36 -04:00
bors-servo
93a6c37836
Auto merge of #26659 - mrobinson:events, r=jdm
Add support for remaining animation and transition events

This PR adds support for remaining animation and transitions events.
There are two commits here. The first is a bit more complicated: it reworks
how rooting is done for animating nodes. Instead of having the `ScriptThread`
try to track which animations are active via events (which can be inaccurate),
it just maintains roots for nodes that are actually present in the animations-
-related data structures. The second commit adds support for the new events.

Unfortunately, the existing events tests either rely on the Web Animations API
or other behavior (for example, that changing animation delay restarts
an animation). Since those two things are out-of-scope for this change,
I've forked some of the WPT tests, removed the reliance on the Web
Animations API, and added them to Servo's internal 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 #21564.
- [x] There are tests for these changes OR

<!-- 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-05-27 01:50:39 -04:00
bors-servo
07eb9ab3fe
Auto merge of #26660 - kunalmohan:gpu-async-resource, r=kvark
Make WebGPU resource creation async and prevent panic during shutdown if WebGPU is enabled.

<!-- Please describe your changes on the following line: -->
1. Make WebGPU resource creation async.
2. Remove some unused code in `WebGPURequest::RequestAdapter`.
3. Prevent panic during shutdown. Since WGPU thread is killed before script, sender and receiver in the script panic at either of the two places-
a. If a buffer is still alive, script tries to send `WebGPURequest::DestroyBuffer` to server while dropping the buffer during shutdown.
7170a69695/components/script/dom/gpubuffer.rs (L118-L122) 7170a69695/components/script/dom/gpubuffer.rs (L182-L186)
b. Receiver in script-thread panics with `RecvError` as soon as sender on server side is dropped. 7170a69695/components/script/script_thread.rs (L1456-L1457)

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
- [X] These changes fix #25472 (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-05-27 00:54:16 -04:00
CYBAI
a0df94bddc Set currentScript to null for module scripts
I misunderstood the test case when I worked on #23545. That test case is
actually not related to dynamic import; instead, the reason why it
crashes is, `currentScript` should be updated to `null`.
2020-05-27 11:22:04 +09:00
bors-servo
06c4ca14c3
Auto merge of #26642 - servo:dynamic-wrap-panic, r=Manishearth
Use dynamic dispatch in `mozjs::panic::wrap_panic`

Pick up https://github.com/servo/rust-mozjs/pull/512

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

This diff is best viewed with "ignore whitespace changes", because of indentation change.
2020-05-26 16:20:10 -04:00
Martin Robinson
77aa3721c5 Add support for remaining animation and transition events
Fixes #21564.
2020-05-26 20:34:58 +02:00
Martin Robinson
47642e0eee Have Animations struct handle rooting nodes
Instead of having `ScriptThread` handle rooting nodes, do this in
`Animations`. This makes it easier to know when it is appropriate to
root and unroot nodes instead of relying on a certain order of events.
This also allows reducing quite a bit the amount of unsafe code.
2020-05-26 20:24:28 +02:00
bors-servo
f3313739f5
Auto merge of #26646 - jdm:parking_lot, r=asajeffrey
Avoid parking_lot bustage with recent rustc nightlies.

- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix #26644
- [x] There are tests for these changes
2020-05-26 10:48:10 -04:00
Kunal Mohan
f4d0183568 Make WebGPU resource creation fully async
Remove some garbage code in adapter id checks
Prevent panic during shutdown if using WebGPU
2020-05-26 19:16:46 +05:30
Josh Matthews
1da40b59af Remove use of nightly features in parking_lot. Update many uses from 0.9 to 0.10. 2020-05-26 09:34:50 -04:00
bors-servo
57846678c2
Auto merge of #26638 - szeged:texi2d_2, r=jdm
Add support for WebGL2 TexImage2D

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

<!-- Please describe your changes on the following line: -->
I've enabled the `conformance2/textures/image/` tests and updated the test expectations.

---
<!-- 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.-->
@mmatyas @zakorgy @jdm
<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
2020-05-26 06:13:27 -04:00
Istvan Miklos
b298160ff2 Add support for WebGL2 TexImage2D
Adds initial support for one of the WebGL2 `TexImage2D` call.
2020-05-26 11:33:58 +02:00
bors-servo
95a818e262
Auto merge of #26630 - kunalmohan:gpu-sampler, r=jdm
Add GPUSampler to WebGPU implementation

Add dom_struct and webidl for GPUSampler, implement GPUDevice.createSampler() method.

<!-- Please describe your changes on the following line: -->
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-05-25 17:54:25 -04:00
Simon Sapin
d103e06ba9 Use dynamic dispatch in mozjs::panic::wrap_panic
Pick up https://github.com/servo/rust-mozjs/pull/512

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

This diff is best viewed with "ignore whitespace changes", because of indentation change.
2020-05-25 20:34:05 +02:00
Kunal Mohan
dd04716b85 Add GPUSampler to WebGPU implementation
Add dom_struct and webidl for GPUSampler, implement GPUDevice.createSampler() method.
2020-05-26 00:00:35 +05:30
bors-servo
2fd427270d
Auto merge of #26609 - mrobinson:improve-transition-finishing, r=jdm
Improve ending of transitions

For legacy reasons, transitions were marked as finished after updating the
style. According to the spec, they should be marked as finished when
animations are updated and before restyle. This change does that as well
as preventing replacement of finished transitions.

Having finished transitions survive a full restyle cycle and allowing
the replacement of finished transition could lead to issues where
animations are removed from the global list of animating transitions
too soon:

 1. A transitions finishes
 2. Restyle
 3. The transition is marked as finished and events are queued
 4. Restyle cancels finished transition and replaces it instead of
    clearing finished transition
 5. Events are sent for the incorrectly canceled transition, removing it
    completely from the list of running transitions due to the extra
    event.

---
<!-- 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
2020-05-25 11:07:50 -04:00
bors-servo
ce076a8382
Auto merge of #26623 - jdm:imagebitmap-gate, r=gterzian
Add a preference to control ImageBitmap while it's incomplete.

Hubs tries to make use of incomplete APIs to load textures and this causes errors. It works fine if we hide the interface instead.
2020-05-25 00:08:19 -04:00
Josh Matthews
d3867c32db Add a preference to control ImageBitmap while it's incomplete. 2020-05-23 11:43:15 -04:00
bors-servo
dde7204756
Auto merge of #26624 - jdm:script-unminify, r=asajeffrey
Use temporary files instead of pipes for JS unminification.

This change allows me to use `--unminify-js` when loading a local Hubs server. Previously there would be multiple hung js-beautifier processes and the page would never make any progress.
2020-05-22 19:20:30 -04:00
Josh Matthews
8f4cb28a6d Use temporary files instead of pipes for JS unminification. 2020-05-22 14:40:50 -04:00
Kunal Mohan
39f336b527 Implement client-side logic for WebGPU id recycling 2020-05-22 21:22:19 +05:30
Martin Robinson
218beb9218 Improve ending of transitions
For legacy reasons, transitions were marked as finished after updating the
style. According to the spec, they should be marked as finished when
animations are updated and before restyle. This change does that as well
as preventing replacement of finished transitions.

Having finished transitions survive a full restyle cycle and allowing
the replacement of finished transition, could lead to issues were
removed from the global list of animating transitions too soon:

 1. A transitions finishes
 2. Restyle
 3. Transitions is marked as finished and events are queued
 4. Restyle cancels finished transition and replaces it instead of
    clearing finished transition
 5. Events are sent for the incorrectly canceled transition removing it
    completely from the list of running transitions due to the extra
    event.
2020-05-21 19:56:29 +02:00
bors-servo
94063d67a8
Auto merge of #26564 - kunalmohan:gpu-id-rotation, r=jdm
Upgrade wgpu version to "0.5.0" and add server-side code for id recycling for WebGPU

<!-- Please describe your changes on the following line: -->
I have updated the cargo.lock to use a wgpu-core at a more recent commit where IdentityHandlerFactory was introduced.
r?@kvark

---
<!-- 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-05-21 13:24:55 -04:00
Kunal Mohan
f3fa53b849 update rust toolchain 2020-05-21 21:51:49 +05:30
bors-servo
70700c20ed
Auto merge of #26594 - mrobinson:animationiteration, r=jdm
Implement animationiteration event

This event is triggered when an animation iterates. This change also
moves iteration out of style calculation to an "update animations" which
is the next part of having animation event handling match the HTML spec.

This change causes a few more tests to pass. Some of the other tests which
exercise this functionality require `animationstart` events.

---
<!-- 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)
- [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-05-21 10:11:45 -04:00
Martin Robinson
873cdd1336 Implement animationiteration event
This event is triggered when an animation iterates. This change also
moves iteration out of style calculation to an "update animations" which
is the next part of having animation event handling match the HTML spec.
2020-05-21 15:19:34 +02:00
Kunal Mohan
a4f911699a Upgrade wgpu-core version to 0.5.0 and implement server-side logic for wgpu id recycling
Remove current implementation of MapReadAsync
2020-05-21 18:28:49 +05:30
bors-servo
1986adee0b
Auto merge of #26520 - szeged:texi2d, r=jdm
Add support for WebGL2 TexImage2D

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

<!-- 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 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-05-21 08:16:00 -04:00
Istvan Miklos
035cb6ebaa Add support for WebGL2 TexImage2D
Adds initial support for one of the WebGL2 `TexImage2D` call.
2020-05-21 10:49:51 +02:00
Gregory Terzian
bd31860c5d serviceworker: turn-off event-loop, don't assume current scope, clear runtime on shutdown 2020-05-21 13:21:28 +08:00
Gregory Terzian
89eb7c2aa2 serviceworker: make job queue unique per origin 2020-05-21 13:21:21 +08:00
bors-servo
e17b53eba5
Auto merge of #26546 - splav:tls-protected-checks, r=jdm
check http_state in determine_request_referrer

<!-- Please describe your changes on the following line: -->
Check https status inside determine_request_referrer.
---
<!-- 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 #14506 (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-05-19 18:03:35 -04:00
Alexandrov Sergey
357b486455 make is_origin_trustworthy a method of ServoUrl + fix localhost handling 2020-05-19 20:06:59 +03:00
Alexandrov Sergey
a7c5c97616 check http_state in determine_request_referrer 2020-05-19 20:06:59 +03:00
bors-servo
cab9104d92
Auto merge of #26499 - utsavoza:ugo/issue-26287/10-05-2020, r=jdm
Add creator URL, creator base URL and creator origin to browsing context

- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix #24944 and fix (partially) #26287
- [x] There are tests for these changes
2020-05-19 12:45:11 -04:00
bors-servo
79b6758cb9
Auto merge of #26484 - servo:layout-2020-style-prep, r=SimonSapin
Implement concept of dirty root
2020-05-19 11:40:58 -04:00
Anthony Ramine
036f123c4e Implement concept of dirty root 2020-05-19 16:26:36 +02:00
Anthony Ramine
518c0660c6 Make Node::style_and_layout_data be a DomRefCell<T>
That way we can use borrow_mut_for_layout and borrow_mut.
2020-05-19 15:51:55 +02:00
Utsav Oza
9b0b03a432 Update wpt-tests metadata 2020-05-19 16:32:10 +05:30
bors-servo
c183f95297
Auto merge of #26551 - Manishearth:per-view, r=asajeffrey
Update to handle per-view eye transforms

Depends on https://github.com/servo/webxr/pull/175
2020-05-18 11:21:33 -04:00
Manish Goregaokar
d627476893 Update to treat view transforms as native-relative 2020-05-18 08:20:54 -07:00
Manish Goregaokar
a97dcd9ad6 Update to use webxr_api::ViewerPose 2020-05-18 08:20:33 -07:00
Manish Goregaokar
794624b42b Move viewports to being per-session, not per-frame 2020-05-18 08:20:19 -07:00
Manish Goregaokar
eaad692c0b Use cached projection matrix 2020-05-18 08:19:42 -07:00
Manish Goregaokar
708824700f Make views a per-frame deal 2020-05-18 08:19:42 -07:00
Utsav Oza
4c637e0601 Update wpt-tests metadata 2020-05-18 19:07:57 +05:30
Utsav Oza
55a3eb6bf4 Run mach test-tidy 2020-05-18 19:07:57 +05:30