Compile external scripts off the main thread
<!-- 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
- [ ] These changes fix#26571 (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. -->
Implement GPUCommandEncoder.copy commands
<!-- 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. -->
Update XRWebGLLayer to match specification.
This unbreaks most of the webxr WPT tests.
---
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix#27312
- [x] There are tests for these changes
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. -->
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. -->
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
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.
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. -->
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. -->
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.
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. -->
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`.
Add stubs for HTMLCanvasElement.captureStream and WebRTC transceiver APIs
These stubs are hidden by default and only exist to allow getting past the relevant code that invokes them on hubs.mozilla.org.
Specifically, 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`.
This is just a first pass to get the code to compile. There are probably
more things I can do that will improve the code and further reduce
cloning.
Implemented HTMLFormElement.relList
<!-- Please describe your changes on the following line: -->
Updated the tests to reflect addition of rel and relList for HTMLFormElement, as well as porting those code snippets from HTMLAnchorElement.
---
<!-- 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#27252 (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. -->
Updated tests to reflect rel and relList in HTMLFormElement
Added AttrValue as style
Added attr
Updated outstanding test cases
Fixed formatting. Hopefully this time works
Implemented HTMLFormElement.relList
Support depth and stencil in webxr
<!-- Please describe your changes on the following line: -->
Creates a `DEPTH_STENCIL` attachment if one is provided by the webxr device.
---
<!-- 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 webxr
<!-- 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. -->
Add a sessionavailable event that allows content to enter an XR session without a user gesture
<!-- Please describe your changes on the following line: -->
This allows servo to implement immersive web apps. https://immersive-web.github.io/webxr/#application-launch
---
<!-- 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 I'm not sure we should have a WPT for something this non-standard.
<!-- 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. -->
Mediadevices.enumeratedevices
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix#26877