Commit graph

95 commits

Author SHA1 Message Date
bors-servo
af077a7222 Auto merge of #18420 - servo:toml, r=nox,emilio
Get rustc commit hash from channel manifest

… added in https://github.com/rust-lang/rust/pull/44218, instead of using the GitHub API.

Also upgrade to rustc 1.22.0-nightly (d93036a04 2017-09-07).

<!-- 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/18420)
<!-- Reviewable:end -->
2017-09-12 05:01:24 -05:00
Simon Sapin
0d4168034f Un-inline some methods initializing thread_local! …
… in order to limit stack frame sizes after extra inlining from
https://github.com/rust-lang/rust/pull/43931

See https://github.com/servo/servo/pull/18420#issuecomment-328769322
2017-09-12 11:42:04 +02:00
Bobby Holley
8268217767 Avoid memmoving ValidationData more than necessary.
MozReview-Commit-ID: 70w3bZ2FU0W
2017-09-11 22:39:35 -07:00
Bobby Holley
74b4f95d71 Encapsulate the sharing cache backend better.
MozReview-Commit-ID: 2x9BIhmwH83
2017-09-11 22:39:34 -07:00
Bobby Holley
db67cd1759 Shorten the naming around the style sharing cache.
MozReview-Commit-ID: EcVQDLoxwFP
2017-09-11 22:39:31 -07:00
Matt Brubeck
21006fb752 Use SmallBitVec to replace BitVec 2017-09-11 06:33:43 -07:00
Hiroyuki Ikezoe
6ed7c69281 Don't cache style data if the element has running animations. 2017-08-23 09:51:27 +09:00
Bobby Holley
54c52910e4 Introduce a new flag and use it to be more permissive about cousin sharing.
MozReview-Commit-ID: BCJg0Ycsy6M
2017-08-05 01:07:02 -07:00
Michael Partheil
b07ebbae6b Replace all uses of the style::stylearc alias with servo_arc.
The alias is left there temporarilly and will be removed completely in a later commit where
also components/style/gecko/generated/structs_{debug|release}.rs are re-generated (they still
use the old alias).
2017-07-19 09:29:05 +02:00
Manish Goregaokar
8d7a368377 stylo: Don't ignore visited state when deciding to share style contexts 2017-07-18 12:40:01 -07:00
Hiroyuki Ikezoe
f91126ba86 Add has_current_styles_for_traversal().
In animation-only restyle, we just need to check the element
has animation restyle hints or has recascade self which is a result
of animation-only restyle for ancestors.
has_current_styles() in Servo_ResolveStyle() is intentionally left there,
it will be changed in a subsequent patch.
2017-07-18 19:13:50 +09:00
bors-servo
6597178b91
Auto merge of #17701 - bholley:reuse_allocations, r=emilio
reuse the bloom filter and style sharing cache across traversals

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

<!-- 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/17701)
<!-- Reviewable:end -->
2017-07-14 11:01:07 +02:00
bors-servo
1c85c55d02 Auto merge of #17713 - emilio:less-code-is-lovely, r=heycam
style: Kill some style sharing code.

It's trivial to do so after #17688.

<!-- 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/17713)
<!-- Reviewable:end -->
2017-07-14 00:25:37 -07:00
Emilio Cobos Álvarez
8667cea4ca
style: Don't stop looking at the sharing cache for various reasons.
All the information that made those failures expensive is now lazily computed
and cached, or eagerly computed anyway, so seems not worth to stop iteration.
2017-07-13 16:23:56 +02:00
Emilio Cobos Álvarez
62310d9bd5
style: Don't use the current element info for cached validation data.
We can take it straight from the validation target.
2017-07-13 15:36:59 +02:00
Emilio Cobos Álvarez
36310e3b66
style: Kill some style sharing code.
MozReview-Commit-ID: 42MyHx3QHuu
2017-07-13 15:32:20 +02:00
Emilio Cobos Álvarez
a34f288b98
Revert "Auto merge of #17701 - bholley:reuse_allocations, r=emilio"
This reverts commit ebfc8f5858, reversing
changes made to 5585ff2c44.

Animation code can reenter and create a new TLS context from the traversal
SequentialTask, so this won't work as written.
2017-07-13 09:58:08 +02:00
Bobby Holley
3bce0c7652 Stop using SendElement in StyleSharingCandiate.
MozReview-Commit-ID: AuNPDsq8bgk
2017-07-12 16:38:08 -07:00
Bobby Holley
ec6cca6d08 Reuse style sharing cache across traversals.
MozReview-Commit-ID: 9wCJtciqs6K
2017-07-12 16:38:07 -07:00
Emilio Cobos Álvarez
c6d5dbbb01
style: Rewrite restyling to split between resolving styles and handling changes.
MozReview-Commit-ID: 4BzjbLbFebF
2017-07-12 09:26:36 +02:00
J. Ryan Stinnett
2b5c56e6a8 Move match and cascade temporaries to CurrentElementInfo
Before this change, the `ComputedStyle` struct that is part of permanent style
data per element holds 2 `StrongRuleNode`s (unvisited and visited) and 2
`Arc<ComputedValues>` (unvisited and visited).

Both rule nodes and the visited values don't actually need to be here.  This
patch moves these 3 to new temporary storage in `CascadeInputs` on
`CurrentElementInfo` during the match and cascade process.  Rule nodes are
pushed down inside the `ComputedValues` for later access after the cascade.
(Visited values were already available there.)

The permanent style data per element now has just the `Arc<ComputedValues>` for
itself and eager pseudo-elements (plus the `RestyleHint`).

MozReview-Commit-ID: 3wq52ERMpdi
2017-06-22 15:47:32 -05:00
Emilio Cobos Álvarez
ffc45e9aaa
style: Inline RestyleData.
Bug: 1368236
MozReview-Commit-ID: 49s3SO0PMHf
2017-06-16 03:36:18 +02:00
Bobby Holley
a98fff1af8 Hoist ApplicableDeclaration{Block,List} into a separate file.
MozReview-Commit-ID: EXnAzfyoZ1e
2017-06-12 12:13:21 -07:00
Cameron McCormack
c533097e20 style: Distinguish between the tree structures used for traversal and selector matching.
This patch renames TNode::parent_element to traversal_parent, since it returns
the parent from the perspective of traversal (which in Gecko uses the
flattened tree).  It also renames TNode::children to traversal_children
for the saem reason.

We keep parent_element and children functions on TNode to use for selector
matching, which must be done on the real DOM tree structure.
2017-06-09 18:37:35 +08:00
bors-servo
310408a828 Auto merge of #17245 - bzbarsky:share-pseudo-styles, r=emilio
Share styles for elements with eager pseudo-elements attached to them

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

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

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

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

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/17245)
<!-- Reviewable:end -->
2017-06-08 15:25:10 -07:00
Boris Zbarsky
9110241360 Share styles for elements with eager pseudo-elements attached to them. 2017-06-08 15:34:30 -04:00
Boris Zbarsky
2f2b93c521 Increase the size of the style sharing cache to 31.
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.
2017-06-08 14:14:44 -04:00
Boris Zbarsky
537cf52707 Fix revalidation selectors when pseudo-elements are involved. 2017-06-08 01:19:50 -04:00
Boris Zbarsky
3d3ce51797 Back out https://github.com/servo/servo/pull/17198 for Gecko test failures 2017-06-07 15:57:48 -04:00
Boris Zbarsky
21eafaa9f8 Increase the size of the style sharing cache to 31.
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.
2017-06-06 22:34:46 -04:00
Boris Zbarsky
f9205440b5 Parent mismatch should not clear style sharing cache.
We can have cousins in the cache whose parent doesn't match ours, and other
cousins whose parent does.  When we encounter one of the former, that's not a
reason to stop lookin for the latter.

Fixes https://bugzilla.mozilla.org/show_bug.cgi?id=1369620
2017-06-05 16:31:58 -04:00
Boris Zbarsky
ad1309552d Allow style sharing for elements with ids as long as the ID is not being used for styling. 2017-06-05 13:32:03 -04:00
Boris Zbarsky
d031b5badb Add selectors with an id in them to the list of revalidation selectors. 2017-06-05 13:32:02 -04:00
Boris Zbarsky
98f95a32da Fix the handling of the Bloom filter in the style sharing cache. 2017-06-05 12:51:51 -04:00
Kenan Rhoton
8aeb512670 Adapt LRUCache to use ArrayDeque crate instead of VecDeque 2017-06-03 20:59:01 +02:00
J. Ryan Stinnett
56b44d2709 Pull decls from Gecko for link preshints
Based on a link's active state and the visited handling mode, pull in link,
vlink, and alink preshint declaration blocks from Gecko as needed.

MozReview-Commit-ID: A6udMYbzQnK
2017-06-02 14:34:39 -05:00
Bobby Holley
47404cfc4e Compare style attributes rather than rejecting them from the cache.
MozReview-Commit-ID: Jmu7Pie2mBP
2017-05-31 06:48:40 -07:00
Bobby Holley
f40c45fe1a Reduce the number of places where we need to enumerate ValidationData members.
MozReview-Commit-ID: 9m2ebknBFSE
2017-05-31 06:48:33 -07:00
Bobby Holley
6d8455a916 Sort the cached class list in ValidationInfo.
MozReview-Commit-ID: 3vsfP5ECzds
2017-05-31 06:48:27 -07:00
Emilio Cobos Álvarez
7db2776348
s/CachedStyleSharingData/ValidationData.
I still think CachedStyleSharingData should be the name, but not going to fight
over it.
2017-05-30 11:23:59 +02:00
Emilio Cobos Álvarez
10bd5636dc
style: Allow sharing style for elements with presentational hints. 2017-05-29 23:12:44 +02:00
Emilio Cobos Álvarez
03952a0c27
style: Also cache the class list in the CurrentElementInfo.
This patch also removes all notion of style sharing from matching.rs, which is
nice.
2017-05-29 22:54:17 +02:00
Emilio Cobos Álvarez
abcc9b301c
style: Add a CachedStyleSharingData to hold the candidate class list and revalidation results. 2017-05-29 21:56:21 +02:00
J. Ryan Stinnett
47c8574c54 Style sharing cache for visited
The style sharing cache stores the regular `ComputedValues`, so it would also
have the visited values as well for anything inserted into the cache (since they
are nested inside).  Unlike all other element states, a change in state of
unvisited vs. visited does not change the style system's output, since we have
already computed both possible outputs up front.

We change the element state checks when looking for style sharing cache hits to
ignore visitedness, since that's handled by the two separate sets of values.

MozReview-Commit-ID: Dt8uK8gSQSP
2017-05-24 18:08:09 -05:00
Emilio Cobos Álvarez
311c403522
style: Move all the style sharing code outside matching.rs
This is just a code health change. I want to move it away to keep matching.rs as
simple as possible.
2017-05-21 02:30:51 +02:00