mirror of
https://github.com/servo/servo.git
synced 2025-07-22 23:03:42 +01:00
stylo: Support :hover and :active quirk
This commit is contained in:
parent
ff17af064b
commit
15fe48f3f6
15 changed files with 229 additions and 73 deletions
|
@ -347,11 +347,11 @@ impl<'a> Iterator for QuerySelectorIterator {
|
|||
fn next(&mut self) -> Option<Root<Node>> {
|
||||
let selectors = &self.selectors;
|
||||
|
||||
// TODO(cgaebel): Is it worth it to build a bloom filter here
|
||||
// (instead of passing `None`)? Probably.
|
||||
let mut ctx = MatchingContext::new(MatchingMode::Normal, None);
|
||||
|
||||
self.iterator.by_ref().filter_map(|node| {
|
||||
// TODO(cgaebel): Is it worth it to build a bloom filter here
|
||||
// (instead of passing `None`)? Probably.
|
||||
let mut ctx = MatchingContext::new(MatchingMode::Normal, None,
|
||||
node.owner_doc().quirks_mode());
|
||||
if let Some(element) = Root::downcast(node) {
|
||||
if matches_selector_list(selectors, &element, &mut ctx) {
|
||||
return Some(Root::upcast(element));
|
||||
|
@ -720,7 +720,8 @@ impl Node {
|
|||
Err(_) => Err(Error::Syntax),
|
||||
// Step 3.
|
||||
Ok(selectors) => {
|
||||
let mut ctx = MatchingContext::new(MatchingMode::Normal, None);
|
||||
let mut ctx = MatchingContext::new(MatchingMode::Normal, None,
|
||||
self.owner_doc().quirks_mode());
|
||||
Ok(self.traverse_preorder().filter_map(Root::downcast).find(|element| {
|
||||
matches_selector_list(&selectors, element, &mut ctx)
|
||||
}))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue