Commit graph

7961 commits

Author SHA1 Message Date
bors-servo
90b0a7fcc5
Auto merge of #25526 - szeged:bind_group_wgpu, r=jdm
Initial implementation of GPUBindGroupLayout for WebGPU

Added WebIDL bindings for `GPUBindGroupLayout`, `GPUBindGroupLayoutDescriptor`, `GPUBindingType`, `GPUShaderStage` and `GPUBindGroupLayoutBinding` (Note: The servo's codegen doesn't like the name, because its already occupied).
Implemented the `createBindGroupLayout` function of `GPUDevice`.

<!-- 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 addresses a part of #24706

cc @kvark @jdm @zakorgy
<!-- 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-01-16 13:36:10 -05:00
Istvan Miklos
9cf007472b Initial implementation of GPUBindGroupLayout for WebGPU
Added WebIDL bindings for `GPUBindGroupLayout`, `GPUBindGroupLayoutDescriptor`, `GPUBindingType`, `GPUShaderStage`
and `GPUBindGroupLayoutBinding` (Note: The servo's codegen doesn't like the name, because its already occupied).
Implemented the `createBindGroupLayout` function of `GPUDevice`.
2020-01-16 10:53:51 +01:00
bors-servo
91877875b9
Auto merge of #25534 - pshaughn:compiledeventscope, r=jdm
Put target element, form owner, and element document on scope chain of compiled events

Event listeners that are created from a function object just get whatever closure the function object had, but event listeners created from a string need a special closure that acts like they were defined inside a series of `with` statements. This now happens. The existing WPT test for it, html/webappapis/scripting/events/compile-event-handler-lexical-scopes.html, also relies on other behavior we don't have, so I added an easier version of the test that doesn't involve bubbling or capturing and doesn't check any IDL properties we don't have. This new test will eventually be redundant when we have everything else the upstream test expects.

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

<!-- 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-01-15 23:27:20 -05:00
Patrick Shaughnessy
59f66fe09d Scope chain is now constructed 2020-01-15 14:13:18 -05:00
bors-servo
f9174a4717
Auto merge of #25519 - szeged:mmatyas__webgl_fns_uniforms, r=jdm
Add support for WebGL2 unsigned uniform operations

This adds support for the WebGL2 `uniform[1234]ui` and `uniform[1234]uiv` operations.

See: https://www.khronos.org/registry/webgl/specs/latest/2.0/#3.7.8

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

cc @jdm @zakorgy @imiklos

---
<!-- 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-01-15 10:45:07 -05:00
Mátyás Mustoha
bc914381a8 Add support for WebGL2 unsigned uniform operations
This adds support for the WebGL2 `uniform[1234]ui` and `uniform[1234]uiv`
operations.

See: https://www.khronos.org/registry/webgl/specs/latest/2.0/#3.7.8
2020-01-15 13:48:35 +01:00
bors-servo
85ea8df00c
Auto merge of #25521 - szeged:mmatyas__webgl_fns_rastdisc, r=nox
Add support for WebGL2 `RASTERIZER_DISCARD` enum.

Add support for the `RASTERIZER_DISCARD` enum for the WebGL2 version of the `Enable`, `Disable` and `IsEnabled` functions.

See https://www.khronos.org/registry/webgl/specs/latest/2.0/#3.7.2

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

cc @jdm @zakorgy @imiklos

Note: The test results may depend on #25519.

---
<!-- 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-01-14 11:47:07 -05:00
Mátyás Mustoha
500b36b669 Add support for WebGL2 RASTERIZER_DISCARD enum.
Add support for the `RASTERIZER_DISCARD` enum for the WebGL2 version
of the `Enable`, `Disable` and `IsEnabled` functions.

See https://www.khronos.org/registry/webgl/specs/latest/2.0/#3.7.2
2020-01-14 12:30:59 +01:00
bors-servo
b52ddc5290
Auto merge of #25510 - pshaughn:queuemicrotask, r=jdm
Implement queueMicrotask

<!-- Please describe your changes on the following line: -->
The VoidFunction of a user-queued microtask is identical to a PromiseJobCallback in everything but type name, so implementing this method turned out to be just a matter of attaching a WebIDL frontend to a copy-and-pasted backend. All the remaining queueMicrotask WPT failures are because we don't have shared/service workers.

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

<!-- 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-01-13 20:17:40 -05:00
Patrick Shaughnessy
b01b2d3d2e queueMicrotask added 2020-01-13 13:45:43 -05:00
bors-servo
0131952d6d
Auto merge of #25030 - szeged:webgpu-constellation, r=gterzian
Only start WebGPU thread if an adapter is requested

<!-- Please describe your changes on the following line: -->
This addresses 1 and 2 from https://github.com/servo/servo/issues/24706#issuecomment-555491438
We send a message to constellation instead of creating the `WebGPU` thread on the start. We send back the result to script and set the `Window`'s `web_gpu` component there.
cc @jdm @imiklos

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

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

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/25030)
<!-- Reviewable:end -->
2020-01-13 11:46:56 -05:00
Zakor Gyula
430248e9c8 Fix returned error types in WebGPU 2020-01-13 10:39:23 +01:00
Zakor Gyula
a751b1c3d7 Only start WebGPU thread if an adapter is requested 2020-01-13 10:39:23 +01:00
bors-servo
dbba9ea453
Auto merge of #25468 - gterzian:add_generic_to_frozen_array, r=Manishearth
Add generic to frozen array

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

https://github.com/servo/servo/pull/25467#discussion_r364575071

Depends on https://github.com/servo/servo/pull/25467

---
<!-- 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-01-12 02:35:09 -05:00
Gregory Terzian
0339601128 cache frozen array of ports 2020-01-12 13:27:45 +08:00
Gregory Terzian
e768ca1643 add a generic utility to convert a slice into a frozen array 2020-01-11 22:42:23 +08:00
bors-servo
63cb13f5fa
Auto merge of #25405 - pshaughn:minmaxstep, r=jdm
make stepUp, stepDown, valueAsNumber, valueAsDate, and list work in HTMLInputElement

<!-- Please describe your changes on the following line: -->
Steppy operation of input elements now functions. A few related tests still fail because of incorrect test expectations. A couple range reftests fail on what might be correct expectations; solving that involves layout, not DOM.
Main changes here:
- str.rs now has its datetime format parsers public, with some changes to align their output with chrono::NaiveDateTime and fix a bug in milliseconds validation
- HTMLInputElement has new attributes, and code behind them for relevant concepts
- servoparser/mod.rs now has some extra code to ensure that input sanitization happens at the right moment during input element creation; the spec is non-specific about when this happens, but it has to happen somewhere and in #21952 @Eijebong had independently come to the same conclusion as me about the timing.
- Some tests are added where WPT wasn't already testing functionality I was adding; Firefox and Chrome pass them, Safari fails some in a reasonably expected way
- Lots of test metadata changed to passing

One test continues to fail because 0.1 * 6 != 0.6 and the spec is written in abstractions instead of actual floating-point numbers; other test failures are WPT bugs I've reported as such and will write fixes for soon if no one else does.

---
<!-- 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 #25390 and fix #25388 and fix #19773 (except validation doesn't exist) and fix #25386

<!-- Either: -->
- [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-01-10 23:26:06 -05:00
Patrick Shaughnessy
87e86c81b9 stepUp, stepDown, valueAsNumber, valueAsDate, and list work and have tests 2020-01-10 20:09:51 -05:00
Patrick Shaughnessy
d59aed606d RadioNodeList now reflects changes to the parent, but has room for performance optimization 2020-01-10 19:09:38 -05:00
bors-servo
6b79a8f042
Auto merge of #25413 - pshaughn:optionindex, r=jdm
Implement HTMLOptionElement.index

<!-- Please describe your changes on the following line: -->
Made list_of_options public in HTMLSelectElement so HTMLOptionElement can see it, added index-getting to HTMLOptionElement.

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

<!-- Either: -->
- [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-01-10 17:14:00 -05:00
bors-servo
fdfc840bac
Auto merge of #25446 - pshaughn:fixme11868, r=jdm
Make getOwnPropertyDescriptor hold the correct value for indexed/named properties

This is towards #25036 and #25415; it could have far-reaching implications so I want to test it in isolation and see the results on the full test suite.

A few lines of code had a FIXME(#11868) despite that issue being closed, and looking for the pattern that was marked that way, I found one other unmarked instance of it. It doesn't immediately crash, and maybe it will pass some tests or fail some tests in informative ways.

EDIT: After adding an overlooked extended attribute to HTMLFormElement, this works very well indeed and seems to be worth merging!

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

<!-- 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. -->
2020-01-10 15:18:10 -05:00
Patrick Shaughnessy
111ede9c77 Make property descriptors hold named/indexed property values 2020-01-10 12:32:08 -05:00
Patrick Shaughnessy
767ccbe568 HTMLOptionElement.index 2020-01-09 15:38:02 -05:00
Mátyás Mustoha
da94f8d0e7 Add initial support for WebGL2 uniform buffer functions
Adds initial support for the following WebGL2 calls:

- bindBufferBase
- bindBufferRange
- getUniformIndices
- getUniformBlockIndex
- getActiveUniforms
- getActiveUniformBlockParameter
- getActiveUniformBlockName
- uniformBlockBinding

See: https://www.khronos.org/registry/webgl/specs/latest/2.0/#3.7.16
2020-01-09 11:17:50 +01:00
bors-servo
f8c957dc1b
Auto merge of #25467 - gterzian:fix_message_event, r=Manishearth
Use dom and new_inherited in (extendable)messageevent

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

Also FIX #24707

---
<!-- 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 #25464 (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-01-09 03:11:33 -05:00
bors-servo
dbee7f7d27
Auto merge of #25463 - Manishearth:input-mocking, r=asajeffrey
Add input mocking, input sources change event

Depends on  https://github.com/servo/webxr/pull/118

Also fixes some bugs I found.

Wanted to finish and merge this before I started on hit testing since the transient hit test stuff might have overlap.

There are a bunch of missing mock pieces that I'll probably do in a separate PR.

Still need to run tests.

Some things I skipped:
 - Doing handedness/target ray setting: See https://github.com/immersive-web/webxr-test-api/issues/46 , this would require making our impl support these changing
 - Handling button initial state: Would require some mock changes, but I ran out of time
 - Handling profiles/etc: We don't yet have impl support for these

r? @jdm
2020-01-09 02:45:49 -05:00
Gregory Terzian
a9fcd7379b use dom and new_inherited in (extendable)messageevent 2020-01-09 13:44:44 +08:00
Manish Goregaokar
94e8ce5739 Make next_input_id an InputId 2020-01-09 08:16:25 +05:30
Manish Goregaokar
c89f79b132 Add a realm 2020-01-09 08:16:25 +05:30
Manish Goregaokar
f721113f8d Handle AddInput/RemoveInput events 2020-01-09 08:16:25 +05:30
Manish Goregaokar
a90a42012b Add XRInputSourcesChangeEvent 2020-01-09 08:16:25 +05:30
Manish Goregaokar
82002765be Add select events 2020-01-09 08:16:25 +05:30
Manish Goregaokar
225254a6b3 Add disconnect()/reconnect() 2020-01-09 08:16:25 +05:30
Manish Goregaokar
e03fd0ef1c Add pointer/grip mocking 2020-01-09 08:16:25 +05:30
Manish Goregaokar
506a0afca3 Add FakeXRDevice::simulateInputSourceConnection() 2020-01-09 08:16:25 +05:30
Manish Goregaokar
7046f543a1 Expose targetRayMode 2020-01-09 08:16:25 +05:30
Manish Goregaokar
11e882385d Correctly initialize grip space 2020-01-09 08:16:25 +05:30
Manish Goregaokar
bf30bf26a4 Add blank FakeXRInputController interface 2020-01-09 08:16:25 +05:30
bors-servo
ed56927faf
Auto merge of #25456 - pshaughn:pastnamesexpire, r=jdm
Past names expire when form owner is reset

<!-- Please describe your changes on the following line: -->
On their way out of form.controls, elements now also leave form.past_names_map, passing one WPT test. We're already scanning linearly through form.controls linearly to get the index of the control there, so additionally scanning through the past names map by value shouldn't raise any particular performance concern.

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

<!-- 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-01-08 16:02:44 -05:00
bors-servo
821de45da8
Auto merge of #25451 - kunalmohan:19308-AccountableRefCell, r=jdm
Add accountable-refcell as optional build time feature

<!-- Please describe your changes on the following line: -->
It can be used with the format `./mach build --features refcell_backtrace`.

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

<!-- Either: -->
- [X] These changes do not require tests because it adds a optional build-time feature only.

<!-- 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-01-08 15:44:41 -05:00
Manish Goregaokar
9ecb13d83f Add SimulateVisibilityChange() 2020-01-08 23:35:01 +05:30
Kunal Mohan
02c1612cb0
Add accountable-refcell as optional build time feature 2020-01-08 09:44:41 +05:30
bors-servo
1e7c206ac4
Auto merge of #25449 - pshaughn:select-adding, r=Manishearth
Implement HTMLSelectElement.add() and indexed setter

HTMLSelectElement.add and its indexed setter just needed to forward to matching methods in HTMLOptionsCollection, which they now do. It was also necessary to change codegen slightly; it had accidentally assumed that if an indexed setter existed, a named getter or setter also would.

I expect this and #25446 will combine to pass more tests than either alone does.

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

<!-- 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-01-07 21:26:48 -05:00
bors-servo
3f5cb0e2f5
Auto merge of #25344 - jdm:webgl2-program-link, r=asajeffrey
Set more ANGLE shader translation properties for WebGL 2

Fixes #25034.
2020-01-07 18:26:40 -05:00
bors-servo
e185423fc7
Auto merge of #25310 - pshaughn:attr_node, r=Manishearth
Attr is a Node, with consequences for many Node methods

<!-- Please describe your changes on the following line: -->
Attr is now a Node, as current WHATWG specs require. I think I did some unidiomatic things to make compareDocumentPosition work and it could use a look by someone more familiar with how to write concise Rust code. I also think the new cases in compareDocumentPosition lack tests; it is possible to compare the position of two attributes, or of an attribute and an element, and I don't think any tests are exercising that functionality.

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

<!-- Either: -->
- [ ] There are tests for these changes (existing cases of Node methods are well-tested, and there is a WPT test specifically for whether Attr is Node, but I'm not sure about new Node method cases)

<!-- 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-01-07 18:13:40 -05:00
Patrick Shaughnessy
9ff6717992 Past names expire when form owner is reset 2020-01-07 11:57:52 -05:00
Patrick Shaughnessy
c1b71fcc4d Implement HTMLSelectElement.add() and indexed setter, fix test that was relying on add to be a stub 2020-01-07 11:05:31 -05:00
Josh Matthews
156ad646a0 webgl: Set more ANGLE shader translation properties for WebGL 2. 2020-01-07 10:22:40 -05:00
Patrick Shaughnessy
a322c6079b Now passing output tests as well as anyone 2020-01-06 15:28:55 -05:00
bors-servo
fd2950e903
Auto merge of #25424 - pshaughn:labelfixes, r=Manishearth
Make labelable element .labels a live list in tree order

This is not the highest-performance solution possible but it's visibly spec-aligned in a way a faster-performing implementation would be harder to verify, and I don't expect label-getting to deal with more than a few nodes at once in practice.
I added a macro by analogy with some of the existing make_XXX_getter! macros; I will change it if it doesn't seem right.
Remaining test failures are because keygen, shadow DOM, and ElementInternals are unimplemented. Shadow DOM should already be handled by the existing code when it is implemented, and keygen should just be able to add a labels_node_list and use the macro like the other labelable elements. ElementInternals labels are slightly different and might need another NodeList case.

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

<!-- Either: -->
- [X] There are tests for these changes, although there's room for more (see https://github.com/web-platform-tests/wpt/issues/21028)

<!-- 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-01-06 13:52:26 -05:00