Commit graph

101 commits

Author SHA1 Message Date
bors-servo
1c6963144d Auto merge of #14386 - mrobinson:display-list-builder-updates, r=glennw
Use new DisplayListBuilder improvements in Servo

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

<!-- Either: -->
- [ ] There are tests for these changes OR
- [x] These changes do not require tests because they should not change behavior.

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

In particular, we no longer to have a WebRenderFrameBuilder. All of the
complication is now handled by the DisplayListBuilder itself.

<!-- 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/14386)
<!-- Reviewable:end -->
2016-11-29 02:36:05 -08:00
Martin Robinson
3c1c03648b Use new DisplayListBuilder improvements in Servo
In particular, we no longer to have a WebRenderFrameBuilder. All of the
complication is now handled by the DisplayListBuilder itself.
2016-11-28 13:15:39 +01:00
Emilio Cobos Álvarez
de1a3d879f
style: Enable the bloom filter recovering. 2016-11-27 15:55:10 +01:00
Bobby Holley
992f7dddf4 Bug 1317016 - Basic infrastructure for RestyleHint-driven traversal.
MozReview-Commit-ID: 7wH5XcILVmX
2016-11-24 17:07:38 -08:00
bors-servo
30867001d1 Auto merge of #14232 - servo:moar-locks, r=upsuper
CSSOM: Make Stylesheet fields have their own synchronization

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

r? @upsuper

---
<!-- 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 bug 1314208.

<!-- 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/14232)
<!-- Reviewable:end -->
2016-11-21 19:33:57 -06:00
bors-servo
bbc821607a Auto merge of #14173 - asajeffrey:script-thread-stores-top-level-frame-id, r=paulrouget
Report panics using the top-level frame id rather than the pipeline id

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

At the moment, we report panics from script and layout using the root pipeline id. Once we are sharing more script threads, there won't be a root pipeline id any more. The plan is only to share script threads in the same tab, so there will be a top-level frame id that all the pipelines have in common. This PR reports panics using that top-level frame id.

This mostly makes a difference to the browser API: rather than targeting a `mozbrowsererror` event at the root iframe of the script thread that panicked, it targets it at the containing mozbrowser iframe.

---
<!-- 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 don't test crash reporting

<!-- 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/14173)
<!-- Reviewable:end -->
2016-11-21 15:51:59 -06:00
Simon Sapin
08066800cd Rename selector_matching.rs to stylist.rs 2016-11-20 15:29:09 +01:00
Simon Sapin
dca1772086 Remove unused dependency 2016-11-18 17:16:54 +01:00
Simon Sapin
cf7adcdca5 Make Stylesheet.dirty_on_viewport_size_change an AtomicBool 2016-11-18 17:13:30 +01:00
Simon Sapin
236c575c50 Replace Stylesheet::set_media with a constructor argument 2016-11-18 17:12:44 +01:00
Cameron McCormack
4e52bb49b9 GC the rule tree only when the free list gets to a certain size. 2016-11-18 17:12:33 +08:00
Alan Jeffrey
c228a4cf03 Report errors using the top-level frame id rather than the pipeline id. 2016-11-17 18:08:24 -06:00
bors-servo
22aebdf5d4 Auto merge of #14246 - emilio:servo-url, r=SimonSapin
Urlmageddon

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

Still needs a bunch of code in net to be converted in order to get more
advantage of this for images and stuff, but meanwhile this should help quite a
bit with #13778.

Still wanted to get this in.

r? @SimonSapin

<!-- 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/14246)
<!-- Reviewable:end -->
2016-11-17 15:34:47 -06:00
bors-servo
e4a27c4d16 Auto merge of #14214 - bholley:dirtiness_overhaul, r=emilio
Overhaul dirtiness handling in Servo to prepare for the new incremental restyle architecture

<!-- 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/14214)
<!-- Reviewable:end -->
2016-11-17 12:25:52 -06:00
Emilio Cobos Álvarez
913c874cb5
Urlmageddon: Use refcounted urls more often. 2016-11-17 18:34:23 +01:00
Bobby Holley
f1043f6305 Track all node damage with PendingRestyles. 2016-11-16 12:09:47 -08:00
Bobby Holley
0547a6b313 Expand the role of modified_elements to include explicit restyle hints and damage.
This will take the place of setting IS_DIRTY and HAS_CHANGED.
2016-11-15 10:51:14 -08:00
Martin Robinson
e164e87e98 Deal with changes to the WebRender API
The WebRender display list is now similar to the Servo display list,
which simplifies the conversion.
2016-11-15 08:44:13 +01:00
Bobby Holley
dda2928386 Remove TDocument from the style and layout crates.
The style system never actually does anything with the document. This allows us
to remove a bunch of stubbing on the Gecko side and streamline some things on
the Servo side in future patches.
2016-11-14 13:04:13 -08:00
Emilio Cobos Álvarez
73917cce83
style: Use rayon instead of our custom work queue. 2016-11-14 21:24:19 +01:00
bors-servo
ef5ca14283 Auto merge of #14084 - mrobinson:scroll_root_2, r=glennw
Don't promote all scrollable regions to stacking contexts

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

Don't promote all scrollable regions to stacking contexts

Instead annotate all flows with their owning ScrollRoots. When
processing the display list items into a flattened display list, we add
PushScrollRoot and PopScrollRoot to signal when scrolling regions start
and end. It is possible for content from different scrolling regions to
intersect and when they do, the stack of scrolling regions is
duplicated.  When these duplicated scrolling regions stacks reach
WebRender, it will scroll them in tandem.

The PushScrollRoot and PopScrollRoot items are currently represented as
StackingContexts in WebRender, but eventually these will be replaced
with special WebRender display items.

---
<!-- 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 #13529 and #13298. (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/14084)
<!-- Reviewable:end -->
2016-11-07 18:49:53 -06:00
Bobby Holley
a2c7a9d0fb Stop using associated types for the concrete TRestyleDamage implementation.
MozReview-Commit-ID: LfaZFCVlIb1
2016-11-07 11:10:48 -08:00
Martin Robinson
ef82d772c1 Don't promote all scrollable regions to stacking contexts
Instead annotate all flows with their owning ScrollRoots. When
processing the display list items into a flattened display list, we add
PushScrollRoot and PopScrollRoot to signal when scrolling regions start
and end. It is possible for content from different scrolling regions to
intersect and when they do, the stack of scrolling regions is
duplicated.  When these duplicated scrolling regions stacks reach
WebRender, it will scroll them in tandem.

The PushScrollRoot and PopScrollRoot items are currently represented as
StackingContexts in WebRender, but eventually these will be replaced
with special WebRender display items.

Fixes #13529.
Fixed #13298.
2016-11-05 18:36:45 +01:00
Emilio Cobos Álvarez
de4fe6e2b6 Concurrent rule tree, v1
This patch introduces infrastructure for the rule tree, and constructs it.

We don't use it yet, nor have good heuristics for GC'ing it, but this should not
happen anymore once we store the rule node reference in the node.

I haven't messed up with memory orders because I want to do a try run with it,
then mess with them.

Take down the ApplicableDeclarationsCache, use the rule tree for doing the cascade.
2016-11-05 17:29:52 +01:00
bors-servo
f7875dad1a Auto merge of #14060 - servo:gfx-azure, r=nox
Remove the direct azure dependencies from gfx, layout and layout_thread.

<!-- 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/14060)
<!-- Reviewable:end -->
2016-11-05 07:26:30 -05:00
bors-servo
2b4a7b0b7a Auto merge of #14053 - notriddle:flow_ref_unsafe, r=pcwalton
Make `FlowRef` a newtype

This creates a sharp distinction between `Arc<Flow>`s, which may be
owned by anyone, and `FlowRef`s, which may only be owned by the
traversal code. By checking the reference count, we ensure that a `Flow`
cannot be pointed to by `Arc`s and `FlowRef`s simultaneously.

This is not a complete fix for #6503, though it is a necessary start
(enforcing the no-aliasing rule of `FlowRef::deref_mut` will require far
more work).

---

- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #14014 (github issue number if applicable).
- [X] These changes do not require tests because the existing tests, plus the added assertions, should be sufficient

<!-- 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/14053)
<!-- Reviewable:end -->
2016-11-04 16:53:38 -05:00
Michael Howell
5f320bd2ca Make FlowRef a newtype
This creates a sharp distinction between `Arc<Flow>`s, which may be
owned by anyone, and `FlowRef`s, which may only be owned by the
traversal code. By checking the reference count, we ensure that a `Flow`
cannot be pointed to by `Arc`s and `FlowRef`s simultaneously.

This is not a complete fix for #6503, though it is a necessary start
(enforcing the no-aliasing rule of `FlowRef::deref_mut` will require far
more work).

Fixes #14014
2016-11-04 13:36:04 -07:00
Ms2ger
81ee81cbb0 Remove the direct azure dependencies from gfx, layout and layout_thread.
This does not cover transitive dependencies through canvas_traits, though that
should not be too hard to solve either.
2016-11-04 12:14:42 +01:00
bors-servo
7b80386047 Auto merge of #14048 - antrik:nosync-ipc_sender, r=mbrubeck
layout/context: Wrap `image_cache_thread` in a `Mutex<>` as well

`SharedLayoutContext.image_cache_thread` didn't get the `Mutex<>`
treatment along with all the other channels in there, because
`ipc-channel::Sender` is presently inherently `Sync`. I believe this to
be an implementation accident though, that should be rectified in the
future -- not something users should actually rely on...

Note that sharing senders (be it `mpsc` or `ipc-channel`) in is probably
not a good idea anyway: just cloning them -- and letting them handle the
sharing internally -- should be both simpler and cheaper. But right now
that's how things are handled here; so let's go with the flow...

<!-- 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/14048)
<!-- Reviewable:end -->
2016-11-03 21:37:17 -05:00
Olaf Buddenhagen
4d14f1eb67 layout/context: Wrap image_cache_thread in a Mutex<> as well
`SharedLayoutContext.image_cache_thread` didn't get the `Mutex<>`
treatment along with all the other channels in there, because
`ipc-channel::Sender` is presently inherently `Sync`. I believe this to
be an implementation accident though, that should be rectified in the
future -- not something users should actually rely on...

Note that sharing senders (be it `mpsc` or `ipc-channel`) in is probably
not a good idea anyway: just cloning them -- and letting them handle the
sharing internally -- should be both simpler and cheaper. But right now
that's how things are handled here; so let's go with the flow...
2016-11-03 16:24:20 +01:00
Anthony Ramine
c4f27e42b7 Remove #![feature(custom_derive)] 2016-11-03 10:14:21 +01:00
bors-servo
c6e15f8ef2 Auto merge of #14028 - servo:rustup, r=nox,SimonSapin
Update Rust to 1.14.0-nightly (7c69b0d5a 2016-11-01)

<!-- 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
- [ ] 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/14028)
<!-- Reviewable:end -->
2016-11-02 21:49:08 -05:00
Simon Sapin
5bb4c6c884 Use heapsize_derive instead of heapsize_plugin 2016-11-03 01:10:32 +01:00
Martin Robinson
cd1c881830 Fold some DisplayList methods into DisplayListBuildState
This makes the API used to build display lists quite a bit simpler and
reduces the amount of auxiliary data structures that need to be passed
around. It is also important preparation work for separating scrolling
areas from stacking contexts.
2016-11-02 11:18:17 +01:00
Xidorn Quan
09cbe3bce0 Make style context use parking_lot::RwLock 2016-11-02 10:10:11 +11:00
Bobby Holley
fb70ee2c0c Drop style data from descendants on display:none.
MozReview-Commit-ID: 8ls43oAGWRg
2016-11-01 11:03:04 -07:00
Ms2ger
a9e3fe75b5 Remove gfx_traits::color. 2016-10-31 18:15:25 +01:00
bors-servo
3a3f3192a8 Auto merge of #13957 - mrobinson:scroll_root, r=glennw
Track overflow:scroll stacking contexts with ScrollRootId instead of StackingContextId

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

<!-- Either: -->
- [ ] There are tests for these changes OR
- [x] These changes do not require tests because this PR should not change behavior.

<!-- 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/13957)
<!-- Reviewable:end -->
2016-10-30 15:27:56 -05:00
Martin Robinson
71d285af80 Use a new id type for tracking scrolling areas
This is a step in disassociating scrolling areas from stacking
contexts. Now scroll areas are defined by unique ids, which means that
in the future stacking context will be able to contain more than one.
2016-10-30 21:10:04 +01:00
Bobby Holley
5442fbec3f Hoist most styling functionality from TNode to TElement.
MozReview-Commit-ID: DZ8ZrsZIiAU
2016-10-29 13:45:40 -07:00
Bobby Holley
05c1f1e016 Introduce StylingMode and deprecate explicit dirtiness.
MozReview-Commit-ID: 5tF075EJKBa
2016-10-26 00:23:18 -07:00
Martin Robinson
8a12c15582 Produce WR display lists without nested stacking contexts
WebRender now supports display lists that do not use nested stacking
contexts for overflow scroll regions. We can remove a bit of code in
Servo now.
2016-10-23 12:31:01 +02:00
bors-servo
bb271ef4af Auto merge of #13848 - mrobinson:remove-layers, r=glennw
Remove concept of Layers from Servo

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

<!-- Either: -->
- [ ] There are tests for these changes OR
- [x] These changes do not require tests because this PR should not change behavior.

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

Layers were a feature of the legacy drawing path. If we re-add them at
some point, it probably makes more sense to make them a product of
display list inspection.

This change also remove a bunch of dead painting code.

<!-- 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/13848)
<!-- Reviewable:end -->
2016-10-21 01:43:25 -05:00
Martin Robinson
ccb7ab926a Remove concept of Layers from Servo
Layers were a feature of the legacy drawing path. If we re-add them at
some point, it probably makes more sense to make them a product of
display list inspection.

This change also remove a bunch of dead painting code.
2016-10-21 08:38:34 +02:00
bors-servo
2e9aaa45dc Auto merge of #13841 - bholley:has_changed, r=emilio
Simplify TNode a bit, removing has_changed from style

A couple of changes here:
* Remove the option to unset with the dirty bit settes.
* Add an explicit API for setting text node style.
* Hoist has_changed handling into the restyle damage setter and text node style setter.
* Make set_style take a non-Option.

<!-- 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/13841)
<!-- Reviewable:end -->
2016-10-20 12:40:58 -05:00
Bobby Holley
cc96b292c2 Simplify TNode a bit.
A couple of changes here:
* Remove the option to unset with the dirty bit setters.
* Add an explicit API for setting text node style.
* Hoist has_changed handling into the restyle damage setter and text node style setter.
* Make set_style take a non-Option.
2016-10-20 09:47:54 -07:00
bors-servo
4e5ad268b1 Auto merge of #13839 - servo:locked-style, r=mbrubeck
Add RwLock in more Arc’d things in stylesheets.

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

CSSOM needs hold potentially multiple references (through `Arc`) to these objects, and then mutate them.

CC @upsuper
r? @mbrubeck

---
<!-- 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/13839)
<!-- Reviewable:end -->
2016-10-20 11:29:27 -05:00
Simon Sapin
742681a623 Add RwLock in more Arc’d things in stylesheets. 2016-10-19 19:55:05 +02:00
Martin Robinson
2219b14be9 Remove the concept of nested stacking contexts from display list builder
With the removal of the legacy rendering path, we don't need to worry
about nested stacking contexts. This change just pushes the
complication to the WebRender conversion step, but a later change will
remove the concept from WebRender as well.

This also helps to prepare for the introduction of ids for particular
scrolling regions, an integral part of multiple ScrollLayers per block.
2016-10-19 12:55:28 +02:00
Glenn Watson
acfdfd2fa9 Remove old rendering backend.
This removes paint threads, rust-layers dependency, and changes
optional webrender types to be required.

The use_webrender option has been removed, however I've left
the "-w" command line option in place so that wpt
runner can continue to pass that. Once it's removed from there
we can also remove the -w option.

Once this stage is complete, it should be fine to change the
display list building code to generate webrender display
lists directly and avoid the conversion step.
2016-10-18 10:21:27 +10:00