Commit graph

76 commits

Author SHA1 Message Date
Matt Brubeck
a5a0e9ffe8 Use SmallBitVec for important flags in PDB 2017-09-11 06:53:05 -07:00
Nicholas Nethercote
d880efcab3
Measure the stylist during memory reporting. 2017-09-05 19:43:50 +02:00
bors-servo
ac7cf53692 Auto merge of #18334 - Manishearth:hashglobe, r=emilio,Gankro
Add fallible hashmaps from HashGlobe for stylo

HashGlobe code is r=emilio,Gankro

integration code is r=emilio from https://bugzilla.mozilla.org/show_bug.cgi?id=1393656

<!-- 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/18334)
<!-- Reviewable:end -->
2017-09-01 16:09:53 -05:00
bors-servo
af52f5394a Auto merge of #18337 - kuoe0:make-the-order-of-rules-in-DevTools-be-the-specificity-order, r=emilio
Make the order of rules in DevTools be the specificity order.

We insert rules with any important declaration into rule tree twice,
one for the normal level and another for the important level. And
when we fetch them from rule tree, we skip the important one to
make the order be the specificity order.

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

<!-- Either: -->
- [ ] There are tests for these changes OR
- [X] These changes do not require tests because test cases already in gecko

<!-- 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/18337)
<!-- Reviewable:end -->
2017-09-01 04:15:21 -05:00
KuoE0
1bacd01a78 Bug 1391198 - Make the order of rules in DevTools be the specificity order.
We insert rules with any important declaration into rule tree twice,
one for normal level and another for important level. And when we fetch
them from rule tree, we skip the important one to make the order be

MozReview-Commit-ID: HewZG6jYVvv
2017-09-01 10:59:57 +08:00
Manish Goregaokar
5cd296a264
stylo: Replace all hashtable collections with ones from style::hash 2017-08-31 16:28:30 -07:00
Nicholas Nethercote
e08829703a Measure memory usage of Stylo's Rule Tree. 2017-08-30 21:46:15 +10: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
KuoE0
a6ceafe3da Make emtpy rule can be inserted into rule tree 2017-08-16 11:08:49 +08:00
Manish Goregaokar
6dac81c34c Include logical properties in has_author_specified_rules 2017-08-09 22:00:11 -07:00
Manish Goregaokar
2ebce54d75 Remove testing feature from style crate 2017-08-07 14:30:31 -07:00
Hiroyuki Ikezoe
07421a8e9c Make replace_rules_internal return true only if important rules changed. 2017-08-03 07:18:32 +09: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
74519cc1a7 stylo: Make Servo Arc types use ptr to T instead of ptr to ArcInner<T> 2017-07-17 18:03:09 -07: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
Emilio Cobos Álvarez
cc94a8b7cb
style: Undo the optimization for grabbing animation rules from the style data.
This is unfortunate, but for now it complicates things, I would like not needing
a ElementData to get the style of an Element in order to fix all the
getDefaultComputedStyle bugs.

MozReview-Commit-ID: LZvsdFEqrDE
2017-07-12 08:39:35 +02:00
Bobby Holley
c742ed31da Use GC machinery rather than recursion for post-rule-tree-teardown node dropping.
MozReview-Commit-ID: BPC6u4sBNPR
2017-07-04 13:43:41 -07:00
Bobby Holley
6ade9c11ec Allow StrongRuleNode drops after RuleTree destruction. 2017-06-30 23:35:40 -07:00
Bobby Holley
67cd974636 Use a different sentinel value to lock the free list.
We're going to use null to indicate that the final GC has already
occurred.
2017-06-30 23:35:32 -07:00
Bobby Holley
654661df36 Hook into the Gecko leak checking machinery.
Since we're going to stop asserting that all RuleNodes have been
destroyed by the time the RuleTree is destroyed, we want reliable leak
checking.
2017-06-30 23:35:22 -07:00
Bobby Holley
31b1233a73 Stop GCing before dropping the root rule node.
We already gc before dropping the RuleTree.
2017-06-30 23:35:14 -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
Emilio Cobos Álvarez
1572bd0948
style: Don't use SmallVec::into_iter to move into another vector.
See bug 1374848 for why.
2017-06-21 01:39:15 +02:00
Ting-Yu Lin
945c3e4a2b stylo: Fix has_author_specified_rules() for rules in XBL stylesheets (bug 1372062)
MozReview-Commit-ID: GBFgr5pqROk
2017-06-20 15:58:00 +08:00
Brian Lewis
0fe381d774 Remove Option wrapper from RuleNode's StyleSource to save one word, add
a None variant to StyleSource as an indicator for a lack of style
source, and refactor all uses with this new form
2017-06-19 21:50:56 +02:00
Bobby Holley
ea81f36b1d Assert against permanently-leaked rule nodes.
MozReview-Commit-ID: CK5iEWWHFSr
2017-06-16 14:12:09 -07:00
Bobby Holley
e93b7fb3e8 Reuse the prev_sibling slot for free_count to save a word.
MozReview-Commit-ID: 9jVkDM4P8mC
2017-06-16 14:11:58 -07:00
Bobby Holley
65fc5a9bd5 Actually increment the counter when adding rule nodes to the free list.
MozReview-Commit-ID: 1uipYlIF8fv
2017-06-16 14:11:53 -07:00
Emilio Cobos Álvarez
46d4128d1f
style: Less refcount churn while inserting in the rule tree.
There's no need for it since we know no GC is happening while we're doing it.

Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
2017-06-13 22:00:22 +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
Bobby Holley
0caad2ffdc Use even fewer bits for source order and shrink ApplicableDeclarationsBlock by another word.
MozReview-Commit-ID: 7B1i1g0HLTj
2017-06-12 12:13:16 -07:00
bors-servo
433b7bf9fa Auto merge of #17221 - aethanyc:support-xbl-stylesheet, r=heycam
stylo: Get rules from Gecko XBL stylesheets in cascading (Bug 1290276)

The change was reviewed in https://bugzilla.mozilla.org/show_bug.cgi?id=1290276

<!-- 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/17221)
<!-- Reviewable:end -->
2017-06-08 00:19:27 -07:00
Ting-Yu Lin
2411749fcf stylo: Get rules from Gecko XBL stylesheets in cascading (Bug 1290276) 2017-06-08 11:18:44 +08:00
Xidorn Quan
7568a19688 Merge CSSColor into Color. 2017-06-08 12:59:22 +10:00
Bobby Holley
b3a61b7a1c Use NonZeroPtrMut for {Strong,Weak}RuleNode.
MozReview-Commit-ID: Da4Ds7SIcCD
2017-06-06 21:38:52 -07:00
Emilio Cobos Álvarez
3ebd48039e
style: Allow StyleSource to be compared. 2017-05-29 21:31:04 +02:00
Brian Birtles
4deab0f06a Fix calculation of base styles to drop animation rules
It seems that changeset 97ce9ed5b0
mistakenly changed the check that a cascade level to keep is *not* an
animation level to a check that it *is* an animation level.
2017-05-26 13:53:23 +09:00
J. Ryan Stinnett
a7882cfeb9 Match and cascade visited styles
To support visited styles, we match and cascade a separate set of styles any
time we notice that an element has a relevant link.

The visited rules and values are held in `ComputedStyle` alongside the
regular rules and values, which simplifies supporting various APIs like
`cascade_primary_and_pseudos` which expect easy access to previously matched
rules.

To simplify passing the additional values around, an additional reference to the
visited `ComputedValues` is placed inside the regular `ComputedValues`.

MozReview-Commit-ID: 2ebbjcfkfWf
2017-05-24 18:07:44 -05:00
Manish Goregaokar
a19dd8142e Rollup merge of #17014 - hiikezoe:animation-rules-in-norma-restyle, r=emilio,birtles
Animation rules in norma restyle

<!-- Please describe your changes on the following line: -->

This is a PR for https://bugzilla.mozilla.org/show_bug.cgi?id=1366631 and https://bugzilla.mozilla.org/show_bug.cgi?id=1367225

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

<!-- 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/17014)
<!-- Reviewable:end -->
2017-05-24 11:59:28 -07:00
Hiroyuki Ikezoe
4935d972e5 Use animation values that have been processed during animation-only restyle for normal restyle. 2017-05-24 11:11:57 +09:00
Hiroyuki Ikezoe
d30c4fe79d Use SMIL override value that has been processed during animation-only restyles for normal restyle.
In the case where we process an element which has SMIL animations in normal travesal
the SMIL styles must have been computed in animation-only restyles. So we
have only to pick the computed styles instead of recomputing it.
2017-05-24 11:11:26 +09:00
Emilio Cobos Álvarez
99e5bb7a48
style: Rewrap some comments to be consistent with the rest of the file. 2017-05-21 03:06:40 +02:00
Emilio Cobos Álvarez
50c022f91a
style: Prefer is_null to comparison with ptr::null_mut. 2017-05-21 03:06:39 +02:00
Emilio Cobos Álvarez
cf6b3a0fcb
style: Simplify the rule tree GC code a bit. 2017-05-21 03:06:37 +02:00
Emilio Cobos Álvarez
e448c4a27e
style: Fix whitespace issue in the rule tree code. 2017-05-21 03:02:53 +02:00
Boris Chiou
60e7a89d57 Add Servo_GetProperties_Overriding_Animation.
We add one FFI, Servo_GetProperties_Overriding_Animation, which calls
StrongRuleNode::get_properties_overriding_animations() to get a LonghandIdSet,
which may override animation properties running on compositor.
2017-05-20 14:29:47 +08:00
Emilio Cobos Álvarez
737c7f1f63
Bug 1364412: Simplify Servo_HasAuthorSpecifiedRules looking at the pseudo style. r=bholley
MozReview-Commit-ID: HpV92ttZGJz
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
2017-05-16 02:49:34 +02:00
Bobby Holley
e9d4110ad4 Handle importance when inserting into the rule tree. 2017-05-11 17:37:17 +02:00
Matt Brubeck
32d37795a2 Bug 1349651 - stylo: Implement HasAuthorSpecifiedRules. 2017-05-09 10:01:46 -07:00
Bobby Holley
d78ca4c4f9 Use StyleArc in the style system.
MozReview-Commit-ID: flF0fv9E9M
2017-05-02 17:35:44 -07:00