aboutsummaryrefslogtreecommitdiffstats
path: root/components/selectors
diff options
context:
space:
mode:
authorSimon Sapin <simon.sapin@exyr.org>2018-11-01 14:09:54 +0100
committerSimon Sapin <simon.sapin@exyr.org>2018-11-10 17:47:28 +0100
commita15d33a10e8a0aa1c02fa44ede50a63b95606b8f (patch)
tree5b0ef37530e77e646c2b6bc7df3d95e756607e77 /components/selectors
parente1fcffb336d763d851f14fae5cda464209552bb2 (diff)
downloadservo-a15d33a10e8a0aa1c02fa44ede50a63b95606b8f.tar.gz
servo-a15d33a10e8a0aa1c02fa44ede50a63b95606b8f.zip
`cargo fix --edition`
Diffstat (limited to 'components/selectors')
-rw-r--r--components/selectors/attr.rs2
-rw-r--r--components/selectors/builder.rs4
-rw-r--r--components/selectors/context.rs10
-rw-r--r--components/selectors/lib.rs6
-rw-r--r--components/selectors/matching.rs22
-rw-r--r--components/selectors/nth_index_cache.rs2
-rw-r--r--components/selectors/parser.rs22
-rw-r--r--components/selectors/tree.rs6
-rw-r--r--components/selectors/visitor.rs4
9 files changed, 39 insertions, 39 deletions
diff --git a/components/selectors/attr.rs b/components/selectors/attr.rs
index c0f5fe73185..07b97a87a56 100644
--- a/components/selectors/attr.rs
+++ b/components/selectors/attr.rs
@@ -2,8 +2,8 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+use crate::parser::SelectorImpl;
use cssparser::ToCss;
-use parser::SelectorImpl;
use std::fmt;
#[derive(Clone, Eq, PartialEq)]
diff --git a/components/selectors/builder.rs b/components/selectors/builder.rs
index 8fcca8f78e2..4f1f09890aa 100644
--- a/components/selectors/builder.rs
+++ b/components/selectors/builder.rs
@@ -17,9 +17,9 @@
//! is non-trivial. This module encapsulates those details and presents an
//! easy-to-use API for the parser.
-use parser::{Combinator, Component, SelectorImpl};
+use crate::parser::{Combinator, Component, SelectorImpl};
+use crate::sink::Push;
use servo_arc::{Arc, HeaderWithLength, ThinArc};
-use sink::Push;
use smallvec::{self, SmallVec};
use std::cmp;
use std::iter;
diff --git a/components/selectors/context.rs b/components/selectors/context.rs
index 9d1bfeee346..b20b4d47582 100644
--- a/components/selectors/context.rs
+++ b/components/selectors/context.rs
@@ -2,11 +2,11 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-use attr::CaseSensitivity;
-use bloom::BloomFilter;
-use nth_index_cache::NthIndexCache;
-use parser::SelectorImpl;
-use tree::{Element, OpaqueElement};
+use crate::attr::CaseSensitivity;
+use crate::bloom::BloomFilter;
+use crate::nth_index_cache::NthIndexCache;
+use crate::parser::SelectorImpl;
+use crate::tree::{Element, OpaqueElement};
/// What kind of selector matching mode we should use.
///
diff --git a/components/selectors/lib.rs b/components/selectors/lib.rs
index 43e274915cb..66d8898cc19 100644
--- a/components/selectors/lib.rs
+++ b/components/selectors/lib.rs
@@ -31,6 +31,6 @@ pub mod sink;
mod tree;
pub mod visitor;
-pub use nth_index_cache::NthIndexCache;
-pub use parser::{Parser, SelectorImpl, SelectorList};
-pub use tree::{Element, OpaqueElement};
+pub use crate::nth_index_cache::NthIndexCache;
+pub use crate::parser::{Parser, SelectorImpl, SelectorList};
+pub use crate::tree::{Element, OpaqueElement};
diff --git a/components/selectors/matching.rs b/components/selectors/matching.rs
index ef942708873..7fd7fc87db7 100644
--- a/components/selectors/matching.rs
+++ b/components/selectors/matching.rs
@@ -2,16 +2,16 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-use attr::{AttrSelectorOperation, NamespaceConstraint, ParsedAttrSelectorOperation};
-use bloom::{BloomFilter, BLOOM_HASH_MASK};
-use nth_index_cache::NthIndexCacheInner;
-use parser::{AncestorHashes, Combinator, Component, LocalName};
-use parser::{NonTSPseudoClass, Selector, SelectorImpl, SelectorIter, SelectorList};
+use crate::attr::{AttrSelectorOperation, NamespaceConstraint, ParsedAttrSelectorOperation};
+use crate::bloom::{BloomFilter, BLOOM_HASH_MASK};
+use crate::nth_index_cache::NthIndexCacheInner;
+use crate::parser::{AncestorHashes, Combinator, Component, LocalName};
+use crate::parser::{NonTSPseudoClass, Selector, SelectorImpl, SelectorIter, SelectorList};
+use crate::tree::Element;
use std::borrow::Borrow;
use std::iter;
-use tree::Element;
-pub use context::*;
+pub use crate::context::*;
// The bloom filter for descendant CSS selectors will have a <1% false
// positive rate until it has this many selectors in it, then it will
@@ -678,7 +678,7 @@ where
element.namespace() == url.borrow()
},
Component::ExplicitNoNamespace => {
- let ns = ::parser::namespace_empty_string::<E::Impl>();
+ let ns = crate::parser::namespace_empty_string::<E::Impl>();
element.namespace() == ns.borrow()
},
Component::ID(ref id) => {
@@ -693,7 +693,7 @@ where
} => {
let is_html = element.is_html_element_in_html_document();
element.attr_matches(
- &NamespaceConstraint::Specific(&::parser::namespace_empty_string::<E::Impl>()),
+ &NamespaceConstraint::Specific(&crate::parser::namespace_empty_string::<E::Impl>()),
select_name(is_html, local_name, local_name_lower),
&AttrSelectorOperation::Exists,
)
@@ -710,7 +710,7 @@ where
}
let is_html = element.is_html_element_in_html_document();
element.attr_matches(
- &NamespaceConstraint::Specific(&::parser::namespace_empty_string::<E::Impl>()),
+ &NamespaceConstraint::Specific(&crate::parser::namespace_empty_string::<E::Impl>()),
local_name,
&AttrSelectorOperation::WithValue {
operator: operator,
@@ -728,7 +728,7 @@ where
let namespace = match attr_sel.namespace() {
Some(ns) => ns,
None => {
- empty_string = ::parser::namespace_empty_string::<E::Impl>();
+ empty_string = crate::parser::namespace_empty_string::<E::Impl>();
NamespaceConstraint::Specific(&empty_string)
},
};
diff --git a/components/selectors/nth_index_cache.rs b/components/selectors/nth_index_cache.rs
index d1de6b0dc02..a3f0e64d76f 100644
--- a/components/selectors/nth_index_cache.rs
+++ b/components/selectors/nth_index_cache.rs
@@ -2,8 +2,8 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+use crate::tree::OpaqueElement;
use fxhash::FxHashMap;
-use tree::OpaqueElement;
/// A cache to speed up matching of nth-index-like selectors.
///
diff --git a/components/selectors/parser.rs b/components/selectors/parser.rs
index 0709c4eef99..ff5a4ff08b3 100644
--- a/components/selectors/parser.rs
+++ b/components/selectors/parser.rs
@@ -2,26 +2,26 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-use attr::{AttrSelectorOperator, AttrSelectorWithOptionalNamespace};
-use attr::{NamespaceConstraint, ParsedAttrSelectorOperation};
-use attr::{ParsedCaseSensitivity, SELECTOR_WHITESPACE};
-use bloom::BLOOM_HASH_MASK;
-use builder::{SelectorBuilder, SpecificityAndFlags};
-use context::QuirksMode;
+use crate::attr::{AttrSelectorOperator, AttrSelectorWithOptionalNamespace};
+use crate::attr::{NamespaceConstraint, ParsedAttrSelectorOperation};
+use crate::attr::{ParsedCaseSensitivity, SELECTOR_WHITESPACE};
+use crate::bloom::BLOOM_HASH_MASK;
+use crate::builder::{SelectorBuilder, SpecificityAndFlags};
+use crate::context::QuirksMode;
+use crate::sink::Push;
+pub use crate::visitor::{SelectorVisitor, Visit};
use cssparser::{parse_nth, serialize_identifier};
use cssparser::{BasicParseError, BasicParseErrorKind, ParseError, ParseErrorKind};
use cssparser::{CowRcStr, Delimiter, SourceLocation};
use cssparser::{CssStringWriter, Parser as CssParser, ToCss, Token};
use precomputed_hash::PrecomputedHash;
use servo_arc::ThinArc;
-use sink::Push;
use smallvec::SmallVec;
use std::borrow::{Borrow, Cow};
use std::fmt::{self, Debug, Display, Write};
use std::iter::Rev;
use std::slice;
use thin_slice::ThinBoxedSlice;
-pub use visitor::{SelectorVisitor, Visit};
/// A trait that represents a pseudo-element.
pub trait PseudoElement: Sized + ToCss {
@@ -465,7 +465,7 @@ where
let namespace = match attr_selector.namespace() {
Some(ns) => ns,
None => {
- empty_string = ::parser::namespace_empty_string::<Impl>();
+ empty_string = crate::parser::namespace_empty_string::<Impl>();
NamespaceConstraint::Specific(&empty_string)
},
};
@@ -2147,9 +2147,9 @@ where
#[cfg(test)]
pub mod tests {
use super::*;
- use builder::HAS_PSEUDO_BIT;
+ use crate::builder::HAS_PSEUDO_BIT;
+ use crate::parser;
use cssparser::{serialize_identifier, Parser as CssParser, ParserInput, ToCss};
- use parser;
use std::collections::HashMap;
use std::fmt;
diff --git a/components/selectors/tree.rs b/components/selectors/tree.rs
index 1e899f22104..56cbb9dbec7 100644
--- a/components/selectors/tree.rs
+++ b/components/selectors/tree.rs
@@ -5,9 +5,9 @@
//! Traits that nodes must implement. Breaks the otherwise-cyclic dependency
//! between layout and style.
-use attr::{AttrSelectorOperation, CaseSensitivity, NamespaceConstraint};
-use matching::{ElementSelectorFlags, MatchingContext};
-use parser::SelectorImpl;
+use crate::attr::{AttrSelectorOperation, CaseSensitivity, NamespaceConstraint};
+use crate::matching::{ElementSelectorFlags, MatchingContext};
+use crate::parser::SelectorImpl;
use std::fmt::Debug;
use std::ptr::NonNull;
diff --git a/components/selectors/visitor.rs b/components/selectors/visitor.rs
index 5c7edbbb994..86b9c2fb0db 100644
--- a/components/selectors/visitor.rs
+++ b/components/selectors/visitor.rs
@@ -6,8 +6,8 @@
#![deny(missing_docs)]
-use attr::NamespaceConstraint;
-use parser::{Combinator, Component, SelectorImpl};
+use crate::attr::NamespaceConstraint;
+use crate::parser::{Combinator, Component, SelectorImpl};
/// A trait to visit selector properties.
///