Commit graph

42754 commits

Author SHA1 Message Date
Kunal Mohan
5285c07f1f Implement GPUCommandEncoder.copy commands 2020-07-21 21:00:23 +05:30
bors-servo
132d8b4601
Auto merge of #27216 - pcwalton:floats-2020, r=Manishearth
Implement core float layout for layout 2020

<!-- Please describe your changes on the following line: -->
Add an implementation of the core float and clear placement logic in layout 2020, not yet wired to the rest of layout.

This commit implements an object that handles the 10 rules in CSS 2.1:

https://www.w3.org/TR/CSS2/visuren.html#float-position

The implementation strategy is that of a persistent balanced binary search tree
of float bands. Binary search trees are commonly used for implementing float
positioning; e.g. by WebKit.  Persistence enables each object that interacts
with floats to efficiently contain a snapshot of the float list at the time
that object was laid out. That way, incremental layout can invalidate and start
reflow at any point in a containing block.

This commit features extensive use of
[QuickCheck](https://github.com/BurntSushi/quickcheck) to ensure that the rules
of the CSS specification are followed.

Because this is not yet connected to layout, floats will not actually be laid
out in Web pages yet.

Note that unit tests as set up in Servo currently require types that they
access to be public. Therefore, some internal layout 2020 types that were
previously private have been made public. This is somewhat unfortunate.

---
<!-- 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-21 00:09:00 -04:00
bors-servo
59841377c2
Auto merge of #27329 - kunalmohan:gpu-label, r=kvark
Update GPUObjectBase webidl and cleanup valid flags

<!-- Please describe your changes on the following line: -->
Update labels to be `USVString`
Remove `valid` flags in WebGPU resources. The only place where we still have that is `GPUCommandEncoder` (Only to validate the GPUCommandEncoder state. Not sure how errors would be handled/reported by server for copy commands).

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-20 20:43:56 -04:00
bors-servo
1ded1ba992
Auto merge of #27338 - jdm:exit-fix, r=Manishearth
Update webxr.

Fixes #27270.
2020-07-20 17:11:58 -04:00
Josh Matthews
5e7d025106 Update webxr. 2020-07-20 16:24:18 -04:00
Patrick Walton
5b36d211b4 Add an implementation of the core float and clear placement logic in layout
2020, not yet wired to the rest of layout.

This commit implements an object that handles the 10 rules in CSS 2.1:

https://www.w3.org/TR/CSS2/visuren.html#float-position

The implementation strategy is that of a persistent balanced binary search tree
of float bands. Binary search trees are commonly used for implementing float
positioning; e.g. by WebKit.  Persistence enables each object that interacts
with floats to efficiently contain a snapshot of the float list at the time
that object was laid out. That way, incremental layout can invalidate and start
reflow at any point in a containing block.

This commit features extensive use of
[QuickCheck](https://github.com/BurntSushi/quickcheck) to ensure that the rules
of the CSS specification are followed.

Because this is not yet connected to layout, floats will not actually be laid
out in Web pages yet.

Note that unit tests as set up in Servo currently require types that they
access to be public. Therefore, some internal layout 2020 types that were
previously private have been made public. This is somewhat unfortunate.

Part of #25167.
2020-07-20 12:42:34 -07:00
Kunal Mohan
cdc0a75fe4 Update GPUObjectBase webidl and cleanup valid flags 2020-07-20 23:03:53 +05:30
bors-servo
48bf169101
Auto merge of #27316 - asajeffrey:webxr-save-restore-gl-state, r=Manishearth
Save / restore state when updating opaque framebuffer bindings

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

This saves and restores the WebGL bindings for texture and framebuffer when beginning a webxr frame.

---
<!-- 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 #27286
- [x] These changes do not require tests because we don't reftest hololens (it would be nice if we did!)

<!-- 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-20 12:20:40 -04:00
bors-servo
06cc355a54
Auto merge of #27326 - servo-wpt-sync:wpt_update_20-07-2020, r=jdm
Sync WPT with upstream (20-07-2020)

Automated downstream sync of changes from upstream as of 20-07-2020.
[no-wpt-sync]
r? @servo-wpt-sync
2020-07-20 12:03:01 -04:00
Alan Jeffrey
f01527503e Updated webxr 2020-07-20 10:10:38 -05:00
Alan Jeffrey
a708b5f7ce Save / restore state when updating opaque framebuffer bindings 2020-07-20 10:10:38 -05:00
bors-servo
d40af67eff
Auto merge of #27322 - servo:dependabot/cargo/indexmap-1.5.0, r=jdm
build(deps): bump indexmap from 1.4.0 to 1.5.0

Bumps [indexmap](https://github.com/bluss/indexmap) from 1.4.0 to 1.5.0.
<details>
<summary>Commits</summary>
<ul>
<li><a href="d293267167"><code>d293267</code></a> Merge pull request <a href="https://github-redirect.dependabot.com/bluss/indexmap/issues/131">#131</a> from cuviper/shredded-potatoes</li>
<li><a href="1999fa2534"><code>1999fa2</code></a> Use new methods in hashbrown 0.8.1</li>
<li><a href="603c326aa8"><code>603c326</code></a> Release 1.5.0</li>
<li><a href="604a2b68a5"><code>604a2b6</code></a> Use plain clear instead of clear_no_drop</li>
<li><a href="b0c9577ad2"><code>b0c9577</code></a> Encapsulate unsafe code in a raw module</li>
<li><a href="66cb0af437"><code>66cb0af</code></a> Make methods that get RawBucket parameters unsafe; add safety comments</li>
<li><a href="379a07ae2a"><code>379a07a</code></a> Don't enable hashbrown/inline-more</li>
<li><a href="39618a2b68"><code>39618a2</code></a> Don't shadow raw_bucket variables</li>
<li><a href="89eefd64b0"><code>89eefd6</code></a> Document the return value of IndexMapCore::push</li>
<li><a href="8771a6c79f"><code>8771a6c</code></a> Upgrade to hashbrown 0.8</li>
<li>Additional commits viewable in <a href="https://github.com/bluss/indexmap/compare/1.4.0...1.5.0">compare view</a></li>
</ul>
</details>
<br />

[![Dependabot compatibility score](https://api.dependabot.com/badges/compatibility_score?dependency-name=indexmap&package-manager=cargo&previous-version=1.4.0&new-version=1.5.0)](https://dependabot.com/compatibility-score/?dependency-name=indexmap&package-manager=cargo&previous-version=1.4.0&new-version=1.5.0)

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
- `@dependabot use these labels` will set the current labels as the default for future PRs for this repo and language
- `@dependabot use these reviewers` will set the current reviewers as the default for future PRs for this repo and language
- `@dependabot use these assignees` will set the current assignees as the default for future PRs for this repo and language
- `@dependabot use this milestone` will set the current milestone as the default for future PRs for this repo and language
- `@dependabot badge me` will comment on this PR with code to add a "Dependabot enabled" badge to your readme

Additionally, you can set the following in your Dependabot [dashboard](https://app.dependabot.com):
- Update frequency (including time of day and day of week)
- Pull request limits (per update run and/or open at any time)
- Out-of-range updates (receive only lockfile updates, if desired)
- Security updates (receive only security updates, if desired)

</details>
2020-07-20 09:52:51 -04:00
Josh Matthews
08b4ed752b
Add 2020 flexbox failure. 2020-07-20 09:03:18 -04:00
WPT Sync Bot
dcfcbcf2ad Update web-platform-tests to revision 8ef40c4007d5da834b25e79197cb8cb4c0a86a42 2020-07-20 10:26:50 +00:00
dependabot-preview[bot]
6189822acf
build(deps): bump indexmap from 1.4.0 to 1.5.0
Bumps [indexmap](https://github.com/bluss/indexmap) from 1.4.0 to 1.5.0.
- [Release notes](https://github.com/bluss/indexmap/releases)
- [Commits](https://github.com/bluss/indexmap/compare/1.4.0...1.5.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-07-20 08:23:50 +00:00
bors-servo
3216209506
Auto merge of #27279 - servo:jdm-patch-46, r=paulrouget
Update hololens documentation.

This will give us something useful to point users towards.
2020-07-20 03:03:09 -04:00
bors-servo
bfb7bea704
Auto merge of #27320 - servo-wpt-sync:wpt_update_19-07-2020, r=jdm
Sync WPT with upstream (19-07-2020)

Automated downstream sync of changes from upstream as of 19-07-2020.
[no-wpt-sync]
r? @servo-wpt-sync
2020-07-19 11:28:59 -04:00
bors-servo
086556e706
Auto merge of #27026 - CYBAI:dynamic-module, r=jdm
Introduce dynamic module

---
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix #25439
- [x] There are tests for these changes
2020-07-19 09:29:50 -04:00
Josh Matthews
7538680b80
Add 2020 failure. 2020-07-19 08:47:16 -04:00
WPT Sync Bot
870553b695 Update web-platform-tests to revision b47352d6c9860ff13c014fda37f35f88e8d935cb 2020-07-19 10:51:06 +00:00
CYBAI
419cd53561 Use JS_GetScriptPrivate to get a mutated return value
Because MSVC uses a different calling conventions for functions that
return non-POD values, we need to use the new exposed wrapper function
so that `GetScriptPrivate` can be handled correctly on Windows.
2020-07-19 16:24:24 +09:00
bors-servo
ccff00742f
Auto merge of #27317 - servo-wpt-sync:wpt_update_18-07-2020, r=servo-wpt-sync
Sync WPT with upstream (18-07-2020)

Automated downstream sync of changes from upstream as of 18-07-2020.
[no-wpt-sync]
r? @servo-wpt-sync
2020-07-18 06:41:39 -04:00
WPT Sync Bot
64b58d76c6 Update web-platform-tests to revision 5934bd3aca20a07917ad46fe7cebe10c68d5e497 2020-07-18 10:41:28 +00:00
bors-servo
e41f1662dc
Auto merge of #27310 - asajeffrey:gitignore-emacs-backup-files, r=jdm
Remove emacs backup files, add them to .gitignore

Remove emacs backup files and add them to .gitignore.
2020-07-17 23:17:47 -04:00
bors-servo
b63ce282aa
Auto merge of #27303 - camelid:async-to-asynch, r=jdm
Use `asynch` instead of `r#async`

<!-- Please describe your changes on the following line: -->
This is a vestige of the transition from 2015 to 2018 edition Rust.
`async` was added as a keyword in 2018 edition Rust, so `cargo fix`
changed the variable name here to `r#async`.

---
<!-- 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
- [x] These changes do not require tests because this is just an internal name change

<!-- 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-17 22:51:12 -04:00
bors-servo
8ce3ff656d
Auto merge of #27295 - asajeffrey:gstreamer-webxr, r=Manishearth
Gstreamer plugin support for streaming from webxr

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

Allows us to stream webxr video content.

---
<!-- 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 do not require tests because we don't reftest the gstreamer plugin

<!-- 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-17 17:36:38 -04:00
bors-servo
9cd22a01f7
Auto merge of #27285 - kunalmohan:async-error, r=kvark
Implement WebGPU ErrorScopes

<!-- Please describe your changes on the following line: -->
This PR covers the following-
1. update wgpu-core (Rustify `RenderPipelineDescriptor`)
2. Add initial implementation of `pushErrorScope` and `popErrorScope`.
3. Use existing `BGL` if an equivalent already exists.

A brief explanation of the ErrorScope Implementation-
1. We store `HashMap<u64, ErrorScopeInfo>` in `GPUDevice`. `ErrorScopeInfo` is a new struct used to store all necessary info for an ErrorScope.
2. We simultaneously store `Vec<u64>` to keep track of the ErrorScope hierarchy. `next_scope_id` is used to get the `scope_id` for a new Scope.
3. We send the `scope_id` of top-level scope to the server in the message for an operation. The server performs the operation and sends back the scope_id with the result message (only if a scope_id was sent from the client. Otherwise no message is sent.).
4. We store a `HashMap<WebGPUDevice, Dom<GPUDevice>>` in `GlobalScope` to access them from `ScriptThread`.
5. While creating a `GPUDevice` we send the `PipelineId` of the pipeline it was created in so that when the server send the response, we can access the device from the GlobalScope of that Pipeline.
6. We generate the relevant `GPUError` in `GlobalScope`(if required) can call the necessary fn in `GPUDevice`.

This implementation is pretty rough and not complete at all. Broadly the following cases aren't handled at the moment-
1. ErrorFilter is not checked when an error is captured.
2. We don't propagate an error to enclosing scope if a scope did not capture it.
3. `UncapturedErrorEvents` is not implemented.

As for Equivalent BGLs we now store `Vec<(Vec<wgt::BindGroupLayoutEntry>, Dom<GPUBindGroupLayout>)>` in `GPUDevice` and compare `Vec<wgt::BindGroupLayoutEntry>` for new BGL with the existing ones and return one if it is found. Otherwise a new one is created and an entry added to the `Vec`.

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

<!-- 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. -->
2020-07-17 13:18:31 -04:00
Kunal Mohan
785497af63 Ensure GPUDevice cleanup in GlobalScope 2020-07-17 21:17:38 +05:30
CYBAI
08723b0e37 Handle script private reference hooks properly 2020-07-18 00:43:35 +09:00
CYBAI
c2feaf14d5 Update test expectation 2020-07-18 00:43:35 +09:00
CYBAI
d1715918f0 Set private reference for classic script
Web developers can use `Dynamic Import` in a classic script; thus, we
need to save the script's private reference so that we can reuse it when
we're going to fetch a dynamic import module for a classic script.

Besides, because it's possible to use different executing context for a
dynamic import module (like `dynamic-import/string-compilation-other-document.html` WPT test),
we can't initialize a module owner at the timing of `SetScriptPrivate`;
thus, if the private module script doesn't hold an owner, we'll use a
DynamicImport owner for it.
2020-07-18 00:43:34 +09:00
CYBAI
99e832a345 Move from direct Evaluate to compile then execute for classic script 2020-07-18 00:43:34 +09:00
Josh Matthews
1aef31bb2f checkpoint - dynamic load inside of a module and classic script works. 2020-07-18 00:43:34 +09:00
CYBAI
0c7f08f743 Introduce DynamicModuleOwner dom struct 2020-07-18 00:43:32 +09:00
Alan Jeffrey
7930bcdd86 Remove emacs backup files, add them to .gitignore 2020-07-17 10:19:11 -05:00
Alan Jeffrey
ec9f1fe9d4 Added documentation for gstreamer webxr 2020-07-17 10:12:17 -05:00
bors-servo
86e7f9afc1
Auto merge of #27302 - jdm:gst-package-mac, r=Manishearth
Make gstreamer packaging explicit

This change aligns Windows and macOS in terms of loading an explicit set of included plugins when initializing gstreamer. It also creates a single source of truth - the set of expected plugins is generated in a build script by the same python code that is used for packaging, so it should be impossible for platforms relying on this system to get out of sync.

Fixes #27293
2020-07-17 10:51:57 -04:00
Josh Matthews
d2e2230413
Add more issue reporting and URL shortening tips. 2020-07-17 10:41:44 -04:00
bors-servo
f221b00007
Auto merge of #27282 - camelid:rc-domstring, r=jdm
Use `Rc` instead of cloning the `DOMString`

<!-- Please describe your changes on the following line: -->
I changed the `text` field of `ScriptOrigin` from a `DOMString` to an `Rc<DOMString>`. Then I updated all the related code to work with an `Rc`.

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

<!-- Either: -->
- [ ] There are tests for these changes OR
- [x] These changes do not require tests because this doesn't introduce new code and should only need to be checked by the compiler

<!-- 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-17 09:30:36 -04:00
bors-servo
68cee9f7c1
Auto merge of #27307 - servo-wpt-sync:wpt_update_17-07-2020, r=servo-wpt-sync
Sync WPT with upstream (17-07-2020)

Automated downstream sync of changes from upstream as of 17-07-2020.
[no-wpt-sync]
r? @servo-wpt-sync
2020-07-17 06:13:33 -04:00
WPT Sync Bot
986610f6ed Update web-platform-tests to revision 8ba782c9d5a545b850cd8920032cb14cfbab2c35 2020-07-17 10:13:18 +00:00
Camelid
a62a30ef83 Use asynch instead of r#async
This is a vestige of the transition from 2015 to 2018 edition Rust.
`async` was added as a keyword in 2018 edition Rust, so `cargo fix`
changed the variable name here to `r#async`.
2020-07-16 20:52:19 -07:00
Josh Matthews
72040be69b Load explicit set of gstreamer plugins on macos, and include them in the nightly package. 2020-07-16 22:42:22 -04:00
Camelid
cdfd4d9075 One fewer Rc::clone() 2020-07-16 19:32:42 -07:00
Camelid
3f440bd6dc Fewer clones 2020-07-16 19:29:57 -07:00
Kunal Mohan
37d606621d address review comments 2020-07-17 02:23:39 +05:30
Alan Jeffrey
50e168a688 Gstreamer plugin support for streaming from webxr 2020-07-16 14:16:32 -05:00
bors-servo
b17a302356
Auto merge of #27300 - jdm:no-ws-host, r=asajeffrey
Remove explicit Host header from websocket connection.

This was a regression from #27164, and fixing it allows hubs.mozilla.com to work again.
2020-07-16 14:43:58 -04:00
Kunal Mohan
d1c13e8df7 Use existing BindGroupLayout if an equivalent BGL already exists 2020-07-16 23:21:09 +05:30
Kunal Mohan
0dc1514d57 Implement Async Error reporting for WebGPU and update wgpu-core 2020-07-16 23:21:09 +05:30