Commit graph

9308 commits

Author SHA1 Message Date
gatowololo
24c14ac94e Factored out permission_state_invocation_results API to GlobalScope
Instead of Window
2020-02-27 00:02:04 +02:00
bors-servo
6116012408
Auto merge of #25831 - szeged:wgpu_read_map_async, r=jdm
Implement mapReadAsync function of GPUBuffer

Implemented the `mapReadAsync` and fixed the `unmap` functions of `GPUBuffer`.
Added `mapped` internal slot for tracking the ArrayBuffer/Promise.
Added more states to the `GPUBufferState` enum.

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

<!-- 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.-->
cc @kvark @jdm @zakorgy
<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
2020-02-25 16:42:35 -05:00
bors-servo
cd00e57c97
Auto merge of #25740 - gterzian:per_fetch_filemanager_handle, r=Manishearth
Per fetch file token for blob url

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

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

First step of https://github.com/servo/servo/issues/25226

---
<!-- 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-02-25 14:49:26 -05:00
Istvan Miklos
2df4d9fce4 Implement mapReadAsync function of GPUBuffer
Implemented the `mapReadAsync` and fixed the `unmap` functions of `GPUBuffer`.
Added `mapped` internal slot for tracking the ArrayBuffer/Promise.
Added more states to the `GPUBufferState` enum.
2020-02-25 10:18:36 +01:00
Gregory Terzian
eb21d5f738 implement broadcastchannel 2020-02-25 14:17:48 +08:00
bors-servo
145c89a2d4
Auto merge of #25499 - NeverHappened:implement-form-dirname, r=jdm
Implement dirname support for form element

Added support for dirname in input on form submit
Added Dir getter / setter for HTMLElement
NOT YET Added get directionality according to https://html.spec.whatwg.org/multipage/dom.html#the-directionality

- [X] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix #25379 (GitHub issue number if applicable)
2020-02-24 21:18:10 -05:00
bors-servo
0884884796
Auto merge of #25345 - jdm:drop-cleanup, r=asajeffrey
Avoid accessing global objects from DOM destructors

This removes all instances that I could find of DOM objects accessing `self.global()` in code that runs as part of a Drop method. This is unsafe because the GC could destroy objects in any order when doing a big sweep. Instead, these types should store the data they need as members so they can run in isolation without accessing the rest of the GC graph as part of their destructors.

---
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix #25258 and fix #23986
- [x] There are tests for these changes
2020-02-24 17:25:02 -05:00
Dmitry Kolupaev
25c5a4c045 Use map_or and fix manifest 2020-02-25 01:18:21 +03:00
Dmitry Kolupaev
ab2aeb6d97 Implement step 5.13 for dirname correctly 2020-02-25 01:18:21 +03:00
Dmitry Kolupaev
6188116090 Add special case directionality of phone input 2020-02-25 01:18:21 +03:00
Dmitry Kolupaev
35d340daba Simplify code for directionality 2020-02-25 01:18:21 +03:00
Dmitry Kolupaev
edb940e613 Remove recursiveness from directionality search 2020-02-25 01:18:21 +03:00
Dmitry Kolupaev
7e2107b1a5 Simplify node#parent_directionality 2020-02-25 01:18:20 +03:00
Dmitry Kolupaev
7d6d1c09cb Rearrange directionality algorithm functions 2020-02-25 01:18:20 +03:00
Dmitry Kolupaev
cb34e5c887 Move dirname collection to input 2020-02-25 01:18:20 +03:00
Dmitry Kolupaev
ef49f2e0eb Implement dirname for form submit and directionality for element 2020-02-25 01:18:20 +03:00
Josh Matthews
1449bac0e1 Avoid accessing node global during Node's destructor. 2020-02-24 16:27:40 -05:00
Josh Matthews
3e95efdea6 Avoid accessing DOM global from XR's destructor. 2020-02-24 16:27:40 -05:00
Josh Matthews
fda0572a93 Avoid accessing DOM global from VRDisplay's destructor. 2020-02-24 16:27:40 -05:00
Josh Matthews
2e6252f256 Avoid fetching node global from HTMLMediaElement's destructor. 2020-02-24 15:58:58 -05:00
Josh Matthews
f02e516f32 Remove unnecessary Option. 2020-02-24 15:58:58 -05:00
bors-servo
dae49435c2
Auto merge of #25668 - pshaughn:iframerecursion, r=jdm
Stop iframes from including their ancestors

An iframe that included itself would just keep loading until running out of resources; the spec includes protection against that, and now Servo follows (some of) the spec about it.

---
<!-- 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 the same-origin case presented in #3931 but not a case in which an intermediate cross-origin iframe is hiding a same-origin ancestor further up.
<!-- Either: -->
- [X] There is a manual test for these changes in #3931

<!-- 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-02-24 15:20:50 -05:00
Mátyás Mustoha
8701d45715 Add support for WebGL2 clear buffer operations
Adds support for the following WebGL2 methods:

- `clearBufferfv`
- `clearBufferiv`
- `clearBufferuiv`
- `clearBufferfi`

See: https://www.khronos.org/registry/webgl/specs/latest/2.0/#3.7.11
2020-02-24 10:57:46 +01:00
bors-servo
92f5b36f49
Auto merge of #25738 - jsjoeio:jsjoeio/issue-25732-rename-xr, r=Manishearth,jdm
refactor: rename XR to XRSystem

<!-- Please describe your changes on the following line: -->
This PR renames XR to XRSystem.

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

<!-- Either: -->
- [ ] There are tests for these changes OR
- [X] These changes do not require tests because it's the changing of a name (XR -> XRSystem)

<!-- 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-02-24 02:27:13 -05:00
bors-servo
0ae17e623f
Auto merge of #25771 - gterzian:leak_message_ports, r=jdm
Leak message ports in Dom, until they are closed

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

FIX #25461
FIX #24810
FIX #24488

---
<!-- 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-02-23 19:24:45 -05:00
JavaScript Joe
30f474312f refactor: rename XR to XRSystem
chore: fix formatting
refactor: change filename and ref to xrsystem
refactor: change filename XRSystem.webidl
refactor: update crate in navigator
refactor: use XRSystem instead of XR in navigator
refactor: update Bindings.conf
refactor: use XRSystemMethods

fix: update assertions for XRSystem

fix: update manifest json
2020-02-23 14:34:42 -08:00
bors-servo
6bc4a7df24
Auto merge of #25810 - Manishearth:xr-profile, r=jdm
Add profiling to WebXR

Fixes https://github.com/servo/webxr/issues/128

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

r? @jdm
2020-02-23 08:55:33 -05:00
Manish Goregaokar
f3e1aba4e3 Add profiling for WebXR 2020-02-22 22:00:05 -08:00
Kunal Mohan
a05553f188
Make Background Hang Monitor Optional
This is done by wrapping all channels of communication
and related objects inside Option which are configured
using flag inside servo_config.
2020-02-23 01:45:52 +05:30
Gregory Terzian
291ab7473d leak message ports in dom, until they are closed 2020-02-22 14:43:30 +08:00
bors-servo
ada95b9878
Auto merge of #25821 - gterzian:fix_messagechannel_constructor_idiom, r=Manishearth
Use new and new_inherited in messagechannel

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

Use common DOM constructor idioms in `MessageChannel`. Also, remove the falliable from the result, since that seems to match the spec better https://html.spec.whatwg.org/multipage/web-messaging.html#dom-messagechannel

---
<!-- 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-02-22 01:13:08 -05:00
Mátyás Mustoha
d5d0a788e3 Add support for WebGL2 getFramebufferAttachmentParameter
Implements the WebGL2 variant of `getFramebufferAttachmentParameter`
and the related parameter checks.

See: https://www.khronos.org/registry/webgl/specs/latest/2.0/#3.7.4
2020-02-21 17:30:03 +01:00
bors-servo
afb1faf80f
Auto merge of #25784 - szeged:mmatyas__webgl_fns_framebuf_attachments, r=jdm
Add support for WebGL2 framebuffer attachments

Adds an initial implementation for the framebuffer attachments introduced with WebGL2 and the related enums and constrains checks.

<!-- Please describe your changes on the following line: -->
Depends on #25765.

cc @jdm @zakorgy

---
<!-- 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-02-21 09:43:09 -05:00
Mátyás Mustoha
b41805a920 Add support for WebGL2 framebuffer attachments
Adds an initial implementation for the framebuffer attachments
introduced with WebGL2 and the related enums and constrains checks.
2020-02-21 11:04:30 +01:00
Gregory Terzian
28d0d90413 use new and new_inherited in messagechannel 2020-02-21 15:33:16 +08:00
Gregory Terzian
895500e68c add a fetch token for blob urls 2020-02-21 14:26:45 +08:00
Josh Matthews
3fd3c23e17 Update ipc-channel and crossbeam-channel. 2020-02-20 11:15:13 -05:00
bors-servo
107a29121c
Auto merge of #25793 - szeged:wgpu_compute_pass_encoder_fns, r=jdm
Implement GPUComputePassEncoder functions

Implement the `dispatch`, `endPass`, `setBindGroup`, `setPipeline` functions of `GPUComputePassEncoder`.

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

<!-- 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.-->
cc @kvark @jdm @zakorgy
<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
2020-02-19 17:18:29 -05:00
bors-servo
35b1548cb6
Auto merge of #25777 - kunalmohan:24720-ImageCache, r=jdm
Take origin from current window instead of creating a new one in event of reflow

Everytime a new `LayoutContext` was created, it created a new origin which
caused endless stream of image loads to occur in case of reflow. The reason
for this was that the existing image, although cached successfully, was not
used because the entry in hashmap did not match because of different(new)
origin.
This is solved by storing the origin of a window in enum `ScriptReflow` and
used in creating new `LayoutContext` in case of reflow.

<!-- Please describe your changes on the following line: -->
r?@jdm

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

<!-- 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-02-19 13:51:30 -05:00
bors-servo
44783c89bb
Auto merge of #25369 - CYBAI:nullable-global, r=jdm
Always pass InRealm to GlobalScope::from_context to avoid getting a null global

---
<!-- 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 #25348
- [x] 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-02-19 12:01:47 -05:00
Istvan Miklos
170e9971ac Implement GPUComputePassEncoder functions
Implement the `dispatch`, `endPass`, `setBindGroup`, `setPipeline` functions of `GPUComputePassEncoder`.
2020-02-19 11:19:59 +01:00
bors-servo
b20883ce99
Auto merge of #25765 - szeged:mmatyas__webgl_fns_framebuf_readslot, r=jdm
Add initial support for WebGL2 read framebuffer

Adds support for binding to the read framebuffer slot and querying its status.

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

Depends on #25752

cc @jdm @zakorgy

---
<!-- 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-02-18 17:11:17 -05:00
bors-servo
fe471de33b
Auto merge of #25752 - szeged:mmatyas__webgl_fns_framebuf_glparams, r=jdm
Add support for WebGL2 `MAX_COLOR_ATTACHMENTS` and `MAX_DRAW_BUFFERS`

Adds support for using the WebGL2 enums `MAX_COLOR_ATTACHMENTS` and `MAX_DRAW_BUFFERS` with `GetParameter`.

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

---
<!-- 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-02-18 13:15:25 -05:00
Kunal Mohan
4a3bf52a7c
remove option for origin and mirror changes to layout_thread_2020 2020-02-18 00:57:33 +05:30
bors-servo
ea7e753cea
Auto merge of #25773 - Manishearth:input-sources-change, r=jdm
Always trigger an input sources change event on session creation

Fixes our behavior to match the spec, and to specifically do it in a way
that makes sense. This is also what Chromium does currently, though I'm
not sure if it does the scheduling the same way.

The spec for this may change, see https://github.com/immersive-web/webxr/issues/961.

This fix, along with https://github.com/servo/servo/pull/25770 , makes
three.js content work on servo. Instead of this fix we can also wait for
https://github.com/mrdoob/three.js/issues/18638 to land (which isn't
certain until we figure out more about
https://github.com/immersive-web/webxr/issues/961 )

Even if https://github.com/immersive-web/webxr/issues/961 decides to
choose the option that obviates this patch, we should probably keep it
for now since there's already content out in the wild relying on this
behavior.

r? @jdm @asajeffrey
2020-02-16 03:10:56 -05:00
CYBAI
403ffcf1eb Always pass InRealm to GlobalScope::from_context to avoid getting null global 2020-02-16 09:55:10 +09:00
Kunal Mohan
a5b43b7df1
Take origin from window instead of creating a new one in case of reflow
Everytime a new LayoutContext was created, it created a new origin which
caused endless stream of image loads to occur in case of reflow. The reason
for this was that the existing image, although cached successfully, was not
used because the entry in hashmap did not match because of different(new)
origin.
This is solved by storing the origin of a window in enum ScriptReflow and
used in creating new LayoutContext in case of reflow.
2020-02-15 23:51:26 +05:30
Manish Goregaokar
09a23b0cb1 Always trigger an input sources change event on session creation 2020-02-15 07:53:55 -08:00
bors-servo
3475790fc2
Auto merge of #25770 - Manishearth:sessionsupport, r=jdm
supportsSession() -> isSessionSupported()

r? @jdm

fixes https://github.com/servo/servo/issues/25596
2020-02-15 07:59:39 -05:00
Manish Goregaokar
54c8cac1cd supportsSession() -> isSessionSupported() 2020-02-15 00:46:18 -08:00