Commit graph

6235 commits

Author SHA1 Message Date
Anthony Ramine
e8f19fa7fc Properly check the right internal formats in gl.renderbufferStorage 2018-04-06 11:22:28 +02:00
Anthony Ramine
ac85d1255d Emit InvalidEnum for invalid targets passed to gl.renderbufferStorage 2018-04-06 11:22:27 +02:00
Anthony Ramine
183cc4c035 Properly check for invalid targets in gl.BindFramebuffer
It should always emit InvalidEnum, not InvalidOperation.
2018-04-06 11:22:27 +02:00
Anthony Ramine
91d07a27db Remove SAMPLE_COVERAGE_INVERT from WebGLRenderingContext::validate_feature_enum
This constant is not mentioned in the docs of glEnable or glIsEnabled.
2018-04-05 09:31:13 +02:00
Anthony Ramine
1881c09a9c Mention #20534 near the enable/disable/isEnabled WebGL methods 2018-04-05 09:31:12 +02:00
Anthony Ramine
fb290e9c9e Properly clamp arguments to WebGLRenderingContext.depthRange 2018-04-05 09:31:09 +02:00
Anthony Ramine
7b4d66b621 Manually clamp the argument of WebGLRenderingContext.clearDepth
Better be safe than to feed stuff to some GPU driver that wouldn't clamp it.
2018-04-05 09:30:21 +02:00
Anthony Ramine
fc6335c01d Properly allow more than FUNC_ADD in blendEquationSeparate 2018-04-04 15:49:21 +02:00
Anthony Ramine
15272d2c3b Properly allow FUNC_SUBTRACT and FUNC_REVERSE_SUBTRACT in blendEquation 2018-04-04 15:43:09 +02:00
Anthony Ramine
ae286a518d Cache BUFFER_USAGE value on the DOM side 2018-04-04 15:41:27 +02:00
Anthony Ramine
93d2082acb Move some methods out of the WebGLRenderingContextBase mixin
Those methods are to be overloaded in WebGL2, but this can't be done with
their current definitions, thanks to https://github.com/KhronosGroup/WebGL/issues/2216.
2018-04-04 13:12:43 +02:00
Anthony Ramine
bb2b6a7a41 Fix the signature of WebGLRenderingContext::BufferSubData 2018-04-04 13:12:42 +02:00
Anthony Ramine
3c56d2f5a7 Move handle_potential_webgl_error to the dom macros module 2018-04-04 13:12:41 +02:00
Anthony Ramine
e7f716de12 Fix the emitted error for invalid targets in WebGLRenderingContext::BufferData_ 2018-04-04 13:12:41 +02:00
Anthony Ramine
235a7b80c9 Introduce WebGLRenderingContext::bound_buffer 2018-04-04 13:12:40 +02:00
Anthony Ramine
605da95076 Improve WebGLBuffer::buffer_data
It now checks the usage argument itself and use generics for the data vector.
2018-04-04 13:12:39 +02:00
Anthony Ramine
4b032f9191 Properly implement the WebGL2 mixin
It should not extend the WebGL1 mixin.
2018-04-03 14:17:11 +02:00
Anthony Ramine
938f1362e7 Update the WebIDL parser 2018-04-03 14:06:07 +02:00
Anthony Ramine
866a523914 Properly use Float32List and Int32List for WebGL uniform methods 2018-04-03 12:22:32 +02:00
Anthony Ramine
088ebcb095 Remove obsolete BufferDataSource 2018-04-03 11:15:54 +02:00
Anthony Ramine
a82164d8a5 Clean up signature of some fallible WebGL methods 2018-04-03 10:51:26 +02:00
Anthony Ramine
84adede785 Clean up WebGLRenderingContext.webidl 2018-04-03 10:51:26 +02:00
bors-servo
9cd60c8e78
Auto merge of #20447 - Brody-Eastwood:master, r=jdm
NCSU Canvas Rendering Project Initial Steps

<!-- Please describe your changes on the following line: -->
Implements the initial steps from:

https://github.com/servo/servo/wiki/Canvas-rendering-project

---
<!-- 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: -->
- [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/20447)
<!-- Reviewable:end -->
2018-04-02 22:24:34 -04:00
Brody Eastwood
8a1590efc6 Add unique canvas IDs to all canvas operations. 2018-04-02 22:02:22 -04:00
Nupur Baghel
2009c4e481 typed array support for XMLHttpRequest's send API 2018-03-29 11:10:00 +05:30
Marcin Mielniczuk
356c57e628 Adapt Servo for mozjs 0.6 and the changes introduced in servo/rust-mozjs#393 2018-03-28 21:28:30 +02:00
bors-servo
1981efcc35
Auto merge of #20431 - talklittle:issues-13234-5600-squashed, r=jdm
TextDecoder: streaming decode, ignoreBOM

<!-- Please describe your changes on the following line: -->
Implement streaming decode and ignoreBOM flag for TextDecoder.

https://encoding.spec.whatwg.org/#dom-textdecoder-decode

https://encoding.spec.whatwg.org/#dom-textdecoder-ignorebom

---
<!-- 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 #13234 (github issue number if applicable).
- [x] These changes fix #5600 (github issue number if applicable).

<!-- Either: -->
- [ ] There are tests for these changes OR
- [x] These changes do not require tests because the wpt tests are used for testing:

* /encoding/textdecoder-fatal-streaming.html
* /encoding/textdecoder-streaming.html
* /encoding/textdecoder-ignorebom.html

<!-- 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/20431)
<!-- Reviewable:end -->
2018-03-26 17:30:36 -04:00
bors-servo
4b8416fafb
Auto merge of #20307 - csmoe:measure_query_time, r=jdm
Measure time required before a layout query is serviced by the layout thread

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

- [X] extract QueryMsg from ReflowGoal
- [X] introduce QueryMsg timestamp

---
<!-- 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 #19795 (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/20307)
<!-- Reviewable:end -->
2018-03-26 15:42:03 -04:00
bors-servo
9c5bdd932e
Auto merge of #20423 - servo:bytes, r=emilio
Use ByteBuf for the canvas messages

<!-- 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/20423)
<!-- Reviewable:end -->
2018-03-26 14:49:16 -04:00
Anthony Ramine
ce81420bef Use ByteBuf for the canvas messages
The type Vec<u8> is super unefficient to work with in Serde if all you want
to represent is a simple blob.
2018-03-26 20:48:02 +02:00
Andrew Shu
3990946a63 TextDecoder: streaming decode, ignoreBOM
https://encoding.spec.whatwg.org/#dom-textdecoder-decode

https://encoding.spec.whatwg.org/#dom-textdecoder-ignorebom
2018-03-26 11:15:44 -07:00
OJ Kwon
a1316fae0a
refactor(websocket): do not borrow sender anymore 2018-03-26 08:54:19 -07:00
Christian Poveda
bff887c5a6 Websockets send typed arrays now 2018-03-25 10:01:33 -05:00
csmoe
054d65763d fix time measure 2018-03-25 09:14:30 +08:00
Anthony Urena
ef0e93c9b1 Updates Bluetooth type to use BufferSource 2018-03-24 20:46:14 -04:00
Anthony Urena
5bf2e71407 Switches characteristic to use BufferSource 2018-03-24 20:46:13 -04:00
Anthony Urena
40235da2d3 Switches WriteValue to use BufferSource 2018-03-24 20:46:12 -04:00
Emilio Cobos Álvarez
c2f8b0468a
Update mozjs. 2018-03-25 00:04:43 +01:00
bors-servo
2f94e0d2a8
Auto merge of #20413 - christianpoveda:issue_20344, r=jdm
TextDecoder's Decode now receives a BufferSource as input

<!-- 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 #20344 (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/20413)
<!-- Reviewable:end -->
2018-03-24 17:46:46 -04:00
Christian Poveda
2c47e7e1db TextDecoder's Decode now receives a BufferSource as input 2018-03-24 16:26:44 -05:00
bors-servo
782d4d4af6
Auto merge of #20414 - servo:webgl, r=emilio
Implement gl.getParameter(gl.ALIASED_POINT_SIZE_RANGE)

<!-- 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/20414)
<!-- Reviewable:end -->
2018-03-24 14:58:38 -04:00
bors-servo
23b2f42a36
Auto merge of #20406 - kwonoj:feat-fetch-body-arraybuffer, r=jdm
feat(fetch): accept arraybuffer in consume_body

<!-- Please describe your changes on the following line: -->
Related to https://github.com/servo/servo/issues/20346.

I realized I am not sufficiently knowledgeable about codebases and have high confidence this PR is not ready to be accepted. Raising it as PR early to possibly ask some suggestions around codebases.

If this PR seems unrecoverable by code review, please feel freely close and unassign me from issue 🙏

This PR tries to implement #20346, updating `Body` idl and implements corresponding implementation in `body.rs` for `fetch`. Criteria for changes may includes

- does `run_array_buffer_data_algorithm` implementation is legit for allocating arraybuffer? (probably not)
- does `run_array_buffer_data_algorithm` implementation is acceptable for handling error, by naively returning `Error::JSFailed`?
- there are some number of wpt test started to PASS with this PR. Is this legit side effect, or something incorrect by current implementation?
- etcs, vice versa

---
<!-- 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 #20346 (github issue number if applicable).

<!-- Either: -->
- [ ] There are tests for these changes OR
- [ ] These changes do not require tests because _____
- wpt test has changed in PR, need to be reviewed.

<!-- 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/20406)
<!-- Reviewable:end -->
2018-03-24 13:46:20 -04:00
bors-servo
2d78964634
Auto merge of #20405 - christianpoveda:issue_20349, r=jdm
Add constructors for typed arrays in DOMMatrix and DOMMatrixReadOnly

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

- DOMMatrix now have the functions: FromFloat32Array, FromFloat64Array.
- DOMMatrixReadOnly now have the functions: FromFloat32Array, FromFloat64Array, ToFloat32Array, ToFloat64Array.

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 #20349 (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/20405)
<!-- Reviewable:end -->
2018-03-24 12:41:44 -04:00
Anthony Ramine
d6ebbd3e17 Implement gl.getParameter(gl.ALIASED_POINT_SIZE_RANGE) 2018-03-24 16:36:19 +01:00
Anthony Ramine
20a309f037 Implement missing WebGLShader checks
Methods compileShader and getShaderParameter should emit an error when
the shader has been deleted.
2018-03-24 15:24:54 +01:00
Anthony Ramine
a62bed82e4 Implement WebGLRenderingContextBase.getAttachedShaders 2018-03-24 13:58:07 +01:00
Anthony Ramine
2befe47384 Implement missing checks in WebGLRenderingContext::GetBufferParameter 2018-03-24 11:44:29 +01:00
OJ Kwon
c0b5eeef57
feat(webidl): expose arraybuffer overload in body idl 2018-03-23 23:12:21 -07:00
bors-servo
72f326b22b
Auto merge of #20400 - servo:webgl, r=emilio
Implement HTMLCanvasElement.toDataURL for WebGL canvas (fixes #19147)

<!-- 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/20400)
<!-- Reviewable:end -->
2018-03-24 00:18:28 -04:00
bors-servo
5a432eaad3
Auto merge of #20404 - MaximilianDauner:issue_20392, r=jdm
GamepadButtonList::sync_from_vr should use more iterators #20392

<!-- Please describe your changes on the following line: -->
Used the zip function instead of iterating over both vectors with an indexing variable and using unwrap.

---
<!-- 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 #20392(github issue number if applicable).

<!-- Either: -->
- [ ] There are tests for these changes OR
- [x] These changes do not require tests because it says in the issue description no need for tests
<!-- 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/20404)
<!-- Reviewable:end -->
2018-03-23 23:15:51 -04:00