mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
This reverts commit 8e15389cae
.
This commit is contained in:
parent
8e15389cae
commit
d6ae8dc112
152 changed files with 4622 additions and 5862 deletions
|
@ -77,11 +77,14 @@ pub trait Element: Sized + Clone + Debug {
|
|||
operation: &AttrSelectorOperation<&<Self::Impl as SelectorImpl>::AttrValue>,
|
||||
) -> bool;
|
||||
|
||||
fn match_non_ts_pseudo_class(
|
||||
fn match_non_ts_pseudo_class<F>(
|
||||
&self,
|
||||
pc: &<Self::Impl as SelectorImpl>::NonTSPseudoClass,
|
||||
context: &mut MatchingContext<Self::Impl>,
|
||||
) -> bool;
|
||||
flags_setter: &mut F,
|
||||
) -> bool
|
||||
where
|
||||
F: FnMut(&Self, ElementSelectorFlags);
|
||||
|
||||
fn match_pseudo_element(
|
||||
&self,
|
||||
|
@ -89,30 +92,6 @@ pub trait Element: Sized + Clone + Debug {
|
|||
context: &mut MatchingContext<Self::Impl>,
|
||||
) -> bool;
|
||||
|
||||
/// Sets selector flags, which indicate what kinds of selectors may have
|
||||
/// matched on this element and therefore what kind of work may need to
|
||||
/// be performed when DOM state changes.
|
||||
///
|
||||
/// You probably don't want to use this directly and want to use
|
||||
/// apply_selector_flags, since that sets flags on the parent as needed.
|
||||
fn set_selector_flags(&self, flags: ElementSelectorFlags);
|
||||
|
||||
fn apply_selector_flags(&self, flags: ElementSelectorFlags) {
|
||||
// Handle flags that apply to the element.
|
||||
let self_flags = flags.for_self();
|
||||
if !self_flags.is_empty() {
|
||||
self.set_selector_flags(self_flags);
|
||||
}
|
||||
|
||||
// Handle flags that apply to the parent.
|
||||
let parent_flags = flags.for_parent();
|
||||
if !parent_flags.is_empty() {
|
||||
if let Some(p) = self.parent_element() {
|
||||
p.set_selector_flags(parent_flags);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Whether this element is a `link`.
|
||||
fn is_link(&self) -> bool;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue