mirror of
https://github.com/servo/servo.git
synced 2025-08-05 21:50:18 +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
|
@ -86,7 +86,7 @@ use ref_filter_map::ref_filter_map;
|
|||
use script_layout_interface::message::ReflowQueryType;
|
||||
use script_thread::Runnable;
|
||||
use selectors::attr::{AttrSelectorOperation, NamespaceConstraint};
|
||||
use selectors::matching::{ElementSelectorFlags, MatchingContext, MatchingMode};
|
||||
use selectors::matching::{ElementSelectorFlags, LocalMatchingContext, MatchingContext, MatchingMode};
|
||||
use selectors::matching::{HAS_EDGE_CHILD_SELECTOR, HAS_SLOW_SELECTOR, HAS_SLOW_SELECTOR_LATER_SIBLINGS};
|
||||
use selectors::matching::{RelevantLinkStatus, matches_selector_list};
|
||||
use servo_atoms::Atom;
|
||||
|
@ -2063,7 +2063,9 @@ impl ElementMethods for Element {
|
|||
match SelectorParser::parse_author_origin_no_namespace(&selectors) {
|
||||
Err(_) => Err(Error::Syntax),
|
||||
Ok(selectors) => {
|
||||
let mut ctx = MatchingContext::new(MatchingMode::Normal, None);
|
||||
let quirks_mode = document_from_node(self).quirks_mode();
|
||||
let mut ctx = MatchingContext::new(MatchingMode::Normal, None,
|
||||
quirks_mode);
|
||||
Ok(matches_selector_list(&selectors, &Root::from_ref(self), &mut ctx))
|
||||
}
|
||||
}
|
||||
|
@ -2082,7 +2084,9 @@ impl ElementMethods for Element {
|
|||
let root = self.upcast::<Node>();
|
||||
for element in root.inclusive_ancestors() {
|
||||
if let Some(element) = Root::downcast::<Element>(element) {
|
||||
let mut ctx = MatchingContext::new(MatchingMode::Normal, None);
|
||||
let quirks_mode = document_from_node(self).quirks_mode();
|
||||
let mut ctx = MatchingContext::new(MatchingMode::Normal, None,
|
||||
quirks_mode);
|
||||
if matches_selector_list(&selectors, &element, &mut ctx) {
|
||||
return Ok(Some(element));
|
||||
}
|
||||
|
@ -2432,7 +2436,7 @@ impl<'a> ::selectors::Element for Root<Element> {
|
|||
|
||||
fn match_non_ts_pseudo_class<F>(&self,
|
||||
pseudo_class: &NonTSPseudoClass,
|
||||
_: &mut MatchingContext,
|
||||
_: &mut LocalMatchingContext<Self::Impl>,
|
||||
_: &RelevantLinkStatus,
|
||||
_: &mut F)
|
||||
-> bool
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue