Commit graph

5644 commits

Author SHA1 Message Date
bors-servo
c3cf4386b0 Auto merge of #14864 - servo:timers, r=jdm
Remove some unsound JSVal handling in JsTimerTask::invoke.

We were using Handles to *copies* of the traced values, rather than the
originals.

<!-- 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/14864)
<!-- Reviewable:end -->
2017-01-05 14:00:50 -08:00
Ms2ger
e2c141179b Remove some unsound JSVal handling in JsTimerTask::invoke.
We were using Handles to *copies* of the traced values, rather than the
originals.
2017-01-05 17:49:01 +01:00
bors-servo
839b7fe8ef Auto merge of #14859 - servo:CallSetup, r=nox
Simplify CallSetup.

<!-- 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/14859)
<!-- Reviewable:end -->
2017-01-05 07:33:46 -08:00
bors-servo
36ddf763f6 Auto merge of #14351 - asajeffrey:servo-rand-share-fds, r=emilio
An in-memory RNG that shares its file descriptor.

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

This PR implements an in-memory random number generator that only uses an OS RNG for (re)seeding. The OS RNG is shared, so there's only one file descriptor for `/dev/urandom` being used.

The PR also implements a tidy check that we don't accidentally introduce an RNG. Rather annoyingly, there are a lot of transitive dependencies on `rand`, notably hash maps in `std`.

This PR makes it possible to use uuids for identifiers such as pipeline and frame ids.

---
<!-- 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 do not require tests because it's fixing a resource issue

<!-- 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/14351)
<!-- Reviewable:end -->
2017-01-05 06:32:23 -08:00
Alan Jeffrey
7ace30f9bd An in-memory RNG that shares its file descriptor. 2017-01-05 13:51:53 +00:00
Ms2ger
8d633fec42 Simplify CallSetup. 2017-01-05 13:55:10 +01:00
bors-servo
4216c16879 Auto merge of #14847 - anholt:webgl-bufferdata, r=emilio
webgl: implement bufferData

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

Adds support for the other overload of bufferData, fixing many conformance tests.  In the process I had to fix the webidl codegen in the overload-distinguished-by-an-object case.  Also includes a little fix for glEnable() validation.

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

<!-- 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/14847)
<!-- Reviewable:end -->
2017-01-05 02:11:29 -08:00
Eric Anholt
4c656f1f61 webgl: Add missing overload of bufferData().
I was writing this to fix the error in gl-enum-tests.html test (it now
gets farther along before it fails due to us missing
getTexParameter()), but it turned out that a lot of the conformance
tests were failing due to it.
2017-01-04 18:02:32 -08:00
Eric Anholt
af380c2717 Fix JS_ObjectIsDate() call in webidl codegen.
We were missing the import, and the prototype of the function has
since changed.  Partial fix for #10675
2017-01-04 18:02:30 -08:00
bors-servo
16b0da5004 Auto merge of #14312 - asajeffrey:script-discard-documents, r=cbrewster
Implement discarding Document objects to reclaim space.

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

This PR implements document discarding. Active documents are kept alive strongly, but inactive documents are only kept alive weakly. When a document is GCd, it is marked as discarded, and if it is every reactivated, a reload of the URL is triggered.

Note that this PR is pretty aggressive about discarding, and can any inactive document (other than those being kept alive by other same-origin pipelines). We might want to damp it down a bit.

Also note that this interacts with browser.html in that the reloading triggered by reactivating a document triggers mozbrowser events.

To test this, I added a `-Zdiscard-inactive-documents` debug flag, which discards all inactive documents, even ones which are reachable through other same-origin pipelines.

---
<!-- 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 #14262.
- [X] These changes do not require tests because we should be able to use the existing tests with `-Zdiscard-inactive-documents`.

<!-- 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/14312)
<!-- Reviewable:end -->
2017-01-04 13:58:57 -08:00
bors-servo
2fe914e2fa Auto merge of #14845 - jdm:restyle-ood, r=emilio
Avoid restyling elements that aren't in a document

- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #14480
- [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/14845)
<!-- Reviewable:end -->
2017-01-04 12:19:00 -08:00
bors-servo
6f9ff7b8bf Auto merge of #14738 - Wafflespeanut:keypress, r=jdm
Properly dispatch keypress event

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

This was an attempt to fix #14659. It turned out that the problem wasn't what I thought it was. So, I didn't fix that. On the brighter side, this fixes two related issues.

- Previously, we were unable to launch `keypress` events from `input` and `textarea` elements, because [we'd been cancelling](1327ebd52f/components/script/dom/htmlinputelement.rs (L1120-L1124)) the key events, so that they don't trigger window navigation - #8400). I've introduced an enum to represent an additional state to an event's cancellation.
- [According to the spec](https://w3c.github.io/uievents/#keypress-event-order), `keypress` (if available) should be dispatched immediately after `keydown`, and it should be followed by `input`. Canceling `keypress` should also cancel `input`. But, we'd been dispatching `input` before `keypress`. We now dispatch `input` once the `keypress` event is on the respective elements.

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

<!-- Either: -->
- [x] These changes do not require tests because it's a refactor?

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

r? @jdm or anyone interested

<!-- 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/14738)
<!-- Reviewable:end -->
2017-01-04 10:52:06 -08:00
Eric Anholt
d90499ab35 Fix is_null_or_undefined() call in codegen to be snake_case.
After a bit of digging, I couldn't find when it was camelCase.  This
started getting generated when I added an overload in webgl.
2017-01-04 09:57:39 -08:00
Eric Anholt
c6f73a612a webgl: Allow enable/disable of STENCIL_TEST 2017-01-04 09:57:38 -08:00
Josh Matthews
9a264c8173 Only pass nodes to layout for restyling that are actually in the document. 2017-01-04 12:42:12 -05:00
Alan Jeffrey
ef50a64598 Updated comment. 2017-01-04 15:22:46 +00:00
Josh Matthews
318a047ee5 Interact with the originating document for stylesheet loads, rather than the element's current document. 2017-01-04 09:55:45 -05:00
Alan Jeffrey
67bf23016e Added warnings for idempotent freeze/thaw. 2017-01-04 13:56:14 +00:00
Alan Jeffrey
78c87ea8d7 Implement discarding Document objects to reclaim space. 2017-01-04 11:29:31 +00:00
Bobby Holley
b9d99390ad Switch to crates.io for atomic_refcell. 2017-01-03 18:14:27 -08:00
Anthony Ramine
3f91ce1d07 Don't generate constructor IDs for inline interfaces 2017-01-03 14:12:19 +01:00
bors-servo
d967d89fc0 Auto merge of #14796 - jlevesy:jl-match-to-if-let, r=Wafflespeanut
replace match by if let statements if possible

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

This PR replaces `match` statements by `if let` when possible.

Thanks for reviewing

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

<!-- Either: -->
- [ ] There are tests for these changes OR
- [X] These changes do not require tests because this PR is a code cleanup patch.

<!-- 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/14796)
<!-- Reviewable:end -->
2016-12-31 21:28:41 -08:00
Eric Anholt
daa64bf84f webgl: Validate enums for blendEquation.
Improves a conformance test that tried passing in desktop GL enums for
blending.
2016-12-31 11:37:38 -08:00
Julien Levesy
b78979d692 replace match by if let statements if possible 2016-12-31 12:34:05 +01:00
Cameron McCormack
be1a73dac5 Don't persist styles on elements not in the document. 2016-12-30 10:58:31 +08:00
bors-servo
885d152e92 Auto merge of #14647 - servo:current-global, r=jdm
Support the 'current' global object.

<!-- 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/14647)
<!-- Reviewable:end -->
2016-12-29 01:38:19 -08:00
bors-servo
c6ea1ec91f Auto merge of #14762 - prampey:error-handle, r=jdm
Error handled canvas closing

<!-- Please describe your changes on the following line: -->
Correctly handled error when Canvas doesn't close properly, with a descriptive warning.

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

<!-- Either: -->
- [ ] There are tests for these changes OR
- [X] These changes do not require tests because minor changes don't require tests.

<!-- 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/14762)
<!-- Reviewable:end -->
2016-12-28 13:49:02 -08:00
bors-servo
149facbb3c Auto merge of #14760 - mrnayak:update-links, r=jdm
Update links to DOM Parsing specification

Changed links from https://domparsing.spec.whatwg.org/ to
https://w3c.github.io/DOM-Parsing/.

<!-- 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 fix #14758

<!-- Either: -->
- [X] These changes do not require tests because these are link update

<!-- 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/14760)
<!-- Reviewable:end -->
2016-12-28 12:05:23 -08:00
Prudhvi Rampey
e3d8131698 Error handled canvas closing 2016-12-28 23:14:46 +05:30
bors-servo
0f600db3ae Auto merge of #14718 - dpyro:websocket-typed-arrays, r=jdm
Rewrote websocket array buffer handling to typed array API

<!-- Please describe your changes on the following line: -➜
Replaced existing code for handling `BinaryType::Arraybuffer` from `JS_NewArrayBuffer` to `Uint8Array::create`.

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

<!-- Either: -->
- [X] These changes do not require tests because they replace an existing implementation

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

I am not certain the test suite will adequately verify my implementation as I am not familiar with the architecture. It compiles and passes the current 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/14718)
<!-- Reviewable:end -->
2016-12-28 09:43:51 -08:00
Raghav
eb401ee2ca Update links to DOM Parsing specification
Changed links from https://domparsing.spec.whatwg.org/ to
https://w3c.github.io/DOM-Parsing/.
2016-12-28 21:45:53 +05:30
Roman Zaynetdinov
40fa021fc1 Use typed array API in TextDecoder::Decode 2016-12-27 16:13:11 +02:00
Ravi Shankar
5f0b3bd53c Fire 'input' event after 'keypress' in input and textarea elements 2016-12-27 15:57:34 +05:30
Ravi Shankar
08662cc64e Allow 'keypress' event to emerge from input and textarea elements 2016-12-27 15:57:23 +05:30
Ravi Shankar
b10bfeaeb6 Change event cancellation from bool to an enum 2016-12-27 12:42:19 +05:30
Sumant Manne
4623b5f76b Rewrote websocket array buffer handling to typed array API 2016-12-26 13:22:41 -06:00
bors-servo
9d320d5a34 Auto merge of #14518 - mbrubeck:rowspan2, r=notriddle
Fix inline layout of table cells impacted by rowspan

This is part of the fix for #11297. This PR fixes the inline layout of table cells impacted by row-spanning cells from previous rows. A separate PR to follow will fix the table block size calculations to account for rowspan.

This PR doesn't yet include any test changes. If it doesn't cause any existing tests to pass, I will add a new test to it.

r? @pcwalton

<!-- 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/14518)
<!-- Reviewable:end -->
2016-12-26 10:09:09 -08:00
bors-servo
1c60a5bef8 Auto merge of #14730 - deror1869107:typed_array_API, r=emilio
Rewrite Crypto::GetRandomValues to use typed array API

<!-- Please describe your changes on the following line: -->
Rewrite Crypto::GetRandomValues to use typed array API

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

<!-- Either: -->
- [X] There are tests for these changes

<!-- 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/14730)
<!-- Reviewable:end -->
2016-12-25 23:37:15 -08:00
deror1869107
684db8bd29 Rewrite Crypto::GetRandomValues to use typed array API
Fix mut typed_array

Redundant code
2016-12-26 11:15:42 +08:00
Emilio Cobos Álvarez
cc262c641f
script: Simplify EventDispatcher's default action. 2016-12-25 19:18:34 +01:00
Emilio Cobos Álvarez
eaf69c29ec
script: Simplify ScriptMemoryFailsafe::drop. 2016-12-25 19:18:29 +01:00
Emilio Cobos Álvarez
2bbde04ccd
script: Simplify Node::collect_text_contents. 2016-12-25 19:18:28 +01:00
Emilio Cobos Álvarez
157ce33105
script: Simplify propagation of disabled state for form controls.
That's a silly exponential algorithm btw.
2016-12-25 19:18:27 +01:00
Emilio Cobos Álvarez
d1b175d145
script: Simplify DOMImplementation::CreateHTMLDocument. 2016-12-25 19:18:26 +01:00
Emilio Cobos Álvarez
755697d6bb
script: Use more idiomatic code for resize handling.
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
2016-12-25 19:18:24 +01:00
Ms2ger
d49e34c1b1 Implement correct security checks for HTMLIFrameElement::contentDocument.
Fixes #10964.
2016-12-23 11:15:47 +01:00
Ms2ger
ec5d08c887 Pass the Document's origin to its constructor.
CC #10963.
2016-12-23 11:15:46 +01:00
Ms2ger
01e336f691 Implement a getter for the 'current' global object. 2016-12-23 11:15:44 +01:00
bors-servo
f0a74ee0d2 Auto merge of #14679 - jdm:nowarntimer, r=asajeffrey
Warn when a timer event is processed for a discarded document.

Turn a panic into a warning for a situation that is easy to hit in web content.

- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #14677
- [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/14679)
<!-- Reviewable:end -->
2016-12-22 18:19:48 -08:00
bors-servo
89cdcbc420 Auto merge of #14632 - servo:multi-global-fetch, r=jdm
Use the API base URL in Fetch APIs.

<!-- 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/14632)
<!-- Reviewable:end -->
2016-12-22 16:40:53 -08:00