aboutsummaryrefslogtreecommitdiffstats
path: root/components/style/rule_tree
Commit message (Collapse)AuthorAgeFilesLines
* Remove XBL as a separate cascading level in Stylo.Xidorn Quan2017-10-231-3/+0
| | | | | | | | | | | | | | | In Gecko, we handle XBL rules like author rules everywhere, except that XBL rules are added and sorted in an independent step, behave as if it has a separate level. It is not clear to me why Stylo chose to add a separate level for XBL rules, but it doesn't seem that there is anything special to do with XBL rules. This bug happens because we don't handle XBL important rules which are handled as part of author rules in Gecko due to lack of the additional level there. We should just follow what Gecko does here and handle them all the same.
* Add Servo_StyleSet_GetComputedValuesByAddingAnimation FFI.Boris Chiou2017-10-191-0/+19
| | | | | | Add an FFI to create a temporary ServoStyleContext with the animation value. We need this because we calculate the Cumulative change hints to check if we can ignore this animation segment.
* Replace all uses of the `heapsize` crate with `malloc_size_of`.Nicholas Nethercote2017-10-181-8/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Servo currently uses `heapsize`, but Stylo/Gecko use `malloc_size_of`. `malloc_size_of` is better -- it handles various cases that `heapsize` does not -- so this patch changes Servo to use `malloc_size_of`. This patch makes the following changes to the `malloc_size_of` crate. - Adds `MallocSizeOf` trait implementations for numerous types, some built-in (e.g. `VecDeque`), some external and Servo-only (e.g. `string_cache`). - Makes `enclosing_size_of_op` optional, because vanilla jemalloc doesn't support that operation. - For `HashSet`/`HashMap`, falls back to a computed estimate when `enclosing_size_of_op` isn't available. - Adds an extern "C" `malloc_size_of` function that does the actual heap measurement; this is based on the same functions from the `heapsize` crate. This patch makes the following changes elsewhere. - Converts all the uses of `heapsize` to instead use `malloc_size_of`. - Disables the "heapsize"/"heap_size" feature for the external crates that provide it. - Removes the `HeapSizeOf` implementation from `hashglobe`. - Adds `ignore` annotations to a few `Rc`/`Arc`, because `malloc_size_of` doesn't derive those types, unlike `heapsize`.
* Remove text-shadow handling from HasAuthorSpecifiedRulesXidorn Quan2017-10-121-29/+4
|
* Support pseudo-element properly in HasAuthorSpecifiedRules.Xidorn Quan2017-10-111-7/+16
|
* stylo: use FnvHashMap everywhere, remove default HashMap construction methodsManish Goregaokar2017-10-031-2/+2
|
* style: Add a TLS-based style struct caching mechanism.Emilio Cobos Álvarez2017-09-141-1/+1
|
* Make MallocSizeOf::malloc_{,enclosing_}size_of unsafe.Nicholas Nethercote2017-09-131-2/+2
| | | | This fixes #18473.
* Overhaul MallocSizeOf and related things.Nicholas Nethercote2017-09-121-6/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | This patch makes the MallocSizeOf stuff in Stylo work more like the HeapSizeOf stuff already in Servo, except better. In particular, it adds deriving support for MallocSizeOf, which will make it easier to improve coverage. The patch does the following. - Combines servo/components/style/stylesheets/memory.rs and the heapsize crate into a new crate, malloc_size_of. - Forks the heapsize_derive crate, calling it malloc_size_of, so that MallocSizeOf can be derived. - Both the new crates have MIT/Apache licenses, like heapsize, in case they are incorporated into heapsize in the future. - Renames the methods within MallocSizeOf and the related traits so they are more concise. - Removes MallocSizeOfWithGuard. - Adds `derive(MallocSizeOf)` to a lot of types, in some cases replacing an equivalent or almost-equivalent hand-written implementation. - Adds stuff so that Rc/Arc can be handled properly.
* Use SmallBitVec for important flags in PDBMatt Brubeck2017-09-111-6/+5
|
* Measure the stylist during memory reporting.Nicholas Nethercote2017-09-051-1/+1
|
* Auto merge of #18334 - Manishearth:hashglobe, r=emilio,Gankrobors-servo2017-09-011-1/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | 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 -->
| * stylo: Replace all hashtable collections with ones from style::hashManish Goregaokar2017-08-311-1/+1
| |
* | Auto merge of #18337 - ↵bors-servo2017-09-011-15/+22
|\ \ | |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 -->
| * Bug 1391198 - Make the order of rules in DevTools be the specificity order.KuoE02017-09-011-15/+22
| | | | | | | | | | | | | | | | 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
* | Measure memory usage of Stylo's Rule Tree.Nicholas Nethercote2017-08-301-1/+15
|/
* order derivable traits listsClément DAVID2017-08-231-2/+2
| | | | | | Ignoring : - **generated**.rs - python/tidy/servo_tidy_tests/rust_tidy.rs
* Make emtpy rule can be inserted into rule treeKuoE02017-08-161-1/+4
|
* Include logical properties in has_author_specified_rulesManish Goregaokar2017-08-091-0/+22
|
* Remove testing feature from style crateManish Goregaokar2017-08-071-5/+4
|
* Make replace_rules_internal return true only if important rules changed.Hiroyuki Ikezoe2017-08-031-1/+5
|
* Replace all uses of the style::stylearc alias with servo_arc.Michael Partheil2017-07-191-1/+1
| | | | | | 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).
* stylo: Make Servo Arc types use ptr to T instead of ptr to ArcInner<T>Manish Goregaokar2017-07-171-5/+5
|
* style: Make RuleTree::root return a reference instead of a strong pointer.Emilio Cobos Álvarez2017-07-121-12/+14
| | | | | | There's no reason it wasn't done before. MozReview-Commit-ID: G0lMLWmfHbS
* style: Undo the optimization for grabbing animation rules from the style data.Emilio Cobos Álvarez2017-07-121-27/+1
| | | | | | | | 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
* Use GC machinery rather than recursion for post-rule-tree-teardown node ↵Bobby Holley2017-07-041-6/+34
| | | | | | dropping. MozReview-Commit-ID: BPC6u4sBNPR
* Allow StrongRuleNode drops after RuleTree destruction.Bobby Holley2017-06-301-6/+34
|
* Use a different sentinel value to lock the free list.Bobby Holley2017-06-301-3/+7
| | | | | We're going to use null to indicate that the final GC has already occurred.
* Hook into the Gecko leak checking machinery.Bobby Holley2017-06-301-0/+50
| | | | | | 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.
* Stop GCing before dropping the root rule node.Bobby Holley2017-06-301-4/+2
| | | | We already gc before dropping the RuleTree.
* Move match and cascade temporaries to CurrentElementInfoJ. Ryan Stinnett2017-06-221-1/+1
| | | | | | | | | | | | | | | | | 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
* style: Don't use SmallVec::into_iter to move into another vector.Emilio Cobos Álvarez2017-06-211-7/+10
| | | | See bug 1374848 for why.
* stylo: Fix has_author_specified_rules() for rules in XBL stylesheets (bug ↵Ting-Yu Lin2017-06-201-2/+2
| | | | | | 1372062) MozReview-Commit-ID: GBFgr5pqROk
* Remove Option wrapper from RuleNode's StyleSource to save one word, addBrian Lewis2017-06-191-26/+39
| | | | | a None variant to StyleSource as an indicator for a lack of style source, and refactor all uses with this new form
* Assert against permanently-leaked rule nodes.Bobby Holley2017-06-161-0/+5
| | | | MozReview-Commit-ID: CK5iEWWHFSr
* Reuse the prev_sibling slot for free_count to save a word.Bobby Holley2017-06-161-20/+45
| | | | MozReview-Commit-ID: 9jVkDM4P8mC
* Actually increment the counter when adding rule nodes to the free list.Bobby Holley2017-06-161-0/+5
| | | | MozReview-Commit-ID: 1uipYlIF8fv
* style: Less refcount churn while inserting in the rule tree.Emilio Cobos Álvarez2017-06-131-30/+40
| | | | | | 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>
* Hoist ApplicableDeclaration{Block,List} into a separate file.Bobby Holley2017-06-121-2/+2
| | | | MozReview-Commit-ID: EXnAzfyoZ1e
* Use even fewer bits for source order and shrink ApplicableDeclarationsBlock ↵Bobby Holley2017-06-121-1/+10
| | | | | | by another word. MozReview-Commit-ID: 7B1i1g0HLTj
* Auto merge of #17221 - aethanyc:support-xbl-stylesheet, r=heycambors-servo2017-06-081-1/+4
|\ | | | | | | | | | | | | | | | | | | | | 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 -->
| * stylo: Get rules from Gecko XBL stylesheets in cascading (Bug 1290276)Ting-Yu Lin2017-06-081-1/+4
| |
* | Merge CSSColor into Color.Xidorn Quan2017-06-081-2/+1
|/
* Use NonZeroPtrMut for {Strong,Weak}RuleNode.Bobby Holley2017-06-061-35/+33
| | | | MozReview-Commit-ID: Da4Ds7SIcCD
* style: Allow StyleSource to be compared.Emilio Cobos Álvarez2017-05-291-0/+6
|
* Fix calculation of base styles to drop animation rulesBrian Birtles2017-05-261-1/+1
| | | | | | It seems that changeset 97ce9ed5b08f7b1c7c6cd71a9499068b8bd2ae4e mistakenly changed the check that a cascade level to keep is *not* an animation level to a check that it *is* an animation level.
* Match and cascade visited stylesJ. Ryan Stinnett2017-05-241-0/+15
| | | | | | | | | | | | | | | 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
* Rollup merge of #17014 - hiikezoe:animation-rules-in-norma-restyle, ↵Manish Goregaokar2017-05-241-1/+51
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 -->
| * Use animation values that have been processed during animation-only restyle ↵Hiroyuki Ikezoe2017-05-241-1/+27
| | | | | | | | for normal restyle.
| * Use SMIL override value that has been processed during animation-only ↵Hiroyuki Ikezoe2017-05-241-0/+24
| | | | | | | | | | | | | | | | 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.