Commit graph

258 commits

Author SHA1 Message Date
bors-servo
473934c989 Auto merge of #18268 - emilio:dirty-viewport-followup, r=SimonSapin
style: Recascade the document instead of using the dirty_on_viewport_size_change bit

This allows us to simplify a lot of code.

On top of #18267.

<!-- 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/18268)
<!-- Reviewable:end -->
2017-08-29 14:18:58 -05:00
Emilio Cobos Álvarez
f28a62ccf3
style: Box the PerPseudo<SelectorMap>, so we don't waste a lot of space.
MozReview-Commit-ID: JmVqI6zNHql
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
2017-08-29 14:23:57 +02:00
Emilio Cobos Álvarez
2291ce4767
style: Remove CascadeInfo. 2017-08-28 14:40:47 +02:00
bors-servo
dc8f26432f Auto merge of #18241 - canaltinova:font-feature-values-lookup, r=emilio,xidorn
stylo: Implement font feature values lookup

This PR reviewed by emilio and xidorn on bugzilla. That is backed out because of Windows build problems. Fixed and landing it again.

---
<!-- 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 [Bug 1355721](https://bugzilla.mozilla.org/show_bug.cgi?id=1355721)

<!-- 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/18241)
<!-- Reviewable:end -->
2017-08-25 15:45:03 -05:00
Nazım Can Altınova
81be90cce2 Implement font feature values lookup for stylo 2017-08-25 12:03:38 -07:00
Emilio Cobos Álvarez
5cd10b9eb7
style: Use consistent indentation in the stylist code. 2017-08-25 13:34:57 +02:00
bors-servo
69e28f0709 Auto merge of #18225 - jdm:unused-visitor-argument, r=emilio
Remove unused selector visitor argument.

The real win here is avoiding cloning the iterator when nobody actually uses it.

---
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] There are tests for these changes

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/18225)
<!-- Reviewable:end -->
2017-08-25 01:10:03 -05:00
Gecko Backout
12b02ce9d5 Backed out changeset 01348a3860f7 for build bustage
CLOSED TREE

Backs out https://github.com/servo/servo/pull/18222
2017-08-25 03:45:31 +00:00
Josh Matthews
ffa9dd1c7c Remove unused selector visitor argument. 2017-08-24 18:17:25 -07:00
Nazım Can Altınova
6d7a1903b8 Implement font feature values lookup for stylo 2017-08-24 12:41:36 -07:00
Clément DAVID
c5fe235112 order derivable traits lists
Ignoring :
 - **generated**.rs
 - python/tidy/servo_tidy_tests/rust_tidy.rs
2017-08-23 21:38:44 +02:00
Emilio Cobos Álvarez
3fd8a534d7
style: Rename SheetRebuildKind::rebuild_invalidation to should_rebuild_invalidation.
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
2017-08-23 14:10:45 +02:00
Emilio Cobos Álvarez
e648dd7822
style: Mention that it's worth to split CascadeData to make clearing clearer.
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
2017-08-23 14:10:44 +02:00
Emilio Cobos Álvarez
570da3b512
style: Assert that only servo passes in UA sheets explicitly.
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
2017-08-23 14:10:44 +02:00
Emilio Cobos Álvarez
bf45a20760
style: Implement finer-grained stylist rebuilds.
MozReview-Commit-ID: ALsH9kSqHb0
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
2017-08-23 11:06:42 +02:00
Emilio Cobos Álvarez
15594dda10
style: Add a StylesheetFlusher abstraction to enable more incremental rebuilds.
MozReview-Commit-ID: 8RBUUErm4bm
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
2017-08-23 09:30:46 +02:00
Emilio Cobos Álvarez
a98fd5e2b6
style: Make the StyleSheetSet::flush API slightly nicer.
MozReview-Commit-ID: LfJxZA9zhaE
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
2017-08-23 09:24:50 +02:00
Bobby Holley
d4aa8e3cef Track the restyle root and use it to do less work during the traversal.
MozReview-Commit-ID: A8O3JOpsv4E
2017-08-22 19:34:46 -07:00
Emilio Cobos Álvarez
c73ec5e649
style: Avoid blanket Sync for GeckoStyleSheet, use a more isolated wrapper. 2017-08-22 16:55:55 +02:00
Emilio Cobos Álvarez
cbf388a5fd
style: Move the StyleSheetSet into the Stylist.
This will allow tracking whether there have been only additions to the
stylesheet set, and in that case don't destroy and completely rebuild the
invalidation map.
2017-08-22 16:55:52 +02:00
Emilio Cobos Álvarez
85996826ab
style: Remove Stylist::is_device_dirty.
More progress on unifying how Gecko and Servo track stylist dirtiness.
2017-08-21 17:58:43 +02:00
Emilio Cobos Álvarez
d1725b1f19
style: Replicate the list of stylesheets on the layout thread.
This is a patch that unifies a bit how Gecko and Stylo stylesheets work, in
order to be able to eventually move the stylesheets into the stylist, and be
able to incrementally update the invalidation map.
2017-08-18 14:31:35 +02:00
Emilio Cobos Álvarez
4c80cccbd2
stylo: Cleanup a bit of the Stylist clear setup.
This moves us to clear on rebuild, which allows us to remove yet another place
where we track stylist dirtiness.

Bug: 1390255
Reviewed-by: heycam
MozReview-Commit-ID: nihQbUAbh8
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
2017-08-16 08:49:41 +02:00
Emilio Cobos Álvarez
fd3d38326c
stylo: only clear relevant origins when medium features change.
Bug: 1389871
Reviewed-by: heycam
MozReview-Commit-ID: 6ocZc1u1TbU
2017-08-14 12:46:43 +02:00
Cameron McCormack
f3a7adfcc7 style: Add ability to clear and rebuild individual origins. 2017-08-13 18:51:03 +08:00
Cameron McCormack
72107eb838 style: Move cleared state into per-origin data. 2017-08-13 18:51:02 +08:00
Cameron McCormack
57ee17d6d9 style: Move rule source order counter into per-origin data. 2017-08-13 18:51:01 +08:00
Cameron McCormack
db6a09f24f style: Move cached media query results into per-origin data. 2017-08-13 18:50:59 +08:00
Cameron McCormack
321643ae61 style: Factor out per-origin data storage.
Also add an iter_mut_origins() function.
2017-08-13 18:50:57 +08:00
Cameron McCormack
57622004ce style: Split collected @font-face / @counter-style rules per origin. 2017-08-11 13:39:49 +08:00
Cameron McCormack
6cbe55206b style: Move selector/declaration counts into PerOriginCascadeData. 2017-08-09 19:27:56 +08:00
Cameron McCormack
cd5b2c9fbe style: Move revalidation selectors into PerOriginCascadeData. 2017-08-09 19:27:55 +08:00
Cameron McCormack
30de56f208 style: Move attribute and state dependencies into PerOriginCascadeData. 2017-08-09 19:27:54 +08:00
Cameron McCormack
16937ba7cd style: Move invalidation map into PerOriginCascadeData. 2017-08-09 19:27:53 +08:00
Cameron McCormack
77c4a42e5d style: Move animations table into PerOriginCascadeData. 2017-08-09 19:27:52 +08:00
Cameron McCormack
781e755f9a style: Use non-counting Bloom filters in Stylist where appropriate. 2017-08-09 19:27:51 +08:00
Cameron McCormack
68268226ea style: Tweak Stylist API for getting animations to avoid exposing the hash table. 2017-08-09 16:24:49 +08:00
Cameron McCormack
6bdb0abebf style: Make CascadeDataIter iterate from highest to lowest level. 2017-08-09 16:24:47 +08:00
Emilio Cobos Álvarez
de58c088b1
style: Avoid hashing hashes.
These are the last instances I can find of us hashing the atoms hash.
2017-08-08 17:06:11 +02:00
Emilio Cobos Álvarez
faa8646e0f
style: Use an enumerated array for per-pseudo maps.
This avoids random HashMaps.

MozReview-Commit-ID: LQeZrLsoOnl
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
2017-08-08 12:40:31 +02:00
Emilio Cobos Álvarez
121e2d5837
style: Move precomputed pseudo handling to its own match arm. 2017-08-08 10:30:44 +02:00
Emilio Cobos Álvarez
64a96ce21c
style: Rework how precomputed pseudo stuff works, to avoid malloc/free churn.
This showed up in a few profiles, and was an easy improvement.

MozReview-Commit-ID: HVqATaSB2Ak
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
2017-08-08 10:28:02 +02:00
Emilio Cobos Álvarez
c3501084f0
style: Don't pre-fill eager pseudo-maps.
This was needed long time ago for Servo's layout. But I don't think there's any
reason for doing this now.
2017-08-07 16:30:06 +02:00
Emilio Cobos Álvarez
7ee4b3f881
style: Avoid branching on the origin for each selector when inserting in the cascade data.
This is on top of #17990, and it's intended to help with bug 1386045.
2017-08-07 12:15:18 +02:00
Cameron McCormack
39f2034015 style: Invert storage of selector maps to key off origin first. 2017-08-07 16:34:28 +08:00
Emilio Cobos Álvarez
f74675639d
style: Less ID revalidation selectors.
Avoid adding id selectors that are in the rule hash keyed by that ID to the list
of revalidation selectors.

This partially fixes bug 1369611 (we could look at the rule hash itself to avoid
inserting some more into the list of revalidation selectors).
2017-08-06 13:13:07 +02:00
bors-servo
c18cac1f34 Auto merge of #17958 - aethanyc:pseudo-classes-chrome-privilege-bug1381851, r=heycam
Pseudo classes chrome privilege (bug 1381851)

This is reviewed in https://bugzilla.mozilla.org/show_bug.cgi?id=1381851

<!-- 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/17958)
<!-- Reviewable:end -->
2017-08-03 06:56:01 -05:00
bors-servo
27d1fbe7ea Auto merge of #17952 - bholley:drain_smallvec, r=emilio
Use drain() over IntoIter on a few SmallVecs

This is all the ones I could find in style/ and selectors/.

See https://bugzilla.mozilla.org/show_bug.cgi?id=1374848

<!-- 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/17952)
<!-- Reviewable:end -->
2017-08-03 03:46:02 -05:00
Ting-Yu Lin
7b28e86501 style: Update comments for push_applicable_declarations_as_xbl_only_stylist()
MozReview-Commit-ID: 4ohpfiYgjxl
2017-08-03 16:30:13 +08:00
Bobby Holley
5a421d7c5f Use drain() over IntoIter on a few SmallVecs.
This is all the ones I could find in style/ and selectors/.
2017-08-02 15:42:57 -07:00