Commit graph

11623 commits

Author SHA1 Message Date
Emilio Cobos Álvarez
7788f43c7e
style: Remove unneeded allow's.
They're useless right now.
2017-01-07 12:34:30 +01:00
bors-servo
85d3bbd999 Auto merge of #14840 - servo:entry-global, r=nox
Implement the entry global.

Partial fix for #10963.

<!-- 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/14840)
<!-- Reviewable:end -->
2017-01-06 05:15:11 -08:00
Ms2ger
cb47a7e403 Implement the entry global.
Partial fix for #10963.
2017-01-06 12:56:35 +01:00
bors-servo
7f9fd0ec1f Auto merge of #14860 - asajeffrey:constellation-index-past-correctly-when-discarding, r=cbrewster
Index the session past correctly when discarding.

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

Oops, indexed from the wrong end when discarding documents in #14312.

---
<!-- 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 we're not testing document discarding

<!-- 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/14860)
<!-- Reviewable:end -->
2017-01-06 03:53:35 -08:00
Xidorn Quan
e7e3889422 Add :-moz-browser-frame pseudo-class 2017-01-06 21:26:12 +11:00
Xidorn Quan
0399f359c1 Add NonTSPseudoClass::is_internal function 2017-01-06 21:26:06 +11:00
Xidorn Quan
fa27ac0544 Add function to convert NonTSPseudoClass to CSSPseudoClassType 2017-01-06 21:25:45 +11:00
bors-servo
83428ecef7 Auto merge of #14872 - upsuper:bug1328806, r=bholley
stylo: Map more Gecko state bits to Servo state bits

This is the servo part of [bug 1328806](https://bugzilla.mozilla.org/show_bug.cgi?id=1328806) which has been reviewed by @bholley on Bugzilla.

r? @bholley

<!-- 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/14872)
<!-- Reviewable:end -->
2017-01-06 00:09:32 -08:00
bors-servo
94d62a2afb Auto merge of #14871 - shssoichiro:14862-tinyfiledialogs-from-crates-io, r=jdm
Use tinyfiledialogs from crates.io

Use the crates.io version of tinyfiledialogs instead of pulling directly from the git repository.

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

<!-- Either: -->
- [X] These changes do not require tests because no code was changed

<!-- 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/14871)
<!-- Reviewable:end -->
2017-01-05 22:49:19 -08:00
bors-servo
8b274f25d3 Auto merge of #14559 - asajeffrey:script-track-document-and-bc-discarding, r=cbrewster
Implement browsing context discarding

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

Implement browsing context discarding (https://html.spec.whatwg.org/multipage/browsers.html#discard-a-document).

* When a pipeline is closed, inform the script thread whether the browsing context is to be discarded.
* In script threads, synchronously discard any similar-origin documents and browsing contexts.
* When a browsing context is discarded, it loses the reference to the active document, but the window keeps it, so we need to move the `Document` pointer from `BrowsingContext` to `Window`.
* Fix the webIDL for Window to make parent and top optional (the spec says they can return null when the browsing context is discarded).

---
<!-- 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 #14411
- [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/14559)
<!-- Reviewable:end -->
2017-01-05 18:20:12 -08:00
Xidorn Quan
0c913d5918 Make Gecko_ElementState return u16 2017-01-06 10:05:10 +11:00
Xidorn Quan
381651fd10 Change order of element state bits 2017-01-06 10:04:49 +11:00
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
Josh Holmer
f2e748588c Use tinyfiledialogs from crates.io 2017-01-05 16:59:44 -05:00
Alan Jeffrey
7c2de62124 Implement browsing context discarding. 2017-01-05 21:12:57 +00:00
Alan Jeffrey
5fd284cf3a Index the session past correctly when discarding. 2017-01-05 20:36:21 +00:00
Alan Jeffrey
3e1a242c7e Increased default max-session-history to 20. 2017-01-05 20:36:20 +00:00
bors-servo
42e28bf7e5 Auto merge of #14863 - charlesvdv:prefs, r=jdm
Allow cli prefs to have numerical value

I'm not sure as I'm new with servo but shouldn't the new function ```parse_opt_prefs``` be in ```prefs.rs``` instead of ```opts.rs``` ?

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

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

<!-- 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/14863)
<!-- Reviewable:end -->
2017-01-05 12:09:01 -08:00
charlesvdv
6a22174eb7 Allow cli prefs to have numerical value
Fix for #14842.

Extract the code inside a function to unit-test it.
2017-01-05 19:32:14 +01: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
65497b493a Auto merge of #14857 - upsuper:moz-top-layer, r=emilio
Add support for -moz-top-layer

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

---
<!-- 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: -->
- [ ] 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/14857)
<!-- Reviewable:end -->
2017-01-05 04:45:40 -08:00
bors-servo
1d9bbfa07b Auto merge of #14851 - hiikezoe:float-iteration-count-rebased, r=emilio
animation-iteration-count property is a number instead of integer.

<!-- Please describe your changes on the following line: -->
This is a revised PR  for #14732.
@emilio?
---
<!-- 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] 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/14851)
<!-- Reviewable:end -->
2017-01-05 03:44:20 -08:00
Xidorn Quan
aa33dfff05 Add support for -moz-top-layer 2017-01-05 22:03:25 +11: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
bors-servo
143dfc879e Auto merge of #14848 - bzbarsky:initial-styles, r=bholley
Stop using global initial styles for stylo; the initial styles need to be per-document

<!-- 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 https://bugzilla.mozilla.org/show_bug.cgi?id=1298588

<!-- Either: -->
- [ ] There are tests for these changes OR
- [X] These changes do not require tests on the servo side because behavior is unchanged.  Gecko-side tests probably exist.

<!-- 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/14848)
<!-- Reviewable:end -->
2017-01-04 21:01:38 -08:00
Boris Zbarsky
dd80b5c0e7 Bug 1298588 part 15, servo piece. Rip out the initial() methods on style structs in stylo. r=bholley 2017-01-04 23:13:55 -05:00
Boris Zbarsky
8e2acee24e Bug 1298588 part 14. Remove ComputedValues::initial_values for stylo. r=bholley 2017-01-04 23:13:53 -05:00
Boris Zbarsky
369fdddcd9 Bug 1298588 part 13. Make sure Device has a ComputedValues for stylo. r=bholley 2017-01-04 23:13:52 -05:00
Boris Zbarsky
62961370ec Bug 1298588 part 12. Compile some bits that call ComputedValues::initial_values only for servo, not stylo. r=bholley
Stylist::set_device seems to only be used in servo code, and is the only consumer of ViewportConstraints::maybe_new.
2017-01-04 23:13:50 -05:00
Boris Zbarsky
8367c96c1b Bug 1298588 part 11. Pass through useful default styles to CascadePropertyFn. r=bholley 2017-01-04 23:13:49 -05:00
Boris Zbarsky
c826b18f87 Bug 1298588 part 10, servo piece. Pass through useful default styles to apply_declarations(). r=bholley 2017-01-04 23:13:48 -05:00
Boris Zbarsky
61f6025dc3 Bug 1298588 part 9, servo piece. Pass through useful default styles to cascade(). r=bholley 2017-01-04 23:13:46 -05:00
Boris Zbarsky
09c74190b9 Bug 1298588 part 8. Pass a SharedStyleContext, not a Stylist, to Legalizer methods. r=bholley 2017-01-04 23:13:45 -05:00
Boris Zbarsky
d3e34db508 Bug 1298588 part 7, servo piece. Stop using initial_values in general in Gecko glue code. r=bholley 2017-01-04 23:13:43 -05:00
Boris Zbarsky
c313c8d17e Bug 1298588 part 6, servo piece. Stop using initial_values when doing inheritance in Gecko glue code. r=bholley 2017-01-04 23:13:42 -05:00
Boris Zbarsky
56941d61a7 Bug 1298588 part 5. Store a ComputedValues on SharedStyleContext. r=bholley 2017-01-04 23:13:40 -05:00
Boris Zbarsky
a5ac55c8ff Bug 1298588 part 4, servo piece. Recreate the default computed values for a document as needed. r=bholley 2017-01-04 23:13:39 -05:00
Boris Zbarsky
34bb2f1e6c Bug 1298588 part 3, servo piece. Add a default ComputedValues member to PerDocumentStyleData. r=bholley 2017-01-04 23:13:31 -05: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
Hiroyuki Ikezoe
f78cd2caf1 animation-iteration-count property is a number instead of integer. 2017-01-05 09:50:10 +09: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
Boris Zbarsky
8908743719 Bug 1298588 part 2, servo piece. Pass through an nsPresContext to the PerDocumentStyleData constructor. r=bholley 2017-01-04 14:42:15 -05: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