Commit graph

6335 commits

Author SHA1 Message Date
bors-servo
fe1a057bd1
Auto merge of #20740 - fabricedesre:mutation-observer-disconnect, r=jdm
Implement MutationObserver.disconnect()

<!-- Please describe your changes on the following line: -->
This implements https://dom.spec.whatwg.org/#dom-mutationobserver-disconnect
I added a `node_list` to the `MutationObserver` struct to keep track of the nodes involved in an observer because otherwise I could not find a way to unregister the observers on the node themselves without traversing the whole document tree. Let me know if there's something I missed.

---
<!-- 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/20740)
<!-- Reviewable:end -->
2018-05-18 18:27:50 -04:00
bors-servo
3d109b4574
Auto merge of #20615 - KiChjang:window-indexed-getter, r=emilio
Implement window indexed getter

Fixes #4589.

<!-- 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/20615)
<!-- Reviewable:end -->
2018-05-17 18:52:38 -04:00
Simon Martin
c2fb588ac7 Issue #20556: Implement proper checks in WebGLRenderingContext's bindBuffer(). 2018-05-10 08:51:51 +02:00
Fabrice Desré
5bfa819038 Implement MutationObserver.disconnect() 2018-05-09 16:27:09 -07:00
Keith Yeung
df23f909cd Do not unwrap in element{,s}FromPoint 2018-05-07 23:25:09 -07:00
bors-servo
1d8283e010
Auto merge of #20329 - gterzian:before_unload, r=cbrewster
Implement beforeunload event and infrastructure

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

Implementation of:
1. https://html.spec.whatwg.org/multipage/#prompt-to-unload-a-document, and
2. https://html.spec.whatwg.org/multipage/#unload-a-document
---
<!-- 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 #10787 and fix #20485 and fix #20588 and fix #20496 (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/20329)
<!-- Reviewable:end -->
2018-05-07 13:22:23 -04:00
Eric Anholt
471924af62 webgl: Add getParameter(UNPACK_PREMULTIPLY_ALPHA_WEBGL) support. 2018-05-07 09:46:30 -07:00
Eric Anholt
8c052d3593 webgl: Add getParameter(UNPACK_FlIP_Y_WEBGL) support. 2018-05-07 09:46:13 -07:00
Eric Anholt
5f2d512c12 webgl: Drop a silly check for 0 in GetTexParameter.
0 is not among the valid values for a wrap mode or filter, so it won't
ever be returned unless the driver is broken, and even if it was a
valid value we would want to pass it through.
2018-05-05 20:13:02 -07:00
Gregory Terzian
29d1cf6270 implement "has event listener", plug into (before)unload 2018-05-05 19:14:43 +08:00
Gregory Terzian
427eaed535 beforeunload and unload infrastructure 2018-05-05 19:14:36 +08:00
Anthony Ramine
0f91712800 Update to gleam 0.5 2018-05-05 13:08:36 +02:00
Gregory Terzian
a1d1b18710 PutForward=href on window and document location 2018-05-04 15:15:12 +08:00
bors-servo
2c9ef9e558
Auto merge of #20689 - fabricedesre:mutation-take-records, r=emilio
MutationObserver api: Implement takeRecords() and characterData mutations

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

I started by looking at adding support for `takeRecords()` to get fluent.js to work on Servo. To get the wpt tests to pass I ended up implementing character data mutations (most of the plumbing was already there) and this fixed a few more tests.

We are still missing support for `disconnect()`, which I keep for a followup.

---
<!-- 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 build-geckolib` 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/20689)
<!-- Reviewable:end -->
2018-05-02 14:05:00 -04:00
Fabrice Desré
75434e6fce MutationObserver api: Implement takeRecords() and characterData mutations 2018-05-02 09:58:37 -07:00
Gregory Terzian
a5a120f30a fire pageshow for new entry after history traversal 2018-05-01 21:41:18 +08:00
Keith Yeung
249e8a575f Set the proper attributes for the WindowProxy property descriptor 2018-04-30 15:43:40 -07:00
Keith Yeung
080600003c Return window proxy properly for indexed window getter 2018-04-30 15:43:39 -07:00
bors-servo
847115ba04
Auto merge of #20671 - cbrewster:history_url, r=asajeffrey
Make session history aware of URLs

<!-- 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 build-geckolib` 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/20671)
<!-- Reviewable:end -->
2018-04-30 13:33:23 -04:00
bors-servo
d1378d6bad
Auto merge of #20533 - paulrouget:res, r=mbrubeck
Delegate resource reading to embedder

Now the embedder provides the content of the files itself. Now, on Android, we can use regular assets instead of unzipping all the resources on the scared at startup.

---
<!-- 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
- [ ] `./mach build-geckolib` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix #15635 (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/20533)
<!-- Reviewable:end -->
2018-04-27 13:50:18 -04:00
Anthony Ramine
73b5bf201f Implement WindowOrWorkerGlobalScope.origin
The test document_domain_setter.html now fails, but AFAIK the origin
comparison can never be true (document.origin is the unprefixed domain,
while the loaded iframe is from www1.…), and that test fails in all
major browsers because of security exceptions anyway.
2018-04-27 16:41:19 +02:00
Anthony Ramine
88a0265c00 Move around WindowOrWorkerGlobalScope methods 2018-04-27 11:19:07 +02:00
Paul Rouget
9fb5795f37 delegate resource reading to embedder 2018-04-27 15:34:52 +08:00
bors-servo
f1a06e0d0c
Auto merge of #20631 - brainlessdeveloper:add-webgl-get-renderbuffer-parameter, r=emilio
Implement WebGL GetRenderbufferParameter

This needed a bump of gleam to version 0.4.33 for this https://github.com/servo/gleam/pull/162

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

I think my changes in test expectations are pretty naive and I have to wait for the PR to run on CI to see what the actual impact is. I'd like some guidance on this, too.

---
<!-- 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 build-geckolib` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix #20514 (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/20631)
<!-- Reviewable:end -->
2018-04-25 04:18:38 -04:00
Connor Brewster
e7ef9cfb30 Make session history aware of URLs 2018-04-24 15:13:11 -05:00
Fausto Núñez Alberro
58760d91d1
Implement WebGL GetRenderbufferParameter
This needed a bump of gleam to version 0.4.33
2018-04-24 18:16:51 +02:00
bors-servo
a27c62717e
Auto merge of #20680 - Brody-Eastwood:master, r=emilio
Moved Canvas rendering to a single thread.

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

Implements the "Subsequent Steps" part of the [NCSU Canvas rendering project.](https://github.com/servo/servo/wiki/Canvas-rendering-project)

I moved most of the functionality from CanvasPaintThread to CanvasData, so CanvasPaintThread essentially just pulls the info out of the message and calls a method on a particular CanvasData element.

I ran into some awkwardness with the fact that one can only take a single mutable reference from a hashmap, though. DrawImageInOther is not really possible to do with only one reference at a time, so it awkwardly still lives in CanvasPaintThread, basically. I also would've preferred to take the reference at the top as soon as I get the CanvasId, since that looks cleaner than having them all start with "canvas_paint_thread.canvases.get_mut[&canvas_id].unwrap()" but that makes trying to take the second reference for DrawImageInOther fail to compile. I'm definitely open to suggestions on how to make that less gross.

The timed single-canvas drawing improved in performance from around ~2.2ms to around ~1.7ms. Slither.io runs better and doesn't crash, but I'm not having it crash on my copy from before these changes, so I don't know if that's new behavior or not.

---
<!-- 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 build-geckolib` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #13879 and #10381.

<!-- Either: -->
- [X] There are tests for these changes (added in the initial steps)

<!-- 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/20680)
<!-- Reviewable:end -->
2018-04-24 01:14:20 -04:00
Brody-Eastwood
f3065f3707 Moved Canvas rendering to a single thread. 2018-04-23 20:50:05 -04:00
Fabrice Desré
42886613d3 Notify the embedder when it should display or hide an IME 2018-04-21 19:46:42 -07:00
Simon Martin
f32ffeb553 Issue #20623: Check the input to WebGLRenderingContext's clear(). 2018-04-21 11:32:11 +02:00
bors-servo
1d8fd8f863
Auto merge of #20661 - cbrewster:history_state_discard, r=asajeffrey
Remove insaccessible history states

<!-- 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 build-geckolib` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] 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/20661)
<!-- Reviewable:end -->
2018-04-19 17:39:44 -04:00
Andrew Shu
68c4791c7d History: update document URL on pushState/replaceState
https://html.spec.whatwg.org/multipage/#dom-history-pushstate
Steps 6, 7, 10
2018-04-18 17:18:48 -07:00
bors-servo
3695fc4efc
Auto merge of #20662 - mbrubeck:smallbitvec, r=nox
Update to smallbitvec 2.1

---
- [x] `./mach build -d` does not report any errors
- [x] `./mach build-geckolib` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes do not require tests because covered by existing 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/20662)
<!-- Reviewable:end -->
2018-04-18 03:04:10 -04:00
bors-servo
b182d7c2ea
Auto merge of #20648 - mattnenterprise:aliased-line-width-range, r=nox
Implement gl.getParameter(gl.ALIASED_LINE_WIDTH_RANGE)

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

Implement gl.getParameter(gl.ALIASED_LINE_WIDTH_RANGE)

---
<!-- 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 build-geckolib` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #20535

<!-- 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/20648)
<!-- Reviewable:end -->
2018-04-18 02:05:35 -04:00
Matt McCoy
36c0e387dd Implement gl.getParameter(gl.ALIASED_LINE_WIDTH_RANGE) 2018-04-17 20:44:35 -04:00
Matt Brubeck
e3f79d9130 Update to smallbitvec 2.1 2018-04-17 17:24:54 -07:00
Connor Brewster
c08ad45681 Remove insaccessible history states 2018-04-17 19:21:51 -05:00
Emilio Cobos Álvarez
827b82dc39
style: Fix build bustage after afe484e46b. 2018-04-17 20:02:58 +02:00
bors-servo
441f1cd231
Auto merge of #20646 - servo:webgl, r=emilio
Some drive-by error condition fix for gl.drawElements

<!-- 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/20646)
<!-- Reviewable:end -->
2018-04-16 12:43:33 -04:00
Connor Brewster
17bd80a7b1 Implement history state 2018-04-16 10:21:15 -05:00
Anthony Ramine
d16a73001f Check the bound buffer element array only for count > 0 in gl.drawElements
See https://www.khronos.org/registry/webgl/specs/latest/1.0/#6.2
2018-04-16 16:23:13 +02:00
Anthony Ramine
7f1590dac0 Check mode first in gl.drawElements 2018-04-16 16:23:07 +02:00
Connor Brewster
5f85824ab3 Replace initial about:blank loads 2018-04-11 09:51:22 -05:00
Alan Jeffrey
cef3f0e039 Use the incumbent global as the source of x-origin postMessage 2018-04-10 12:25:26 -05:00
bors-servo
ce72e52656
Auto merge of #20598 - servo:webgl, r=Manishearth
Four nondescript WebGL improvements

<!-- 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/20598)
<!-- Reviewable:end -->
2018-04-10 04:28:40 -04:00
Simon Sapin
3d6614e314 Upgrade to rustc 1.27.0-nightly (056f589fb 2018-04-07) 2018-04-09 21:43:25 +02:00
Anthony Ramine
f837354cb7 Do not emit a WebGL error for "gl_" prefixed names in gl.getAttribLocation 2018-04-09 15:52:56 +02:00
Anthony Ramine
561c41097f Fix filtering of reserved WebGL names in gl.getAttribLocation 2018-04-09 14:44:02 +02:00
Anthony Ramine
fcb6d5112e Properly check for cubic dimensions in gl.copyTexImage2D 2018-04-09 14:44:02 +02:00
Anthony Ramine
68898f4ebd Fix the error emitted for invalid targets in WebGLTexture::bind
It doesn't actually matter because this is only called from
WebGLRenderingContext::BindTexture, which already checks the target,
but better be safe than sorry.
2018-04-09 11:46:12 +02:00