Commit graph

19254 commits

Author SHA1 Message Date
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
Anthony Ramine
6156d9aacb Update Webrender to last version 2018-04-26 16:50:24 +02:00
Pyfisch
aada975dea Place item clipping_and_scrolling inside closure
A utility function assures that if the clipping and scrolling are changed
for a display item the old value is later restored.
2018-04-25 13:19:46 +02:00
bors-servo
6d42d2f1e8
Auto merge of #20690 - servo:wrup, r=glennw
Update Webrender

Fixes #20609

<!-- 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/20690)
<!-- Reviewable:end -->
2018-04-25 05:10:51 -04:00
Bastien Orivel
8bd2e91cdc Update Webrender
Fixes #20609
2018-04-25 10:25:21 +02: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
Pyfisch
c0be925bed Move DL items from gfx to layout
Implement corner clipping.
Remove PixelFormat from WebrenderImageInfo.
Use WebRender text shadow.
Remove MallocSizeOf and Deserialize for DL items.

Closes #19649, #19680, #19802
2018-04-22 13:13:45 +02: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
05fe8fa08d
Auto merge of #20666 - servo:url, r=nox
Fix building servo_url by itself

Fix #20664

<!-- 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/20666)
<!-- Reviewable:end -->
2018-04-19 18:42:53 -04: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
bors-servo
89bf7c2a92
Auto merge of #20658 - kvark:deglify, r=emilio
Make gleam optional for compositor, switch various names from glutin to winit

<!-- Please describe your changes on the following line: -->
The PR goes an extra step towards discriminating GL to a level of an optional dependency. This would ease up the transition to gfx-hal when the time calls for it, and upstreams some of the patches we've been using locally, cleans up some of the old cruft along the way.

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

<!-- Either: -->
- [ ] There are tests for these changes OR
- [ ] These changes do not require tests because _____ it's just refactoring

<!-- 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/20658)
<!-- Reviewable:end -->
2018-04-19 16:18:14 -04:00
bors-servo
319de3b0fe
Auto merge of #20578 - kwonoj:refactor-bluetooth-manager, r=paulrouget
refactor(bluetooth): removes direct ui invocation from bluetooth thread

<!-- Please describe your changes on the following line: -->
Relates to #20429.

This PR is mostly blocked by https://github.com/servo/servo/pull/20480, cause both are nearly identical change in crux and based on review of prior changes this PR need to be updated. Just didn't want assigned issue hanging without visible progresses, so prepped PR to followup further.

(mostly copy-paste from pair PR)

Probably point of review / need to be updated are

1. Communication between components
Currently it's wired as like below:
```
+----------------+                    +---------------+              +---------+
|                |  constellationMsg  |               | embedderMsg  |         |
| bluetooth_thread +----------------->+ constellation +------------->+ browser |
|                |                    |               |              |         |
+-----+----------+                    +---------------+              +----+----+
      ^                                                                   |
      +-------------------------------------------------------------------+
                                device: String
```
- is this feasible approach?
- does organization of message / fn (where to put consteallation / embedder msg & fns) are legit?

2. Invoking tfd in a separate thread
- This was mainly to align behavior to previous implentation, where tfd was invoked inside of filemanager_thread so does not block main. It may possibly just let block instead.

and of course, a lot of other codes need to follow better practices.

---
<!-- 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 #20429 (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/20578)
<!-- Reviewable:end -->
2018-04-19 15:11:20 -04:00
Simon Sapin
e7e52d855b Fix building servo_url by itself
Fix #20664
2018-04-19 17:01:14 +02:00
Dzmitry Malyshau
7fa295d8e6 Make gleam optional for compositor, switch various names from glutin to winit 2018-04-18 22:40:47 -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
OJ Kwon
61b4a891bb
refactor(bluetooth): uses embedderproxy directly 2018-04-18 11:39:33 -07:00
OJ Kwon
5574b42126
feat(constellation): add handler for scriptmsg 2018-04-18 11:39:33 -07:00
OJ Kwon
6fa74133dd
refactor(bluetooth): send message to open select dialog 2018-04-18 11:39:33 -07:00
OJ Kwon
410cf63a8e
refactor(bluetooth): factory fn returns constellation channel 2018-04-18 11:39:32 -07:00
OJ Kwon
c2161da3ca
feat(browser): implement device select dialog 2018-04-18 11:39:32 -07:00
OJ Kwon
a352dcc145
refactor(constellation): add handler for new scriptmsg 2018-04-18 11:39:32 -07:00
OJ Kwon
c141090d61
feat(constellation): expose msg for bluetooth thread 2018-04-18 11:39:31 -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
bors-servo
087bd20b6d
Auto merge of #20657 - emilio:gecko-sync, r=emilio
style: Sync changes from mozilla-central.

See each individual commit from details.
2018-04-17 14:06:08 -04:00
Emilio Cobos Álvarez
a82ed50257
style: Fix build after 1bc30a6732. 2018-04-17 20:03:55 +02:00
Emilio Cobos Álvarez
827b82dc39
style: Fix build bustage after afe484e46b. 2018-04-17 20:02:58 +02:00
Emilio Cobos Álvarez
f5c85a816a
style: Remove an unused import. 2018-04-17 20:02:33 +02:00
Emilio Cobos Álvarez
376aafc2c8
style: Update bindings. 2018-04-17 20:02:33 +02:00
Xidorn Quan
b11c3f1f45
style: Remove trailing underscore of float ident.
Bug: 1454528
Reviewed-by: heycam
MozReview-Commit-ID: DN7rQu3adSB
2018-04-17 20:02:16 +02:00
Emilio Cobos Álvarez
1bc30a6732
style: Move unboxing to style, and handle display: contents before other suppressions.
This also adopts the resolution of [1] while at it, and switches XUL to not
support display: contents until a use case appears.

This makes our behavior consistent both with the spec and also in terms of
handling dynamic changes to stuff that would otherwise get suppressed.

Also makes us consistent with both Blink and WebKit in terms of computed style.
We were the only ones respecting "behaves as display: none" without actually
computing to display: none. Will file a spec issue to get that changed.

It also makes us match Blink and WebKit in terms of respecting display: contents
before other suppressions, see the reftest which I didn't write as a WPT
(because there's no spec supporting neither that or the opposite of what we do),
where a <g> element respects display: contents even though if it had any other
kind of display value we'd suppress the frame for it and all the descendants
since it's an SVG element in a non-SVG subtree.

Also, this removes the page-break bit from the display: contents loop, which I
think is harmless.

As long as the tests under style are based in namespace id / node name /
traversal parent, this should not make style sharing go wrong in any way, since
that's the first style sharing check we do at [2].

The general idea under this change is making all nodes with computed style of
display: contents actually honor it. Otherwise there's no way of making the
setup sound except re-introducing something similar to all the state tracking
removed in bug 1303605.

[1]: https://github.com/w3c/csswg-drafts/issues/2167
[2]: https://searchfox.org/mozilla-central/rev/fca4426325624fecbd493c31389721513fc49fef/servo/components/style/sharing/mod.rs#700

Bug: 1453702
Reviewed-by: mats, xidorn
MozReview-Commit-ID: JoCKnGYEleD
2018-04-17 20:01:46 +02:00
Bobby Holley
afe484e46b
style: Allow placeholder import sheets.
This is necessary because we can't create GeckoStyleSheets off-main-thread,
so we need a placeholder until it can be filled in.

Bug: 1454030
Reviewed-by: emilio
MozReview-Commit-ID: ssRme4fLYg
2018-04-17 20:01:27 +02:00
Jonathan Watt
ccbd84886b
Fix error name in comment for try_match_ident_ignore_ascii_case 2018-04-17 13:24:30 +01:00
Xidorn Quan
7403ec8b70
style: Support prefs for aliases.
Bug: 1453521
Reviewed-by: heycam
MozReview-Commit-ID: 8DAFmLDVYlR
2018-04-16 20:15:13 +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
bors-servo
11733d3d8a
Auto merge of #20638 - cbrewster:history_state, r=asajeffrey
Implement History State

<!-- Please describe your changes on the following line: -->
This just handles history states in the session history. URL handling and hashchange events still nee to be implemented.

---
<!-- 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 #19156 (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/20638)
<!-- Reviewable:end -->
2018-04-16 11:21:41 -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
Simon Sapin
7dbc524207 Fork the jemallocator crate, fix for nightly-2018-04-15
CC https://github.com/alexcrichton/jemallocator/pull/40,
https://github.com/rust-lang/rust/pull/49669

The new version of jemallocator requires a more recent jemalloc
https://github.com/alexcrichton/jemallocator/pull/34
which doesn’t build on our current Android toolchain
https://github.com/jemalloc/jemalloc/issues/1175.

To avoid blocking on figuring that out, duplicate ~70 lines
from jemallocator and use the older jemalloc-sys directly.
2018-04-16 08:56:08 +02:00
Emilio Cobos Álvarez
0d15ab17d3
style: Update binidngs. 2018-04-14 21:15:44 +02:00