mirror of
https://github.com/servo/servo.git
synced 2025-08-04 13:10:20 +01:00
style: Remove hashes from style rules and dependencies.
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.
This commit is contained in:
parent
9394ea9644
commit
dee4aea264
8 changed files with 61 additions and 84 deletions
|
@ -164,10 +164,10 @@ pub fn matches_selector_list<E>(selector_list: &SelectorList<E::Impl>,
|
|||
-> bool
|
||||
where E: Element
|
||||
{
|
||||
selector_list.0.iter().any(|selector_and_hashes| {
|
||||
matches_selector(&selector_and_hashes.selector,
|
||||
selector_list.0.iter().any(|selector| {
|
||||
matches_selector(selector,
|
||||
0,
|
||||
&selector_and_hashes.hashes,
|
||||
None,
|
||||
element,
|
||||
context,
|
||||
&mut |_, _| {})
|
||||
|
@ -371,7 +371,7 @@ enum SelectorMatchingResult {
|
|||
#[inline(always)]
|
||||
pub fn matches_selector<E, F>(selector: &Selector<E::Impl>,
|
||||
offset: usize,
|
||||
hashes: &AncestorHashes,
|
||||
hashes: Option<&AncestorHashes>,
|
||||
element: &E,
|
||||
context: &mut MatchingContext,
|
||||
flags_setter: &mut F)
|
||||
|
@ -380,9 +380,11 @@ pub fn matches_selector<E, F>(selector: &Selector<E::Impl>,
|
|||
F: FnMut(&E, ElementSelectorFlags),
|
||||
{
|
||||
// Use the bloom filter to fast-reject.
|
||||
if let Some(filter) = context.bloom_filter {
|
||||
if !may_match::<E>(hashes, filter) {
|
||||
return false;
|
||||
if let Some(hashes) = hashes {
|
||||
if let Some(filter) = context.bloom_filter {
|
||||
if !may_match::<E>(hashes, filter) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue