mirror of
https://github.com/servo/servo.git
synced 2025-08-05 21:50:18 +01:00
style: Add attributes to the rule hash
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
This commit is contained in:
parent
44e71dee2e
commit
017036dba8
5 changed files with 110 additions and 31 deletions
|
@ -1961,7 +1961,15 @@ impl CascadeData {
|
|||
state_dependencies: ElementState::empty(),
|
||||
document_state_dependencies: DocumentState::empty(),
|
||||
mapped_ids: PrecomputedHashSet::default(),
|
||||
selectors_for_cache_revalidation: SelectorMap::new(),
|
||||
// NOTE: We disable attribute bucketing for revalidation because we
|
||||
// rely on the buckets to match, but we don't want to just not share
|
||||
// style across elements with different attributes.
|
||||
//
|
||||
// An alternative to this would be to perform a style sharing check
|
||||
// like may_match_different_id_rules which would check that the
|
||||
// attribute buckets match on all scopes. But that seems
|
||||
// somewhat gnarly.
|
||||
selectors_for_cache_revalidation: SelectorMap::new_without_attribute_bucketing(),
|
||||
animations: Default::default(),
|
||||
extra_data: ExtraStyleData::default(),
|
||||
effective_media_query_results: EffectiveMediaQueryResults::new(),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue