aboutsummaryrefslogtreecommitdiffstats
path: root/components/style/selector_map.rs
Commit message (Collapse)AuthorAgeFilesLines
* style: Make the SelectorMap API slightly nicer.Emilio Cobos Álvarez2017-10-301-3/+3
|
* Revert "Diagnostic map semantics."Manish Goregaokar2017-10-231-42/+32
| | | | This reverts commit f5c5be00a7df984647364dfc84c0c9bc6d3e2f34.
* style: avoid selector refcount churn during invalidation.Emilio Cobos Álvarez2017-10-231-12/+15
| | | | Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
* style: Make MatchingContext generic over SelectorImpl.Emilio Cobos Álvarez2017-10-191-20/+26
| | | | | This will help Xidorn implement tree pseudos, and in general makes sense, allowing to put specific matching data in a selectors implementation.
* Replace all uses of the `heapsize` crate with `malloc_size_of`.Nicholas Nethercote2017-10-181-6/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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`.
* Removed pdqsort dependency and changed style create to use stdlib sort method.Savid Sharan2017-10-161-9/+1
|
* Diagnostic map semantics.Bobby Holley2017-10-071-32/+42
| | | | MozReview-Commit-ID: C0a5g6xMPY0
* Revert #18668 - Add mprotect diagnostics for HashMap crashBobby Holley2017-10-031-44/+5
|
* Semantics for ProtectedHashMap.Bobby Holley2017-09-281-5/+44
| | | | MozReview-Commit-ID: K0m65uZi7iw
* Overhaul MallocSizeOf and related things.Nicholas Nethercote2017-09-121-43/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* stylo: Add uses of fallible Vec, SmallVec and HashMap facilities.Julian Seward2017-09-101-10/+25
| | | | | Bug: 1395064 Reviewed-by: emilio
* style: remove selector_map::find_push.Emilio Cobos Álvarez2017-09-091-10/+4
| | | | | It has a single caller and is overly generic, which is going to make harder to add fallible allocations to it.
* Measure SmallVecs in SelectorMap and InvalidationMap.Nicholas Nethercote2017-09-061-5/+20
|
* Measure the stylist during memory reporting.Nicholas Nethercote2017-09-051-0/+29
|
* Tidy fixesManish Goregaokar2017-09-011-2/+2
|
* stylo: Replace all hashtable collections with ones from style::hashManish Goregaokar2017-08-311-6/+12
|
* stylo: Cleanup a bit of the Stylist clear setup.Emilio Cobos Álvarez2017-08-161-0/+9
| | | | | | | | | | 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>
* style: Avoid multiple selector walk-ups during SelectorMap insertion.Emilio Cobos Álvarez2017-08-161-89/+84
| | | | | MozReview-Commit-ID: 5b2X0GL2753 Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
* style: Rework how precomputed pseudo stuff works, to avoid malloc/free churn.Emilio Cobos Álvarez2017-08-081-23/+0
| | | | | | | 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>
* style: Remove outdated comments.Emilio Cobos Álvarez2017-08-071-8/+6
|
* style: Make PrecomputedHasher fail loudly and with error messages when used ↵Emilio Cobos Álvarez2017-08-071-5/+7
| | | | incorrectly.
* style: Avoid hashing the precomputed hash atoms already have.Emilio Cobos Álvarez2017-08-071-8/+43
| | | | | | | | | | | | This shaves a fair amount of time of stylist rebuild. Most of the extra remaining overhead are memory allocations... I'll try to get those sorted out next, though fixing that may overlap quite a bit with the work Cameron is doing in bug 1382925. MozReview-Commit-ID: 3j2SBY4QnKf Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
* Use a 1-entry smallvec in the selector maps.Bobby Holley2017-08-061-10/+17
| | | | MozReview-Commit-ID: 1JPkVxs3cdP
* style: Remove SelectorAndHashes.Emilio Cobos Álvarez2017-07-131-7/+1
|
* style: Remove hashes from style rules and dependencies.Emilio Cobos Álvarez2017-07-131-1/+1
| | | | | | 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.
* style: Remove unneeded bounds in SelectorMap and related code.Emilio Cobos Álvarez2017-07-131-10/+3
| | | | MozReview-Commit-ID: CWwdVCwWijn
* Account for left-to-right rather than right-to-left precedence of classes in ↵Bobby Holley2017-06-201-9/+8
| | | | | | selector maps. MozReview-Commit-ID: 8qIl4k3RxaC
* style: Implement a more fine-grained invalidation method.Emilio Cobos Álvarez2017-06-131-2/+12
| | | | | | | | | | | This commit also removes the old restyle_hints module and splits it into multiple modules under components/style/invalidation/element/. The basic approach is to walk down the tree using compound selectors as needed, in order to do as little selector-matching as possible. Bug: 1368240 MozReview-Commit-ID: 2YO8fKFygZI
* ID and class selectors are ASCII case-insensitive in quirks mode.Simon Sapin2017-06-121-65/+70
| | | | https://bugzilla.mozilla.org/show_bug.cgi?id=1363778
* Hoist ApplicableDeclaration{Block,List} into a separate file.Bobby Holley2017-06-121-1/+2
| | | | MozReview-Commit-ID: EXnAzfyoZ1e
* Use even fewer bits for source order and shrink ApplicableDeclarationsBlock ↵Bobby Holley2017-06-121-2/+2
| | | | | | by another word. MozReview-Commit-ID: 7B1i1g0HLTj
* Stop slicing selectors when noting dependencies, and match with an offset ↵Bobby Holley2017-06-051-15/+19
| | | | | | instead. MozReview-Commit-ID: KLqmdRKygO0
* Collapse Selector, SelectorInner, and ComplexSelector into a single Selector.Bobby Holley2017-06-051-2/+2
| | | | | | The refcounting is still internal. We'll fix that up next. MozReview-Commit-ID: CTxZNaR3Qgj
* Move the ancestor hashes out of Selector.Bobby Holley2017-06-051-11/+19
| | | | MozReview-Commit-ID: 5mipXnjgSED
* Allow style sharing for elements with ids as long as the ID is not being ↵Boris Zbarsky2017-06-051-0/+6
| | | | used for styling.
* style: Add a SelectorMapEntry trait.Emilio Cobos Álvarez2017-05-231-6/+18
|
* style: Move SelectorMap to its own submodule.Emilio Cobos Álvarez2017-05-231-0/+443