Граф коммитов

57 Коммитов

Автор SHA1 Сообщение Дата
Kenan Rhoton 8ee6cafb05 servo: Merge #17142 - Move LRUCache to ArrayDeque crate (from kenan-rhoton:LRUCacheArrayVecDeque); r=emilio
We move LRUCache from using VecDeque to ArrayDeque to avoid using heap allocations.

This relies on the fix in goandylok/arraydeque#4.

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

<!-- Either: -->
- [ ] There are tests for these changes OR
- [X] These changes do not require tests because the use cases are the same, only minimal implementation changes have been made

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

I additionally ran test-unit, because I'm paranoid.

Source-Repo: https://github.com/servo/servo
Source-Revision: 2dd67a94971bf562e2eed90582f28ef78a70cf70

--HG--
extra : subtree_source : https%3A//hg.mozilla.org/projects/converted-servo-linear
extra : subtree_revision : 3bbb1feb0ae4fb0919edb4f32252594911e1cbe4
2017-06-04 13:29:24 -07:00
Bobby Holley 4caf2d2c7b servo: Merge #17110 - Improve Style Sharing (from bholley:better_style_sharing); r=emilio
Reviewed in:
https://bugzilla.mozilla.org/show_bug.cgi?id=1368665
https://bugzilla.mozilla.org/show_bug.cgi?id=1368399

Source-Repo: https://github.com/servo/servo
Source-Revision: 1b9cc2de3418f6dbe27102d02ac4d4fadb6cc643

--HG--
extra : subtree_source : https%3A//hg.mozilla.org/projects/converted-servo-linear
extra : subtree_revision : 04e46d17f239248fbe39ac7d6e7bd4287255cf74
2017-05-31 10:07:53 -05:00
Emilio Cobos Álvarez 7b2d94daee servo: Merge #17063 - style: Allow sharing styles across elements with presentational hints (from emilio:pres-hints-sharing); r=bholley
Source-Repo: https://github.com/servo/servo
Source-Revision: 38a6a3bff6f6e0e35eb592891d5e70e7cb897b69

--HG--
extra : subtree_source : https%3A//hg.mozilla.org/projects/converted-servo-linear
extra : subtree_revision : 5c6316d592dfa5ef57e7fc03f4c5211cbbc1b1d7
2017-05-30 07:28:06 -05:00
heyzoos 4062fb2f77 servo: Merge #16968 - Stylist accessors (from HeyZoos:stylist-accessors); r=emilio
<!-- Please describe your changes on the following line: -->
Add accessor methods for the `device` and `ruleset` fields in the `Stylist` struct.

---
<!-- 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 #16857 (github issue number if applicable).
<!-- Either: -->
- [X] There are tests for these changes

<!-- 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: 1306b16d5a170074b4f42046a7b1a3a43952b346

--HG--
extra : subtree_source : https%3A//hg.mozilla.org/projects/converted-servo-linear
extra : subtree_revision : a5e0289fe7456134e270f64236827be605ce061e
2017-05-22 20:12:46 -05:00
Emilio Cobos Álvarez 7666f7ec85 servo: Merge #16972 - style: Move all the style sharing code outside matching.rs (from emilio:sanity-is-important-most-of-the-time); r=bholley
This is just a code health change. I want to move it away to keep matching.rs as
simple as possible.

Source-Repo: https://github.com/servo/servo
Source-Revision: 03fbea4ec8af3ef6c5c621974b3c52cd755ed287

--HG--
extra : subtree_source : https%3A//hg.mozilla.org/projects/converted-servo-linear
extra : subtree_revision : 9c40723f62f8a51aebeda92f90d7b148498fa820
2017-05-20 21:11:38 -05:00
Emilio Cobos Álvarez 7bb0c2c428 servo: Merge #16802 - style: Slim down SharedStyleContext, and do various other cleanups around the style crate (from emilio:slim-down-slc); r=bholley
This slims down SharedStyleContext, in preparation for a few things.

First, I would like to eventually move the stylist to the document in Servo, in
order for it to hold the StyleSheetSet.

Also, this gets rid of a fair amount of overhead while creating it in stylo.

Fixes bug 1363245.

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

--HG--
extra : subtree_source : https%3A//hg.mozilla.org/projects/converted-servo-linear
extra : subtree_revision : e20eedc331b5fa4c6e2fecc140e10f220619deb8
2017-05-12 08:56:47 -05:00
Emilio Cobos Álvarez c421fb27c4 servo: Merge #16778 - Take all the snapshots into account in the style system (from emilio:snapshots); r=bholley
See [bug 1355343](https://bugzilla.mozilla.org/show_bug.cgi?id=1355343).

The servo part of this patch presumably needs some polishing, let's see.

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

--HG--
extra : subtree_source : https%3A//hg.mozilla.org/projects/converted-servo-linear
extra : subtree_revision : e30b841acf517260bf607fbc59afd29327d6164c
2017-05-10 15:08:59 -05:00
Bobby Holley 0698f88159 servo: Merge #16745 - Use selector maps for revalidation and dependency selectors (from bholley:more_selector_maps); r=emilio
https://bugzilla.mozilla.org/show_bug.cgi?id=1360088

Source-Repo: https://github.com/servo/servo
Source-Revision: 741958b2fbe0cdf0a89e4dc88c3b1a51e18693d3

--HG--
extra : subtree_source : https%3A//hg.mozilla.org/projects/converted-servo-linear
extra : subtree_revision : 547c741c779e30d048ab03fbf3926435f54a9f78
2017-05-05 16:29:00 -05:00
Bobby Holley f716af270a servo: Merge #16702 - Use a custom arc in the style system (from bholley:custom_arc); r=emilio
See https://bugzilla.mozilla.org/show_bug.cgi?id=1360889

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

--HG--
extra : subtree_source : https%3A//hg.mozilla.org/projects/converted-servo-linear
extra : subtree_revision : 85baf2471e165666e2540cbcf4fbb55587e60f39
2017-05-02 20:01:10 -05:00
Emilio Cobos Álvarez 9d915de239 servo: Merge #16630 - Make stylo traverse Native Anonymous Content, fixing a bunch of restyle bugs (from emilio:nac); r=bholley,hiro
Source-Repo: https://github.com/servo/servo
Source-Revision: c633e291c93c942d34c731fe6ceb4db3b7347a16

--HG--
extra : subtree_source : https%3A//hg.mozilla.org/projects/converted-servo-linear
extra : subtree_revision : 2e9c223acb6e494c3945c47fc5ab7817c54de504
2017-04-27 07:39:42 -05:00
Bobby Holley b093fa5b7c servo: Merge #16578 - Fix up the style sharing cache (from bholley:fix_style_sharing_cache); r=emilio
https://bugzilla.mozilla.org/show_bug.cgi?id=1358694

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

--HG--
extra : subtree_source : https%3A//hg.mozilla.org/projects/converted-servo-linear
extra : subtree_revision : a794839431bb0746904b1156ad94e9f3c2746319
2017-04-23 14:45:29 -05:00
Boris Chiou 2568e13f60 servo: Merge #16496 - stylo: Bug 1341372 - Detect new transitions and let it run (from BorisChiou:stylo/transition/trigger); r=heycam
These are interdependent patches of Bug 1341372. We let animation-only restyle also work for RESTYLE_CSS_TRANSITIONS, and check if we need to update transitions by each transition property. If it is necessary to create/replace/cancel transitions, we create a SequentialTask for CSS_TRANSITIONS.

---
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix Bug 1341372
- [X] These changes do not require tests because there are tests in Gecko already.

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

--HG--
extra : subtree_source : https%3A//hg.mozilla.org/projects/converted-servo-linear
extra : subtree_revision : 6c532f5d11b4349d35c326f64f6c259d25ef0ef2
2017-04-17 05:07:23 -05:00
Bobby Holley 4a471e742c servo: Merge #16432 - Coalesce duplicate selector flags and improve LRUCache (from bholley:faster_selector_flags); r=bholley
https://bugzilla.mozilla.org/show_bug.cgi?id=1356148

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

--HG--
extra : subtree_source : https%3A//hg.mozilla.org/projects/converted-servo-linear
extra : subtree_revision : 80163de2670777df44a56737a8e673eb74cea549
2017-04-13 08:56:03 -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 206fa732a5 servo: Merge #16358 - Fix up the style sharing cache (from bholley:style_sharing_fixes); r=emilio
Reviewed in:
https://bugzilla.mozilla.org/show_bug.cgi?id=1354895
https://bugzilla.mozilla.org/show_bug.cgi?id=1332525

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

--HG--
extra : subtree_source : https%3A//hg.mozilla.org/projects/converted-servo-linear
extra : subtree_revision : ea1494fe9e1c0720730f3999a0c11bd0b3434617
2017-04-11 22:52:23 -05:00
Manish Goregaokar c357d4646c servo: Merge #16316 - stylo: Make font base size computation threadsafe (from Manishearth:stylo-threadsafe); r=emilio
r=emilio https://bugzilla.mozilla.org/show_bug.cgi?id=1351200

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

--HG--
extra : subtree_source : https%3A//hg.mozilla.org/projects/converted-servo-linear
extra : subtree_revision : 22f72365127df85cf53f1fd89b955be092cedb70
2017-04-09 06:15:51 -05:00
Cameron McCormack ba496d5598 servo: Merge #16309 - style: add a "for frame reconstruction" mode for restyle traversal (from heycam:restyle-reconstruct); r=bholley
This is the Servo part of https://bugzilla.mozilla.org/show_bug.cgi?id=1351535.

Source-Repo: https://github.com/servo/servo
Source-Revision: 2f67f69e895206135012c7445a86fb07d6e3b6b5

--HG--
extra : subtree_source : https%3A//hg.mozilla.org/projects/converted-servo-linear
extra : subtree_revision : fbd7a0657af2e60eb295c93b18d6d61622d159c0
2017-04-09 01:04:57 -05:00
Sebastian Hengst 5ca82fe2ef Backed out changeset d44f633899ce (bug 1351535) 2017-04-08 16:52:51 +02:00
Cameron McCormack e18ef453ec Bug 1351535 - Part 5.1: Move TraversalFlags into SharedStyleContext. r=bholley
MozReview-Commit-ID: IfLzJ9h6vKT

--HG--
extra : rebase_source : ef70203c3c2f891cc8b13f4d63caaebfa3d176e7
2017-04-08 16:36:09 +08:00
Xidorn Quan ef751c7674 servo: Merge #16297 - Remove servo_url dependency for geckolib (from upsuper:stylo-servo-url); r=SimonSapin
It seems mod attr is not used for geckolib at all, and that is the only place where servo_url is still referenced for geckolib, so we can just remove it.

Source-Repo: https://github.com/servo/servo
Source-Revision: 12a4cc875d44a1a516412dc4c6044e897c0c6e47

--HG--
extra : subtree_source : https%3A//hg.mozilla.org/projects/converted-servo-linear
extra : subtree_revision : b9f52a41735831d5dc19d7577bd8d4056ddf0948
2017-04-07 04:34:47 -05:00
Bobby Holley 8f3f795143 servo: Merge #16291 - Hoist possibly_expired_animations into CurrentElementInfo (from bholley:possibly_expired); r=emilio
The current mechanism requires threading a lot of this state through a bunch of
callsites that are several layers of abstraction above the code that actually
uses this vector (which is only compiled for servo). Putting it in
CurrentElementInfo gets it nicely out of the way.

Source-Repo: https://github.com/servo/servo
Source-Revision: 48a412abc7d56529770bdbe2cf0f5e6af852538e

--HG--
extra : subtree_source : https%3A//hg.mozilla.org/projects/converted-servo-linear
extra : subtree_revision : 0835e398d3db3ff28992d71ee648485033c3c94d
2017-04-06 20:07:48 -05:00
Hiroyuki Ikezoe 5b96d164fb servo: Merge #16147 - Update effect properties for animations (from hiikezoe:update-effect-properties); r=heycam
<!-- Please describe your changes on the following line: -->
This is a PR of https://bugzilla.mozilla.org/show_bug.cgi?id=1350754
---
<!-- 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 for stylo

<!-- 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: 1e2b36a97a9391e274d924227a8857024dbe4774

--HG--
extra : subtree_source : https%3A//hg.mozilla.org/projects/converted-servo-linear
extra : subtree_revision : 81f6907eb040b5727ba39aa14ab5cd1edf7871b8
2017-03-27 03:47:47 -07:00
Hiroyuki Ikezoe 030755351f servo: Merge #16145 - Animation only restyles (from hiikezoe:animation-only-restyles); r=heycam
<!-- Please describe your changes on the following line: -->
This is a PR of https://bugzilla.mozilla.org/show_bug.cgi?id=1344966

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

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

--HG--
extra : subtree_source : https%3A//hg.mozilla.org/projects/converted-servo-linear
extra : subtree_revision : 9f2e870cb55520ba6deee3ba63b6b673d48bca2e
2017-03-26 21:13:44 -07:00
Simon Sapin 33a9e6d050 servo: Merge #16014 - Per-process lock for CSSOM objects (from servo:style-ref); r=emilio
<!-- Please describe your changes on the following line: -->

Before this PR, every object reflected in CSSOM is in `Arc<RwLock<_>>` to enable safe (synchronized) mutable aliasing. Acquiring all these locks has significant cost during selector matching:

* https://bugzilla.mozilla.org/show_bug.cgi?id=1311469
* https://bugzilla.mozilla.org/show_bug.cgi?id=1335941
* https://bugzilla.mozilla.org/show_bug.cgi?id=1339703

This PR introduce a mechanism to protect many objects with the same `RwLock` that only needs to be acquired once.

In Stylo, there is one such lock per process (in a `lazy_static`), used for everything.

I non-Stylo Servo, I originally intended to have one such lock per document (for author-origin stylesheets, and one per process for user-agent and user sytlesheets since they’re shared across documents, and never mutated anyway). However I failed to have the same document-specific (or pipeline-specific) `Arc` reachable from both `Document` nodes and `LayoutThread`. Recursively following callers lead me to include this `Arc` in `UnprivilegedPipelineContent`, but that needs to be serializable. So there is a second process-wide lock.

This was previously #15998, closed accidentally.

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

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

--HG--
extra : subtree_source : https%3A//hg.mozilla.org/projects/converted-servo-linear
extra : subtree_revision : 851230e57ac8775707df5f0f103be5feac81fc41
2017-03-19 14:31:19 -07:00
Emilio Cobos Álvarez b11ee5a0ec servo: Merge #15931 - style: Kill SharedStyleContext::default_computed_values (from emilio:die-defaultvalues-die); r=mbrubeck
This is on top of https://github.com/servo/servo/pull/15928.

Now that cascade() gets a Device ref, we can use the default computed values
from there to avoid propagating that state all over the place.

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

--HG--
extra : subtree_source : https%3A//hg.mozilla.org/projects/converted-servo-linear
extra : subtree_revision : 4da0b4a162f5987954a443b93f411e461ef0187d
2017-03-13 16:50:26 -07:00
Emilio Cobos Álvarez c1ff312d84 servo: Merge #15913 - Use the proper viewport size for stylo (from emilio:viewport-size); r=heycam,hiro
Reviewed upstream at [bug 1303229](https://bugzil.la/1303229).

Source-Repo: https://github.com/servo/servo
Source-Revision: 06f99c13f233bad71a42affccb10c86295ff014b

--HG--
extra : subtree_source : https%3A//hg.mozilla.org/projects/converted-servo-linear
extra : subtree_revision : fd7d711c75bf2d5e217d186ad875e4d8e1602c3a
2017-03-11 04:40:31 -08: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
Hiroyuki Ikezoe 2505a45477 servo: Merge #15900 - Process css animations for gecko (from hiikezoe:process-css-animations); r=heycam
<!-- Please describe your changes on the following line: -->
This is a PR for https://bugzilla.mozilla.org/show_bug.cgi?id=1341985 .

---
<!-- 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 it's for stylo

<!-- 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: 63bed270734aee1956d1c1ec131aa1de9d5bb5a0

--HG--
extra : subtree_source : https%3A//hg.mozilla.org/projects/converted-servo-linear
extra : subtree_revision : 69544f0d05b3b246aaa3d206e46661e0bc18266f
2017-03-09 20:23:21 -08:00
Emilio Cobos Álvarez 133841fd02 servo: Merge #15805 - layout_thread: Also reposition elements when reflowing all nodes (from emilio:reposition); r=glennw
Source-Repo: https://github.com/servo/servo
Source-Revision: aeb7ab867f6d0d0df049329ebb55231c1e092805

--HG--
extra : subtree_source : https%3A//hg.mozilla.org/projects/converted-servo-linear
extra : subtree_revision : 6a948927d7a2f65447b2f8fd65477fb66b3d3f13
2017-03-02 18:46:40 -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
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
Boris Zbarsky d934174175 servo: Merge #14848 - Stop using global initial styles for stylo; the initial styles need to be per-document (from bzbarsky:initial-styles); r=bholley
<!-- 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. -->

Source-Repo: https://github.com/servo/servo
Source-Revision: 143dfc879e609603839502d61bc064fba96cc80f
2017-01-04 21:01:38 -08:00
Emilio Cobos Álvarez 121224a608 servo: Merge #14819 - Document most of the remaining parts of the style system, make docs-by-default for the whole style system (from emilio:no-missing-docs); r=Manishearth
Source-Repo: https://github.com/servo/servo
Source-Revision: 87847324a0815e2214fd34da89bbefa4222b1197
2017-01-02 04:10:56 -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
Julien Wajsberg 7b2299345c servo: Merge #14430 - Expose Quirks Mode information in the layout data and code (from julienw:access-quirks-mode-from-layout); r=emilio
<!-- Please describe your changes on the following line: -->
This patch exposes the Quirks (NoQuirks/LimitedQuirks/Quirks) state to the layout subsystem.

---
<!-- 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).
Prelimary work for issue #11704.

<!-- Either: -->
- [ ] There are tests for these changes OR
- [ ] These changes do not require tests because _____
(Waiting for guidance of where/which tests I could do here)

<!-- 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: 164426a7f90c90652d2d52c5a54be91154d26af7
2016-12-17 13:25:06 -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
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
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
Simon Sapin c839f3f401 servo: Merge #14294 - Rename a few source files (from servo:renames); r=Wafflespeanut
<!-- 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 _____

<!-- 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: 68b1d1d2860ac6c6e8c1c0dfe46af6790ca01dc8

--HG--
rename : servo/components/style/gecko/selector_impl.rs => servo/components/style/gecko/selector_parser.rs
rename : servo/components/style/selector_impl.rs => servo/components/style/selector_parser.rs
rename : servo/components/style/servo/selector_impl.rs => servo/components/style/servo/selector_parser.rs
rename : servo/components/style/selector_matching.rs => servo/components/style/stylist.rs
rename : servo/tests/unit/style/selector_matching.rs => servo/tests/unit/style/stylist.rs
2016-11-20 09:21:52 -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
Xidorn Quan c9dd8223d4 servo: Merge #14008 - Make style::context use parking_lot::RwLock (from upsuper:rwlock); r=SimonSapin
<!-- Please describe your changes on the following line: -->
The main motivation is to use `parking_lot::RwLock` instead of `sync::RwLock` in `style::context`, so that we can make `Stylesheet` be hold in a `parking_lot::RwLock` like other structs used for geckolib.

r? @SimonSapin

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

Source-Repo: https://github.com/servo/servo
Source-Revision: 1192aaa14d85f8be2f1ec6a1195755bc308f41ed
2016-11-01 18:26:20 -05:00
UK992 f8cb9971b7 servo: Merge #13205 - Tidy: Fix ordering use statements with braces (from UK992:tidy-sort); r=Wafflespeanut
This hack fixes https://github.com/servo/servo/issues/7412 and matches behavior with rustfmt.

Source-Repo: https://github.com/servo/servo
Source-Revision: 3117787fd2a8b7748cfde1e9b8c5be3c00f2c599
2016-09-08 22:19:19 -05:00
Emilio Cobos Álvarez 4853fe4b89 servo: Merge #12392 - style: Add support to test animations programatically (from emilio:test-animations); r=SimonSapin
<!-- 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 #12120

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

r? @SimonSapin for the style changes, @Ms2ger or @jdm for the dom and test changes

Source-Repo: https://github.com/servo/servo
Source-Revision: 14aeccc33ab44d706df86fbce67339218efe710c
2016-07-20 13:38:31 -05:00
Simon Sapin c710b104be servo: Merge #12515 - Make the style crate more concrete (from servo:concrete-style); r=bholley
Background:

The changes to Servo code to support Stylo began in the `selectors` crate with making pseudo-elements generic, defined be the user, so that different users (such as Servo and Gecko/Stylo) could have a different set of pseudo-elements supported and parsed. Adding a trait makes sense there since `selectors` is in its own repository and has others users (or at least [one](https://github.com/SimonSapin/kuchiki)).

Then we kind of kept going with the same pattern and added a bunch of traits in the `style` crate to make everything generic, allowing Servo and Gecko/Stylo to do things differently. But we’ve also added a `gecko` Cargo feature to do conditional compilation, at first to enable or disable some CSS properties and values in the Mako templates. Since we’re doing conditional compilation anyway, it’s often easier and simpler to do it more (with `#[cfg(feature = "gecko")]` and `#[cfg(feature = "servo")]`) that to keep adding traits and making everything generic. When a type is generic, any method that we want to call on it needs to be part of some trait.

----

The first several commits move some code around, mostly from `geckolib` to `style` (with `#[cfg(feature = "gecko")]`) but otherwise don’t change much.

The following commits remove some traits and many type parameters through the `style` crate, replacing them with pairs of conditionally-compiled API-compatible items (types, methods, …).

Simplifying code is nice to make it more maintainable, but this is motivated by another change described in https://github.com/servo/servo/pull/12391#issuecomment-232183942. (Porting Servo for that change proved difficult because some code in the `style` crate was becoming generic over `String` vs `Atom`, and this PR will help make that concrete. That change, in turn, is motivated by removing geckolib’s `[replace]` override for string-cache, in order to enable using a single Cargo "workspace" in this repository.)

r? @bholley

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

<!-- Either: -->
- [ ] There are tests for these changes OR
- [x] These changes do not require new 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. -->

Source-Repo: https://github.com/servo/servo
Source-Revision: 2d01d41a506bcbc7f26a2284b9f42390d6ef96ab

--HG--
rename : servo/ports/geckolib/selector_impl.rs => servo/components/style/gecko_selector_impl.rs
rename : servo/ports/geckolib/values.rs => servo/components/style/gecko_values.rs
rename : servo/ports/geckolib/properties.mako.rs => servo/components/style/properties/gecko.mako.rs
2016-07-20 02:58:34 -05: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