mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Bug 1364850: Move PseudoElement to be just another combinator in selectors. r=bholley
MozReview-Commit-ID: 8OoOIodkKJ5 Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
This commit is contained in:
parent
8375319928
commit
522f8489d6
19 changed files with 675 additions and 541 deletions
|
@ -123,6 +123,14 @@ impl<T> MatchAttr for T where T: MatchAttrGeneric, T::Impl: SelectorImpl<AttrVal
|
|||
pub trait Element: MatchAttr + Sized {
|
||||
fn parent_element(&self) -> Option<Self>;
|
||||
|
||||
/// The parent of a given pseudo-element, after matching a pseudo-element
|
||||
/// selector.
|
||||
///
|
||||
/// This is guaranteed to be called in a pseudo-element.
|
||||
fn pseudo_element_originating_element(&self) -> Option<Self> {
|
||||
self.parent_element()
|
||||
}
|
||||
|
||||
// Skips non-element nodes
|
||||
fn first_child_element(&self) -> Option<Self>;
|
||||
|
||||
|
@ -145,6 +153,11 @@ pub trait Element: MatchAttr + Sized {
|
|||
flags_setter: &mut F) -> bool
|
||||
where F: FnMut(&Self, ElementSelectorFlags);
|
||||
|
||||
fn match_pseudo_element(&self,
|
||||
pe: &<Self::Impl as SelectorImpl>::PseudoElement,
|
||||
context: &mut MatchingContext)
|
||||
-> bool;
|
||||
|
||||
fn get_id(&self) -> Option<<Self::Impl as SelectorImpl>::Identifier>;
|
||||
fn has_class(&self, name: &<Self::Impl as SelectorImpl>::ClassName) -> bool;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue