aboutsummaryrefslogtreecommitdiffstats
path: root/components/style/bloom.rs
Commit message (Collapse)AuthorAgeFilesLines
* Move Stylo to its own repo (#31350)Delan Azabani2024-02-271-401/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * Remove packages that were moved to external repo * Add workspace dependencies pointing to 2023-06-14 branch * Fix servo-tidy.toml errors * Update commit to include #31346 * Update commit to include servo/stylo#2 * Move css-properties.json lookup to target/doc/stylo * Remove dependency on vendored mako in favour of pypi dependency This also removes etc/ci/generate_workflow.py, which has been unused since at least 9e71bd6a7010d6e5723831696ae0ebe26b47682f. * Add temporary code to debug Windows test failures * Fix failures on Windows due to custom target dir * Update commit to include servo/stylo#3 * Fix license in tests/unit/style/build.rs * Document how to build with local Stylo in Cargo.toml
* Further changes required by ServoOriol Brufau2023-05-271-3/+3
|
* style: Add attributes to the rule hashEmilio Cobos Álvarez2023-05-261-8/+5
| | | | | | | | | | | | | | | | | | | See the discussion here: https://twitter.com/Rich_Harris/status/1433153204678799365 This should make attribute selectors roughly as fast as class selectors. I think it's worth trying and see if perf bots complain on micro-benchmarks and stylebench and such. I made attributes more specific than local names, but less specific than classes, which I think makes sense. When doing something like foo[data-bar], filtering by data-bar seems likely to yield less elements than filtering by foo. While at it, remove the bloom filter pref since we shipped it in bug 1704551 for 87 and we haven't heard complaints. Differential Revision: https://phabricator.services.mozilla.com/D124383
* Further changes required by ServoOriol Brufau2023-05-171-0/+2
|
* style: Add attribute names to the bloom filterOriol Brufau2023-05-161-0/+17
| | | | | | | | | | | | | Safari does this. This reduces the runtime in the example linked from comment 0 quite a lot (40ms on a local opt build, from ~130ms on a release nightly build). I added a pref because there's a slight chance of performance regressions on pages that do not use attribute selectors, as we're now doing more unconditional work per element (adding the attributes to the bloom filter). But the trade-off should be worth it, I think. Differential Revision: https://phabricator.services.mozilla.com/D111689
* style: Update smallvec to 1.0.Emilio Cobos Álvarez2019-12-161-3/+3
| | | | Differential Revision: https://phabricator.services.mozilla.com/D56044
* style: Shutdown Servo's thread-pool in leak-checking builds, leak the atom ↵Emilio Cobos Álvarez2019-09-121-4/+11
| | | | | | table elsewhere. Differential Revision: https://phabricator.services.mozilla.com/D44217
* Auto merge of #23532 - est31:unused_code_removal_4, r=emiliobors-servo2019-06-071-5/+0
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove unused code (4/4) <!-- Please describe your changes on the following line: --> Fourth and final PR in a series of PRs to remove unused/dead code from servo, powered by an (upcoming) tool of mine. Please take a look and tell me if you want to keep something. * First PR: #23477 * Second PR: #23498 * Third PR: #23499 Shortstat of the combined PR series: ``` 47 files changed, 7 insertions(+), 805 deletions(-) ``` --- <!-- 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 <!-- Either: --> - [ ] There are tests for these changes OR - [x] These changes do not require tests because they only remove dead code <!-- 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/23532) <!-- Reviewable:end -->
| * Remove unused code from selector and style cratesest312019-06-071-5/+0
| |
* | style: Add refcount logging to servo_arc.Emilio Cobos Álvarez2019-06-041-1/+1
|/ | | | Differential Revision: https://phabricator.services.mozilla.com/D32173
* style: fix some rust-nightly warnings about unused doc comments.Emilio Cobos Álvarez2019-03-271-1/+1
| | | | Differential Revision: https://phabricator.services.mozilla.com/D24287
* Upgrade to rustc 1.35.0-nightly (4c27fb19b 2019-03-25)Simon Sapin2019-03-261-5/+7
|
* Rustfmt has changed its default style :/Simon Sapin2018-12-281-1/+1
|
* Update MPL license to https (part 4)Jan Andre Ikenmeyer2018-11-191-1/+1
|
* `cargo fix --edition`Simon Sapin2018-11-101-1/+1
|
* Run rustfmt on selectors, servo_arc, and style.Bobby Holley2018-04-101-20/+25
| | | | | | | | | | This was generated with: ./mach cargo fmt --package selectors && ./mach cargo fmt --package servo_arc && ./mach cargo fmt --package style Using rustfmt 0.4.1-nightly (a4462d1 2018-03-26)
* style: Remove get_ prefix from get_state and get_id.Emilio Cobos Álvarez2018-02-241-1/+1
|
* selectors: Remove the get_ prefix from get_local_name and get_namespace.Emilio Cobos Álvarez2018-02-241-2/+2
|
* style: Use the ? operator for OptionMatt Brubeck2017-12-091-4/+2
|
* Un-inline some methods initializing thread_local! …Simon Sapin2017-09-121-0/+6
| | | | | | | … 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
* style: Minimal cleanup in bloom.rsEmilio Cobos Álvarez2017-09-091-3/+4
|
* style: Remove another stale todo.Emilio Cobos Álvarez2017-09-091-4/+0
| | | | This was fixed by me in 1e6999b02b3568d29e8397c84852a4a916644cf7.
* 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).
* Auto merge of #17701 - bholley:reuse_allocations, r=emiliobors-servo2017-07-141-4/+28
| | | | | | | | | | | 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 -->
* Revert "Auto merge of #17701 - bholley:reuse_allocations, r=emilio"Emilio Cobos Álvarez2017-07-131-28/+4
| | | | | | | | This reverts commit ebfc8f585834948f9b7564ffe382a6e266edf738, reversing changes made to 5585ff2c440dc27c8e98e834c9c0e9d956581b8e. Animation code can reenter and create a new TLS context from the traversal SequentialTask, so this won't work as written.
* Store the bloom filter in TLS and reuse it across traversals.Bobby Holley2017-07-121-4/+28
| | | | MozReview-Commit-ID: EbzDehr2Y2L
* Be smarter when clearing the bloom filter.Bobby Holley2017-06-211-1/+20
|
* Switch the bloom element list to a SmallVec and track pushed hashes.Bobby Holley2017-06-211-13/+48
|
* Push elements in order in StyleBloom::rebuilds.Bobby Holley2017-06-211-5/+7
| | | | | | | | | | | This is important because we're about to start storing a parallel list of pushed hashes, and the current behavior here will cause mismatches there. We take the opportunity to bump the SmallVec size to 16, since each entry is only a word and we really want to avoid heap-allocating. And then we switch to drain(), because of https://github.com/rust-lang/rust/issues/42763
* style: Distinguish between the tree structures used for traversal and ↵Cameron McCormack2017-06-091-9/+9
| | | | | | | | | | | | 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.
* Parent mismatch should not clear style sharing cache.Boris Zbarsky2017-06-051-0/+6
| | | | | | | | 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
* Fix the handling of the Bloom filter in the style sharing cache.Boris Zbarsky2017-06-051-1/+9
|
* style: Use a SmallVec for common ancestors in the bloom filter.Emilio Cobos Álvarez2017-05-211-5/+8
|
* style: Move some bloom filter code outside of matching.rsEmilio Cobos Álvarez2017-05-201-5/+34
| | | | Also simplify it, while we're at it.
* Do the sequential traversal breadth-first.Bobby Holley2017-04-091-16/+10
| | | | | | | | | | | | | While we're at it, we also eliminate the 'unknown' dom depth for the bloom filter. Computing depth has negligible cost relative to the amount of work we do setting up the bloom filter at a given depth. Doing it once per traversal should be totally fine. I originally separated the elimination of unknown dom depth from the traversal changes, but I got bloom filter crashes on the intermediate patch, presumably because I didn't properly fix the sequential traversal for this case. Given that the final state is green, I just decided to squash and move on.
* Bug 1336646 - Use the bloom filter for manual style resolves and pass a ↵Bobby Holley2017-02-081-3/+11
| | | | | | | | mutable StyleContext into match_element. r=emilio We need to do something here to avoid a double-borrow when passing a mutable StyleContext to match_element. After some discussion on IRC, we decided that building the bloom filter for this case is probably worthwhile.
* style: Document the bloom filter.Emilio Cobos Álvarez2016-12-311-8/+40
|
* Stop using UnsafeNode in the bloom filter.Bobby Holley2016-12-221-47/+24
|
* Hoist bloom filter into scoped TLS and simplify code.Bobby Holley2016-12-221-14/+3
|
* Allow the style bloom filter to recover from switch to a node with no common ↵Cameron McCormack2016-12-041-2/+16
| | | | ancestor with the old node.
* style: Don't pop too much in the bloom filter.Emilio Cobos Álvarez2016-12-021-1/+1
| | | | | | | | This is not a problem for Servo, because we recovered it without much problem a few lines below, and we never reached the pathological case where the filter has one element (the root), and we restyled another element with depth 1. Fixes bug 1321725.
* style: Introduce StyleBloomEmilio Cobos Álvarez2016-11-271-0/+235
The idea is this will fix the bad behavior of the bloom filter in parallel traversal.