Commit Graph

51 Commits

Author SHA1 Message Date
Bobby Holley
b515de0c66 servo: Merge #20603 - Run rustfmt on selectors, servo_arc, and style (from bholley:rustfmt_style); r=Manishearth
Now that rustfmt is getting close to stable, and work on the style system has died down a bit, it seemed like an opportune time to auto-format the style crates.

The first commit disables import reordering, since tidy and rustfmt don't currently agree on the correct ordering. The second commit does a bunch of manual fixups such that the output of rustfmt passes tidy. The third commit runs rustfmt on the three aforementioned crate.

There are a few dozen warnings in the style crate about lines longer than 100 characters. It would be good to fix these, but I don't have time for that now.

Source-Repo: https://github.com/servo/servo
Source-Revision: 9a900ef019cd643bff961d7b20db6da69f3edb29

--HG--
extra : subtree_source : https%3A//hg.mozilla.org/projects/converted-servo-linear
extra : subtree_revision : 2b228d52a084bc832444ac686290840c4369f98d
2018-04-10 21:00:11 -04:00
Emilio Cobos Álvarez
e47cb58448 servo: Merge #20117 - style: Somewhat miscelaneous cleanup (from emilio:misc-cleanup); r=nox
Source-Repo: https://github.com/servo/servo
Source-Revision: bbfca28a4f3770896955375d01f1c489b4632fd3

--HG--
extra : subtree_source : https%3A//hg.mozilla.org/projects/converted-servo-linear
extra : subtree_revision : cca02ea2c160395889cfd6eb60c62a065d490300
2018-02-24 17:28:20 -05:00
Bobby Holley
3cdfd413f8 servo: Merge #18412 - Increase stack safety margin for stylo (from bholley:bump_style_stacks); r=bholley
https://bugzilla.mozilla.org/show_bug.cgi?id=1395708

Source-Repo: https://github.com/servo/servo
Source-Revision: 8868d2223dbb28b07ae1936095bc9ec644fe58a7

--HG--
extra : subtree_source : https%3A//hg.mozilla.org/projects/converted-servo-linear
extra : subtree_revision : 9c0a9b9c3fb42d8e1ab8b632255517d68d184f34
2017-09-07 13:52:48 -05:00
Bobby Holley
b1eb48ffa3 servo: Merge #18248 - stylo: Check stack depth in invalidation machinery and re-enable limits (from bholley:more_stack_limits); r=bholley
https://bugzilla.mozilla.org/show_bug.cgi?id=1376884

Source-Repo: https://github.com/servo/servo
Source-Revision: 3c42792efade03a31b9eeca8be457992cf83722c

--HG--
extra : subtree_source : https%3A//hg.mozilla.org/projects/converted-servo-linear
extra : subtree_revision : f02582172bef70c26d97eb8bff9304956f3f911a
2017-08-25 23:29:46 -05:00
Bobby Holley
16249a5a0b servo: Merge #18238 - Replace the sequential/parallel distinction with a unified adaptive traversal (from bholley:adaptive_driver); r=emilio
https://bugzilla.mozilla.org/show_bug.cgi?id=1393632

Source-Repo: https://github.com/servo/servo
Source-Revision: 72c59ff830b256ca5bd6df7736a9d9acfc9d3e52

--HG--
extra : subtree_source : https%3A//hg.mozilla.org/projects/converted-servo-linear
extra : subtree_revision : c20e0e7691cc57e8d96627501e64962588c3eea5
2017-08-25 12:23:41 -05:00
Julian Seward
d25fe41b86 servo: Merge #18231 - Bug 1376883 - stylo: Drop thread pool stack size to 100k. r=bholley (from julian-seward1:master); r=bholley
<!-- Please describe your changes on the following line: -->
Bug 1376883 - stylo: Drop thread pool stack size to 100k.  r=bholley.

---
<!-- 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 #__ (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. -->

Source-Repo: https://github.com/servo/servo
Source-Revision: 7fa6e355836901726e20af0d5e74cf3d37b944db

--HG--
extra : subtree_source : https%3A//hg.mozilla.org/projects/converted-servo-linear
extra : subtree_revision : eeac903d3db70a77e940762fa1fc81a60cb07d2c
2017-08-25 10:14:23 -05:00
Bobby Holley
91435fb8ed servo: Merge #18048 - More refactoring of the traversal in preparation for restyle roots (from bholley:more_traversal_refactoring_for_restyle_roots); r=emilio
https://bugzilla.mozilla.org/show_bug.cgi?id=1389347

Source-Repo: https://github.com/servo/servo
Source-Revision: 8fb7836f40b03c94d0e87929965ee3c19b171091

--HG--
extra : subtree_source : https%3A//hg.mozilla.org/projects/converted-servo-linear
extra : subtree_revision : 9a9172b1db6fb8e016ff403d247c147713a82042
2017-08-11 16:47:12 -05:00
Boris Zbarsky
bee23c484c servo: Merge #17936 - Don't start kicking off work units during parallel stylo traversal until they're actually full (from bzbarsky:parallel-better-sharing); r=bholley
This improves style sharing at the cost of a bit less parallelism.  Fixes Gecko
bug 1385982.  r=bholley

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

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

Source-Repo: https://github.com/servo/servo
Source-Revision: 3be1be03c472889800ee63ae5bebd1c47e00f6c6

--HG--
extra : subtree_source : https%3A//hg.mozilla.org/projects/converted-servo-linear
extra : subtree_revision : 01d9a0d7a6c59b8744a320056ebe87dd584be092
2017-08-01 15:01:04 -05:00
Bobby Holley
497e5345cc servo: Merge #17741 - Trim some fat from the traversal (from bholley:trim_traversal_fat); r=emilio
https://bugzilla.mozilla.org/show_bug.cgi?id=1380877

Source-Repo: https://github.com/servo/servo
Source-Revision: 17f99e2a7bb0d7eec167eac952f12a7feafd647d

--HG--
extra : subtree_source : https%3A//hg.mozilla.org/projects/converted-servo-linear
extra : subtree_revision : 4e5e24b864f4a1f80808930aa629917de1b44c8d
2017-07-15 15:07:51 -07:00
Bobby Holley
df77fb2e20 servo: Merge #17615 - Rip out the generic abstractions around ThreadLocalStyleContext (from bholley:simplify_local_context); r=emilio
https://bugzilla.mozilla.org/show_bug.cgi?id=1378540

Source-Repo: https://github.com/servo/servo
Source-Revision: 8923a9e5f0cc292062f852babe878326aff656ef

--HG--
extra : subtree_source : https%3A//hg.mozilla.org/projects/converted-servo-linear
extra : subtree_revision : fd5436ab04b074ecab59f7341e77590975f62656
2017-07-05 19:29:01 -07:00
Julian Seward
7a6431b33b servo: Merge #17563 - Bug 1368302 - stylo: possible stack overflow when processing very dee… (from julian-seward1:master); r=bholley
…p DOM.  r=bholley.

Whilst working with variants of the bloom-basic test for Stylo perf
profiling, I noticed that it is easy to cause Firefox to segfault on DOMs
with a depth of more than about 1500 elements.  This fix limits the use of
tail recursion to 150 elements.  This isn't externally observable to content
-- we're still completely correct, just not using tail recursion any more.

<!-- 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: -->
- [ ] `./mach build -d` does not report any errors
- [ ] `./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 _____

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

Source-Repo: https://github.com/servo/servo
Source-Revision: 683a53b080fa119562f6d4ee3a4deb0cc863c128

--HG--
extra : subtree_source : https%3A//hg.mozilla.org/projects/converted-servo-linear
extra : subtree_revision : 01ea54b32f447d0890b1effbe439a5b56f627232
2017-06-30 03:01:08 -07:00
Bobby Holley
ced56a8161 servo: Merge #17334 - Make the traversal work better with the style sharing cache (from bholley:breadth_first_traversal); r=emilio
https://bugzilla.mozilla.org/show_bug.cgi?id=1365692

Source-Repo: https://github.com/servo/servo
Source-Revision: 6ec95ecb9f5159eafa8d3051c259d566d518f29d

--HG--
extra : subtree_source : https%3A//hg.mozilla.org/projects/converted-servo-linear
extra : subtree_revision : b8b74ce57dbeb6d85958a4c903095fefc4569443
2017-06-15 10:34:49 -07:00
Cameron McCormack
e32ea7a9d2 servo: Merge #17252 - style: don't perform selector matching on the flattened tree (from heycam:flattened-tree); r=emilio
From https://bugzilla.mozilla.org/show_bug.cgi?id=1369954.

Source-Repo: https://github.com/servo/servo
Source-Revision: 969047bb7cab0f5e8c235017b7e9f7a170c9b7e4

--HG--
extra : subtree_source : https%3A//hg.mozilla.org/projects/converted-servo-linear
extra : subtree_revision : 37f9028eb2fb24f4b46f7e7d3397e23a0c334e37
2017-06-09 03:57:36 -07:00
Boris Zbarsky
ed9ed19cfb servo: Merge #17235 - Increase the size of the style sharing cache to 31 (from bzbarsky:bigger-sharing-cache); r=bholley
<!-- 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 https://bugzilla.mozilla.org/show_bug.cgi?id=1369621

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

Source-Repo: https://github.com/servo/servo
Source-Revision: 612f2c1c2a9e56de2abe9ce32fcb6461a133686d

--HG--
extra : subtree_source : https%3A//hg.mozilla.org/projects/converted-servo-linear
extra : subtree_revision : 89a0524ef12c025009488f127ecc083a71ba646b
2017-06-08 12:22:38 -07:00
Boris Zbarsky
2b3fb6fd20 servo: Merge #17214 - Back out https://github.com/servo/servo/pull/17198 for Gecko test failures (from bzbarsky:backout-style-sharing-increase); r=bustage
<!-- 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 _____

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

Source-Repo: https://github.com/servo/servo
Source-Revision: 3553ae4df97092a2c909d8bd104ece4d6a211ce3

--HG--
extra : subtree_source : https%3A//hg.mozilla.org/projects/converted-servo-linear
extra : subtree_revision : 67b273a5a3d29e30cc7ba0984dced239a438090c
2017-06-07 13:50:54 -07:00
Boris Zbarsky
0867caaab3 servo: Merge #17198 - Increase the size of the style sharing cache to 31 (from bzbarsky:bigger-sharing-cache); r=bholley
Still a lot of guesswork here, but this does seem to get us better sharing.  See
https://bugzilla.mozilla.org/show_bug.cgi?id=1369621 for some data.

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

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

Source-Repo: https://github.com/servo/servo
Source-Revision: fdd1d719f34dccb2e808f91977bf134dc0bc6ab7

--HG--
extra : subtree_source : https%3A//hg.mozilla.org/projects/converted-servo-linear
extra : subtree_revision : f0aa8402e468e98650faee53072ee43732478d80
2017-06-07 04:13:50 -07:00
Bobby Holley
20411d4b85 servo: Merge #16971 - Rewrite parallel.rs (from bholley:fix_parallelism); r=emilio
https://bugzilla.mozilla.org/show_bug.cgi?id=1366347

Source-Repo: https://github.com/servo/servo
Source-Revision: f14eeb00c0d9c76ead36d9caecafb218598525b1

--HG--
extra : subtree_source : https%3A//hg.mozilla.org/projects/converted-servo-linear
extra : subtree_revision : d78c7f90576fa45fb949e9424d57c6aa7906f980
2017-05-21 01:12:22 -05:00
Bobby Holley
5e30d096e5 servo: Merge #16379 - Limit traversal statistics dumps to subtrees of 50 or more elements and add more values (from bholley:quieter_stats); r=SimonSapin
On Gecko, we get tons of console spam from 1-element traversals if we don't do this.

Source-Repo: https://github.com/servo/servo
Source-Revision: b51416846993f108269c0d979649c575e47a91ac

--HG--
extra : subtree_source : https%3A//hg.mozilla.org/projects/converted-servo-linear
extra : subtree_revision : 45a8d3e1054aa01c263cfe90c3cfd2d3c3c5e71f
2017-04-13 01:44:12 -05:00
Bobby Holley
9ab23a87f3 servo: Merge #16369 - Store style system options in the global style data and shared style context (from bholley:style_system_options); r=SimonSapin
I wanted to add an environmental variable to disable the style sharing
cache for gecko, but the current pattern involves lazy_static!, which
involves an atomic operation on lookup, which is a bit hot to do each
time we try to share styles. This makes that work happen once per
process.

Source-Repo: https://github.com/servo/servo
Source-Revision: 54ecfb155dba40382764ee20186a31f067a507be

--HG--
extra : subtree_source : https%3A//hg.mozilla.org/projects/converted-servo-linear
extra : subtree_revision : 35cbfe0f6490eadf25d9de020f0d2ea851badaba
2017-04-12 02:27:02 -05:00
Bobby Holley
ec70de47f6 servo: Merge #16312 - Make the sequential traversal breadth-first (from bholley:breadth_first_sequential); r=emilio
Reviewed in https://bugzilla.mozilla.org/show_bug.cgi?id=1354806

Source-Repo: https://github.com/servo/servo
Source-Revision: fd2b092839ec5229066ed1d608a81a556f38c55b

--HG--
extra : subtree_source : https%3A//hg.mozilla.org/projects/converted-servo-linear
extra : subtree_revision : 4a85dcd1bb4c702c61c0bc277e858da48d9f0cdc
2017-04-09 01:55:09 -05:00
Emilio Cobos Álvarez
99fa3bca94 servo: Merge #15891 - style: Iterate the LRU cache contents from back to front (from emilio:lru-back-to-front); r=bholley,mbrubeck
This is on top of #15888. Only the second commit needs review.

We put the more recently used item last, so iterating then from left to right is
pointless.

Source-Repo: https://github.com/servo/servo
Source-Revision: 7fa4a94bb154449702e5ae9422c3008a5195c714

--HG--
extra : subtree_source : https%3A//hg.mozilla.org/projects/converted-servo-linear
extra : subtree_revision : fbf4742c4186ad27bd4d5ccd3e2319a5b0748b55
2017-03-11 02:31:25 -08:00
Bobby Holley
4596312de1 servo: Merge #15557 - stylo: various fixes to improve style logging in opt builds (from bholley:opt_logging); r=emilio
This adds a traversal time entry to the style statistics, and switches to warn! as discussed in [1].

[1] https://bugzilla.mozilla.org/show_bug.cgi?id=1339176

Source-Repo: https://github.com/servo/servo
Source-Revision: 715a16423095e1bba2c192c0aebecb8f6aaffab3

--HG--
extra : subtree_source : https%3A//hg.mozilla.org/projects/converted-servo-linear
extra : subtree_revision : 945c58dec89fcbd5f4e59729a37aacddf368b983
2017-02-15 03:05:07 -08:00
Bobby Holley
a9e7b86e87 servo: Merge #15462 - Accumulate parent elements that need selector bits set on the ThreadLocalStyleContext (from bholley:accumulate_selector_flags); r=emilio
Discussion and review in https://bugzilla.mozilla.org/show_bug.cgi?id=1336646

Source-Repo: https://github.com/servo/servo
Source-Revision: cbfd4464270f8690b90b9b96c395523a3a39e2de

--HG--
extra : subtree_source : https%3A//hg.mozilla.org/projects/converted-servo-linear
extra : subtree_revision : c3bfb03915e31cb95db1b247edb24872eb1cfcf5
2017-02-08 19:33:27 -08:00
Emilio Cobos Álvarez
e606f041e6 servo: Merge #15160 - style: Expose the traversal kind to the style system (from emilio:expose-traversal-kind); r=bholley
This way we'll be able to take different paths for the sequential and parallel
traversals in some concrete cases.

This is a preliminar patch to fix bug 1332525.

r? @bholley

Source-Repo: https://github.com/servo/servo
Source-Revision: 1934a338757a84a6efddcbd3ecf051cd128a8d18
2017-01-24 17:02:41 -08:00
Bobby Holley
ffb83d6686 servo: Merge #15119 - Add style performance statistics to Servo (from bholley:traversal_stats); r=emilio
Gecko bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1331856

Source-Repo: https://github.com/servo/servo
Source-Revision: f8418a328435b114f6d8bb41c378a5bf0dfa4428
2017-01-19 15:27:34 -08:00
Bobby Holley
e445eee20a servo: Merge #14907 - Give up on hoisting ElementData into the frame and eliminate the concept of consuming styles (from bholley:eliminate_consume); r=emilio
Servo PR for the work in https://bugzilla.mozilla.org/show_bug.cgi?id=1325734

Source-Repo: https://github.com/servo/servo
Source-Revision: 2a2a89b7e401e72a4d8d6199c483d7ab09ff5c1e
2017-01-09 17:26:50 -08:00
Emilio Cobos Álvarez
89013f9ba5 servo: Merge #14801 - style: Document and force documentation in a big chunk of the style crate (from emilio:no-missing-docs); r=mbrubeck,Manishearth,Wafflespeanut
Style no forced docs for the properties code and similar, but I ran out of time, and I think it's a nice improvement.

I'd appreciate a fast-ish turn-around time because this is pretty much prone to bitrot.

Source-Repo: https://github.com/servo/servo
Source-Revision: bd67163438317daa711b2411ce302aaf5bf4136a
2016-12-31 03:19:02 -08:00
Bobby Holley
408478b137 servo: Merge #14662 - Hoist bloom filter into scoped TLS, and remove a bunch of complexity and unsafety from the style system (from bholley:bloom_tls); r=emilio
With this PR, the only remaining usage of UnsafeNode is the transition stuff, which is servo-only and probably going to be rewritten over the course of stylo. The parallel traversal is now fully typechecked and safe. \o/

r? @emilio

Source-Repo: https://github.com/servo/servo
Source-Revision: b35ab98132539d4e6f1fcd4b3307eae40e387861
2016-12-22 12:02:38 -08:00
Bobby Holley
8eb98de31a servo: Merge #14642 - Use Scoped TLS in the style system and eliminate UnsafeNode usage in the StyleSharingCandidateCache (from bholley:scoped_tls); r=emilio
See the discussion in https://bugzilla.mozilla.org/show_bug.cgi?id=1323372

@emilio Please review, but don't merge yet until we get the upstream changes into Rayon.

CC @SimonSapin @heycam @upsuper @Manishearth @pcwalton @nikomatsakis

Source-Repo: https://github.com/servo/servo
Source-Revision: 8fd8d6161426af386c0dfd3d13968a409474eb16
2016-12-21 11:11:12 -08:00
Bobby Holley
b0588eeb56 servo: Merge #14610 - Simplify style context architecture and make it safer (from bholley:style_context_refactor); r=emilio
See the discussion at https://bugzilla.mozilla.org/show_bug.cgi?id=1323372

Not done here, but want to get a try run in on the first patch.

Source-Repo: https://github.com/servo/servo
Source-Revision: a4ecdf2d5fda281f25e2689852bc2134429e07c6
2016-12-16 11:38:27 -08:00
Alan Jeffrey
07258edab3 servo: Merge #14592 - Remove the util crate (from asajeffrey:util-goodbye); r=mbrubeck
<!-- Please describe your changes on the following line: -->

This PR removes the `util` crate.

* Replaced the `spawn_named` and `clamp` functions by appropriate uses of `std:🧵:Builder::spawn`, `std::cmp::min` and `std::cmp::max`.
* Moved `opts`, `prefs` and `resource_files` into a new `config` crate.
* Moved `remutex` and `geometry` into their own crates.

---
<!-- 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 they are refactorings

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

Source-Repo: https://github.com/servo/servo
Source-Revision: 4eb653817f87e5fb47de34356f558eb76ecbca9f

--HG--
rename : servo/components/util/Cargo.toml => servo/components/config/Cargo.toml
rename : servo/components/util/basedir.rs => servo/components/config/basedir.rs
rename : servo/components/util/lib.rs => servo/components/config/lib.rs
rename : servo/components/util/opts.rs => servo/components/config/opts.rs
rename : servo/components/util/prefs.rs => servo/components/config/prefs.rs
rename : servo/components/util/resource_files.rs => servo/components/config/resource_files.rs
rename : servo/components/util/geometry.rs => servo/components/geometry/lib.rs
rename : servo/components/util/remutex.rs => servo/components/remutex/lib.rs
rename : servo/tests/unit/util/lib.rs => servo/tests/unit/servo_config/lib.rs
rename : servo/tests/unit/util/opts.rs => servo/tests/unit/servo_config/opts.rs
rename : servo/tests/unit/util/prefs.rs => servo/tests/unit/servo_config/prefs.rs
rename : servo/tests/unit/util/remutex.rs => servo/tests/unit/servo_remutex/lib.rs
2016-12-14 16:48:42 -08:00
Bobby Holley
0124e8b7ab servo: Merge #14560 - stylo: Fix some crashes on incubator (from bholley:fix_crashes); r=heycam
Corresponding gecko bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1322945

Source-Repo: https://github.com/servo/servo
Source-Revision: 855358866640605fe055d792832db2f5e74fe197
2016-12-12 19:13:03 -08:00
Bobby Holley
637f6af4d6 servo: Merge #14436 - Make restyle tracking more granular (from bholley:granular_restyle); r=emilio
The primary idea of this patch is to ditch the rigid enum of Previous/Current
styles, and replace it with a series of indicators for the various types of
work that needs to be performed (expanding snapshots, rematching, recascading,
and damage processing). This loses us a little bit of sanity checking (since
the up-to-date-ness of our style is no longer baked into the type system), but
gives us a lot more flexibility that we'll need going forward (especially when
we separate matching from cascading). We also eliminate get_styling_mode in
favor of a method on the traversal.

This patch does a few other things as ridealongs:
* Temporarily eliminates the handling for transfering ownership of styles to the
  frame. We'll need this again at some point, but for now it's causing too much
  complexity for a half-implemented feature.
* Ditches TRestyleDamage, which is no longer necessary post-crate-merge, and is
  a constant source of compilation failures from either needing to be imported
  or being unnecessarily imported (which varies between gecko and servo).
* Expands Snapshots for the traversal root, which was missing before.
* Fixes up the skip_root stuff to avoid visiting the skipped root.
* Unifies parallel traversal and avoids spawning for a single work item.
* Adds an explicit pre_traverse step do any pre-processing and determine whether
      we need to traverse at all.

Source-Repo: https://github.com/servo/servo
Source-Revision: b9a8ccd775c3192e3810a1730b1d0bc2b5c9dfb6
2016-12-09 17:01:05 -08:00
Emilio Cobos Álvarez
cca73fbfd1 servo: Merge #14353 - Fix the bloom filter stuff (from emilio:fix-bloom); r=SimonSapin
<!-- Please describe your changes on the following line: -->

I think I got the numbers right, want to do a try run before just in case.

r? @SimonSapin

Source-Repo: https://github.com/servo/servo
Source-Revision: 2289ad53dd9a2666645b1f7eef07636e21c1607e
2016-11-28 10:30:19 -08:00
Bobby Holley
62e95664e4 servo: Merge #14300 - stylo: Basic infrastructure for RestyleHint-driven traversal (from bholley:restyle_driven_traversal); r=emilio
Gecko Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=131701

(Don't review yet, will flag on the gecko bug when the time comes)

Source-Repo: https://github.com/servo/servo
Source-Revision: d98abaec20e624aa89a3abddf4cf2a6399951ef1
2016-11-25 09:00:44 -08:00
Emilio Cobos Álvarez
fbd6dc3fd6 servo: Merge #13641 - Use rayon to drive parallel layout and styling (from emilio:rayon-style); r=pcwalton
<!-- Please describe your changes on the following line: -->

The current work queue had a really annoying constraint: The size of the node had to be the size of the work unit data.

This makes it impractical for the new restyling model where we plan to pass down a bunch of data.

Rayon by default makes you wait for the result of the work unit, which makes it impractical for the current model (it's mostly sequential).

I added an API to rayon that allows us to push work to the queue without waiting (https://github.com/nikomatsakis/rayon/pull/103).

This still needs some work (for example, we're loosing the memory reporting functionality), but I wanted feedback on this.

---

<!-- 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 #__ (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. -->

Source-Repo: https://github.com/servo/servo
Source-Revision: 9467fbe26d25dfc633d5ab8973fe459d14eff9dc
2016-11-14 14:47:21 -06:00
Simon Sapin
9c206a6cf3 servo: Merge #13202 - Rule tree, v1 (from emilio:rule-tree); r=SimonSapin,Manishearth,emilio
<!-- 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

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

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.

Source-Repo: https://github.com/servo/servo
Source-Revision: ac0475971bb24a63ca5d36d1d17e3036ddb99049
2016-11-05 17:11:24 -05:00
Bobby Holley
70abae6571 servo: Merge #14010 - incremental restyle: Centralize pre-styling setup, eliminate RestyleResult, and drop data for display:none subtrees (from bholley:element_data_management); r=emilio
Source-Repo: https://github.com/servo/servo
Source-Revision: cf9d282914c65d712635b14636a62003b863bdf0
2016-11-01 13:05:46 -05:00
Bobby Holley
91213da5fc servo: Merge #13956 - incremental restyle: Hoist most styling functionality from TNode to TElement (from bholley:more_telement); r=emilio
This is a continuation of the work in #13951. I'm separating it out into a separate PR since the aforementioned patch has a green try run and this one doesn't yet.

Source-Repo: https://github.com/servo/servo
Source-Revision: b611e5c3b219e8f6aa9a7937aa7f5ea552762cd4
2016-10-29 17:14:10 -05:00
Bobby Holley
aab7b04925 servo: Merge #13913 - incremental restyle: Introduce StylingMode and deprecate explicit dirtiness (from bholley:styling_mode); r=emilio
This is another chunk of work to move us toward the new incremental restyle architecture.

Eventually, we'll make a fine-grained decision at each node about what style to recompute based on the RestyleHint on the node data (along with other things). For now, we use the existence of RestyleData as a coarse-grained approximation of this.

Source-Repo: https://github.com/servo/servo
Source-Revision: c8b6ece97b6eec8ac4e16a7a79a605356279cfb6
2016-10-26 06:36:06 -05:00
Bobby Holley
79a77ced40 servo: Merge #13655 - Move children_to_process to layout (from bholley:children_to_process); r=<try>
We don't need this for Gecko, and it's hard to implement in that case because
there's nowhere obvious to put it (we don't plan to create TSDs for non-dirty
nodes, and non-dirty nodes can have dirty children which require the
children_to_process atomic). There are various solutions here, but punting is
the easiest.

We'll need to rethink this if/when we need to do a bottom-up traversal for
Gecko.

Source-Repo: https://github.com/servo/servo
Source-Revision: 70dbfd28fa44b0cd89a0ea39a6bd1180611c5e66
2016-10-09 01:37:42 -05:00
Bobby Holley
4cf0bc2db4 servo: Merge #13520 - Implement AtomicRefCell and use it for layout/style node data (from bholley:atomic_refcell); r=emilio
See the rationale at https://bugzilla.mozilla.org/show_bug.cgi?id=1305141

Source-Repo: https://github.com/servo/servo
Source-Revision: c93eaca6a3563ea8472b2ac783e9a596528517b8
2016-10-02 21:24:11 -05:00
Emilio Cobos Álvarez
25b2eb5a04 servo: Merge #12668 - Rewrite the style sharing candidate cache (from emilio:style-cache); r=SimonSapin,pcwalton
<!-- Please describe your changes on the following line: -->

See the first commit's description for a bit of background. I'm making the PR in this state just to verify against try I've handled all cases of possibly incorrect sharing and, if not, fix it.

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

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

Source-Repo: https://github.com/servo/servo
Source-Revision: ec7efff14bf775d400ae768d8cb4ba1dac88ab59
2016-08-17 16:34:30 -05:00
Emilio Cobos Álvarez
c84426cbcf servo: Merge #12757 - stylo: Stop restyling display: none elements, remove the has_changed hack that made us use ReconstructFrame unconditionally (from emilio:stylo); r=bholley,pcwalton
<!-- 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

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

r? @bholley

Source-Repo: https://github.com/servo/servo
Source-Revision: 1b2450339c40dbcb65e94a346ea434d45f0edf90
2016-08-10 21:02:30 -05:00
Emilio Cobos Álvarez
e6192bfc52 servo: Merge #12563 - stylo: Improve restyling performance (from emilio:stylo); r=bholley,jdm,pcwalton
This commit adds hooks to the Servo style traversal to avoid traversing all the
DOM for every restyle. Additionally it changes the behavior of the dirty flag to
be propagated top down, to prevent extra overhead when an element is dirtied.

This commit doesn't aim to change the behavior on Servo just yet, since Servo does extra job when dirtying the node related with DOM revision counters that might be necessary.

CC @asajeffrey for the DOM revision counters stuff. When a node is dirty, do all its descendants really need to increment the revision counter, or is this an unintended effect? My intuition is that this is hurting performance quite a lot for servo.

r? @bholley

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

<!-- Either: -->
- [x] These changes do not require tests because no geckolib tests yet.

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

Source-Repo: https://github.com/servo/servo
Source-Revision: 944d371b8f0e72f6aa5465be38c0c8daeab66127
2016-07-27 17:56:26 -05:00
Anthony Ramine
cc183b15a7 servo: Merge #12224 - Remove some stuff from util (from nox:die-util-die); r=Ms2ger
Source-Repo: https://github.com/servo/servo
Source-Revision: 3b0dadda529a5ba45a8a0dc394187f43a66e7c1f

--HG--
rename : servo/components/util/print_tree.rs => servo/components/gfx_traits/print_tree.rs
rename : servo/components/util/workqueue.rs => servo/components/style/workqueue.rs
2016-07-04 12:57:00 -07:00
Emilio Cobos Álvarez
b3b8f4ed55 servo: Merge #11946 - style: Remove the Mutex from new_animations_sender by moving it to the local StyleContext (from emilio:animations-sender); r=bholley
<!-- 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

<!-- Either: -->
- [x] These changes do not require tests because refactoring.

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

As a follow-up, we could move all the data living under a mutex in the
SharedLayoutContext only in order to create the local context to the same place.

This should increase animation performance when there are multiple animations in
one page that happen to be on different threads.

r? @SimonSapin/@mbrubeck for the style/layout, @bholley for the geckolib changes

Source-Repo: https://github.com/servo/servo
Source-Revision: ec0d3e084dbaecf749a67ba52e5f680262960a29
2016-07-01 14:12:54 -07:00
Emilio Cobos Álvarez
c399260cd8 servo: Merge #11766 - Add @keyframes and animation-* support (from emilio:keyframes-parsing); r=SimonSapin,pcwalton
- [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. -->

This adds support for parsing `@keyframes` rules, and animation properties. Stylo will need it sometime soonish, plus I want to make animations work in Servo.

The remaining part is doin the math and trigger the animations correctly from servo. I don't expect it to be *that* hard, but probaby I'll need to learn a bit more about the current animation infra (e.g. why the heck is the `new_animations_sender` guarded by a `Mutex`?).

I'd expect to land this, since this is already a bunch of work, this is the part exclusively required by stylo (at least if we don't use Servo's machinery), the media query parsing is tested, and the properties land after a flag, but if you prefer to wait until I finish this up it's fine for me too.

r? @SimonSapin

cc @pcwalton @bholley

Source-Repo: https://github.com/servo/servo
Source-Revision: d3a81373e44634c30d31da0457e1c1e86c0911ed
2016-06-28 17:31:01 -05:00
Simon Sapin
993d896521 servo: Merge #11816 - Make the style crate (almost) build with a stable compiler (from servo:stable-style); r=nox
<!-- Please describe your changes on the following line: -->

The bulk of this is adding cargo features to make derived implementations of `heapsize` and `serde` traits optional.

"Almost" because `std::intrinsics::discriminant_value` is currently unstable and doesn’t have any stable replacement that I know of. For now, this PR conditionally replaces it with `unimplemented!()`.

r? @nox

---
<!-- 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 <s>fix</s> are part of #11815 (github issue number if applicable).

<!-- Either: -->
- [ ] There are tests for these changes OR
- [x] These changes do not <s>require tests</s> *have tests yet* because that requires https://github.com/servo/servo/issues/11806, but I still want to land this before it bitrots. (Tests should check that the build succeeds with a stable compiler.)

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

Source-Repo: https://github.com/servo/servo
Source-Revision: 0fb5d634a007f3d0424f95569ac3f83d500d054c
2016-06-22 09:43:20 -05:00
Bobby Holley
97c48a8863 servo: Merge #9976 - Remove lifetimes from Style/Layout traits (from bholley:remove_trait_lifetimes); r=SimonSapin
Right now, there's a huge amount of complexity in T{Node,Element,Document} and friends because of the lifetime parameter.

Before I started generalizing this code for use by Gecko, these wrappers were plain structs. They had (and still have) a phantom lifetime associated with them to prevent references to DOM nodes from leaking past the end of restyle, when they might be invalidated by a GC.

When I generalized them, I decided to put the lifetime on the trait as well, since there are some situations where the lifetime is, in fact, necessary. Specifically, they are necessary for the compiler to understand that all the things borrowed from all the nodes and elements and so on have the same lifetime (the lifetime of the restyle), rather than the lifetime of whichever particular element or node pointer the value was borrowed from. This come up in situations where we do |let el = node.as_element()| or |let n = el.as_node()| and then borrow something from the result. The compiler thinks the borrow lifetime is that of |el| or |n|, when it's actually longer.

In practice though, I think the style and layout algorithms we use don't run into this issue much, and we can hack around it where it comes up. So I think we should remove the lifetimes from the traits, which will let us aggregate the embedding-provided traits together onto a single meta-trait and significantly simplify the code.

Source-Repo: https://github.com/servo/servo
Source-Revision: aea8d8959dcb157a8cc381f1403246ce8ca1ca00
2016-03-15 02:34:53 +05:01