Commit graph

8748 commits

Author SHA1 Message Date
Manish Goregaokar
acfe1ee0dd Add support for OpenXR hololens backend 2019-08-12 19:28:48 -07:00
Fernando Jiménez Moreno
322062bb3f Fix HTMLMediaElement seek race condition 2019-08-12 15:45:13 +02:00
Bastien Orivel
c693ef7025 Update rand to 0.6
I changed the isaac random to always be the 32 bits one because the 64
bits version doesn't work with ReseedingRng as it requires the
generator's output to be u32 for some reasons.

The other main change is that the reseed method doesn't exist anymore
and now rand recreates a new generator when it needs to reseed so I had
to add a new method for when we don't want a generator to be reseeded.

Closes #23558
2019-08-11 20:50:22 +02:00
George Roman
58f80f4ff3 Add support for returning array-like types from the Execute(Async)Script wd command 2019-08-10 12:39:10 +03:00
bors-servo
90fb4c3589
Auto merge of #23930 - CYBAI:incumbent-global-assertion, r=jdm
Assert incumbent global is always some in get_incumbent_global hook

While working on module script, I'd like to use Promise with a custom
callback with type `Box<dyn TaskBox>` which means we didn't use web API
callbacks as native handlers. However, we'll get a panic from
`enqueue_promise_job` and the panic says we have a `null` incumbent
global. The main problem here is, the Promise API is strongly tied to JS
engine and it always assumes there's a meaningful answer for "what
specific global is this promise associated with". So, when I don't use
the Promise for a specific web API, our engine cannot find a proper
incumbent global for us so that we get the `null` incumbent global
panic.

To make us catch this case easier in the future, we should add the
assertion inside `get_incumbent_global` hook so that we can know this
quickly next time.

Ref: https://mozilla.logbot.info/servo/20190807#c16525481

---
- [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 it should just add assertion inside the hook

<!-- 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/23930)
<!-- Reviewable:end -->
2019-08-09 02:54:33 -04:00
marmeladema
357b6c54ff Use safe JSContext in callbacks 2019-08-09 00:43:29 +01:00
marmeladema
0703a1ad6d Use safe JSContext as first argument for throw_dom_exception 2019-08-09 00:43:28 +01:00
marmeladema
6c26518f61 Remove usage of various unsafe keyword 2019-08-09 00:43:28 +01:00
marmeladema
78034a90d0 Use safe JSContext when possible in interface.rs 2019-08-09 00:43:24 +01:00
marmeladema
8b070fef52 Use safe JSContext in get_constructor_object_from_local_name 2019-08-09 00:02:10 +01:00
marmeladema
6d444afd9e Use safe JSContext in MicrotaskQueue 2019-08-09 00:02:10 +01:00
marmeladema
b18fa8b8a7 Use safe JSContext in compartments 2019-08-09 00:02:10 +01:00
marmeladema
ce3778afcc Remove some usage of unsafe code in iterator.rs 2019-08-09 00:02:09 +01:00
marmeladema
b08a3e6217 Remove some usage of unsafe code in AudioBuffer 2019-08-09 00:02:09 +01:00
marmeladema
4a5f51e079 Remove some usage of unsafe code in Permissions 2019-08-09 00:02:09 +01:00
marmeladema
8968286aa1 Don't mark new methods as unsafe in code generation 2019-08-09 00:02:09 +01:00
marmeladema
914bda9cd4 Remove some usage of unsafe code in CustomElementRegistry 2019-08-09 00:02:08 +01:00
marmeladema
0ecab7bbe0 Remove some usage of unsafe code in FileReader 2019-08-09 00:02:08 +01:00
marmeladema
5ca3dd9d05 Remove some usage of unsafe code in XMLHttpRequest 2019-08-09 00:02:08 +01:00
marmeladema
1d92796b03 Remove some usage of unsafe code in HTMLCanvasElement 2019-08-09 00:02:08 +01:00
marmeladema
d1282dc8cc Remove some usage of unsafe code in History 2019-08-09 00:02:07 +01:00
marmeladema
51e22fbc26 Remove some usage of unsafe code in Promise 2019-08-09 00:02:07 +01:00
CYBAI
28e64fc701 Assert incumbent global is always some in get_incumbent_global hook
While working on module script, I'd like to use Promise with a custom
callback with type `Box<dyn TaskBox>` which means we didn't use web API
callbacks as native handlers. However, we'll get a panic from
`enqueue_promise_job` and the panic says we have a `null` incumbent
global. The main problem here is, the Promise API is strongly tied to JS
engine and it always assumes there's a meaningful answer for "what
specific global is this promise associated with". So, when I don't use
the Promise for a specific web API, our engine cannot find a proper
incumbent global for us so that we get the `null` incumbent global
panic.

To make us catch this case easier in the future, we should add the
assertion inside `get_incumbent_global` hook so that we can know this
quickly next time.

Ref: https://mozilla.logbot.info/servo/20190807#c16525481
2019-08-08 12:39:56 +09:00
Simon Sapin
c38c964f1b Upgrade to rustc 1.38.0-nightly (dddb7fca0 2019-07-30) 2019-07-31 13:34:01 +02:00
bors-servo
6429fbeeff
Auto merge of #23891 - gterzian:fix_raf_flodding, r=asajeffrey
WebXr: allow for only a single raf message, until callbacks execute

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

See https://github.com/servo/webxr/issues/34

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

<!-- 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/23891)
<!-- Reviewable:end -->
2019-07-30 10:37:35 -04:00
Gregory Terzian
358b82279f allow for only a single raf message, until callbacks execute 2019-07-30 17:12:59 +08:00
bors-servo
8e7daa77b6
Auto merge of #23856 - servo:stylo-engines, r=nox
Stylo: replace product={gecko,servo} with engine={gecko,servo-2013,servo-2020}

Renaming the variable helped make sure I looked at every use.

Also auto-generate relevant parts of `CSSStyleDeclaration.webidl`, to make libscript compile accordingly.

<!-- 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/23856)
<!-- Reviewable:end -->
2019-07-30 02:40:38 -04:00
Simon Sapin
0215d09ccb Generate apis.html and css-properties.json for docs as part of crates’ build scripts
… rather than as an extra step after `cargo doc`.
This helps always using the correct set of CSS properties
(for layout 2013 v.s. 2020).
2019-07-30 08:37:33 +02:00
bors-servo
73784246b8
Auto merge of #23887 - servo:jdm-patch-47, r=asajeffrey
Use origin of final HTTP response as document origin

I discovered surprising problems when loading pages from http://joshmatthews.net that load same-origin images and try to use them as webgl textures. Since there's a redirect from joshmatthews.net to www.joshmatthews.net, the images are not considered same-origin in Servo because the document stores the origin for the original request's URL, rather than the origin of the response that is received after processing any redirections.

<!-- 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/23887)
<!-- Reviewable:end -->
2019-07-29 23:20:53 -04:00
Josh Matthews
bfd9bbe82a Use origin of final HTTP response as document origin. 2019-07-29 21:58:58 -04:00
bors-servo
9043f247d9
Auto merge of #23839 - Manishearth:end-improve, r=asajeffrey
Improve session test lifecycle code

Requires https://github.com/servo/webxr/pull/25

Fixes https://github.com/servo/servo/issues/23796, hopefully

r? @asajeffrey

<!-- 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/23839)
<!-- Reviewable:end -->
2019-07-29 21:27:52 -04:00
bors-servo
bde4cb476e
Auto merge of #23886 - servo:jdm-patch-46, r=asajeffrey
Avoid panic during shutdown when Blobs exist

Observed when closing the UWP app when https://www.joshmatthews.net/demos/lamp.html is the active document.

---
- [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 no real shutdown tests.

<!-- 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/23886)
<!-- Reviewable:end -->
2019-07-29 18:42:28 -04:00
Manish Goregaokar
d996d3c1eb Improve session test lifecycle code 2019-07-29 15:37:17 -07:00
Josh Matthews
9e18166550
Don't panic if file manager thread is unreachable when cleaning up Blobs. 2019-07-29 16:03:29 -04:00
Simon Sapin
ddb4e369dd Stylo: replace product={gecko,servo} with engine={gecko,servo-2013,servo-2020}
Renaming the variable helped make sure I looked at every use.
2019-07-29 17:37:03 +02:00
Simon Sapin
f1300bb98b Auto-generate CSSStyleDeclaration.webidl for CSS properties based on the style crate 2019-07-29 17:37:03 +02:00
Josh Matthews
8f5c37c0b5 Don't panic if WebGL thread can't be reached during finalization. 2019-07-29 10:09:24 -04:00
Alan Jeffrey
c757a9c009 Get XR sessions to track the draw texture, so we render the XR framebuffer rather than the default canvas framebuffer 2019-07-28 10:24:38 -04:00
Alan Jeffrey
133a17e15c Replace use of callbacks in webxr by channels 2019-07-26 23:36:13 -05:00
bors-servo
8ec28978cd
Auto merge of #23777 - jdm:webgl-main-thread, r=asajeffrey
Support running WebGL in its own thread or on the main thread.

This is the final missing piece to support WebGL in ANGLE on Windows. ANGLE doesn't support multiple GL contexts on separate threads using the same underlying Direct3d device, so we need to process all GL operations for WebGL on the same thread as the compositor. These changes try to retain enough flexibility to support both approaches so we can get WebGL working on Windows ASAP.

---
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix #23697
- [x] There are tests for these changes

<!-- 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/23777)
<!-- Reviewable:end -->
2019-07-26 09:16:34 -04:00
bors-servo
2981fe87ce
Auto merge of #23855 - sreeise:media_frag_string, r=ferjm
Changed DOMString usages to string in MediaFragmentParser

<!-- Please describe your changes on the following line: -->
Changed `DOMString` usages to `String`/`&str`.

---
<!-- 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 #23834 (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. -->

<!-- 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/23855)
<!-- Reviewable:end -->
2019-07-26 08:22:09 -04:00
Josh Matthews
a2ca3ddbd9 Remove extra webgl message pumping thread. 2019-07-25 23:07:23 -04:00
Josh Matthews
410d5bc772 Update SpiderMonkey bindings for Windows arm64 crash fix. 2019-07-25 20:23:21 -04:00
sreeise
598d343854 Changed DOMString usages to string in MediaFragmentParser 2019-07-25 13:34:18 -04:00
Kagami Sascha Rosylight
bf70decdd3 remove redundant extra scoping 2019-07-25 12:43:43 +09:00
Kagami Sascha Rosylight
87cc409579 use SafeJSContext 2019-07-25 11:14:21 +09:00
Kagami Sascha Rosylight
caf7a2488e
Merge branch 'master' into tojson 2019-07-25 10:09:33 +09:00
bors-servo
7adf022dfa
Auto merge of #23837 - cburgos:bugfix/link_called-update, r=jdm
update link_called when link function called.

<!-- Please describe your changes on the following line: -->
On call of WebGLProgram::link update link_called to true

---
<!-- 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 #23722  (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. -->

<!-- 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/23837)
<!-- Reviewable:end -->
2019-07-24 20:20:14 -04:00
Kagami Sascha Rosylight
16b4e3446b Support default toJSON in WebIDL 2019-07-24 22:01:55 +09:00
marmeladema
88cacfb009 Modify *::get_cx methods to return a safe JSContext instead of a raw one 2019-07-24 09:53:10 +01:00