Further changes required by Servo

This commit is contained in:
Oriol Brufau 2023-11-01 01:47:21 +01:00 committed by Martin Robinson
parent 3076481c52
commit 9e36918bf0

View file

@ -473,12 +473,11 @@ impl<'a> Iterator for QuerySelectorIterator {
.filter_map(|node| { .filter_map(|node| {
// TODO(cgaebel): Is it worth it to build a bloom filter here // TODO(cgaebel): Is it worth it to build a bloom filter here
// (instead of passing `None`)? Probably. // (instead of passing `None`)? Probably.
// let mut nth_index_cache = Default::default();
// FIXME(bholley): Consider an nth-index cache here.
let mut ctx = MatchingContext::new( let mut ctx = MatchingContext::new(
MatchingMode::Normal, MatchingMode::Normal,
None, None,
None, &mut nth_index_cache,
node.owner_doc().quirks_mode(), node.owner_doc().quirks_mode(),
NeedsSelectorFlags::No, NeedsSelectorFlags::No,
); );
@ -967,11 +966,11 @@ impl Node {
Err(_) => Err(Error::Syntax), Err(_) => Err(Error::Syntax),
// Step 3. // Step 3.
Ok(selectors) => { Ok(selectors) => {
// FIXME(bholley): Consider an nth-index cache here. let mut nth_index_cache = Default::default();
let mut ctx = MatchingContext::new( let mut ctx = MatchingContext::new(
MatchingMode::Normal, MatchingMode::Normal,
None, None,
None, &mut nth_index_cache,
doc.quirks_mode(), doc.quirks_mode(),
NeedsSelectorFlags::No, NeedsSelectorFlags::No,
); );