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
Emilio Cobos Álvarez
fc77f1fe31
style: Avoid looping through every selector more than twice.
...
I've left the Invalidation stuff on its own since that's more complex, but I
think this may help a bit (perhaps not too much though) with the slow rebuild
times.
2017-08-03 00:32:52 +02:00
Boris Zbarsky
7161fff1b8
Add a Stylo API for reparenting a given style.
...
Servo side of part 4 of the fix for Gecko bug 1324619. r=emilio
2017-07-28 22:54:06 -04:00
Nazım Can Altınova
43cf493832
style: Implement parsing/serialization for @font-feature-values rule
2017-07-27 13:37:57 -07:00
Emilio Cobos Álvarez
b15fa2cd79
style: fix alignment in call to get_all_matching_rules.
2017-07-27 01:35:57 +02:00
Boris Zbarsky
048044f98b
Make it possible to construct StyleBuilder with two different inherited styles.
...
Part 3 of Gecko bug 1382806. r=emilio
2017-07-26 15:25:34 -04:00
Emilio Cobos Álvarez
f879ebcc99
selectors: Don't track class and id ancestor hashes in quirks mode.
...
It's incorrect to track classes and id selectors in a quirks-mode document,
since they should match case-insensitively.
Bug: 1382812
Reviewed-by: bholley
MozReview-Commit-ID: 4uvrfYsWb1v
2017-07-20 22:42:35 +02: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
Emilio Cobos Álvarez
655c842d2e
style: Cleanup most of the Inner mess.
...
MozReview-Commit-ID: Ieg2GJT0yUl
2017-07-18 17:34:57 +02:00
Manish Goregaokar
89930e7565
stylo: Switch Gecko over to ServoStyleContext
2017-07-17 18:03:23 -07:00
Manish Goregaokar
74519cc1a7
stylo: Make Servo Arc types use ptr to T instead of ptr to ArcInner<T>
2017-07-17 18:03:09 -07:00
Manish Goregaokar
808b1f509b
stylo: Use ComputedValuesInner instead of ComputedValues when we don't need it
2017-07-17 18:02:25 -07:00
Emilio Cobos Álvarez
dee4aea264
style: Remove hashes from style rules and dependencies.
...
Dependencies are very numerous, and now we shouldn't be getting so many of them.
Style rules just don't need them, so it's a waste of memory.
2017-07-13 05:44:53 +02:00
Emilio Cobos Álvarez
9394ea9644
style: Remove unneeded bounds in SelectorMap and related code.
...
MozReview-Commit-ID: CWwdVCwWijn
2017-07-13 03:34:33 +02:00
Emilio Cobos Álvarez
6d6c80e79b
style: Remove StyleRelations.
...
They're unused now. We can add them back if needed.
MozReview-Commit-ID: 92Y2Na0ZbVn
2017-07-12 09:26:55 +02: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
Emilio Cobos Álvarez
fcf85e4658
style: Make RuleTree::root return a reference instead of a strong pointer.
...
There's no reason it wasn't done before.
MozReview-Commit-ID: G0lMLWmfHbS
2017-07-12 08:39:41 +02:00
Josh Matthews
a08371e8eb
stylo: Create error reporters linked to documents (bug 1352669)
2017-07-10 20:46:08 -04:00
Gecko Backout
32269fa7cc
Backed out changeset fec394734f83 (bug 17624) for build bustage a=backout CLOSED TREE
...
Backs out https://github.com/servo/servo/pull/17624
2017-07-06 21:58:15 +00:00
Josh Matthews
dc2a500f4b
stylo: Create error reporters linked to documents (bug 1352669)
2017-07-06 14:05:52 -04:00
Emilio Cobos Álvarez
1263075776
stylo: Fix StyleSheetInner/Stylesheet mapping
...
The key of this patch is the split between Stylesheet and StylesheetContents.
Gecko will use StylesheetContents, which maps to a ServoStyleSheetInner.
2017-07-02 15:49:40 +02:00
Bobby Holley
6ade9c11ec
Allow StrongRuleNode drops after RuleTree destruction.
2017-06-30 23:35:40 -07:00
Boris Zbarsky
52d1b59515
Implement :visited handling for lazy pseudo-elements in stylo.
...
Part 2 of the fix for Gecko bug 1364242: https://bugzilla.mozilla.org/show_bug.cgi?id=1364242
2017-06-29 16:22:13 -07:00
Boris Zbarsky
351c7f7859
Change lazily_compute_pseudo_element_style to take an &Arc for the parent style.
...
This makes it easier to do later changes that want to pass an Arc here.
Part 1 of the fix for Gecko bug 1364242: https://bugzilla.mozilla.org/show_bug.cgi?id=1364242
2017-06-29 16:20:47 -07:00
Boris Zbarsky
746f245f32
Fix style computation for first-letter pseudo-elements with inline ancestors.
...
We should inherit from the inline, not its parent block.
Gecko bug 1324618 part 10 servo bits: https://bugzilla.mozilla.org/show_bug.cgi?id=1324618
2017-06-26 23:29:18 -07:00
bors-servo
6342a4b455
Auto merge of #17471 - aethanyc:fix-pseudo-element-matching-xbl, r=emilio
...
stylo: Fix pseudo element matching for rules in XBL stylesheets
This change was reviewed in https://bugzilla.mozilla.org/show_bug.cgi?id=1372876
<!-- 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/17471 )
<!-- Reviewable:end -->
2017-06-22 19:53:37 -07: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
Ting-Yu Lin
1795af5e57
stylo: Fix pseudo element matching for rules in XBL stylesheets (bug 1372876)
...
MozReview-Commit-ID: JeliK45G8MT
2017-06-22 22:37:51 +08:00
Bobby Holley
db8f59407f
Hoist sink into selectors.
...
It probably makes more sense (eventually) to put it in SmallVec.
MozReview-Commit-ID: AIBKCLiMNN2
2017-06-20 11:59:10 -07:00
Cameron McCormack
accd2752ce
style: Make checks for attribute/state dependencies take stylist dirty state into account.
...
This is a follow-up Servo-side change for https://bugzilla.mozilla.org/show_bug.cgi?id=1352306
which caused some test failures on landing.
2017-06-19 09:33:02 +08:00