mirror of
https://github.com/servo/servo.git
synced 2025-07-22 23:03:42 +01:00
Bug 1336646 - Apply selector flags during traversal. r=emilio
This commit is contained in:
parent
37b8d5231d
commit
9e860df9df
17 changed files with 295 additions and 192 deletions
|
@ -67,7 +67,7 @@ use script_layout_interface::{LayoutElementType, LayoutNodeType, TrustedNodeAddr
|
|||
use script_layout_interface::message::Msg;
|
||||
use script_traits::DocumentActivity;
|
||||
use script_traits::UntrustedNodeAddress;
|
||||
use selectors::matching::{MatchingReason, matches};
|
||||
use selectors::matching::matches;
|
||||
use selectors::parser::SelectorList;
|
||||
use servo_url::ServoUrl;
|
||||
use std::borrow::ToOwned;
|
||||
|
@ -322,7 +322,7 @@ impl<'a> Iterator for QuerySelectorIterator {
|
|||
// (instead of passing `None`)? Probably.
|
||||
self.iterator.by_ref().filter_map(|node| {
|
||||
if let Some(element) = Root::downcast(node) {
|
||||
if matches(selectors, &element, None, MatchingReason::Other) {
|
||||
if matches(selectors, &element, None) {
|
||||
return Some(Root::upcast(element));
|
||||
}
|
||||
}
|
||||
|
@ -685,7 +685,7 @@ impl Node {
|
|||
// Step 3.
|
||||
Ok(selectors) => {
|
||||
Ok(self.traverse_preorder().filter_map(Root::downcast).find(|element| {
|
||||
matches(&selectors.0, element, None, MatchingReason::Other)
|
||||
matches(&selectors.0, element, None)
|
||||
}))
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue