Further changes required by Servo

This commit is contained in:
Oriol Brufau 2023-08-12 01:27:26 +02:00 committed by Martin Robinson
parent 4878422c93
commit b05552369f
3 changed files with 35 additions and 25 deletions

View file

@ -79,7 +79,9 @@ use script_layout_interface::{HTMLCanvasData, HTMLMediaData, LayoutElementType,
use script_layout_interface::{SVGSVGData, StyleAndOpaqueLayoutData, TrustedNodeAddress};
use script_traits::DocumentActivity;
use script_traits::UntrustedNodeAddress;
use selectors::matching::{matches_selector_list, MatchingContext, MatchingMode};
use selectors::matching::{
matches_selector_list, MatchingContext, MatchingMode, NeedsSelectorFlags,
};
use selectors::parser::SelectorList;
use servo_arc::Arc;
use servo_url::ServoUrl;
@ -473,6 +475,7 @@ impl<'a> Iterator for QuerySelectorIterator {
None,
None,
node.owner_doc().quirks_mode(),
NeedsSelectorFlags::No,
);
if let Some(element) = DomRoot::downcast(node) {
if matches_selector_list(selectors, &element, &mut ctx) {
@ -956,8 +959,13 @@ impl Node {
// Step 3.
Ok(selectors) => {
// FIXME(bholley): Consider an nth-index cache here.
let mut ctx =
MatchingContext::new(MatchingMode::Normal, None, None, doc.quirks_mode());
let mut ctx = MatchingContext::new(
MatchingMode::Normal,
None,
None,
doc.quirks_mode(),
NeedsSelectorFlags::No,
);
Ok(self
.traverse_preorder(ShadowIncluding::No)
.filter_map(DomRoot::downcast)