Skip to content

Commit

Permalink
Rename SelectorMethods to Visit, after its one method.
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonSapin committed Jan 12, 2018
1 parent 79f93cf commit c14b766
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
10 changes: 5 additions & 5 deletions components/selectors/parser.rs
Expand Up @@ -96,7 +96,7 @@ macro_rules! with_all_bounds {

/// non tree-structural pseudo-classes
/// (see: https://drafts.csswg.org/selectors/#structural-pseudos)
type NonTSPseudoClass: $($CommonBounds)* + Sized + ToCss + SelectorMethods<Impl = Self>;
type NonTSPseudoClass: $($CommonBounds)* + Sized + ToCss + Visit<Impl = Self>;

/// pseudo-elements
type PseudoElement: $($CommonBounds)* + PseudoElement<Impl = Self>;
Expand Down Expand Up @@ -326,15 +326,15 @@ impl AncestorHashes {
}
}

pub trait SelectorMethods {
pub trait Visit {
type Impl: SelectorImpl;

fn visit<V>(&self, visitor: &mut V) -> bool
where
V: SelectorVisitor<Impl = Self::Impl>;
}

impl<Impl: SelectorImpl> SelectorMethods for Selector<Impl> {
impl<Impl: SelectorImpl> Visit for Selector<Impl> {
type Impl = Impl;

fn visit<V>(&self, visitor: &mut V) -> bool
Expand Down Expand Up @@ -364,7 +364,7 @@ impl<Impl: SelectorImpl> SelectorMethods for Selector<Impl> {
}
}

impl<Impl: SelectorImpl> SelectorMethods for Component<Impl> {
impl<Impl: SelectorImpl> Visit for Component<Impl> {
type Impl = Impl;

fn visit<V>(&self, visitor: &mut V) -> bool
Expand Down Expand Up @@ -2013,7 +2013,7 @@ pub mod tests {
}
}

impl SelectorMethods for PseudoClass {
impl Visit for PseudoClass {
type Impl = DummySelectorImpl;

fn visit<V>(&self, _visitor: &mut V) -> bool
Expand Down
4 changes: 2 additions & 2 deletions components/style/gecko/selector_parser.rs
Expand Up @@ -12,7 +12,7 @@ use gecko_bindings::sugar::ownership::{HasBoxFFI, HasFFI, HasSimpleFFI};
use invalidation::element::document_state::InvalidationMatchingData;
use selector_parser::{Direction, SelectorParser};
use selectors::SelectorList;
use selectors::parser::{self as selector_parser, Selector, SelectorMethods, SelectorParseErrorKind};
use selectors::parser::{self as selector_parser, Selector, Visit, SelectorParseErrorKind};
use selectors::visitor::SelectorVisitor;
use std::fmt;
use string_cache::{Atom, Namespace, WeakAtom, WeakNamespace};
Expand Down Expand Up @@ -113,7 +113,7 @@ impl ToCss for NonTSPseudoClass {
}
}

impl SelectorMethods for NonTSPseudoClass {
impl Visit for NonTSPseudoClass {
type Impl = SelectorImpl;

fn visit<V>(&self, visitor: &mut V) -> bool
Expand Down
2 changes: 1 addition & 1 deletion components/style/invalidation/element/invalidation_map.rs
Expand Up @@ -15,7 +15,7 @@ use selector_parser::Direction;
use selector_parser::SelectorImpl;
use selectors::attr::NamespaceConstraint;
use selectors::parser::{Combinator, Component};
use selectors::parser::{Selector, SelectorIter, SelectorMethods};
use selectors::parser::{Selector, SelectorIter, Visit};
use selectors::visitor::SelectorVisitor;
use smallvec::SmallVec;

Expand Down
4 changes: 2 additions & 2 deletions components/style/servo/selector_parser.rs
Expand Up @@ -19,7 +19,7 @@ use properties::PropertyFlags;
use properties::longhands::display::computed_value::T as Display;
use selector_parser::{AttrValue as SelectorAttrValue, PseudoElementCascadeType, SelectorParser};
use selectors::attr::{AttrSelectorOperation, NamespaceConstraint, CaseSensitivity};
use selectors::parser::{SelectorMethods, SelectorParseErrorKind};
use selectors::parser::{Visit, SelectorParseErrorKind};
use selectors::visitor::SelectorVisitor;
use std::fmt;
use std::mem;
Expand Down Expand Up @@ -312,7 +312,7 @@ impl ToCss for NonTSPseudoClass {
}
}

impl SelectorMethods for NonTSPseudoClass {
impl Visit for NonTSPseudoClass {
type Impl = SelectorImpl;


Expand Down
2 changes: 1 addition & 1 deletion components/style/stylist.rs
Expand Up @@ -31,7 +31,7 @@ use selectors::bloom::{BloomFilter, NonCountingBloomFilter};
use selectors::matching::{ElementSelectorFlags, matches_selector, MatchingContext, MatchingMode};
use selectors::matching::VisitedHandlingMode;
use selectors::parser::{AncestorHashes, Combinator, Component, Selector};
use selectors::parser::{SelectorIter, SelectorMethods};
use selectors::parser::{SelectorIter, Visit};
use selectors::visitor::SelectorVisitor;
use servo_arc::{Arc, ArcBorrow};
use shared_lock::{Locked, SharedRwLockReadGuard, StylesheetGuards};
Expand Down

0 comments on commit c14b766

Please sign in to comment.