Bug 1506391 - `cargo fix --edition`. r=emilio
☠☠ backed out by 66b88241e436 ☠ ☠
authorSimon Sapin <simon.sapin@exyr.org>
Thu, 01 Nov 2018 14:09:54 +0100
changeset 445774 3840ce1ebfb092d38e97a2787f019050e161986a
parent 445773 94517e21621cb1d7ab513592f1931f13c1b6682e
child 445775 be88680421db1ac86856b7d10e8dfa664d059a6f
push id109768
push useremilio@crisal.io
push dateSat, 10 Nov 2018 20:42:43 +0000
treeherdermozilla-inbound@b8216171101c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersemilio
bugs1506391
milestone65.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1506391 - `cargo fix --edition`. r=emilio
servo/components/hashglobe/src/fake.rs
servo/components/hashglobe/src/hash_map.rs
servo/components/hashglobe/src/table.rs
servo/components/selectors/attr.rs
servo/components/selectors/builder.rs
servo/components/selectors/context.rs
servo/components/selectors/lib.rs
servo/components/selectors/matching.rs
servo/components/selectors/nth_index_cache.rs
servo/components/selectors/parser.rs
servo/components/selectors/tree.rs
servo/components/selectors/visitor.rs
servo/components/servo_arc/lib.rs
servo/components/style/animation.rs
servo/components/style/applicable_declarations.rs
servo/components/style/attr.rs
servo/components/style/author_styles.rs
servo/components/style/bezier.rs
servo/components/style/bloom.rs
servo/components/style/context.rs
servo/components/style/counter_style/mod.rs
servo/components/style/custom_properties.rs
servo/components/style/data.rs
servo/components/style/dom.rs
servo/components/style/dom_apis.rs
servo/components/style/driver.rs
servo/components/style/encoding_support.rs
servo/components/style/error_reporting.rs
servo/components/style/font_face.rs
servo/components/style/font_metrics.rs
servo/components/style/invalidation/element/document_state.rs
servo/components/style/invalidation/element/element_wrapper.rs
servo/components/style/invalidation/element/invalidation_map.rs
servo/components/style/invalidation/element/invalidator.rs
servo/components/style/invalidation/element/restyle_hints.rs
servo/components/style/invalidation/element/state_and_attributes.rs
servo/components/style/invalidation/media_queries.rs
servo/components/style/invalidation/stylesheets.rs
servo/components/style/lib.rs
servo/components/style/logical_geometry.rs
servo/components/style/matching.rs
servo/components/style/media_queries/media_condition.rs
servo/components/style/media_queries/media_feature.rs
servo/components/style/media_queries/media_feature_expression.rs
servo/components/style/media_queries/media_list.rs
servo/components/style/media_queries/media_query.rs
servo/components/style/media_queries/mod.rs
servo/components/style/parallel.rs
servo/components/style/parser.rs
servo/components/style/properties/cascade.rs
servo/components/style/properties/declaration_block.rs
servo/components/style/rule_cache.rs
servo/components/style/rule_tree/mod.rs
servo/components/style/selector_map.rs
servo/components/style/selector_parser.rs
servo/components/style/servo/media_queries.rs
servo/components/style/servo/restyle_damage.rs
servo/components/style/servo/selector_parser.rs
servo/components/style/servo/url.rs
servo/components/style/shared_lock.rs
servo/components/style/sharing/checks.rs
servo/components/style/sharing/mod.rs
servo/components/style/style_adjuster.rs
servo/components/style/style_resolver.rs
servo/components/style/stylesheet_set.rs
servo/components/style/stylesheets/counter_style_rule.rs
servo/components/style/stylesheets/document_rule.rs
servo/components/style/stylesheets/font_face_rule.rs
servo/components/style/stylesheets/font_feature_values_rule.rs
servo/components/style/stylesheets/import_rule.rs
servo/components/style/stylesheets/keyframes_rule.rs
servo/components/style/stylesheets/loader.rs
servo/components/style/stylesheets/media_rule.rs
servo/components/style/stylesheets/mod.rs
servo/components/style/stylesheets/namespace_rule.rs
servo/components/style/stylesheets/page_rule.rs
servo/components/style/stylesheets/rule_list.rs
servo/components/style/stylesheets/rule_parser.rs
servo/components/style/stylesheets/rules_iterator.rs
servo/components/style/stylesheets/style_rule.rs
servo/components/style/stylesheets/stylesheet.rs
servo/components/style/stylesheets/supports_rule.rs
servo/components/style/stylesheets/viewport_rule.rs
servo/components/style/stylist.rs
servo/components/style/traversal.rs
servo/components/style/use_counters/mod.rs
servo/components/style/values/animated/color.rs
servo/components/style/values/animated/effects.rs
servo/components/style/values/animated/font.rs
servo/components/style/values/animated/length.rs
servo/components/style/values/animated/mod.rs
servo/components/style/values/animated/svg.rs
servo/components/style/values/computed/angle.rs
servo/components/style/values/computed/background.rs
servo/components/style/values/computed/basic_shape.rs
servo/components/style/values/computed/border.rs
servo/components/style/values/computed/box.rs
servo/components/style/values/computed/color.rs
servo/components/style/values/computed/column.rs
servo/components/style/values/computed/counters.rs
servo/components/style/values/computed/easing.rs
servo/components/style/values/computed/effects.rs
servo/components/style/values/computed/flex.rs
servo/components/style/values/computed/font.rs
servo/components/style/values/computed/image.rs
servo/components/style/values/computed/length.rs
servo/components/style/values/computed/list.rs
servo/components/style/values/computed/mod.rs
servo/components/style/values/computed/motion.rs
servo/components/style/values/computed/outline.rs
servo/components/style/values/computed/percentage.rs
servo/components/style/values/computed/position.rs
servo/components/style/values/computed/rect.rs
servo/components/style/values/computed/resolution.rs
servo/components/style/values/computed/svg.rs
servo/components/style/values/computed/table.rs
servo/components/style/values/computed/text.rs
servo/components/style/values/computed/time.rs
servo/components/style/values/computed/transform.rs
servo/components/style/values/computed/ui.rs
servo/components/style/values/computed/url.rs
servo/components/style/values/generics/basic_shape.rs
servo/components/style/values/generics/border.rs
servo/components/style/values/generics/box.rs
servo/components/style/values/generics/counters.rs
servo/components/style/values/generics/easing.rs
servo/components/style/values/generics/font.rs
servo/components/style/values/generics/grid.rs
servo/components/style/values/generics/image.rs
servo/components/style/values/generics/length.rs
servo/components/style/values/generics/mod.rs
servo/components/style/values/generics/rect.rs
servo/components/style/values/generics/size.rs
servo/components/style/values/generics/svg.rs
servo/components/style/values/generics/text.rs
servo/components/style/values/generics/transform.rs
servo/components/style/values/generics/url.rs
servo/components/style/values/mod.rs
servo/components/style/values/specified/angle.rs
servo/components/style/values/specified/background.rs
servo/components/style/values/specified/basic_shape.rs
servo/components/style/values/specified/border.rs
servo/components/style/values/specified/box.rs
servo/components/style/values/specified/calc.rs
servo/components/style/values/specified/color.rs
servo/components/style/values/specified/column.rs
servo/components/style/values/specified/counters.rs
servo/components/style/values/specified/easing.rs
servo/components/style/values/specified/effects.rs
servo/components/style/values/specified/flex.rs
servo/components/style/values/specified/font.rs
servo/components/style/values/specified/grid.rs
servo/components/style/values/specified/image.rs
servo/components/style/values/specified/length.rs
servo/components/style/values/specified/list.rs
servo/components/style/values/specified/mod.rs
servo/components/style/values/specified/motion.rs
servo/components/style/values/specified/outline.rs
servo/components/style/values/specified/percentage.rs
servo/components/style/values/specified/position.rs
servo/components/style/values/specified/rect.rs
servo/components/style/values/specified/resolution.rs
servo/components/style/values/specified/source_size_list.rs
servo/components/style/values/specified/svg.rs
servo/components/style/values/specified/svg_path.rs
servo/components/style/values/specified/table.rs
servo/components/style/values/specified/text.rs
servo/components/style/values/specified/time.rs
servo/components/style/values/specified/transform.rs
servo/components/style/values/specified/ui.rs
servo/components/style/values/specified/url.rs
servo/components/style_derive/animate.rs
servo/components/style_derive/cg.rs
servo/components/style_derive/compute_squared_distance.rs
servo/components/style_derive/parse.rs
servo/components/style_derive/specified_value_info.rs
servo/components/style_derive/to_animated_value.rs
servo/components/style_derive/to_animated_zero.rs
servo/components/style_derive/to_computed_value.rs
servo/components/style_derive/to_css.rs
servo/components/style_traits/lib.rs
servo/components/style_traits/values.rs
servo/components/style_traits/viewport.rs
--- a/servo/components/hashglobe/src/fake.rs
+++ b/servo/components/hashglobe/src/fake.rs
@@ -21,17 +21,17 @@ use std::hash::{BuildHasher, Hash};
 use std::ops::{Deref, DerefMut};
 
 pub use std::collections::hash_map::{Entry, Iter as MapIter, IterMut as MapIterMut, RandomState};
 pub use std::collections::hash_set::{IntoIter as SetIntoIter, Iter as SetIter};
 
 #[derive(Clone)]
 pub struct HashMap<K, V, S = RandomState>(StdMap<K, V, S>);
 
-use FailedAllocationError;
+use crate::FailedAllocationError;
 
 impl<K, V, S> Deref for HashMap<K, V, S> {
     type Target = StdMap<K, V, S>;
     fn deref(&self) -> &Self::Target {
         &self.0
     }
 }
 
--- a/servo/components/hashglobe/src/hash_map.rs
+++ b/servo/components/hashglobe/src/hash_map.rs
@@ -18,17 +18,17 @@ use std::fmt::{self, Debug};
 use std::hash::{BuildHasher, Hash};
 use std::iter::FromIterator;
 use std::mem::{self, replace};
 use std::ops::{Deref, Index};
 
 use super::table::BucketState::{Empty, Full};
 use super::table::{self, Bucket, EmptyBucket, FullBucket, FullBucketMut, RawTable, SafeHash};
 
-use FailedAllocationError;
+use crate::FailedAllocationError;
 
 const MIN_NONZERO_RAW_CAPACITY: usize = 32; // must be a power of two
 
 /// The default behavior of HashMap implements a maximum load factor of 90.9%.
 #[derive(Clone)]
 struct DefaultResizePolicy;
 
 impl DefaultResizePolicy {
--- a/servo/components/hashglobe/src/table.rs
+++ b/servo/components/hashglobe/src/table.rs
@@ -3,27 +3,27 @@
 // http://rust-lang.org/COPYRIGHT.
 //
 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-use alloc::{alloc, dealloc};
-use shim::{Shared, Unique};
+use crate::alloc::{alloc, dealloc};
+use crate::shim::{Shared, Unique};
 use std::cmp;
 use std::hash::{BuildHasher, Hash, Hasher};
 use std::marker;
 use std::mem::{self, align_of, size_of};
 use std::ops::{Deref, DerefMut};
 use std::ptr;
 
 use self::BucketState::*;
-use FailedAllocationError;
+use crate::FailedAllocationError;
 
 /// Integer type used for stored hash values.
 ///
 /// No more than bit_width(usize) bits are needed to select a bucket.
 ///
 /// The most significant bit is ours to use for tagging `SafeHash`.
 ///
 /// (Even if we could have usize::MAX bytes allocated for buckets,
@@ -790,17 +790,17 @@ impl<K, V> RawTable<K, V> {
                 "capacity overflow when allocating RawTable",
             ));
         }
 
         // FORK NOTE: Uses alloc shim instead of Heap.alloc
         let buffer = alloc(size, alignment);
 
         if buffer.is_null() {
-            use AllocationInfo;
+            use crate::AllocationInfo;
             return Err(FailedAllocationError {
                 reason: "out of memory when allocating RawTable",
                 allocation_info: Some(AllocationInfo { size, alignment }),
             });
         }
 
         let hashes = buffer.offset(hash_offset as isize) as *mut HashUint;
 
--- a/servo/components/selectors/attr.rs
+++ b/servo/components/selectors/attr.rs
@@ -1,14 +1,14 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * 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)]
 pub struct AttrSelectorWithOptionalNamespace<Impl: SelectorImpl> {
     pub namespace: Option<NamespaceConstraint<(Impl::NamespacePrefix, Impl::NamespaceUrl)>>,
     pub local_name: Impl::LocalName,
     pub local_name_lower: Impl::LocalName,
     pub operation: ParsedAttrSelectorOperation<Impl::AttrValue>,
--- a/servo/components/selectors/builder.rs
+++ b/servo/components/selectors/builder.rs
@@ -12,19 +12,19 @@
 //!   matching order.
 //! * We store the simple selectors for each combinator from left to right, so
 //!   that we match the cheaper simple selectors first.
 //!
 //! Meeting all these constraints without extra memmove traffic during parsing
 //! 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;
 use std::ops::{Add, AddAssign};
 use std::ptr;
 use std::slice;
 
 /// Top-level SelectorBuilder struct. This should be stack-allocated by the
--- a/servo/components/selectors/context.rs
+++ b/servo/components/selectors/context.rs
@@ -1,17 +1,17 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * 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.
 ///
 /// There are two modes of selector matching. The difference is only noticeable
 /// in presence of pseudo-elements.
 #[derive(Clone, Copy, Debug, PartialEq)]
 pub enum MatchingMode {
     /// Don't ignore any pseudo-element selectors.
--- a/servo/components/selectors/lib.rs
+++ b/servo/components/selectors/lib.rs
@@ -26,11 +26,11 @@ mod builder;
 pub mod context;
 pub mod matching;
 mod nth_index_cache;
 pub mod parser;
 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};
--- a/servo/components/selectors/matching.rs
+++ b/servo/components/selectors/matching.rs
@@ -1,22 +1,22 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * 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
 // rapidly increase.
 pub static RECOMMENDED_SELECTOR_BLOOM_FILTER_SIZE: usize = 4096;
 
 bitflags! {
     /// Set of flags that are set on either the element or its parent (depending
@@ -673,49 +673,49 @@ where
             element.match_pseudo_element(pseudo, context.shared)
         },
         Component::LocalName(ref local_name) => matches_local_name(element, local_name),
         Component::ExplicitUniversalType | Component::ExplicitAnyNamespace => true,
         Component::Namespace(_, ref url) | Component::DefaultNamespace(ref url) => {
             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) => {
             element.has_id(id, context.shared.classes_and_ids_case_sensitivity())
         },
         Component::Class(ref class) => {
             element.has_class(class, context.shared.classes_and_ids_case_sensitivity())
         },
         Component::AttributeInNoNamespaceExists {
             ref local_name,
             ref local_name_lower,
         } => {
             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,
             )
         },
         Component::AttributeInNoNamespace {
             ref local_name,
             ref value,
             operator,
             case_sensitivity,
             never_matches,
         } => {
             if never_matches {
                 return false;
             }
             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,
                     case_sensitivity: case_sensitivity.to_unconditional(is_html),
                     expected_value: value,
                 },
             )
         },
@@ -723,17 +723,17 @@ where
             if attr_sel.never_matches {
                 return false;
             }
             let is_html = element.is_html_element_in_html_document();
             let empty_string;
             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)
                 },
             };
             element.attr_matches(
                 &namespace,
                 select_name(is_html, &attr_sel.local_name, &attr_sel.local_name_lower),
                 &match attr_sel.operation {
                     ParsedAttrSelectorOperation::Exists => AttrSelectorOperation::Exists,
--- a/servo/components/selectors/nth_index_cache.rs
+++ b/servo/components/selectors/nth_index_cache.rs
@@ -1,14 +1,14 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * 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.
 ///
 /// See [1] for some discussion around the design tradeoffs.
 ///
 /// [1] https://bugzilla.mozilla.org/show_bug.cgi?id=1401855#c3
 #[derive(Default)]
 pub struct NthIndexCache {
--- a/servo/components/selectors/parser.rs
+++ b/servo/components/selectors/parser.rs
@@ -1,32 +1,32 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * 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 {
     /// The `SelectorImpl` this pseudo-element is used for.
     type Impl: SelectorImpl;
 
     /// Whether the pseudo-element supports a given state selector to the right
     /// of it.
@@ -460,17 +460,17 @@ where
                     return false;
                 }
             }
             AttributeOther(ref attr_selector) if !attr_selector.never_matches => {
                 let empty_string;
                 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)
                     },
                 };
                 if !visitor.visit_attribute_selector(
                     &namespace,
                     &attr_selector.local_name,
                     &attr_selector.local_name_lower,
                 ) {
@@ -2142,19 +2142,19 @@ where
         P::parse_non_ts_pseudo_class(parser, location, name).map(Component::NonTSPseudoClass)
     })
 }
 
 // NB: pub module in order to access the DummyParser
 #[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;
 
     #[derive(Clone, Debug, Eq, PartialEq)]
     pub enum PseudoClass {
         Hover,
         Active,
         Lang(String),
--- a/servo/components/selectors/tree.rs
+++ b/servo/components/selectors/tree.rs
@@ -1,18 +1,18 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * 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/. */
 
 //! 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;
 
 /// Opaque representation of an Element, for identity comparisons. We use
 /// NonZeroPtrMut to get the NonZero optimization.
 #[derive(Clone, Debug, Eq, Hash, PartialEq)]
 pub struct OpaqueElement(NonNull<()>);
 
--- a/servo/components/selectors/visitor.rs
+++ b/servo/components/selectors/visitor.rs
@@ -1,18 +1,18 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * 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/. */
 
 //! Visitor traits for selectors.
 
 #![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.
 ///
 /// All the `visit_foo` methods return a boolean indicating whether the
 /// traversal should continue or not.
 pub trait SelectorVisitor {
     /// The selector implementation this visitor wants to visit.
     type Impl: SelectorImpl;
--- a/servo/components/servo_arc/lib.rs
+++ b/servo/components/servo_arc/lib.rs
@@ -1055,17 +1055,17 @@ pub struct ArcUnion<A, B> {
     phantom_b: PhantomData<B>,
 }
 
 unsafe impl<A: Sync + Send, B: Send + Sync> Send for ArcUnion<A, B> {}
 unsafe impl<A: Sync + Send, B: Send + Sync> Sync for ArcUnion<A, B> {}
 
 impl<A: PartialEq, B: PartialEq> PartialEq for ArcUnion<A, B> {
     fn eq(&self, other: &Self) -> bool {
-        use ArcUnionBorrow::*;
+        use crate::ArcUnionBorrow::*;
         match (self.borrow(), other.borrow()) {
             (First(x), First(y)) => x == y,
             (Second(x), Second(y)) => x == y,
             (_, _) => false,
         }
     }
 }
 
--- a/servo/components/style/animation.rs
+++ b/servo/components/style/animation.rs
@@ -3,39 +3,39 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 //! CSS transitions and animations.
 
 // NOTE(emilio): This code isn't really executed in Gecko, but we don't want to
 // compile it out so that people remember it exists, thus the cfg'd Sender
 // import.
 
-use bezier::Bezier;
-use context::SharedStyleContext;
-use dom::{OpaqueNode, TElement};
-use font_metrics::FontMetricsProvider;
-use properties::animated_properties::AnimatedProperty;
-use properties::longhands::animation_direction::computed_value::single_value::T as AnimationDirection;
-use properties::longhands::animation_play_state::computed_value::single_value::T as AnimationPlayState;
-use properties::{self, CascadeMode, ComputedValues, LonghandId};
-use rule_tree::CascadeLevel;
+use crate::bezier::Bezier;
+use crate::context::SharedStyleContext;
+use crate::dom::{OpaqueNode, TElement};
+use crate::font_metrics::FontMetricsProvider;
+use crate::properties::animated_properties::AnimatedProperty;
+use crate::properties::longhands::animation_direction::computed_value::single_value::T as AnimationDirection;
+use crate::properties::longhands::animation_play_state::computed_value::single_value::T as AnimationPlayState;
+use crate::properties::{self, CascadeMode, ComputedValues, LonghandId};
+use crate::rule_tree::CascadeLevel;
+use crate::stylesheets::keyframes_rule::{KeyframesAnimation, KeyframesStep, KeyframesStepValue};
+use crate::timer::Timer;
+use crate::values::computed::box_::TransitionProperty;
+use crate::values::computed::Time;
+use crate::values::computed::TimingFunction;
+use crate::values::generics::box_::AnimationIterationCount;
+use crate::values::generics::easing::{StepPosition, TimingFunction as GenericTimingFunction};
+use crate::Atom;
 use servo_arc::Arc;
 #[cfg(feature = "servo")]
 use servo_channel::Sender;
 use std::fmt;
 #[cfg(feature = "gecko")]
 use std::sync::mpsc::Sender;
-use stylesheets::keyframes_rule::{KeyframesAnimation, KeyframesStep, KeyframesStepValue};
-use timer::Timer;
-use values::computed::box_::TransitionProperty;
-use values::computed::Time;
-use values::computed::TimingFunction;
-use values::generics::box_::AnimationIterationCount;
-use values::generics::easing::{StepPosition, TimingFunction as GenericTimingFunction};
-use Atom;
 
 /// This structure represents a keyframes animation current iteration state.
 ///
 /// If the iteration count is infinite, there's no other state, otherwise we
 /// have to keep track the current iteration and the max iteration count.
 #[derive(Clone, Debug)]
 pub enum KeyframesIterationState {
     /// Infinite iterations, so no need to track a state.
--- a/servo/components/style/applicable_declarations.rs
+++ b/servo/components/style/applicable_declarations.rs
@@ -1,18 +1,18 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * 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/. */
 
 //! Applicable declarations management.
 
-use properties::PropertyDeclarationBlock;
-use rule_tree::{CascadeLevel, ShadowCascadeOrder, StyleSource};
+use crate::properties::PropertyDeclarationBlock;
+use crate::rule_tree::{CascadeLevel, ShadowCascadeOrder, StyleSource};
+use crate::shared_lock::Locked;
 use servo_arc::Arc;
-use shared_lock::Locked;
 use smallvec::SmallVec;
 use std::fmt::{self, Debug};
 
 /// List of applicable declarations. This is a transient structure that shuttles
 /// declarations between selector matching and inserting into the rule tree, and
 /// therefore we want to avoid heap-allocation where possible.
 ///
 /// In measurements on wikipedia, we pretty much never have more than 8 applicable
--- a/servo/components/style/attr.rs
+++ b/servo/components/style/attr.rs
@@ -2,30 +2,30 @@
  * 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/. */
 
 //! Parsed representations of [DOM attributes][attr].
 //!
 //! [attr]: https://dom.spec.whatwg.org/#interface-attr
 
 use app_units::Au;
+use crate::properties::PropertyDeclarationBlock;
+use crate::shared_lock::Locked;
+use crate::str::str_join;
+use crate::str::{read_exponent, read_fraction, HTML_SPACE_CHARACTERS};
+use crate::str::{read_numbers, split_commas, split_html_space_chars};
+use crate::values::specified::Length;
+use crate::{Atom, LocalName, Namespace, Prefix};
 use cssparser::{self, Color, RGBA};
 use euclid::num::Zero;
 use num_traits::ToPrimitive;
-use properties::PropertyDeclarationBlock;
 use selectors::attr::AttrSelectorOperation;
 use servo_arc::Arc;
 use servo_url::ServoUrl;
-use shared_lock::Locked;
 use std::str::FromStr;
-use str::str_join;
-use str::{read_exponent, read_fraction, HTML_SPACE_CHARACTERS};
-use str::{read_numbers, split_commas, split_html_space_chars};
-use values::specified::Length;
-use {Atom, LocalName, Namespace, Prefix};
 
 // Duplicated from script::dom::values.
 const UNSIGNED_LONG_MAX: u32 = 2147483647;
 
 #[derive(Clone, Copy, Debug, PartialEq)]
 #[cfg_attr(feature = "servo", derive(MallocSizeOf))]
 pub enum LengthOrPercentageOrAuto {
     Auto,
--- a/servo/components/style/author_styles.rs
+++ b/servo/components/style/author_styles.rs
@@ -1,25 +1,25 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * 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/. */
 
 //! A set of author stylesheets and their computed representation, such as the
 //! ones used for ShadowRoot and XBL.
 
-use context::QuirksMode;
-use dom::TElement;
+use crate::context::QuirksMode;
+use crate::dom::TElement;
+use crate::invalidation::media_queries::ToMediaListKey;
+use crate::media_queries::Device;
+use crate::shared_lock::SharedRwLockReadGuard;
+use crate::stylesheet_set::AuthorStylesheetSet;
+use crate::stylesheets::StylesheetInDocument;
+use crate::stylist::CascadeData;
 #[cfg(feature = "gecko")]
 use gecko_bindings::sugar::ownership::{HasBoxFFI, HasFFI, HasSimpleFFI};
-use invalidation::media_queries::ToMediaListKey;
-use media_queries::Device;
-use shared_lock::SharedRwLockReadGuard;
-use stylesheet_set::AuthorStylesheetSet;
-use stylesheets::StylesheetInDocument;
-use stylist::CascadeData;
 
 /// A set of author stylesheets and their computed representation, such as the
 /// ones used for ShadowRoot and XBL.
 pub struct AuthorStyles<S>
 where
     S: StylesheetInDocument + PartialEq + 'static,
 {
     /// The sheet collection, which holds the sheet pointers, the invalidations,
--- a/servo/components/style/bezier.rs
+++ b/servo/components/style/bezier.rs
@@ -3,17 +3,17 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 //! Parametric Bézier curves.
 //!
 //! This is based on `WebCore/platform/graphics/UnitBezier.h` in WebKit.
 
 #![deny(missing_docs)]
 
-use values::CSSFloat;
+use crate::values::CSSFloat;
 
 const NEWTON_METHOD_ITERATIONS: u8 = 8;
 
 /// A unit cubic Bézier curve, used for timing functions in CSS transitions and animations.
 pub struct Bezier {
     ax: f64,
     bx: f64,
     cx: f64,
--- a/servo/components/style/bloom.rs
+++ b/servo/components/style/bloom.rs
@@ -3,17 +3,17 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 //! The style bloom filter is used as an optimization when matching deep
 //! descendant selectors.
 
 #![deny(missing_docs)]
 
 use atomic_refcell::{AtomicRefCell, AtomicRefMut};
-use dom::{SendElement, TElement};
+use crate::dom::{SendElement, TElement};
 use owning_ref::OwningHandle;
 use selectors::bloom::BloomFilter;
 use servo_arc::Arc;
 use smallvec::SmallVec;
 
 /// Bloom filters are large allocations, so we store them in thread-local storage
 /// such that they can be reused across style traversals. StyleBloom is responsible
 /// for ensuring that the bloom filter is zeroed when it is dropped.
--- a/servo/components/style/context.rs
+++ b/servo/components/style/context.rs
@@ -1,60 +1,60 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * 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/. */
 
 //! The context within which style is calculated.
 
+use app_units::Au;
 #[cfg(feature = "servo")]
-use animation::Animation;
-use app_units::Au;
-use bloom::StyleBloom;
-use data::{EagerPseudoStyles, ElementData};
+use crate::animation::Animation;
+use crate::bloom::StyleBloom;
+use crate::data::{EagerPseudoStyles, ElementData};
+#[cfg(feature = "servo")]
+use crate::dom::OpaqueNode;
+use crate::dom::{SendElement, TElement};
+use crate::font_metrics::FontMetricsProvider;
+use crate::parallel::{STACK_SAFETY_MARGIN_KB, STYLE_THREAD_STACK_SIZE_KB};
+use crate::properties::ComputedValues;
 #[cfg(feature = "servo")]
-use dom::OpaqueNode;
-use dom::{SendElement, TElement};
+use crate::properties::PropertyId;
+use crate::rule_cache::RuleCache;
+use crate::rule_tree::StrongRuleNode;
+use crate::selector_parser::{SnapshotMap, EAGER_PSEUDO_COUNT};
+use crate::shared_lock::StylesheetGuards;
+use crate::sharing::StyleSharingCache;
+use crate::stylist::Stylist;
+use crate::thread_state::{self, ThreadState};
+use crate::timer::Timer;
+use crate::traversal::DomTraversal;
+use crate::traversal_flags::TraversalFlags;
 use euclid::Size2D;
 use euclid::TypedScale;
-use font_metrics::FontMetricsProvider;
 use fxhash::FxHashMap;
 #[cfg(feature = "gecko")]
 use gecko_bindings::structs;
-use parallel::{STACK_SAFETY_MARGIN_KB, STYLE_THREAD_STACK_SIZE_KB};
 #[cfg(feature = "servo")]
 use parking_lot::RwLock;
-use properties::ComputedValues;
-#[cfg(feature = "servo")]
-use properties::PropertyId;
-use rule_cache::RuleCache;
-use rule_tree::StrongRuleNode;
-use selector_parser::{SnapshotMap, EAGER_PSEUDO_COUNT};
 use selectors::matching::ElementSelectorFlags;
 use selectors::NthIndexCache;
 use servo_arc::Arc;
 #[cfg(feature = "servo")]
 use servo_atoms::Atom;
 #[cfg(feature = "servo")]
 use servo_channel::Sender;
-use shared_lock::StylesheetGuards;
-use sharing::StyleSharingCache;
 use std::fmt;
 use std::ops;
 #[cfg(feature = "servo")]
 use std::sync::Mutex;
 use style_traits::CSSPixel;
 use style_traits::DevicePixel;
 #[cfg(feature = "servo")]
 use style_traits::SpeculativePainter;
-use stylist::Stylist;
-use thread_state::{self, ThreadState};
 use time;
-use timer::Timer;
-use traversal::DomTraversal;
-use traversal_flags::TraversalFlags;
 use uluru::{Entry, LRUCache};
 
 pub use selectors::matching::QuirksMode;
 
 /// This structure is used to create a local style context from a shared one.
 #[cfg(feature = "servo")]
 pub struct ThreadLocalStyleContextCreationInfo {
     new_animations_sender: Sender<Animation>,
--- a/servo/components/style/counter_style/mod.rs
+++ b/servo/components/style/counter_style/mod.rs
@@ -1,32 +1,32 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * 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/. */
 
 //! The [`@counter-style`][counter-style] at-rule.
 //!
 //! [counter-style]: https://drafts.csswg.org/css-counter-styles/
 
+use crate::error_reporting::ContextualParseError;
+use crate::parser::{Parse, ParserContext};
+use crate::shared_lock::{SharedRwLockReadGuard, ToCssWithGuard};
+use crate::str::CssStringWriter;
+use crate::values::specified::Integer;
+use crate::values::CustomIdent;
+use crate::Atom;
 use cssparser::{AtRuleParser, DeclarationListParser, DeclarationParser};
 use cssparser::{CowRcStr, Parser, SourceLocation, Token};
-use error_reporting::ContextualParseError;
-use parser::{Parse, ParserContext};
 use selectors::parser::SelectorParseErrorKind;
-use shared_lock::{SharedRwLockReadGuard, ToCssWithGuard};
 use std::fmt::{self, Write};
 use std::mem;
 use std::num::Wrapping;
 use std::ops::Range;
-use str::CssStringWriter;
 use style_traits::{Comma, CssWriter, OneOrMoreSeparated, ParseError};
 use style_traits::{StyleParseErrorKind, ToCss};
-use values::specified::Integer;
-use values::CustomIdent;
-use Atom;
 
 /// Parse a counter style name reference.
 ///
 /// This allows the reserved counter style names "decimal" and "disc".
 pub fn parse_counter_style_name<'i, 't>(
     input: &mut Parser<'i, 't>,
 ) -> Result<CustomIdent, ParseError<'i>> {
     macro_rules! predefined {
@@ -365,17 +365,17 @@ impl Parse for System {
     ) -> Result<Self, ParseError<'i>> {
         try_match_ident_ignore_ascii_case! { input,
             "cyclic" => Ok(System::Cyclic),
             "numeric" => Ok(System::Numeric),
             "alphabetic" => Ok(System::Alphabetic),
             "symbolic" => Ok(System::Symbolic),
             "additive" => Ok(System::Additive),
             "fixed" => {
-                let first_symbol_value = input.try(|i| Integer::parse(context, i)).ok();
+                let first_symbol_value = input.r#try(|i| Integer::parse(context, i)).ok();
                 Ok(System::Fixed { first_symbol_value: first_symbol_value })
             }
             "extends" => {
                 let other = parse_counter_style_name(input)?;
                 Ok(System::Extends(other))
             }
         }
     }
@@ -452,17 +452,17 @@ pub struct Negative(pub Symbol, pub Opti
 
 impl Parse for Negative {
     fn parse<'i, 't>(
         context: &ParserContext,
         input: &mut Parser<'i, 't>,
     ) -> Result<Self, ParseError<'i>> {
         Ok(Negative(
             Symbol::parse(context, input)?,
-            input.try(|input| Symbol::parse(context, input)).ok(),
+            input.r#try(|input| Symbol::parse(context, input)).ok(),
         ))
     }
 }
 
 /// <https://drafts.csswg.org/css-counter-styles/#counter-style-range>
 ///
 /// Empty Vec represents 'auto'
 #[derive(Clone, Debug)]
@@ -478,17 +478,17 @@ pub enum CounterBound {
 }
 
 impl Parse for Ranges {
     fn parse<'i, 't>(
         context: &ParserContext,
         input: &mut Parser<'i, 't>,
     ) -> Result<Self, ParseError<'i>> {
         if input
-            .try(|input| input.expect_ident_matching("auto"))
+            .r#try(|input| input.expect_ident_matching("auto"))
             .is_ok()
         {
             Ok(Ranges(Vec::new()))
         } else {
             input
                 .parse_comma_separated(|input| {
                     let opt_start = parse_bound(context, input)?;
                     let opt_end = parse_bound(context, input)?;
@@ -507,17 +507,17 @@ impl Parse for Ranges {
         }
     }
 }
 
 fn parse_bound<'i, 't>(
     context: &ParserContext,
     input: &mut Parser<'i, 't>,
 ) -> Result<CounterBound, ParseError<'i>> {
-    if let Ok(integer) = input.try(|input| Integer::parse(context, input)) {
+    if let Ok(integer) = input.r#try(|input| Integer::parse(context, input)) {
         return Ok(CounterBound::Integer(integer));
     }
     input.expect_ident_matching("infinite")?;
     Ok(CounterBound::Infinite)
 }
 
 impl ToCss for Ranges {
     fn to_css<W>(&self, dest: &mut CssWriter<W>) -> fmt::Result
@@ -551,17 +551,17 @@ where
 #[derive(Clone, Debug, ToCss)]
 pub struct Pad(pub Integer, pub Symbol);
 
 impl Parse for Pad {
     fn parse<'i, 't>(
         context: &ParserContext,
         input: &mut Parser<'i, 't>,
     ) -> Result<Self, ParseError<'i>> {
-        let pad_with = input.try(|input| Symbol::parse(context, input));
+        let pad_with = input.r#try(|input| Symbol::parse(context, input));
         let min_length = Integer::parse_non_negative(context, input)?;
         let pad_with = pad_with.or_else(|_| Symbol::parse(context, input))?;
         Ok(Pad(min_length, pad_with))
     }
 }
 
 /// <https://drafts.csswg.org/css-counter-styles/#counter-style-fallback>
 #[derive(Clone, Debug, ToCss)]
@@ -583,17 +583,17 @@ pub struct Symbols(#[css(iterable)] pub 
 
 impl Parse for Symbols {
     fn parse<'i, 't>(
         context: &ParserContext,
         input: &mut Parser<'i, 't>,
     ) -> Result<Self, ParseError<'i>> {
         let mut symbols = Vec::new();
         loop {
-            if let Ok(s) = input.try(|input| Symbol::parse(context, input)) {
+            if let Ok(s) = input.r#try(|input| Symbol::parse(context, input)) {
                 symbols.push(s)
             } else {
                 if symbols.is_empty() {
                     return Err(input.new_custom_error(StyleParseErrorKind::UnspecifiedError));
                 } else {
                     return Ok(Symbols(symbols));
                 }
             }
@@ -635,17 +635,17 @@ impl OneOrMoreSeparated for AdditiveTupl
     type S = Comma;
 }
 
 impl Parse for AdditiveTuple {
     fn parse<'i, 't>(
         context: &ParserContext,
         input: &mut Parser<'i, 't>,
     ) -> Result<Self, ParseError<'i>> {
-        let symbol = input.try(|input| Symbol::parse(context, input));
+        let symbol = input.r#try(|input| Symbol::parse(context, input));
         let weight = Integer::parse_non_negative(context, input)?;
         let symbol = symbol.or_else(|_| Symbol::parse(context, input))?;
         Ok(AdditiveTuple {
             weight: weight,
             symbol: symbol,
         })
     }
 }
@@ -668,17 +668,17 @@ pub enum SpeakAs {
 }
 
 impl Parse for SpeakAs {
     fn parse<'i, 't>(
         _context: &ParserContext,
         input: &mut Parser<'i, 't>,
     ) -> Result<Self, ParseError<'i>> {
         let mut is_spell_out = false;
-        let result = input.try(|input| {
+        let result = input.r#try(|input| {
             let ident = input.expect_ident().map_err(|_| ())?;
             match_ignore_ascii_case! { &*ident,
                 "auto" => Ok(SpeakAs::Auto),
                 "bullets" => Ok(SpeakAs::Bullets),
                 "numbers" => Ok(SpeakAs::Numbers),
                 "words" => Ok(SpeakAs::Words),
                 "spell-out" => {
                     is_spell_out = true;
--- a/servo/components/style/custom_properties.rs
+++ b/servo/components/style/custom_properties.rs
@@ -1,30 +1,30 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * 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/. */
 
 //! Support for [custom properties for cascading variables][custom].
 //!
 //! [custom]: https://drafts.csswg.org/css-variables/
 
+use crate::hash::map::Entry;
+use crate::properties::{CSSWideKeyword, CustomDeclarationValue};
+use crate::selector_map::{PrecomputedHashMap, PrecomputedHashSet};
+use crate::Atom;
 use cssparser::{Delimiter, Parser, ParserInput, SourcePosition, Token, TokenSerializationType};
-use hash::map::Entry;
 use precomputed_hash::PrecomputedHash;
-use properties::{CSSWideKeyword, CustomDeclarationValue};
-use selector_map::{PrecomputedHashMap, PrecomputedHashSet};
 use selectors::parser::SelectorParseErrorKind;
 use servo_arc::Arc;
 use smallvec::SmallVec;
 use std::borrow::{Borrow, Cow};
 use std::cmp;
 use std::fmt::{self, Write};
 use std::hash::Hash;
 use style_traits::{CssWriter, ParseError, StyleParseErrorKind, ToCss};
-use Atom;
 
 /// The environment from which to get `env` function values.
 ///
 /// TODO(emilio): If this becomes a bit more complex we should probably move it
 /// to the `media_queries` module, or something.
 #[derive(Debug, MallocSizeOf)]
 pub struct CssEnvironment;
 
@@ -548,33 +548,33 @@ fn parse_fallback<'i, 't>(input: &mut Pa
 fn parse_var_function<'i, 't>(
     input: &mut Parser<'i, 't>,
     references: Option<&mut VarOrEnvReferences>,
 ) -> Result<(), ParseError<'i>> {
     let name = input.expect_ident_cloned()?;
     let name = parse_name(&name).map_err(|()| {
         input.new_custom_error(SelectorParseErrorKind::UnexpectedIdent(name.clone()))
     })?;
-    if input.try(|input| input.expect_comma()).is_ok() {
+    if input.r#try(|input| input.expect_comma()).is_ok() {
         parse_fallback(input)?;
     }
     if let Some(refs) = references {
         refs.custom_property_references.insert(Atom::from(name));
     }
     Ok(())
 }
 
 fn parse_env_function<'i, 't>(
     input: &mut Parser<'i, 't>,
     references: Option<&mut VarOrEnvReferences>,
 ) -> Result<(), ParseError<'i>> {
     // TODO(emilio): This should be <custom-ident> per spec, but no other
     // browser does that, see https://github.com/w3c/csswg-drafts/issues/3262.
     input.expect_ident()?;
-    if input.try(|input| input.expect_comma()).is_ok() {
+    if input.r#try(|input| input.expect_comma()).is_ok() {
         parse_fallback(input)?;
     }
     if let Some(references) = references {
         references.references_environment = true;
     }
     Ok(())
 }
 
--- a/servo/components/style/data.rs
+++ b/servo/components/style/data.rs
@@ -1,30 +1,30 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * 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/. */
 
 //! Per-node data used in style calculation.
 
-use context::{SharedStyleContext, StackLimitChecker};
-use dom::TElement;
-use invalidation::element::invalidator::InvalidationResult;
-use invalidation::element::restyle_hints::RestyleHint;
+use crate::context::{SharedStyleContext, StackLimitChecker};
+use crate::dom::TElement;
+use crate::invalidation::element::invalidator::InvalidationResult;
+use crate::invalidation::element::restyle_hints::RestyleHint;
+use crate::properties::ComputedValues;
+use crate::rule_tree::StrongRuleNode;
+use crate::selector_parser::{PseudoElement, RestyleDamage, EAGER_PSEUDO_COUNT};
+use crate::shared_lock::StylesheetGuards;
+use crate::style_resolver::{PrimaryStyle, ResolvedElementStyles, ResolvedStyle};
 #[cfg(feature = "gecko")]
 use malloc_size_of::MallocSizeOfOps;
-use properties::ComputedValues;
-use rule_tree::StrongRuleNode;
-use selector_parser::{PseudoElement, RestyleDamage, EAGER_PSEUDO_COUNT};
 use selectors::NthIndexCache;
 use servo_arc::Arc;
-use shared_lock::StylesheetGuards;
 use std::fmt;
 use std::mem;
 use std::ops::{Deref, DerefMut};
-use style_resolver::{PrimaryStyle, ResolvedElementStyles, ResolvedStyle};
 
 bitflags! {
     /// Various flags stored on ElementData.
     #[derive(Default)]
     pub struct ElementDataFlags: u8 {
         /// Whether the styles changed for this restyle.
         const WAS_RESTYLED = 1 << 0;
         /// Whether the last traversal of this element did not do
@@ -250,18 +250,18 @@ impl ElementData {
         stack_limit_checker: Option<&StackLimitChecker>,
         nth_index_cache: &mut NthIndexCache,
     ) -> InvalidationResult {
         // In animation-only restyle we shouldn't touch snapshot at all.
         if shared_context.traversal_flags.for_animation_only() {
             return InvalidationResult::empty();
         }
 
-        use invalidation::element::invalidator::TreeStyleInvalidator;
-        use invalidation::element::state_and_attributes::StateAndAttrInvalidationProcessor;
+        use crate::invalidation::element::invalidator::TreeStyleInvalidator;
+        use crate::invalidation::element::state_and_attributes::StateAndAttrInvalidationProcessor;
 
         debug!(
             "invalidate_style_if_needed: {:?}, flags: {:?}, has_snapshot: {}, \
              handled_snapshot: {}, pseudo: {:?}",
             element,
             shared_context.traversal_flags,
             element.has_snapshot(),
             element.handled_snapshot(),
--- a/servo/components/style/dom.rs
+++ b/servo/components/style/dom.rs
@@ -2,40 +2,40 @@
  * 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/. */
 
 //! Types and traits used to access the DOM from style calculation.
 
 #![allow(unsafe_code)]
 #![deny(missing_docs)]
 
-use applicable_declarations::ApplicableDeclarationBlock;
 use atomic_refcell::{AtomicRef, AtomicRefCell, AtomicRefMut};
 #[cfg(feature = "gecko")]
 use context::PostAnimationTasks;
 #[cfg(feature = "gecko")]
 use context::UpdateAnimationsTasks;
-use data::ElementData;
-use element_state::ElementState;
-use font_metrics::FontMetricsProvider;
-use media_queries::Device;
-use properties::{AnimationRules, ComputedValues, PropertyDeclarationBlock};
-use selector_parser::{AttrValue, Lang, PseudoElement, SelectorImpl};
+use crate::applicable_declarations::ApplicableDeclarationBlock;
+use crate::data::ElementData;
+use crate::element_state::ElementState;
+use crate::font_metrics::FontMetricsProvider;
+use crate::media_queries::Device;
+use crate::properties::{AnimationRules, ComputedValues, PropertyDeclarationBlock};
+use crate::selector_parser::{AttrValue, Lang, PseudoElement, SelectorImpl};
+use crate::shared_lock::Locked;
+use crate::stylist::CascadeData;
+use crate::traversal_flags::TraversalFlags;
+use crate::{Atom, LocalName, Namespace, WeakAtom};
 use selectors::matching::{ElementSelectorFlags, QuirksMode, VisitedHandlingMode};
 use selectors::sink::Push;
 use selectors::Element as SelectorsElement;
 use servo_arc::{Arc, ArcBorrow};
-use shared_lock::Locked;
 use std::fmt;
 use std::fmt::Debug;
 use std::hash::Hash;
 use std::ops::Deref;
-use stylist::CascadeData;
-use traversal_flags::TraversalFlags;
-use {Atom, LocalName, Namespace, WeakAtom};
 
 /// An opaque handle to a node, which, unlike UnsafeNode, cannot be transformed
 /// back into a non-opaque representation. The only safe operation that can be
 /// performed on this node is to compare it to another opaque handle or to another
 /// OpaqueNode.
 ///
 /// Layout and Graphics use this to safely represent nodes for comparison purposes.
 /// Because the script task's GC does not trace layout, node data cannot be safely stored in layout
--- a/servo/components/style/dom_apis.rs
+++ b/servo/components/style/dom_apis.rs
@@ -1,26 +1,26 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * 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/. */
 
 //! Generic implementations of some DOM APIs so they can be shared between Servo
 //! and Gecko.
 
-use context::QuirksMode;
-use dom::{TDocument, TElement, TNode, TShadowRoot};
-use invalidation::element::invalidator::{DescendantInvalidationLists, Invalidation};
-use invalidation::element::invalidator::{InvalidationProcessor, InvalidationVector};
+use crate::context::QuirksMode;
+use crate::dom::{TDocument, TElement, TNode, TShadowRoot};
+use crate::invalidation::element::invalidator::{DescendantInvalidationLists, Invalidation};
+use crate::invalidation::element::invalidator::{InvalidationProcessor, InvalidationVector};
+use crate::Atom;
 use selectors::attr::CaseSensitivity;
 use selectors::matching::{self, MatchingContext, MatchingMode};
 use selectors::parser::{Combinator, Component, LocalName, SelectorImpl};
 use selectors::{Element, NthIndexCache, SelectorList};
 use smallvec::SmallVec;
 use std::borrow::Borrow;
-use Atom;
 
 /// <https://dom.spec.whatwg.org/#dom-element-matches>
 pub fn element_matches<E>(
     element: &E,
     selector_list: &SelectorList<E::Impl>,
     quirks_mode: QuirksMode,
 ) -> bool
 where
@@ -589,17 +589,17 @@ pub fn query_selector<E, Q>(
     root: E::ConcreteNode,
     selector_list: &SelectorList<E::Impl>,
     results: &mut Q::Output,
     may_use_invalidation: MayUseInvalidation,
 ) where
     E: TElement,
     Q: SelectorQuery<E>,
 {
-    use invalidation::element::invalidator::TreeStyleInvalidator;
+    use crate::invalidation::element::invalidator::TreeStyleInvalidator;
 
     let quirks_mode = root.owner_doc().quirks_mode();
 
     let mut nth_index_cache = NthIndexCache::default();
     let mut matching_context = MatchingContext::new(
         MatchingMode::Normal,
         None,
         Some(&mut nth_index_cache),
--- a/servo/components/style/driver.rs
+++ b/servo/components/style/driver.rs
@@ -2,27 +2,27 @@
  * 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/. */
 
 //! Implements traversal over the DOM tree. The traversal starts in sequential
 //! mode, and optionally parallelizes as it discovers work.
 
 #![deny(missing_docs)]
 
-use context::{PerThreadTraversalStatistics, StyleContext};
-use context::{ThreadLocalStyleContext, TraversalStatistics};
-use dom::{SendNode, TElement, TNode};
-use parallel;
-use parallel::{DispatchMode, WORK_UNIT_MAX};
+use crate::context::{PerThreadTraversalStatistics, StyleContext};
+use crate::context::{ThreadLocalStyleContext, TraversalStatistics};
+use crate::dom::{SendNode, TElement, TNode};
+use crate::parallel;
+use crate::parallel::{DispatchMode, WORK_UNIT_MAX};
+use crate::scoped_tls::ScopedTLS;
+use crate::traversal::{DomTraversal, PerLevelTraversalData, PreTraverseToken};
 use rayon;
-use scoped_tls::ScopedTLS;
 use std::collections::VecDeque;
 use std::mem;
 use time;
-use traversal::{DomTraversal, PerLevelTraversalData, PreTraverseToken};
 
 #[cfg(feature = "servo")]
 fn should_report_statistics() -> bool {
     false
 }
 
 #[cfg(feature = "gecko")]
 fn should_report_statistics() -> bool {
--- a/servo/components/style/encoding_support.rs
+++ b/servo/components/style/encoding_support.rs
@@ -1,25 +1,25 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * 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/. */
 
 //! Parsing stylesheets from bytes (not `&str`).
 
 extern crate encoding_rs;
 
-use context::QuirksMode;
+use crate::context::QuirksMode;
+use crate::error_reporting::ParseErrorReporter;
+use crate::media_queries::MediaList;
+use crate::shared_lock::SharedRwLock;
+use crate::stylesheets::{Origin, Stylesheet, StylesheetLoader, UrlExtraData};
 use cssparser::{stylesheet_encoding, EncodingSupport};
-use error_reporting::ParseErrorReporter;
-use media_queries::MediaList;
 use servo_arc::Arc;
-use shared_lock::SharedRwLock;
 use std::borrow::Cow;
 use std::str;
-use stylesheets::{Origin, Stylesheet, StylesheetLoader, UrlExtraData};
 
 struct EncodingRs;
 
 impl EncodingSupport for EncodingRs {
     type Encoding = &'static encoding_rs::Encoding;
 
     fn utf8() -> Self::Encoding {
         encoding_rs::UTF_8
--- a/servo/components/style/error_reporting.rs
+++ b/servo/components/style/error_reporting.rs
@@ -1,20 +1,20 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * 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/. */
 
 //! Types used to report parsing errors.
 
 #![deny(missing_docs)]
 
+use crate::stylesheets::UrlExtraData;
 use cssparser::{BasicParseErrorKind, ParseErrorKind, SourceLocation, Token};
 use std::fmt;
 use style_traits::ParseError;
-use stylesheets::UrlExtraData;
 
 /// Errors that can be encountered while parsing CSS.
 #[derive(Debug)]
 pub enum ContextualParseError<'a> {
     /// A property declaration was not recognized.
     UnsupportedPropertyDeclaration(&'a str, ParseError<'a>),
     /// A font face descriptor was not recognized.
     UnsupportedFontFaceDescriptor(&'a str, ParseError<'a>),
--- a/servo/components/style/font_face.rs
+++ b/servo/components/style/font_face.rs
@@ -1,39 +1,39 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * 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/. */
 
 //! The [`@font-face`][ff] at-rule.
 //!
 //! [ff]: https://drafts.csswg.org/css-fonts/#at-font-face-rule
 
+use crate::error_reporting::ContextualParseError;
+use crate::parser::{Parse, ParserContext};
+use crate::shared_lock::{SharedRwLockReadGuard, ToCssWithGuard};
+use crate::str::CssStringWriter;
+use crate::values::computed::font::FamilyName;
+use crate::values::generics::font::FontStyle as GenericFontStyle;
+use crate::values::specified::font::SpecifiedFontStyle;
+use crate::values::specified::font::{AbsoluteFontWeight, FontStretch};
+use crate::values::specified::url::SpecifiedUrl;
+use crate::values::specified::Angle;
 #[cfg(feature = "gecko")]
 use cssparser::UnicodeRange;
 use cssparser::{AtRuleParser, DeclarationListParser, DeclarationParser, Parser};
 use cssparser::{CowRcStr, SourceLocation};
-use error_reporting::ContextualParseError;
-use parser::{Parse, ParserContext};
 #[cfg(feature = "gecko")]
 use properties::longhands::font_language_override;
 use selectors::parser::SelectorParseErrorKind;
-use shared_lock::{SharedRwLockReadGuard, ToCssWithGuard};
 use std::fmt::{self, Write};
-use str::CssStringWriter;
 use style_traits::values::SequenceWriter;
 use style_traits::{Comma, CssWriter, OneOrMoreSeparated, ParseError};
 use style_traits::{StyleParseErrorKind, ToCss};
-use values::computed::font::FamilyName;
-use values::generics::font::FontStyle as GenericFontStyle;
-use values::specified::font::SpecifiedFontStyle;
-use values::specified::font::{AbsoluteFontWeight, FontStretch};
 #[cfg(feature = "gecko")]
 use values::specified::font::{SpecifiedFontFeatureSettings, SpecifiedFontVariationSettings};
-use values::specified::url::SpecifiedUrl;
-use values::specified::Angle;
 
 /// A source for a font-face rule.
 #[cfg_attr(feature = "servo", derive(Deserialize, Serialize))]
 #[derive(Clone, Debug, Eq, PartialEq, ToCss)]
 pub enum Source {
     /// A `url()` source.
     Url(UrlSource),
     /// A `local()` source.
@@ -113,17 +113,17 @@ macro_rules! impl_range {
     ($range:ident, $component:ident) => {
         impl Parse for $range {
             fn parse<'i, 't>(
                 context: &ParserContext,
                 input: &mut Parser<'i, 't>,
             ) -> Result<Self, ParseError<'i>> {
                 let first = $component::parse(context, input)?;
                 let second = input
-                    .try(|input| $component::parse(context, input))
+                    .r#try(|input| $component::parse(context, input))
                     .unwrap_or_else(|_| first.clone());
                 Ok($range(first, second))
             }
         }
         impl ToCss for $range {
             fn to_css<W>(&self, dest: &mut CssWriter<W>) -> fmt::Result
             where
                 W: fmt::Write,
@@ -227,17 +227,17 @@ impl Parse for FontStyle {
         input: &mut Parser<'i, 't>,
     ) -> Result<Self, ParseError<'i>> {
         let style = SpecifiedFontStyle::parse(context, input)?;
         Ok(match style {
             GenericFontStyle::Normal => FontStyle::Normal,
             GenericFontStyle::Italic => FontStyle::Italic,
             GenericFontStyle::Oblique(angle) => {
                 let second_angle = input
-                    .try(|input| SpecifiedFontStyle::parse_angle(context, input))
+                    .r#try(|input| SpecifiedFontStyle::parse_angle(context, input))
                     .unwrap_or_else(|_| angle.clone());
 
                 FontStyle::Oblique(angle, second_angle)
             },
         })
     }
 }
 
@@ -373,29 +373,29 @@ impl<'a, 'b, 'i> AtRuleParser<'i> for Fo
 }
 
 impl Parse for Source {
     fn parse<'i, 't>(
         context: &ParserContext,
         input: &mut Parser<'i, 't>,
     ) -> Result<Source, ParseError<'i>> {
         if input
-            .try(|input| input.expect_function_matching("local"))
+            .r#try(|input| input.expect_function_matching("local"))
             .is_ok()
         {
             return input
                 .parse_nested_block(|input| FamilyName::parse(context, input))
                 .map(Source::Local);
         }
 
         let url = SpecifiedUrl::parse(context, input)?;
 
         // Parsing optional format()
         let format_hints = if input
-            .try(|input| input.expect_function_matching("format"))
+            .r#try(|input| input.expect_function_matching("format"))
             .is_ok()
         {
             input.parse_nested_block(|input| {
                 input.parse_comma_separated(|input| Ok(input.expect_string()?.as_ref().to_owned()))
             })?
         } else {
             vec![]
         };
--- a/servo/components/style/font_metrics.rs
+++ b/servo/components/style/font_metrics.rs
@@ -2,21 +2,21 @@
  * 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/. */
 
 //! Access to font metrics from the style system.
 
 #![deny(missing_docs)]
 
 use app_units::Au;
-use context::SharedStyleContext;
-use logical_geometry::WritingMode;
-use media_queries::Device;
-use properties::style_structs::Font;
-use Atom;
+use crate::context::SharedStyleContext;
+use crate::logical_geometry::WritingMode;
+use crate::media_queries::Device;
+use crate::properties::style_structs::Font;
+use crate::Atom;
 
 /// Represents the font metrics that style needs from a font to compute the
 /// value of certain CSS units like `ex`.
 #[derive(Clone, Debug, PartialEq)]
 pub struct FontMetrics {
     /// The x-height of the font.
     pub x_height: Au,
     /// The zero advance. This is usually writing mode dependent
--- a/servo/components/style/invalidation/element/document_state.rs
+++ b/servo/components/style/invalidation/element/document_state.rs
@@ -1,21 +1,21 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * 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/. */
 
 //! An invalidation processor for style changes due to document state changes.
 
-use dom::TElement;
-use element_state::DocumentState;
-use invalidation::element::invalidator::{DescendantInvalidationLists, InvalidationVector};
-use invalidation::element::invalidator::{Invalidation, InvalidationProcessor};
-use invalidation::element::state_and_attributes;
+use crate::dom::TElement;
+use crate::element_state::DocumentState;
+use crate::invalidation::element::invalidator::{DescendantInvalidationLists, InvalidationVector};
+use crate::invalidation::element::invalidator::{Invalidation, InvalidationProcessor};
+use crate::invalidation::element::state_and_attributes;
+use crate::stylist::CascadeData;
 use selectors::matching::{MatchingContext, MatchingMode, QuirksMode, VisitedHandlingMode};
-use stylist::CascadeData;
 
 /// A struct holding the members necessary to invalidate document state
 /// selectors.
 pub struct InvalidationMatchingData {
     /// The document state that has changed, which makes it always match.
     pub document_state: DocumentState,
 }
 
--- a/servo/components/style/invalidation/element/element_wrapper.rs
+++ b/servo/components/style/invalidation/element/element_wrapper.rs
@@ -1,25 +1,25 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * 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/. */
 
 //! A wrapper over an element and a snapshot, that allows us to selector-match
 //! against a past state of the element.
 
-use dom::TElement;
-use element_state::ElementState;
-use selector_parser::{AttrValue, NonTSPseudoClass, PseudoElement, SelectorImpl};
-use selector_parser::{Snapshot, SnapshotMap};
+use crate::dom::TElement;
+use crate::element_state::ElementState;
+use crate::selector_parser::{AttrValue, NonTSPseudoClass, PseudoElement, SelectorImpl};
+use crate::selector_parser::{Snapshot, SnapshotMap};
+use crate::{Atom, CaseSensitivityExt, LocalName, Namespace, WeakAtom};
 use selectors::attr::{AttrSelectorOperation, CaseSensitivity, NamespaceConstraint};
 use selectors::matching::{ElementSelectorFlags, MatchingContext};
 use selectors::{Element, OpaqueElement};
 use std::cell::Cell;
 use std::fmt;
-use {Atom, CaseSensitivityExt, LocalName, Namespace, WeakAtom};
 
 /// In order to compute restyle hints, we perform a selector match against a
 /// list of partial selectors whose rightmost simple selector may be sensitive
 /// to the thing being changed. We do this matching twice, once for the element
 /// as it exists now and once for the element as it existed at the time of the
 /// last restyle. If the results of the selector match differ, that means that
 /// the given partial selector is sensitive to the change, and we compute a
 /// restyle hint based on its combinator.
@@ -55,17 +55,17 @@ pub trait ElementSnapshot: Sized {
     fn id_attr(&self) -> Option<&WeakAtom>;
 
     /// Whether this snapshot contains the class `name`. Should only be called
     /// if `has_attrs()` returns true.
     fn has_class(&self, name: &Atom, case_sensitivity: CaseSensitivity) -> bool;
 
     /// A callback that should be called for each class of the snapshot. Should
     /// only be called if `has_attrs()` returns true.
-    fn each_class<F>(&self, F)
+    fn each_class<F>(&self, _: F)
     where
         F: FnMut(&Atom);
 
     /// The `xml:lang=""` or `lang=""` attribute value per this snapshot.
     fn lang_attr(&self) -> Option<AttrValue>;
 }
 
 /// A simple wrapper over an element and a snapshot, that allows us to
--- a/servo/components/style/invalidation/element/invalidation_map.rs
+++ b/servo/components/style/invalidation/element/invalidation_map.rs
@@ -1,26 +1,26 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * 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/. */
 
 //! Code for invalidations due to state or attribute changes.
 
-use context::QuirksMode;
-use element_state::{DocumentState, ElementState};
+use crate::context::QuirksMode;
+use crate::element_state::{DocumentState, ElementState};
+use crate::selector_map::{MaybeCaseInsensitiveHashMap, SelectorMap, SelectorMapEntry};
+use crate::selector_parser::SelectorImpl;
+use crate::{Atom, LocalName, Namespace};
 use fallible::FallibleVec;
 use hashglobe::FailedAllocationError;
-use selector_map::{MaybeCaseInsensitiveHashMap, SelectorMap, SelectorMapEntry};
-use selector_parser::SelectorImpl;
 use selectors::attr::NamespaceConstraint;
 use selectors::parser::{Combinator, Component};
 use selectors::parser::{Selector, SelectorIter, Visit};
 use selectors::visitor::SelectorVisitor;
 use smallvec::SmallVec;
-use {Atom, LocalName, Namespace};
 
 /// Mapping between (partial) CompoundSelectors (and the combinator to their
 /// right) and the states and attributes they depend on.
 ///
 /// In general, for all selectors in all applicable stylesheets of the form:
 ///
 /// |a _ b _ c _ d _ e|
 ///
--- a/servo/components/style/invalidation/element/invalidator.rs
+++ b/servo/components/style/invalidation/element/invalidator.rs
@@ -1,18 +1,18 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * 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/. */
 
 //! The struct that takes care of encapsulating all the logic on where and how
 //! element styles need to be invalidated.
 
-use context::StackLimitChecker;
-use dom::{TElement, TNode, TShadowRoot};
-use selector_parser::SelectorImpl;
+use crate::context::StackLimitChecker;
+use crate::dom::{TElement, TNode, TShadowRoot};
+use crate::selector_parser::SelectorImpl;
 use selectors::matching::matches_compound_selector_from;
 use selectors::matching::{CompoundSelectorMatchingResult, MatchingContext};
 use selectors::parser::{Combinator, Component, Selector};
 use smallvec::SmallVec;
 use std::fmt;
 
 /// A trait to abstract the collection of invalidations for a given pass.
 pub trait InvalidationProcessor<'a, E>
--- a/servo/components/style/invalidation/element/restyle_hints.rs
+++ b/servo/components/style/invalidation/element/restyle_hints.rs
@@ -1,17 +1,17 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * 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/. */
 
 //! Restyle hints: an optimization to avoid unnecessarily matching selectors.
 
+use crate::traversal_flags::TraversalFlags;
 #[cfg(feature = "gecko")]
 use gecko_bindings::structs::nsRestyleHint;
-use traversal_flags::TraversalFlags;
 
 bitflags! {
     /// The kind of restyle we need to do for a given element.
     pub struct RestyleHint: u8 {
         /// Do a selector match of the element.
         const RESTYLE_SELF = 1 << 0;
 
         /// Do a selector match of the element's descendants.
--- a/servo/components/style/invalidation/element/state_and_attributes.rs
+++ b/servo/components/style/invalidation/element/state_and_attributes.rs
@@ -1,33 +1,33 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * 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/. */
 
 //! An invalidation processor for style changes due to state and attribute
 //! changes.
 
-use context::SharedStyleContext;
-use data::ElementData;
-use dom::TElement;
-use element_state::ElementState;
-use invalidation::element::element_wrapper::{ElementSnapshot, ElementWrapper};
-use invalidation::element::invalidation_map::*;
-use invalidation::element::invalidator::{DescendantInvalidationLists, InvalidationVector};
-use invalidation::element::invalidator::{Invalidation, InvalidationProcessor};
-use invalidation::element::restyle_hints::RestyleHint;
-use selector_map::SelectorMap;
-use selector_parser::Snapshot;
+use crate::context::SharedStyleContext;
+use crate::data::ElementData;
+use crate::dom::TElement;
+use crate::element_state::ElementState;
+use crate::invalidation::element::element_wrapper::{ElementSnapshot, ElementWrapper};
+use crate::invalidation::element::invalidation_map::*;
+use crate::invalidation::element::invalidator::{DescendantInvalidationLists, InvalidationVector};
+use crate::invalidation::element::invalidator::{Invalidation, InvalidationProcessor};
+use crate::invalidation::element::restyle_hints::RestyleHint;
+use crate::selector_map::SelectorMap;
+use crate::selector_parser::Snapshot;
+use crate::stylesheets::origin::{Origin, OriginSet};
+use crate::{Atom, WeakAtom};
 use selectors::attr::CaseSensitivity;
 use selectors::matching::matches_selector;
 use selectors::matching::{MatchingContext, MatchingMode, VisitedHandlingMode};
 use selectors::NthIndexCache;
 use smallvec::SmallVec;
-use stylesheets::origin::{Origin, OriginSet};
-use {Atom, WeakAtom};
 
 /// The collector implementation.
 struct Collector<'a, 'b: 'a, 'selectors: 'a, E>
 where
     E: TElement,
 {
     element: E,
     wrapper: ElementWrapper<'b, E>,
--- a/servo/components/style/invalidation/media_queries.rs
+++ b/servo/components/style/invalidation/media_queries.rs
@@ -1,20 +1,20 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * 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/. */
 
 //! Code related to the invalidation of media-query-affected rules.
 
-use context::QuirksMode;
+use crate::context::QuirksMode;
+use crate::media_queries::Device;
+use crate::shared_lock::SharedRwLockReadGuard;
+use crate::stylesheets::{DocumentRule, ImportRule, MediaRule};
+use crate::stylesheets::{NestedRuleIterationCondition, Stylesheet, SupportsRule};
 use fxhash::FxHashSet;
-use media_queries::Device;
-use shared_lock::SharedRwLockReadGuard;
-use stylesheets::{DocumentRule, ImportRule, MediaRule};
-use stylesheets::{NestedRuleIterationCondition, Stylesheet, SupportsRule};
 
 /// A key for a given media query result.
 ///
 /// NOTE: It happens to be the case that all the media lists we care about
 /// happen to have a stable address, so we can just use an opaque pointer to
 /// represent them.
 ///
 /// Also, note that right now when a rule or stylesheet is removed, we do a full
@@ -110,23 +110,23 @@ impl NestedRuleIterationCondition for Po
 
     /// Whether we should process the nested rules in a given `@-moz-document` rule.
     fn process_document(
         guard: &SharedRwLockReadGuard,
         device: &Device,
         quirks_mode: QuirksMode,
         rule: &DocumentRule,
     ) -> bool {
-        use stylesheets::EffectiveRules;
+        use crate::stylesheets::EffectiveRules;
         EffectiveRules::process_document(guard, device, quirks_mode, rule)
     }
 
     /// Whether we should process the nested rules in a given `@supports` rule.
     fn process_supports(
         guard: &SharedRwLockReadGuard,
         device: &Device,
         quirks_mode: QuirksMode,
         rule: &SupportsRule,
     ) -> bool {
-        use stylesheets::EffectiveRules;
+        use crate::stylesheets::EffectiveRules;
         EffectiveRules::process_supports(guard, device, quirks_mode, rule)
     }
 }
--- a/servo/components/style/invalidation/stylesheets.rs
+++ b/servo/components/style/invalidation/stylesheets.rs
@@ -2,29 +2,29 @@
  * 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/. */
 
 //! A collection of invalidations due to changes in which stylesheets affect a
 //! document.
 
 #![deny(unsafe_code)]
 
-use dom::{TDocument, TElement, TNode};
+use crate::dom::{TDocument, TElement, TNode};
+use crate::invalidation::element::element_wrapper::{ElementSnapshot, ElementWrapper};
+use crate::invalidation::element::restyle_hints::RestyleHint;
+use crate::media_queries::Device;
+use crate::selector_parser::{SelectorImpl, Snapshot, SnapshotMap};
+use crate::shared_lock::SharedRwLockReadGuard;
+use crate::stylesheets::{CssRule, StylesheetInDocument};
+use crate::Atom;
+use crate::CaseSensitivityExt;
+use crate::LocalName as SelectorLocalName;
 use fxhash::FxHashSet;
-use invalidation::element::element_wrapper::{ElementSnapshot, ElementWrapper};
-use invalidation::element::restyle_hints::RestyleHint;
-use media_queries::Device;
-use selector_parser::{SelectorImpl, Snapshot, SnapshotMap};
 use selectors::attr::CaseSensitivity;
 use selectors::parser::{Component, LocalName, Selector};
-use shared_lock::SharedRwLockReadGuard;
-use stylesheets::{CssRule, StylesheetInDocument};
-use Atom;
-use CaseSensitivityExt;
-use LocalName as SelectorLocalName;
 
 /// A style sheet invalidation represents a kind of element or subtree that may
 /// need to be restyled. Whether it represents a whole subtree or just a single
 /// element is determined by whether the invalidation is stored in the
 /// StylesheetInvalidationSet's invalid_scopes or invalid_elements table.
 #[derive(Debug, Eq, Hash, MallocSizeOf, PartialEq)]
 enum Invalidation {
     /// An element with a given id.
@@ -414,17 +414,17 @@ impl StylesheetInvalidationSet {
 
     /// Collects invalidations for a given CSS rule.
     fn collect_invalidations_for_rule(
         &mut self,
         rule: &CssRule,
         guard: &SharedRwLockReadGuard,
         device: &Device,
     ) {
-        use stylesheets::CssRule::*;
+        use crate::stylesheets::CssRule::*;
         debug!("StylesheetInvalidationSet::collect_invalidations_for_rule");
         debug_assert!(!self.fully_invalid, "Not worth to be here!");
 
         match *rule {
             Style(ref lock) => {
                 let style_rule = lock.read_with(guard);
                 for selector in &style_rule.selectors.0 {
                     self.collect_invalidations(selector);
--- a/servo/components/style/lib.rs
+++ b/servo/components/style/lib.rs
@@ -211,20 +211,20 @@ pub mod gecko_properties {
 
 macro_rules! reexport_computed_values {
     ( $( { $name: ident, $boxed: expr } )+ ) => {
         /// Types for [computed values][computed].
         ///
         /// [computed]: https://drafts.csswg.org/css-cascade/#computed
         pub mod computed_values {
             $(
-                pub use properties::longhands::$name::computed_value as $name;
+                pub use crate::properties::longhands::$name::computed_value as $name;
             )+
             // Don't use a side-specific name needlessly:
-            pub use properties::longhands::border_top_style::computed_value as border_style;
+            pub use crate::properties::longhands::border_top_style::computed_value as border_style;
         }
     }
 }
 longhand_properties_idents!(reexport_computed_values);
 
 #[cfg(feature = "gecko")]
 use gecko_string_cache::WeakAtom;
 #[cfg(feature = "servo")]
--- a/servo/components/style/logical_geometry.rs
+++ b/servo/components/style/logical_geometry.rs
@@ -1,17 +1,17 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * 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/. */
 
 //! Geometry in flow-relative space.
 
+use crate::properties::style_structs;
 use euclid::num::Zero;
 use euclid::{Point2D, Rect, SideOffsets2D, Size2D};
-use properties::style_structs;
 use std::cmp::{max, min};
 use std::fmt::{self, Debug, Error, Formatter};
 use std::ops::{Add, Sub};
 use unicode_bidi as bidi;
 
 pub enum BlockFlowDirection {
     TopToBottom,
     RightToLeft,
@@ -37,18 +37,18 @@ bitflags!(
         const SIDEWAYS = 1 << 4;
         const UPRIGHT = 1 << 5;
     }
 );
 
 impl WritingMode {
     /// Return a WritingMode bitflags from the relevant CSS properties.
     pub fn new(inheritedbox_style: &style_structs::InheritedBox) -> Self {
-        use properties::longhands::direction::computed_value::T as Direction;
-        use properties::longhands::writing_mode::computed_value::T as SpecifiedWritingMode;
+        use crate::properties::longhands::direction::computed_value::T as Direction;
+        use crate::properties::longhands::writing_mode::computed_value::T as SpecifiedWritingMode;
 
         let mut flags = WritingMode::empty();
 
         match inheritedbox_style.clone_direction() {
             Direction::Ltr => {},
             Direction::Rtl => {
                 flags.insert(WritingMode::RTL);
             },
--- a/servo/components/style/matching.rs
+++ b/servo/components/style/matching.rs
@@ -2,29 +2,29 @@
  * 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/. */
 
 //! High-level interface to CSS selector matching.
 
 #![allow(unsafe_code)]
 #![deny(missing_docs)]
 
-use context::{ElementCascadeInputs, QuirksMode, SelectorFlagsMap};
-use context::{SharedStyleContext, StyleContext};
-use data::ElementData;
-use dom::TElement;
-use invalidation::element::restyle_hints::RestyleHint;
-use properties::longhands::display::computed_value::T as Display;
-use properties::ComputedValues;
-use rule_tree::{CascadeLevel, StrongRuleNode};
-use selector_parser::{PseudoElement, RestyleDamage};
+use crate::context::{ElementCascadeInputs, QuirksMode, SelectorFlagsMap};
+use crate::context::{SharedStyleContext, StyleContext};
+use crate::data::ElementData;
+use crate::dom::TElement;
+use crate::invalidation::element::restyle_hints::RestyleHint;
+use crate::properties::longhands::display::computed_value::T as Display;
+use crate::properties::ComputedValues;
+use crate::rule_tree::{CascadeLevel, StrongRuleNode};
+use crate::selector_parser::{PseudoElement, RestyleDamage};
+use crate::style_resolver::ResolvedElementStyles;
+use crate::traversal_flags::TraversalFlags;
 use selectors::matching::ElementSelectorFlags;
 use servo_arc::{Arc, ArcBorrow};
-use style_resolver::ResolvedElementStyles;
-use traversal_flags::TraversalFlags;
 
 /// Represents the result of comparing an element's old and new style.
 #[derive(Debug)]
 pub struct StyleDifference {
     /// The resulting damage.
     pub damage: RestyleDamage,
 
     /// Whether any styles changed.
@@ -88,18 +88,18 @@ trait PrivateMatchMethods: TElement {
     /// Returns true if an !important rule was replaced.
     fn replace_rules_internal(
         &self,
         replacements: RestyleHint,
         context: &mut StyleContext<Self>,
         cascade_visited: CascadeVisitedMode,
         cascade_inputs: &mut ElementCascadeInputs,
     ) -> bool {
-        use properties::PropertyDeclarationBlock;
-        use shared_lock::Locked;
+        use crate::properties::PropertyDeclarationBlock;
+        use crate::shared_lock::Locked;
 
         debug_assert!(
             replacements.intersects(RestyleHint::replacements()) &&
                 (replacements & !RestyleHint::replacements()).is_empty()
         );
 
         let stylist = &context.shared.stylist;
         let guards = &context.shared.guards;
@@ -414,18 +414,18 @@ trait PrivateMatchMethods: TElement {
     fn process_animations(
         &self,
         context: &mut StyleContext<Self>,
         old_values: &mut Option<Arc<ComputedValues>>,
         new_values: &mut Arc<ComputedValues>,
         _restyle_hint: RestyleHint,
         _important_rules_changed: bool,
     ) {
-        use animation;
-        use dom::TNode;
+        use crate::animation;
+        use crate::dom::TNode;
 
         let mut possibly_expired_animations = vec![];
         let shared_context = context.shared;
         if let Some(ref mut old) = *old_values {
             // FIXME(emilio, #20116): This makes no sense.
             self.update_animations_for_cascade(
                 shared_context,
                 old,
@@ -578,21 +578,21 @@ trait PrivateMatchMethods: TElement {
     // Also, this function gets the old style, for some reason I don't really
     // get, but the functions called (mainly update_style_for_animation) expects
     // the new style, wtf?
     #[cfg(feature = "servo")]
     fn update_animations_for_cascade(
         &self,
         context: &SharedStyleContext,
         style: &mut Arc<ComputedValues>,
-        possibly_expired_animations: &mut Vec<::animation::PropertyAnimation>,
-        font_metrics: &::font_metrics::FontMetricsProvider,
+        possibly_expired_animations: &mut Vec<crate::animation::PropertyAnimation>,
+        font_metrics: &crate::font_metrics::FontMetricsProvider,
     ) {
-        use animation::{self, Animation, AnimationUpdate};
-        use dom::TNode;
+        use crate::animation::{self, Animation, AnimationUpdate};
+        use crate::dom::TNode;
 
         // Finish any expired transitions.
         let this_opaque = self.as_node().opaque();
         animation::complete_expired_transitions(this_opaque, style, context);
 
         // Merge any running animations into the current style, and cancel them.
         let had_running_animations = context
             .running_animations
--- a/servo/components/style/media_queries/media_condition.rs
+++ b/servo/components/style/media_queries/media_condition.rs
@@ -2,19 +2,19 @@
  * 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/. */
 
 //! A media query condition:
 //!
 //! https://drafts.csswg.org/mediaqueries-4/#typedef-media-condition
 
 use super::{Device, MediaFeatureExpression};
-use context::QuirksMode;
+use crate::context::QuirksMode;
+use crate::parser::ParserContext;
 use cssparser::{Parser, Token};
-use parser::ParserContext;
 use std::fmt::{self, Write};
 use style_traits::{CssWriter, ParseError, StyleParseErrorKind, ToCss};
 
 /// A binary `and` or `or` operator.
 #[derive(Clone, Copy, Debug, Eq, MallocSizeOf, Parse, PartialEq, ToCss)]
 #[allow(missing_docs)]
 pub enum Operator {
     And,
@@ -109,17 +109,17 @@ impl MediaCondition {
 
         if is_negation {
             let inner_condition = Self::parse_in_parens(context, input)?;
             return Ok(MediaCondition::Not(Box::new(inner_condition)));
         }
 
         // ParenthesisBlock.
         let first_condition = Self::parse_paren_block(context, input)?;
-        let operator = match input.try(Operator::parse) {
+        let operator = match input.r#try(Operator::parse) {
             Ok(op) => op,
             Err(..) => return Ok(first_condition),
         };
 
         if allow_or == AllowOr::No && operator == Operator::Or {
             return Err(location.new_custom_error(StyleParseErrorKind::UnspecifiedError));
         }
 
@@ -128,17 +128,17 @@ impl MediaCondition {
         conditions.push(Self::parse_in_parens(context, input)?);
 
         let delim = match operator {
             Operator::And => "and",
             Operator::Or => "or",
         };
 
         loop {
-            if input.try(|i| i.expect_ident_matching(delim)).is_err() {
+            if input.r#try(|i| i.expect_ident_matching(delim)).is_err() {
                 return Ok(MediaCondition::Operation(
                     conditions.into_boxed_slice(),
                     operator,
                 ));
             }
 
             conditions.push(Self::parse_in_parens(context, input)?);
         }
@@ -154,17 +154,17 @@ impl MediaCondition {
     }
 
     fn parse_paren_block<'i, 't>(
         context: &ParserContext,
         input: &mut Parser<'i, 't>,
     ) -> Result<Self, ParseError<'i>> {
         input.parse_nested_block(|input| {
             // Base case.
-            if let Ok(inner) = input.try(|i| Self::parse(context, i)) {
+            if let Ok(inner) = input.r#try(|i| Self::parse(context, i)) {
                 return Ok(MediaCondition::InParens(Box::new(inner)));
             }
             let expr = MediaFeatureExpression::parse_in_parenthesis_block(context, input)?;
             Ok(MediaCondition::Feature(expr))
         })
     }
 
     /// Whether this condition matches the device and quirks mode.
--- a/servo/components/style/media_queries/media_feature.rs
+++ b/servo/components/style/media_queries/media_feature.rs
@@ -1,22 +1,22 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * 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/. */
 
 //! Media features.
 
 use super::media_feature_expression::{AspectRatio, RangeOrOperator};
 use super::Device;
+use crate::parser::ParserContext;
+use crate::values::computed::{CSSPixelLength, Resolution};
+use crate::Atom;
 use cssparser::Parser;
-use parser::ParserContext;
 use std::fmt;
 use style_traits::ParseError;
-use values::computed::{CSSPixelLength, Resolution};
-use Atom;
 
 /// A generic discriminant for an enum value.
 pub type KeywordDiscriminant = u8;
 
 type MediaFeatureEvaluator<T> = fn(
     device: &Device,
     // null == no value was given in the query.
     value: Option<T>,
--- a/servo/components/style/media_queries/media_feature_expression.rs
+++ b/servo/components/style/media_queries/media_feature_expression.rs
@@ -3,31 +3,31 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 //! Parsing for media feature expressions, like `(foo: bar)` or
 //! `(width >= 400px)`.
 
 use super::media_feature::{Evaluator, MediaFeatureDescription};
 use super::media_feature::{KeywordDiscriminant, ParsingRequirements};
 use super::Device;
-use context::QuirksMode;
+use crate::context::QuirksMode;
+use crate::parser::{Parse, ParserContext};
+use crate::str::{starts_with_ignore_ascii_case, string_as_ascii_lowercase};
+use crate::stylesheets::Origin;
+use crate::values::computed::{self, ToComputedValue};
+use crate::values::specified::{Integer, Length, Number, Resolution};
+use crate::values::{serialize_atom_identifier, CSSFloat};
+use crate::Atom;
 use cssparser::{Parser, Token};
 #[cfg(feature = "gecko")]
 use gecko_bindings::structs;
 use num_traits::Zero;
-use parser::{Parse, ParserContext};
 use std::cmp::{Ordering, PartialOrd};
 use std::fmt::{self, Write};
-use str::{starts_with_ignore_ascii_case, string_as_ascii_lowercase};
 use style_traits::{CssWriter, ParseError, StyleParseErrorKind, ToCss};
-use stylesheets::Origin;
-use values::computed::{self, ToComputedValue};
-use values::specified::{Integer, Length, Number, Resolution};
-use values::{serialize_atom_identifier, CSSFloat};
-use Atom;
 
 /// An aspect ratio, with a numerator and denominator.
 #[derive(Clone, Copy, Debug, Eq, MallocSizeOf, PartialEq)]
 pub struct AspectRatio(pub u32, pub u32);
 
 impl ToCss for AspectRatio {
     fn to_css<W>(&self, dest: &mut CssWriter<W>) -> fmt::Result
     where
@@ -216,24 +216,24 @@ fn consume_operation_or_colon(input: &mu
             Token::Colon => return Ok(None),
             Token::Delim(oper) => oper,
             _ => return Err(()),
         }
     };
     Ok(Some(match first_delim {
         '=' => Operator::Equal,
         '>' => {
-            if input.try(|i| i.expect_delim('=')).is_ok() {
+            if input.r#try(|i| i.expect_delim('=')).is_ok() {
                 Operator::GreaterThanEqual
             } else {
                 Operator::GreaterThan
             }
         },
         '<' => {
-            if input.try(|i| i.expect_delim('=')).is_ok() {
+            if input.r#try(|i| i.expect_delim('=')).is_ok() {
                 Operator::LessThanEqual
             } else {
                 Operator::LessThan
             }
         },
         _ => return Err(()),
     }))
 }
@@ -265,20 +265,20 @@ impl MediaFeatureExpression {
     }
 
     /// Parse a media feature expression where we've already consumed the
     /// parenthesis.
     pub fn parse_in_parenthesis_block<'i, 't>(
         context: &ParserContext,
         input: &mut Parser<'i, 't>,
     ) -> Result<Self, ParseError<'i>> {
+        #[cfg(feature = "servo")]
+        use crate::servo::media_queries::MEDIA_FEATURES;
         #[cfg(feature = "gecko")]
         use gecko::media_features::MEDIA_FEATURES;
-        #[cfg(feature = "servo")]
-        use servo::media_queries::MEDIA_FEATURES;
 
         // FIXME: remove extra indented block when lifetimes are non-lexical
         let feature;
         let range;
         {
             let location = input.current_source_location();
             let ident = input.expect_ident()?;
 
@@ -345,17 +345,17 @@ impl MediaFeatureExpression {
 
             if range.is_some() && !feature.allows_ranges() {
                 return Err(location.new_custom_error(
                     StyleParseErrorKind::MediaQueryExpectedFeatureName(ident.clone()),
                 ));
             }
         }
 
-        let operator = input.try(consume_operation_or_colon);
+        let operator = input.r#try(consume_operation_or_colon);
         let operator = match operator {
             Err(..) => {
                 // If there's no colon, this is a media query of the
                 // form '(<feature>)', that is, there's no value
                 // specified.
                 //
                 // Gecko doesn't allow ranged expressions without a
                 // value, so just reject them here too.
--- a/servo/components/style/media_queries/media_list.rs
+++ b/servo/components/style/media_queries/media_list.rs
@@ -2,21 +2,21 @@
  * 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/. */
 
 //! A media query list:
 //!
 //! https://drafts.csswg.org/mediaqueries/#typedef-media-query-list
 
 use super::{Device, MediaQuery, Qualifier};
-use context::QuirksMode;
+use crate::context::QuirksMode;
+use crate::error_reporting::ContextualParseError;
+use crate::parser::ParserContext;
 use cssparser::{Delimiter, Parser};
 use cssparser::{ParserInput, Token};
-use error_reporting::ContextualParseError;
-use parser::ParserContext;
 
 /// A type that encapsulates a media query list.
 #[css(comma, derive_debug)]
 #[derive(Clone, MallocSizeOf, ToCss)]
 pub struct MediaList {
     /// The list of media queries.
     #[css(iterable)]
     pub media_queries: Vec<MediaQuery>,
--- a/servo/components/style/media_queries/media_query.rs
+++ b/servo/components/style/media_queries/media_query.rs
@@ -2,23 +2,23 @@
  * 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/. */
 
 //! A media query:
 //!
 //! https://drafts.csswg.org/mediaqueries/#typedef-media-query
 
 use super::media_condition::MediaCondition;
+use crate::parser::ParserContext;
+use crate::str::string_as_ascii_lowercase;
+use crate::values::CustomIdent;
+use crate::Atom;
 use cssparser::Parser;
-use parser::ParserContext;
 use std::fmt::{self, Write};
-use str::string_as_ascii_lowercase;
 use style_traits::{CssWriter, ParseError, ToCss};
-use values::CustomIdent;
-use Atom;
 
 /// <https://drafts.csswg.org/mediaqueries/#mq-prefix>
 #[derive(Clone, Copy, Debug, Eq, MallocSizeOf, Parse, PartialEq, ToCss)]
 pub enum Qualifier {
     /// Hide a media query from legacy UAs:
     /// <https://drafts.csswg.org/mediaqueries/#mq-only>
     Only,
     /// Negate a media query:
@@ -120,27 +120,27 @@ impl MediaQuery {
     /// Parse a media query given css input.
     ///
     /// Returns an error if any of the expressions is unknown.
     pub fn parse<'i, 't>(
         context: &ParserContext,
         input: &mut Parser<'i, 't>,
     ) -> Result<Self, ParseError<'i>> {
         let (qualifier, explicit_media_type) = input
-            .try(|input| -> Result<_, ()> {
-                let qualifier = input.try(Qualifier::parse).ok();
+            .r#try(|input| -> Result<_, ()> {
+                let qualifier = input.r#try(Qualifier::parse).ok();
                 let ident = input.expect_ident().map_err(|_| ())?;
                 let media_type = MediaQueryType::parse(&ident)?;
                 Ok((qualifier, Some(media_type)))
             })
             .unwrap_or_default();
 
         let condition = if explicit_media_type.is_none() {
             Some(MediaCondition::parse(context, input)?)
-        } else if input.try(|i| i.expect_ident_matching("and")).is_ok() {
+        } else if input.r#try(|i| i.expect_ident_matching("and")).is_ok() {
             Some(MediaCondition::parse_disallow_or(context, input)?)
         } else {
             None
         };
 
         let media_type = explicit_media_type.unwrap_or(MediaQueryType::All);
         Ok(Self {
             qualifier,
--- a/servo/components/style/media_queries/mod.rs
+++ b/servo/components/style/media_queries/mod.rs
@@ -13,12 +13,12 @@ mod media_query;
 pub mod media_feature;
 pub mod media_feature_expression;
 
 pub use self::media_condition::MediaCondition;
 pub use self::media_feature_expression::MediaFeatureExpression;
 pub use self::media_list::MediaList;
 pub use self::media_query::{MediaQuery, MediaQueryType, MediaType, Qualifier};
 
+#[cfg(feature = "servo")]
+pub use crate::servo::media_queries::Device;
 #[cfg(feature = "gecko")]
 pub use gecko::media_queries::Device;
-#[cfg(feature = "servo")]
-pub use servo::media_queries::Device;
--- a/servo/components/style/parallel.rs
+++ b/servo/components/style/parallel.rs
@@ -18,23 +18,23 @@
 //! invoke |unsafe { SendNode::new(n) }| to put nodes in containers that may
 //! be sent to other threads. This occurs in only a handful of places and is
 //! easy to grep for. At the time of this writing, there is no other unsafe
 //! code in the parallel traversal.
 
 #![deny(missing_docs)]
 
 use arrayvec::ArrayVec;
-use context::{StyleContext, ThreadLocalStyleContext};
-use dom::{OpaqueNode, SendNode, TElement};
+use crate::context::{StyleContext, ThreadLocalStyleContext};
+use crate::dom::{OpaqueNode, SendNode, TElement};
+use crate::scoped_tls::ScopedTLS;
+use crate::traversal::{DomTraversal, PerLevelTraversalData};
 use itertools::Itertools;
 use rayon;
-use scoped_tls::ScopedTLS;
 use smallvec::SmallVec;
-use traversal::{DomTraversal, PerLevelTraversalData};
 
 /// The minimum stack size for a thread in the styling pool, in kilobytes.
 pub const STYLE_THREAD_STACK_SIZE_KB: usize = 256;
 
 /// The stack margin. If we get this deep in the stack, we will skip recursive
 /// optimizations to ensure that there is sufficient room for non-recursive work.
 ///
 /// We allocate large safety margins because certain OS calls can use very large
--- a/servo/components/style/parser.rs
+++ b/servo/components/style/parser.rs
@@ -1,20 +1,20 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * 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/. */
 
 //! The context within which CSS code is parsed.
 
-use context::QuirksMode;
+use crate::context::QuirksMode;
+use crate::error_reporting::{ContextualParseError, ParseErrorReporter};
+use crate::stylesheets::{CssRuleType, Namespaces, Origin, UrlExtraData};
+use crate::use_counters::UseCounters;
 use cssparser::{Parser, SourceLocation, UnicodeRange};
-use error_reporting::{ContextualParseError, ParseErrorReporter};
 use style_traits::{OneOrMoreSeparated, ParseError, ParsingMode, Separator};
-use stylesheets::{CssRuleType, Namespaces, Origin, UrlExtraData};
-use use_counters::UseCounters;
 
 /// Asserts that all ParsingMode flags have a matching ParsingMode value in gecko.
 #[cfg(feature = "gecko")]
 #[inline]
 pub fn assert_parsing_mode_match() {
     use gecko_bindings::structs;
 
     macro_rules! check_parsing_modes {
--- a/servo/components/style/properties/cascade.rs
+++ b/servo/components/style/properties/cascade.rs
@@ -1,35 +1,35 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * 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/. */
 
 //! The main cascading algorithm of the style system.
 
-use context::QuirksMode;
-use custom_properties::CustomPropertiesBuilder;
-use dom::TElement;
-use font_metrics::FontMetricsProvider;
-use logical_geometry::WritingMode;
-use media_queries::Device;
-use properties::{ComputedValues, StyleBuilder};
-use properties::{LonghandId, LonghandIdSet};
-use properties::{PropertyDeclaration, PropertyDeclarationId, DeclarationImportanceIterator};
-use properties::CASCADE_PROPERTY;
-use rule_cache::{RuleCache, RuleCacheConditions};
-use rule_tree::{CascadeLevel, StrongRuleNode};
-use selector_parser::PseudoElement;
+use crate::context::QuirksMode;
+use crate::custom_properties::CustomPropertiesBuilder;
+use crate::dom::TElement;
+use crate::font_metrics::FontMetricsProvider;
+use crate::logical_geometry::WritingMode;
+use crate::media_queries::Device;
+use crate::properties::{ComputedValues, StyleBuilder};
+use crate::properties::{LonghandId, LonghandIdSet};
+use crate::properties::{PropertyDeclaration, PropertyDeclarationId, DeclarationImportanceIterator};
+use crate::properties::CASCADE_PROPERTY;
+use crate::rule_cache::{RuleCache, RuleCacheConditions};
+use crate::rule_tree::{CascadeLevel, StrongRuleNode};
+use crate::selector_parser::PseudoElement;
 use servo_arc::Arc;
-use shared_lock::StylesheetGuards;
+use crate::shared_lock::StylesheetGuards;
 use smallbitvec::SmallBitVec;
 use smallvec::SmallVec;
 use std::borrow::Cow;
 use std::cell::RefCell;
-use style_adjuster::StyleAdjuster;
-use values::computed;
+use crate::style_adjuster::StyleAdjuster;
+use crate::values::computed;
 
 /// We split the cascade in two phases: 'early' properties, and 'late'
 /// properties.
 ///
 /// Early properties are the ones that don't have dependencies _and_ other
 /// properties depend on, for example, writing-mode related properties, color
 /// (for currentColor), or font-size (for em, etc).
 ///
--- a/servo/components/style/properties/declaration_block.rs
+++ b/servo/components/style/properties/declaration_block.rs
@@ -1,35 +1,35 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * 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/. */
 
 //! A property declaration block.
 
 #![deny(missing_docs)]
 
-use context::QuirksMode;
+use crate::context::QuirksMode;
 use cssparser::{DeclarationListParser, parse_important, ParserInput, CowRcStr};
 use cssparser::{Parser, AtRuleParser, DeclarationParser, Delimiter, ParseErrorKind};
-use custom_properties::{CustomPropertiesBuilder, CssEnvironment};
-use error_reporting::{ParseErrorReporter, ContextualParseError};
+use crate::custom_properties::{CustomPropertiesBuilder, CssEnvironment};
+use crate::error_reporting::{ParseErrorReporter, ContextualParseError};
 use itertools::Itertools;
-use parser::ParserContext;
-use properties::animated_properties::{AnimationValue, AnimationValueMap};
-use shared_lock::Locked;
+use crate::parser::ParserContext;
+use crate::properties::animated_properties::{AnimationValue, AnimationValueMap};
+use crate::shared_lock::Locked;
 use smallbitvec::{self, SmallBitVec};
 use smallvec::SmallVec;
 use std::fmt::{self, Write};
 use std::iter::{DoubleEndedIterator, Zip};
 use std::slice::Iter;
-use str::{CssString, CssStringBorrow, CssStringWriter};
+use crate::str::{CssString, CssStringBorrow, CssStringWriter};
 use style_traits::{CssWriter, ParseError, ParsingMode, StyleParseErrorKind, ToCss};
-use stylesheets::{CssRuleType, Origin, UrlExtraData};
+use crate::stylesheets::{CssRuleType, Origin, UrlExtraData};
 use super::*;
-use values::computed::Context;
+use crate::values::computed::Context;
 
 /// The animation rules.
 ///
 /// The first one is for Animation cascade level, and the second one is for
 /// Transition cascade level.
 pub struct AnimationRules(pub Option<Arc<Locked<PropertyDeclarationBlock>>>,
                           pub Option<Arc<Locked<PropertyDeclarationBlock>>>);
 
@@ -139,25 +139,25 @@ impl<'a> DoubleEndedIterator for Declara
 }
 
 /// Iterator for AnimationValue to be generated from PropertyDeclarationBlock.
 pub struct AnimationValueIterator<'a, 'cx, 'cx_a:'cx> {
     iter: DeclarationImportanceIterator<'a>,
     context: &'cx mut Context<'cx_a>,
     default_values: &'a ComputedValues,
     /// Custom properties in a keyframe if exists.
-    extra_custom_properties: Option<&'a Arc<::custom_properties::CustomPropertiesMap>>,
+    extra_custom_properties: Option<&'a Arc<crate::custom_properties::CustomPropertiesMap>>,
 }
 
 impl<'a, 'cx, 'cx_a:'cx> AnimationValueIterator<'a, 'cx, 'cx_a> {
     fn new(
         declarations: &'a PropertyDeclarationBlock,
         context: &'cx mut Context<'cx_a>,
         default_values: &'a ComputedValues,
-        extra_custom_properties: Option<&'a Arc<::custom_properties::CustomPropertiesMap>>,
+        extra_custom_properties: Option<&'a Arc<crate::custom_properties::CustomPropertiesMap>>,
     ) -> AnimationValueIterator<'a, 'cx, 'cx_a> {
         AnimationValueIterator {
             iter: declarations.declaration_importance_iter(),
             context,
             default_values,
             extra_custom_properties,
         }
     }
@@ -253,17 +253,17 @@ impl PropertyDeclarationBlock {
     }
 
     /// Return an iterator of (AnimatableLonghand, AnimationValue).
     #[inline]
     pub fn to_animation_value_iter<'a, 'cx, 'cx_a:'cx>(
         &'a self,
         context: &'cx mut Context<'cx_a>,
         default_values: &'a ComputedValues,
-        extra_custom_properties: Option<&'a Arc<::custom_properties::CustomPropertiesMap>>,
+        extra_custom_properties: Option<&'a Arc<crate::custom_properties::CustomPropertiesMap>>,
     ) -> AnimationValueIterator<'a, 'cx, 'cx_a> {
         AnimationValueIterator::new(self, context, default_values, extra_custom_properties)
     }
 
     /// Returns whether this block contains any declaration with `!important`.
     ///
     /// This is based on the `declarations_importance` bit-vector,
     /// which should be maintained whenever `declarations` is changed.
@@ -462,17 +462,17 @@ impl PropertyDeclarationBlock {
 
                 // As a compatibility hack, specially on Android,
                 // don't allow to override a prefixed webkit display
                 // value with an unprefixed version from parsing
                 // code.
                 //
                 // TODO(emilio): Unship.
                 if let PropertyDeclaration::Display(old_display) = *slot {
-                    use properties::longhands::display::computed_value::T as display;
+                    use crate::properties::longhands::display::computed_value::T as display;
 
                     if let PropertyDeclaration::Display(new_display) = declaration {
                         if display::should_ignore_parsed_value(old_display, new_display) {
                             return false;
                         }
                     }
                 }
 
@@ -836,31 +836,31 @@ impl PropertyDeclarationBlock {
     }
 
     /// Returns a custom properties map which is the result of cascading custom
     /// properties in this declaration block along with context's custom
     /// properties.
     pub fn cascade_custom_properties_with_context(
         &self,
         context: &Context,
-    ) -> Option<Arc<::custom_properties::CustomPropertiesMap>> {
+    ) -> Option<Arc<crate::custom_properties::CustomPropertiesMap>> {
         self.cascade_custom_properties(
             context.style().custom_properties(),
             context.device().environment(),
         )
     }
 
     /// Returns a custom properties map which is the result of cascading custom
     /// properties in this declaration block along with the given custom
     /// properties.
     fn cascade_custom_properties(
         &self,
-        inherited_custom_properties: Option<&Arc<::custom_properties::CustomPropertiesMap>>,
+        inherited_custom_properties: Option<&Arc<crate::custom_properties::CustomPropertiesMap>>,
         environment: &CssEnvironment,
-    ) -> Option<Arc<::custom_properties::CustomPropertiesMap>> {
+    ) -> Option<Arc<crate::custom_properties::CustomPropertiesMap>> {
         let mut builder = CustomPropertiesBuilder::new(
             inherited_custom_properties,
             environment,
         );
 
         for declaration in self.normal_declaration_iter() {
             if let PropertyDeclaration::Custom(ref declaration) = *declaration {
                 builder.cascade(&declaration.name, &declaration.value);
--- a/servo/components/style/rule_cache.rs
+++ b/servo/components/style/rule_cache.rs
@@ -1,24 +1,24 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * 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/. */
 
 //! A cache from rule node to computed values, in order to cache reset
 //! properties.
 
+use crate::logical_geometry::WritingMode;
+use crate::properties::{ComputedValues, StyleBuilder};
+use crate::rule_tree::StrongRuleNode;
+use crate::selector_parser::PseudoElement;
+use crate::shared_lock::StylesheetGuards;
+use crate::values::computed::NonNegativeLength;
 use fxhash::FxHashMap;
-use logical_geometry::WritingMode;
-use properties::{ComputedValues, StyleBuilder};
-use rule_tree::StrongRuleNode;
-use selector_parser::PseudoElement;
 use servo_arc::Arc;
-use shared_lock::StylesheetGuards;
 use smallvec::SmallVec;
-use values::computed::NonNegativeLength;
 
 /// The conditions for caching and matching a style in the rule cache.
 #[derive(Clone, Debug, Default)]
 pub struct RuleCacheConditions {
     uncacheable: bool,
     font_size: Option<NonNegativeLength>,
     writing_mode: Option<WritingMode>,
 }
--- a/servo/components/style/rule_tree/mod.rs
+++ b/servo/components/style/rule_tree/mod.rs
@@ -1,31 +1,31 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * 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/. */
 
 #![allow(unsafe_code)]
 
 //! The rule tree.
 
-use applicable_declarations::ApplicableDeclarationList;
+use crate::applicable_declarations::ApplicableDeclarationList;
+use crate::properties::{Importance, LonghandIdSet, PropertyDeclarationBlock};
+use crate::shared_lock::{Locked, SharedRwLockReadGuard, StylesheetGuards};
+use crate::stylesheets::StyleRule;
+use crate::thread_state;
 #[cfg(feature = "gecko")]
 use gecko::selector_parser::PseudoElement;
 #[cfg(feature = "gecko")]
 use malloc_size_of::{MallocSizeOf, MallocSizeOfOps};
-use properties::{Importance, LonghandIdSet, PropertyDeclarationBlock};
 use servo_arc::{Arc, ArcBorrow, ArcUnion, ArcUnionBorrow};
-use shared_lock::{Locked, SharedRwLockReadGuard, StylesheetGuards};
 use smallvec::SmallVec;
 use std::io::{self, Write};
 use std::mem;
 use std::ptr;
 use std::sync::atomic::{AtomicPtr, AtomicUsize, Ordering};
-use stylesheets::StyleRule;
-use thread_state;
 
 /// The rule tree, the structure servo uses to preserve the results of selector
 /// matching.
 ///
 /// This is organized as a tree of rules. When a node matches a set of rules,
 /// they're inserted in order in the tree, starting with the less specific one.
 ///
 /// When a rule is inserted in the tree, other elements may share the path up to
@@ -1144,17 +1144,17 @@ impl StrongRuleNode {
             current, next
         );
 
         Some(WeakRuleNode::from_ptr(current))
     }
 
     unsafe fn assert_free_list_has_no_duplicates_or_null(&self) {
         assert!(cfg!(debug_assertions), "This is an expensive check!");
-        use hash::FxHashSet;
+        use crate::hash::FxHashSet;
 
         let me = &*self.ptr();
         assert!(me.is_root());
 
         let mut current = self.ptr();
         let mut seen = FxHashSet::default();
         while current != FREE_LIST_SENTINEL {
             let next = (*current).next_free.load(Ordering::Relaxed);
@@ -1425,17 +1425,17 @@ impl StrongRuleNode {
     /// but not equal to Transitions.
     ///
     /// If there are any custom properties, we set the boolean value of the
     /// returned tuple to true.
     pub fn get_properties_overriding_animations(
         &self,
         guards: &StylesheetGuards,
     ) -> (LonghandIdSet, bool) {
-        use properties::PropertyDeclarationId;
+        use crate::properties::PropertyDeclarationId;
 
         // We want to iterate over cascade levels that override the animations
         // level, i.e.  !important levels and the transitions level.
         //
         // However, we actually want to skip the transitions level because
         // although it is higher in the cascade than animations, when both
         // transitions and animations are present for a given element and
         // property, transitions are suppressed so that they don't actually
--- a/servo/components/style/selector_map.rs
+++ b/servo/components/style/selector_map.rs
@@ -1,31 +1,31 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * 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/. */
 
 //! A data structure to efficiently index structs containing selectors by local
 //! name, ids and hash.
 
-use applicable_declarations::ApplicableDeclarationList;
-use context::QuirksMode;
-use dom::TElement;
+use crate::applicable_declarations::ApplicableDeclarationList;
+use crate::context::QuirksMode;
+use crate::dom::TElement;
+use crate::hash::map as hash_map;
+use crate::hash::{HashMap, HashSet};
+use crate::rule_tree::{CascadeLevel, ShadowCascadeOrder};
+use crate::selector_parser::SelectorImpl;
+use crate::stylist::Rule;
+use crate::{Atom, LocalName, Namespace, WeakAtom};
 use fallible::FallibleVec;
-use hash::map as hash_map;
-use hash::{HashMap, HashSet};
 use hashglobe::FailedAllocationError;
 use precomputed_hash::PrecomputedHash;
-use rule_tree::{CascadeLevel, ShadowCascadeOrder};
-use selector_parser::SelectorImpl;
 use selectors::matching::{matches_selector, ElementSelectorFlags, MatchingContext};
 use selectors::parser::{Combinator, Component, SelectorIter};
 use smallvec::SmallVec;
 use std::hash::{BuildHasherDefault, Hash, Hasher};
-use stylist::Rule;
-use {Atom, LocalName, Namespace, WeakAtom};
 
 /// A hasher implementation that doesn't hash anything, because it expects its
 /// input to be a suitable u32 hash.
 pub struct PrecomputedHasher {
     hash: Option<u32>,
 }
 
 impl Default for PrecomputedHasher {
--- a/servo/components/style/selector_parser.rs
+++ b/servo/components/style/selector_parser.rs
@@ -1,43 +1,43 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * 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/. */
 
 //! The pseudo-classes and pseudo-elements supported by the style system.
 
 #![deny(missing_docs)]
 
+use crate::element_state::ElementState;
+use crate::stylesheets::{Namespaces, Origin, UrlExtraData};
+use crate::values::serialize_atom_identifier;
+use crate::Atom;
 use cssparser::{Parser as CssParser, ParserInput};
-use element_state::ElementState;
 use selectors::parser::SelectorList;
 use std::fmt::{self, Debug, Write};
 use style_traits::{CssWriter, ParseError, ToCss};
-use stylesheets::{Namespaces, Origin, UrlExtraData};
-use values::serialize_atom_identifier;
-use Atom;
 
 /// A convenient alias for the type that represents an attribute value used for
 /// selector parser implementation.
 pub type AttrValue = <SelectorImpl as ::selectors::SelectorImpl>::AttrValue;
 
 #[cfg(feature = "servo")]
-pub use servo::selector_parser::*;
+pub use crate::servo::selector_parser::*;
 
 #[cfg(feature = "gecko")]
 pub use gecko::selector_parser::*;
 
 #[cfg(feature = "servo")]
-pub use servo::selector_parser::ServoElementSnapshot as Snapshot;
+pub use crate::servo::selector_parser::ServoElementSnapshot as Snapshot;
 
 #[cfg(feature = "gecko")]
 pub use gecko::snapshot::GeckoElementSnapshot as Snapshot;
 
 #[cfg(feature = "servo")]
-pub use servo::restyle_damage::ServoRestyleDamage as RestyleDamage;
+pub use crate::servo::restyle_damage::ServoRestyleDamage as RestyleDamage;
 
 #[cfg(feature = "gecko")]
 pub use gecko::restyle_damage::GeckoRestyleDamage as RestyleDamage;
 
 /// Servo's selector parser.
 #[cfg_attr(feature = "servo", derive(MallocSizeOf))]
 pub struct SelectorParser<'a> {
     /// The origin of the stylesheet we're parsing.
--- a/servo/components/style/servo/media_queries.rs
+++ b/servo/components/style/servo/media_queries.rs
@@ -1,29 +1,29 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * 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/. */
 
 //! Servo's media-query device and expression representation.
 
 use app_units::Au;
+use crate::custom_properties::CssEnvironment;
+use crate::media_queries::media_feature::{AllowsRanges, ParsingRequirements};
+use crate::media_queries::media_feature::{Evaluator, MediaFeatureDescription};
+use crate::media_queries::media_feature_expression::RangeOrOperator;
+use crate::media_queries::MediaType;
+use crate::properties::ComputedValues;
+use crate::values::computed::font::FontSize;
+use crate::values::computed::CSSPixelLength;
+use crate::values::KeyframesName;
 use cssparser::RGBA;
-use custom_properties::CssEnvironment;
 use euclid::{Size2D, TypedScale, TypedSize2D};
-use media_queries::media_feature::{AllowsRanges, ParsingRequirements};
-use media_queries::media_feature::{Evaluator, MediaFeatureDescription};
-use media_queries::media_feature_expression::RangeOrOperator;
-use media_queries::MediaType;
-use properties::ComputedValues;
 use std::sync::atomic::{AtomicBool, AtomicIsize, Ordering};
 use style_traits::viewport::ViewportConstraints;
 use style_traits::{CSSPixel, DevicePixel};
-use values::computed::font::FontSize;
-use values::computed::CSSPixelLength;
-use values::KeyframesName;
 
 /// A device is a structure that represents the current media a given document
 /// is displayed in.
 ///
 /// This is the struct against which media queries are evaluated.
 #[derive(Debug, MallocSizeOf)]
 pub struct Device {
     /// The current media type used by de device.
--- a/servo/components/style/servo/restyle_damage.rs
+++ b/servo/components/style/servo/restyle_damage.rs
@@ -1,18 +1,18 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * 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/. */
 
 //! The restyle damage is a hint that tells layout which kind of operations may
 //! be needed in presence of incremental style changes.
 
-use computed_values::display::T as Display;
-use matching::{StyleChange, StyleDifference};
-use properties::ComputedValues;
+use crate::computed_values::display::T as Display;
+use crate::matching::{StyleChange, StyleDifference};
+use crate::properties::ComputedValues;
 use std::fmt;
 
 bitflags! {
     /// Individual layout actions that may be necessary after restyling.
     pub struct ServoRestyleDamage: u8 {
         /// Repaint the node itself.
         ///
         /// Currently unused; need to decide how this propagates.
--- a/servo/components/style/servo/selector_parser.rs
+++ b/servo/components/style/servo/selector_parser.rs
@@ -1,34 +1,36 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * 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/. */
 
 #![deny(missing_docs)]
 
 //! Servo's selector parser.
 
-use attr::{AttrIdentifier, AttrValue};
+use crate::attr::{AttrIdentifier, AttrValue};
+use crate::dom::{OpaqueNode, TElement, TNode};
+use crate::element_state::{DocumentState, ElementState};
+use crate::invalidation::element::document_state::InvalidationMatchingData;
+use crate::invalidation::element::element_wrapper::ElementSnapshot;
+use crate::properties::longhands::display::computed_value::T as Display;
+use crate::properties::{ComputedValues, PropertyFlags};
+use crate::selector_parser::{
+    AttrValue as SelectorAttrValue, PseudoElementCascadeType, SelectorParser,
+};
+use crate::{Atom, CaseSensitivityExt, LocalName, Namespace, Prefix};
 use cssparser::{serialize_identifier, CowRcStr, Parser as CssParser, SourceLocation, ToCss};
-use dom::{OpaqueNode, TElement, TNode};
-use element_state::{DocumentState, ElementState};
 use fxhash::FxHashMap;
-use invalidation::element::document_state::InvalidationMatchingData;
-use invalidation::element::element_wrapper::ElementSnapshot;
-use properties::longhands::display::computed_value::T as Display;
-use properties::{ComputedValues, PropertyFlags};
-use selector_parser::{AttrValue as SelectorAttrValue, PseudoElementCascadeType, SelectorParser};
 use selectors::attr::{AttrSelectorOperation, CaseSensitivity, NamespaceConstraint};
 use selectors::parser::{SelectorParseErrorKind, Visit};
 use selectors::visitor::SelectorVisitor;
 use std::fmt;
 use std::mem;
 use std::ops::{Deref, DerefMut};
 use style_traits::{ParseError, StyleParseErrorKind};
-use {Atom, CaseSensitivityExt, LocalName, Namespace, Prefix};
 
 /// A pseudo-element, both public and private.
 ///
 /// NB: If you add to this list, be sure to update `each_simple_pseudo_element` too.
 #[derive(Clone, Debug, Eq, Hash, PartialEq)]
 #[cfg_attr(feature = "servo", derive(MallocSizeOf))]
 #[allow(missing_docs)]
 #[repr(usize)]
@@ -344,17 +346,17 @@ impl Visit for NonTSPseudoClass {
     }
 }
 
 impl NonTSPseudoClass {
     /// Gets a given state flag for this pseudo-class. This is used to do
     /// selector matching, and it's set from the DOM.
     pub fn state_flag(&self) -> ElementState {
         use self::NonTSPseudoClass::*;
-        use element_state::ElementState;
+        use crate::element_state::ElementState;
         match *self {
             Active => ElementState::IN_ACTIVE_STATE,
             Focus => ElementState::IN_FOCUS_STATE,
             Fullscreen => ElementState::IN_FULLSCREEN_STATE,
             Hover => ElementState::IN_HOVER_STATE,
             Enabled => ElementState::IN_ENABLED_STATE,
             Disabled => ElementState::IN_DISABLED_STATE,
             Checked => ElementState::IN_CHECKED_STATE,
--- a/servo/components/style/servo/url.rs
+++ b/servo/components/style/servo/url.rs
@@ -1,24 +1,24 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * 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/. */
 
 //! Common handling for the specified value CSS url() values.
 
+use crate::parser::{Parse, ParserContext};
 use cssparser::Parser;
-use parser::{Parse, ParserContext};
 use servo_url::ServoUrl;
 use std::fmt::{self, Write};
 // Note: We use std::sync::Arc rather than servo_arc::Arc here because the
 // nonzero optimization is important in keeping the size of SpecifiedUrl below
 // the threshold.
+use crate::values::computed::{Context, ToComputedValue};
 use std::sync::Arc;
 use style_traits::{CssWriter, ParseError, ToCss};
-use values::computed::{Context, ToComputedValue};
 
 /// A CSS url() value for servo.
 ///
 /// Servo eagerly resolves SpecifiedUrls, which it can then take advantage of
 /// when computing values. In contrast, Gecko uses a different URL backend, so
 /// eagerly resolving with rust-url would be duplicated work.
 ///
 /// However, this approach is still not necessarily optimal: See
--- a/servo/components/style/shared_lock.rs
+++ b/servo/components/style/shared_lock.rs
@@ -1,27 +1,27 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * 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/. */
 
 //! Different objects protected by the same lock
 
 #[cfg(feature = "gecko")]
 use atomic_refcell::{AtomicRef, AtomicRefCell, AtomicRefMut};
+use crate::str::{CssString, CssStringWriter};
+use crate::stylesheets::Origin;
 #[cfg(feature = "servo")]
 use parking_lot::RwLock;
 use servo_arc::Arc;
 use std::cell::UnsafeCell;
 use std::fmt;
 #[cfg(feature = "servo")]
 use std::mem;
 #[cfg(feature = "gecko")]
 use std::ptr;
-use str::{CssString, CssStringWriter};
-use stylesheets::Origin;
 
 /// A shared read/write lock that can protect multiple objects.
 ///
 /// In Gecko builds, we don't need the blocking behavior, just the safety. As
 /// such we implement this with an AtomicRefCell instead in Gecko builds,
 /// which is ~2x as fast, and panics (rather than deadlocking) when things go
 /// wrong (which is much easier to debug on CI).
 ///
--- a/servo/components/style/sharing/checks.rs
+++ b/servo/components/style/sharing/checks.rs
@@ -1,21 +1,21 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * 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/. */
 
 //! Different checks done during the style sharing process in order to determine
 //! quickly whether it's worth to share style, and whether two different
 //! elements can indeed share the same style.
 
-use bloom::StyleBloom;
-use context::{SelectorFlagsMap, SharedStyleContext};
-use dom::TElement;
+use crate::bloom::StyleBloom;
+use crate::context::{SelectorFlagsMap, SharedStyleContext};
+use crate::dom::TElement;
+use crate::sharing::{StyleSharingCandidate, StyleSharingTarget};
 use selectors::NthIndexCache;
-use sharing::{StyleSharingCandidate, StyleSharingTarget};
 
 /// Determines whether a target and a candidate have compatible parents for
 /// sharing.
 pub fn parents_allow_sharing<E>(
     target: &mut StyleSharingTarget<E>,
     candidate: &mut StyleSharingCandidate<E>,
 ) -> bool
 where
--- a/servo/components/style/sharing/mod.rs
+++ b/servo/components/style/sharing/mod.rs
@@ -59,38 +59,38 @@
 //! the up-front checks but would have different matching results for the
 //! selector in question.  In this case, "descendants" includes pseudo-elements,
 //! so there is a single selector map of revalidation selectors that includes
 //! both selectors targeting elements and selectors targeting pseudo-element
 //! originating elements.  We ensure that the pseudo-element parts of all these
 //! selectors are effectively stripped off, so that matching them all against
 //! elements makes sense.
 
-use applicable_declarations::ApplicableDeclarationBlock;
 use atomic_refcell::{AtomicRefCell, AtomicRefMut};
-use bloom::StyleBloom;
-use context::{SelectorFlagsMap, SharedStyleContext, StyleContext};
-use dom::{SendElement, TElement};
-use matching::MatchMethods;
+use crate::applicable_declarations::ApplicableDeclarationBlock;
+use crate::bloom::StyleBloom;
+use crate::context::{SelectorFlagsMap, SharedStyleContext, StyleContext};
+use crate::dom::{SendElement, TElement};
+use crate::matching::MatchMethods;
+use crate::properties::ComputedValues;
+use crate::rule_tree::StrongRuleNode;
+use crate::style_resolver::{PrimaryStyle, ResolvedElementStyles};
+use crate::stylist::Stylist;
+use crate::Atom;
 use owning_ref::OwningHandle;
-use properties::ComputedValues;
-use rule_tree::StrongRuleNode;
 use selectors::matching::{ElementSelectorFlags, VisitedHandlingMode};
 use selectors::NthIndexCache;
 use servo_arc::Arc;
 use smallbitvec::SmallBitVec;
 use smallvec::SmallVec;
 use std::marker::PhantomData;
 use std::mem;
 use std::ops::Deref;
 use std::ptr::NonNull;
-use style_resolver::{PrimaryStyle, ResolvedElementStyles};
-use stylist::Stylist;
 use uluru::{Entry, LRUCache};
-use Atom;
 
 mod checks;
 
 /// The amount of nodes that the style sharing candidate cache should hold at
 /// most.  We'd somewhat like 32, but ArrayDeque only implements certain backing
 /// store sizes.  A cache size of 32 would mean a backing store of 33, but
 /// that's not an implemented size: we can do 32 or 40.
 ///
--- a/servo/components/style/style_adjuster.rs
+++ b/servo/components/style/style_adjuster.rs
@@ -1,23 +1,23 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * 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/. */
 
 //! A struct to encapsulate all the style fixups and flags propagations
 //! a computed style needs in order for it to adhere to the CSS spec.
 
 use app_units::Au;
-use dom::TElement;
-use properties::computed_value_flags::ComputedValueFlags;
-use properties::longhands::display::computed_value::T as Display;
-use properties::longhands::float::computed_value::T as Float;
-use properties::longhands::overflow_x::computed_value::T as Overflow;
-use properties::longhands::position::computed_value::T as Position;
-use properties::{self, ComputedValues, StyleBuilder};
+use crate::dom::TElement;
+use crate::properties::computed_value_flags::ComputedValueFlags;
+use crate::properties::longhands::display::computed_value::T as Display;
+use crate::properties::longhands::float::computed_value::T as Float;
+use crate::properties::longhands::overflow_x::computed_value::T as Overflow;
+use crate::properties::longhands::position::computed_value::T as Position;
+use crate::properties::{self, ComputedValues, StyleBuilder};
 
 /// A struct that implements all the adjustment methods.
 ///
 /// NOTE(emilio): If new adjustments are introduced that depend on reset
 /// properties of the parent, you may need tweaking the
 /// `ChildCascadeRequirement` code in `matching.rs`.
 ///
 /// NOTE(emilio): Also, if new adjustments are introduced that break the
@@ -357,18 +357,18 @@ impl<'a, 'b: 'a> StyleAdjuster<'a, 'b> {
     }
 
     /// This implements an out-of-date spec. The new spec moves the handling of
     /// this to layout, which Gecko implements but Servo doesn't.
     ///
     /// See https://github.com/servo/servo/issues/15229
     #[cfg(feature = "servo")]
     fn adjust_for_alignment(&mut self, layout_parent_style: &ComputedValues) {
-        use computed_values::align_items::T as AlignItems;
-        use computed_values::align_self::T as AlignSelf;
+        use crate::computed_values::align_items::T as AlignItems;
+        use crate::computed_values::align_self::T as AlignSelf;
 
         if self.style.get_position().clone_align_self() == AlignSelf::Auto &&
             !self.style.out_of_flow_positioned()
         {
             let self_align = match layout_parent_style.get_position().clone_align_items() {
                 AlignItems::Stretch => AlignSelf::Stretch,
                 AlignItems::Baseline => AlignSelf::Baseline,
                 AlignItems::FlexStart => AlignSelf::FlexStart,
@@ -529,17 +529,17 @@ impl<'a, 'b: 'a> StyleAdjuster<'a, 'b> {
 
     /// Computes the used text decoration for Servo.
     ///
     /// FIXME(emilio): This is a layout tree concept, should move away from
     /// style, since otherwise we're going to have the same subtle bugs WebKit
     /// and Blink have with this very same thing.
     #[cfg(feature = "servo")]
     fn adjust_for_text_decorations_in_effect(&mut self) {
-        use values::computed::text::TextDecorationsInEffect;
+        use crate::values::computed::text::TextDecorationsInEffect;
 
         let decorations_in_effect = TextDecorationsInEffect::from_style(&self.style);
         if self.style.get_inherited_text().text_decorations_in_effect != decorations_in_effect {
             self.style
                 .mutate_inherited_text()
                 .text_decorations_in_effect = decorations_in_effect;
         }
     }
--- a/servo/components/style/style_resolver.rs
+++ b/servo/components/style/style_resolver.rs
@@ -1,29 +1,29 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * 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/. */
 
 //! Style resolution for a given element or pseudo-element.
 
-use applicable_declarations::ApplicableDeclarationList;
-use context::{CascadeInputs, ElementCascadeInputs, StyleContext};
-use data::{EagerPseudoStyles, ElementStyles};
-use dom::TElement;
+use crate::applicable_declarations::ApplicableDeclarationList;
+use crate::context::{CascadeInputs, ElementCascadeInputs, StyleContext};
+use crate::data::{EagerPseudoStyles, ElementStyles};
+use crate::dom::TElement;
+use crate::matching::MatchMethods;
+use crate::properties::longhands::display::computed_value::T as Display;
+use crate::properties::{AnimationRules, ComputedValues};
+use crate::rule_tree::StrongRuleNode;
+use crate::selector_parser::{PseudoElement, SelectorImpl};
+use crate::stylist::RuleInclusion;
 use log::Level::Trace;
-use matching::MatchMethods;
-use properties::longhands::display::computed_value::T as Display;
-use properties::{AnimationRules, ComputedValues};
-use rule_tree::StrongRuleNode;
-use selector_parser::{PseudoElement, SelectorImpl};
 use selectors::matching::{
     ElementSelectorFlags, MatchingContext, MatchingMode, VisitedHandlingMode,
 };
 use servo_arc::Arc;
-use stylist::RuleInclusion;
 
 /// Whether pseudo-elements should be resolved or not.
 #[derive(Clone, Copy, Debug, Eq, PartialEq)]
 pub enum PseudoElementResolution {
     /// Only resolve pseudo-styles if possibly applicable.
     IfApplicable,
     /// Force pseudo-element resolution.
     Force,
@@ -106,17 +106,17 @@ where
         layout_parent_style.map(|s| &**s),
     )
 }
 
 fn eager_pseudo_is_definitely_not_generated(
     pseudo: &PseudoElement,
     style: &ComputedValues,
 ) -> bool {
-    use properties::computed_value_flags::ComputedValueFlags;
+    use crate::properties::computed_value_flags::ComputedValueFlags;
 
     if !pseudo.is_before_or_after() {
         return false;
     }
 
     if !style.flags.intersects(ComputedValueFlags::INHERITS_DISPLAY) &&
         style.get_box().clone_display() == Display::None
     {
--- a/servo/components/style/stylesheet_set.rs
+++ b/servo/components/style/stylesheet_set.rs
@@ -1,21 +1,21 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * 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/. */
 
 //! A centralized set of stylesheets for a document.
 
-use dom::TElement;
-use invalidation::stylesheets::StylesheetInvalidationSet;
-use media_queries::Device;
-use selector_parser::SnapshotMap;
-use shared_lock::SharedRwLockReadGuard;
+use crate::dom::TElement;
+use crate::invalidation::stylesheets::StylesheetInvalidationSet;
+use crate::media_queries::Device;
+use crate::selector_parser::SnapshotMap;
+use crate::shared_lock::SharedRwLockReadGuard;
+use crate::stylesheets::{Origin, OriginSet, OriginSetIterator, PerOrigin, StylesheetInDocument};
 use std::{mem, slice};
-use stylesheets::{Origin, OriginSet, OriginSetIterator, PerOrigin, StylesheetInDocument};
 
 /// Entry for a StylesheetSet.
 #[derive(MallocSizeOf)]
 struct StylesheetSetEntry<S>
 where
     S: StylesheetInDocument + PartialEq + 'static,
 {
     /// The sheet.
--- a/servo/components/style/stylesheets/counter_style_rule.rs
+++ b/servo/components/style/stylesheets/counter_style_rule.rs
@@ -1,7 +1,7 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * 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/. */
 
 #![allow(missing_docs)]
 
-pub use counter_style::CounterStyleRuleData as CounterStyleRule;
+pub use crate::counter_style::CounterStyleRuleData as CounterStyleRule;
--- a/servo/components/style/stylesheets/document_rule.rs
+++ b/servo/components/style/stylesheets/document_rule.rs
@@ -1,29 +1,29 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * 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/. */
 
 //! [@document rules](https://www.w3.org/TR/2012/WD-css3-conditional-20120911/#at-document)
 //! initially in CSS Conditional Rules Module Level 3, @document has been postponed to the level 4.
 //! We implement the prefixed `@-moz-document`.
 
+use crate::media_queries::Device;
+use crate::parser::{Parse, ParserContext};
+use crate::shared_lock::{DeepCloneParams, DeepCloneWithLock, Locked};
+use crate::shared_lock::{SharedRwLock, SharedRwLockReadGuard, ToCssWithGuard};
+use crate::str::CssStringWriter;
+use crate::stylesheets::CssRules;
+use crate::values::CssUrl;
 use cssparser::{Parser, SourceLocation};
 #[cfg(feature = "gecko")]
 use malloc_size_of::{MallocSizeOfOps, MallocUnconditionalShallowSizeOf};
-use media_queries::Device;
-use parser::{Parse, ParserContext};
 use servo_arc::Arc;
-use shared_lock::{DeepCloneParams, DeepCloneWithLock, Locked};
-use shared_lock::{SharedRwLock, SharedRwLockReadGuard, ToCssWithGuard};
 use std::fmt::{self, Write};
-use str::CssStringWriter;
 use style_traits::{CssWriter, ParseError, StyleParseErrorKind, ToCss};
-use stylesheets::CssRules;
-use values::CssUrl;
 
 #[derive(Debug)]
 /// A @-moz-document rule
 pub struct DocumentRule {
     /// The parsed condition
     pub condition: DocumentCondition,
     /// Child rules
     pub rules: Arc<Locked<CssRules>>,
@@ -130,17 +130,17 @@ macro_rules! parse_quoted_or_unquoted_st
 }
 
 impl DocumentMatchingFunction {
     /// Parse a URL matching function for a`@document` rule's condition.
     pub fn parse<'i, 't>(
         context: &ParserContext,
         input: &mut Parser<'i, 't>,
     ) -> Result<Self, ParseError<'i>> {
-        if let Ok(url) = input.try(|input| CssUrl::parse(context, input)) {
+        if let Ok(url) = input.r#try(|input| CssUrl::parse(context, input)) {
             return Ok(DocumentMatchingFunction::Url(url));
         }
 
         let location = input.current_source_location();
         let function = input.expect_function()?.clone();
         match_ignore_ascii_case! { &function,
             "url-prefix" => {
                 parse_quoted_or_unquoted_string!(input, DocumentMatchingFunction::UrlPrefix)
--- a/servo/components/style/stylesheets/font_face_rule.rs
+++ b/servo/components/style/stylesheets/font_face_rule.rs
@@ -1,7 +1,7 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * 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/. */
 
 #![allow(missing_docs)]
 
-pub use font_face::FontFaceRuleData as FontFaceRule;
+pub use crate::font_face::FontFaceRuleData as FontFaceRule;
--- a/servo/components/style/stylesheets/font_feature_values_rule.rs
+++ b/servo/components/style/stylesheets/font_feature_values_rule.rs
@@ -1,33 +1,33 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * 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/. */
 
 //! The [`@font-feature-values`][font-feature-values] at-rule.
 //!
 //! [font-feature-values]: https://drafts.csswg.org/css-fonts-3/#at-font-feature-values-rule
 
+use crate::error_reporting::ContextualParseError;
+use crate::parser::{Parse, ParserContext};
+use crate::shared_lock::{SharedRwLockReadGuard, ToCssWithGuard};
+use crate::str::CssStringWriter;
+use crate::stylesheets::CssRuleType;
+use crate::values::computed::font::FamilyName;
+use crate::values::serialize_atom_identifier;
+use crate::Atom;
 use cssparser::{AtRuleParser, AtRuleType, BasicParseErrorKind, CowRcStr};
 use cssparser::{DeclarationListParser, DeclarationParser, Parser};
 use cssparser::{QualifiedRuleParser, RuleListParser, SourceLocation, Token};
-use error_reporting::ContextualParseError;
 #[cfg(feature = "gecko")]
 use gecko_bindings::bindings::Gecko_AppendFeatureValueHashEntry;
 #[cfg(feature = "gecko")]
 use gecko_bindings::structs::{self, gfxFontFeatureValueSet, nsTArray};
-use parser::{Parse, ParserContext};
-use shared_lock::{SharedRwLockReadGuard, ToCssWithGuard};
 use std::fmt::{self, Write};
-use str::CssStringWriter;
 use style_traits::{CssWriter, ParseError, StyleParseErrorKind, ToCss};
-use stylesheets::CssRuleType;
-use values::computed::font::FamilyName;
-use values::serialize_atom_identifier;
-use Atom;
 
 /// A @font-feature-values block declaration.
 /// It is `<ident>: <integer>+`.
 /// This struct can take 3 value types.
 /// - `SingleValue` is to keep just one unsigned integer value.
 /// - `PairValues` is to keep one or two unsigned integer values.
 /// - `VectorValues` is to keep a list of unsigned integer values.
 #[derive(Clone, Debug, PartialEq)]
--- a/servo/components/style/stylesheets/import_rule.rs
+++ b/servo/components/style/stylesheets/import_rule.rs
@@ -1,26 +1,26 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * 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/. */
 
 //! The [`@import`][import] at-rule.
 //!
 //! [import]: https://drafts.csswg.org/css-cascade-3/#at-import
 
-use context::QuirksMode;
+use crate::context::QuirksMode;
+use crate::media_queries::MediaList;
+use crate::shared_lock::{DeepCloneParams, DeepCloneWithLock};
+use crate::shared_lock::{SharedRwLock, SharedRwLockReadGuard, ToCssWithGuard};
+use crate::str::CssStringWriter;
+use crate::stylesheets::{CssRule, Origin, StylesheetInDocument};
+use crate::values::CssUrl;
 use cssparser::SourceLocation;
-use media_queries::MediaList;
-use shared_lock::{DeepCloneParams, DeepCloneWithLock};
-use shared_lock::{SharedRwLock, SharedRwLockReadGuard, ToCssWithGuard};
 use std::fmt::{self, Write};
-use str::CssStringWriter;
 use style_traits::{CssWriter, ToCss};
-use stylesheets::{CssRule, Origin, StylesheetInDocument};
-use values::CssUrl;
 
 /// With asynchronous stylesheet parsing, we can't synchronously create a
 /// GeckoStyleSheet. So we use this placeholder instead.
 #[derive(Clone, Debug)]
 pub struct PendingSheet {
     origin: Origin,
     quirks_mode: QuirksMode,
 }
@@ -119,17 +119,17 @@ impl StylesheetInDocument for ImportShee
             ImportSheet::Pending(_) => &[],
         }
     }
 }
 
 /// A sheet that is held from an import rule.
 #[cfg(feature = "servo")]
 #[derive(Debug)]
-pub struct ImportSheet(pub ::servo_arc::Arc<::stylesheets::Stylesheet>);
+pub struct ImportSheet(pub ::servo_arc::Arc<crate::stylesheets::Stylesheet>);
 
 #[cfg(feature = "servo")]
 impl StylesheetInDocument for ImportSheet {
     fn origin(&self, guard: &SharedRwLockReadGuard) -> Origin {
         self.0.origin(guard)
     }
 
     fn quirks_mode(&self, guard: &SharedRwLockReadGuard) -> QuirksMode {
--- a/servo/components/style/stylesheets/keyframes_rule.rs
+++ b/servo/components/style/stylesheets/keyframes_rule.rs
@@ -1,32 +1,32 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * 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/. */
 
 //! Keyframes: https://drafts.csswg.org/css-animations/#keyframes
 
+use crate::error_reporting::ContextualParseError;
+use crate::parser::ParserContext;
+use crate::properties::longhands::transition_timing_function::single_value::SpecifiedValue as SpecifiedTimingFunction;
+use crate::properties::LonghandIdSet;
+use crate::properties::{Importance, PropertyDeclaration};
+use crate::properties::{LonghandId, PropertyDeclarationBlock, PropertyId};
+use crate::properties::{PropertyDeclarationId, SourcePropertyDeclaration};
+use crate::shared_lock::{DeepCloneParams, DeepCloneWithLock, SharedRwLock, SharedRwLockReadGuard};
+use crate::shared_lock::{Locked, ToCssWithGuard};
+use crate::str::CssStringWriter;
+use crate::stylesheets::rule_parser::VendorPrefix;
+use crate::stylesheets::{CssRuleType, StylesheetContents};
+use crate::values::{serialize_percentage, KeyframesName};
 use cssparser::{parse_one_rule, DeclarationListParser, DeclarationParser, SourceLocation, Token};
 use cssparser::{AtRuleParser, CowRcStr, Parser, ParserInput, QualifiedRuleParser, RuleListParser};
-use error_reporting::ContextualParseError;
-use parser::ParserContext;
-use properties::longhands::transition_timing_function::single_value::SpecifiedValue as SpecifiedTimingFunction;
-use properties::LonghandIdSet;
-use properties::{Importance, PropertyDeclaration};
-use properties::{LonghandId, PropertyDeclarationBlock, PropertyId};
-use properties::{PropertyDeclarationId, SourcePropertyDeclaration};
 use servo_arc::Arc;
-use shared_lock::{DeepCloneParams, DeepCloneWithLock, SharedRwLock, SharedRwLockReadGuard};
-use shared_lock::{Locked, ToCssWithGuard};
 use std::fmt::{self, Write};
-use str::CssStringWriter;
 use style_traits::{CssWriter, ParseError, ParsingMode, StyleParseErrorKind, ToCss};
-use stylesheets::rule_parser::VendorPrefix;
-use stylesheets::{CssRuleType, StylesheetContents};
-use values::{serialize_percentage, KeyframesName};
 
 /// A [`@keyframes`][keyframes] rule.
 ///
 /// [keyframes]: https://drafts.csswg.org/css-animations/#keyframes
 #[derive(Debug)]
 pub struct KeyframesRule {
     /// The name of the current animation.
     pub name: KeyframesName,
--- a/servo/components/style/stylesheets/loader.rs
+++ b/servo/components/style/stylesheets/loader.rs
@@ -1,22 +1,22 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * 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/. */
 
 //! The stylesheet loader is the abstraction used to trigger network requests
 //! for `@import` rules.
 
+use crate::media_queries::MediaList;
+use crate::parser::ParserContext;
+use crate::shared_lock::{Locked, SharedRwLock};
+use crate::stylesheets::import_rule::ImportRule;
+use crate::values::CssUrl;
 use cssparser::SourceLocation;
-use media_queries::MediaList;
-use parser::ParserContext;
 use servo_arc::Arc;
-use shared_lock::{Locked, SharedRwLock};
-use stylesheets::import_rule::ImportRule;
-use values::CssUrl;
 
 /// The stylesheet loader is the abstraction used to trigger network requests
 /// for `@import` rules.
 pub trait StylesheetLoader {
     /// Request a stylesheet after parsing a given `@import` rule, and return
     /// the constructed `@import` rule.
     fn request_stylesheet(
         &self,
--- a/servo/components/style/stylesheets/media_rule.rs
+++ b/servo/components/style/stylesheets/media_rule.rs
@@ -1,27 +1,27 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * 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/. */
 
 //! An [`@media`][media] urle.
 //!
 //! [media]: https://drafts.csswg.org/css-conditional/#at-ruledef-media
 
+use crate::media_queries::MediaList;
+use crate::shared_lock::{DeepCloneParams, DeepCloneWithLock, Locked};
+use crate::shared_lock::{SharedRwLock, SharedRwLockReadGuard, ToCssWithGuard};
+use crate::str::CssStringWriter;
+use crate::stylesheets::CssRules;
 use cssparser::SourceLocation;
 #[cfg(feature = "gecko")]
 use malloc_size_of::{MallocSizeOfOps, MallocUnconditionalShallowSizeOf};
-use media_queries::MediaList;
 use servo_arc::Arc;
-use shared_lock::{DeepCloneParams, DeepCloneWithLock, Locked};
-use shared_lock::{SharedRwLock, SharedRwLockReadGuard, ToCssWithGuard};
 use std::fmt::{self, Write};
-use str::CssStringWriter;
 use style_traits::{CssWriter, ToCss};
-use stylesheets::CssRules;
 
 /// An [`@media`][media] urle.
 ///
 /// [media]: https://drafts.csswg.org/css-conditional/#at-ruledef-media
 #[derive(Debug)]
 pub struct MediaRule {
     /// The list of media queries used by this media rule.
     pub media_queries: Arc<Locked<MediaList>>,
--- a/servo/components/style/stylesheets/mod.rs
+++ b/servo/components/style/stylesheets/mod.rs
@@ -18,25 +18,25 @@ mod page_rule;
 mod rule_list;
 mod rule_parser;
 mod rules_iterator;
 mod style_rule;
 mod stylesheet;
 pub mod supports_rule;
 pub mod viewport_rule;
 
+use crate::parser::ParserContext;
+use crate::shared_lock::{DeepCloneParams, DeepCloneWithLock, Locked};
+use crate::shared_lock::{SharedRwLock, SharedRwLockReadGuard, ToCssWithGuard};
+use crate::str::CssStringWriter;
 use cssparser::{parse_one_rule, Parser, ParserInput};
 #[cfg(feature = "gecko")]
 use malloc_size_of::{MallocSizeOfOps, MallocUnconditionalShallowSizeOf};
-use parser::ParserContext;
 use servo_arc::Arc;
-use shared_lock::{DeepCloneParams, DeepCloneWithLock, Locked};
-use shared_lock::{SharedRwLock, SharedRwLockReadGuard, ToCssWithGuard};
 use std::fmt;
-use str::CssStringWriter;
 use style_traits::ParsingMode;
 
 pub use self::counter_style_rule::CounterStyleRule;
 pub use self::document_rule::DocumentRule;
 pub use self::font_face_rule::FontFaceRule;
 pub use self::font_feature_values_rule::FontFeatureValuesRule;
 pub use self::import_rule::ImportRule;
 pub use self::keyframes_rule::KeyframesRule;
--- a/servo/components/style/stylesheets/namespace_rule.rs
+++ b/servo/components/style/stylesheets/namespace_rule.rs
@@ -1,19 +1,19 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * 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/. */
 
 //! The `@namespace` at-rule.
 
+use crate::shared_lock::{SharedRwLockReadGuard, ToCssWithGuard};
+use crate::str::CssStringWriter;
+use crate::{Namespace, Prefix};
 use cssparser::SourceLocation;
-use shared_lock::{SharedRwLockReadGuard, ToCssWithGuard};
 use std::fmt::{self, Write};
-use str::CssStringWriter;
-use {Namespace, Prefix};
 
 /// A `@namespace` rule.
 #[derive(Clone, Debug, PartialEq)]
 #[allow(missing_docs)]
 pub struct NamespaceRule {
     /// The namespace prefix, and `None` if it's the default Namespace
     pub prefix: Option<Prefix>,
     /// The actual namespace url.
--- a/servo/components/style/stylesheets/page_rule.rs
+++ b/servo/components/style/stylesheets/page_rule.rs
@@ -1,25 +1,25 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * 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/. */
 
 //! A [`@page`][page] rule.
 //!
 //! [page]: https://drafts.csswg.org/css2/page.html#page-box
 
+use crate::properties::PropertyDeclarationBlock;
+use crate::shared_lock::{DeepCloneParams, DeepCloneWithLock, Locked};
+use crate::shared_lock::{SharedRwLock, SharedRwLockReadGuard, ToCssWithGuard};
+use crate::str::CssStringWriter;
 use cssparser::SourceLocation;
 #[cfg(feature = "gecko")]
 use malloc_size_of::{MallocSizeOf, MallocSizeOfOps, MallocUnconditionalShallowSizeOf};
-use properties::PropertyDeclarationBlock;
 use servo_arc::Arc;
-use shared_lock::{DeepCloneParams, DeepCloneWithLock, Locked};
-use shared_lock::{SharedRwLock, SharedRwLockReadGuard, ToCssWithGuard};
 use std::fmt::{self, Write};
-use str::CssStringWriter;
 
 /// A [`@page`][page] rule.
 ///
 /// This implements only a limited subset of the CSS
 /// 2.2 syntax.
 ///
 /// In this subset, [page selectors][page-selectors] are not implemented.
 ///
--- a/servo/components/style/stylesheets/rule_list.rs
+++ b/servo/components/style/stylesheets/rule_list.rs
@@ -1,25 +1,25 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * 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/. */
 
 //! A list of CSS rules.
 
+use crate::shared_lock::{DeepCloneParams, DeepCloneWithLock, Locked};
+use crate::shared_lock::{SharedRwLock, SharedRwLockReadGuard, ToCssWithGuard};
+use crate::str::CssStringWriter;
+use crate::stylesheets::loader::StylesheetLoader;
+use crate::stylesheets::rule_parser::{InsertRuleContext, State};
+use crate::stylesheets::stylesheet::StylesheetContents;
+use crate::stylesheets::{CssRule, RulesMutateError};
 #[cfg(feature = "gecko")]
 use malloc_size_of::{MallocShallowSizeOf, MallocSizeOfOps};
 use servo_arc::{Arc, RawOffsetArc};
-use shared_lock::{DeepCloneParams, DeepCloneWithLock, Locked};
-use shared_lock::{SharedRwLock, SharedRwLockReadGuard, ToCssWithGuard};
 use std::fmt::{self, Write};
-use str::CssStringWriter;
-use stylesheets::loader::StylesheetLoader;
-use stylesheets::rule_parser::{InsertRuleContext, State};
-use stylesheets::stylesheet::StylesheetContents;
-use stylesheets::{CssRule, RulesMutateError};
 
 /// A list of CSS rules.
 #[derive(Debug)]
 pub struct CssRules(pub Vec<CssRule>);
 
 impl CssRules {
     /// Whether this CSS rules is empty.
     pub fn is_empty(&self) -> bool {
--- a/servo/components/style/stylesheets/rule_parser.rs
+++ b/servo/components/style/stylesheets/rule_parser.rs
@@ -1,40 +1,40 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * 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/. */
 
 //! Parsing of the stylesheet contents.
 
-use counter_style::{parse_counter_style_body, parse_counter_style_name_definition};
+use crate::counter_style::{parse_counter_style_body, parse_counter_style_name_definition};
+use crate::error_reporting::ContextualParseError;
+use crate::font_face::parse_font_face_block;
+use crate::media_queries::MediaList;
+use crate::parser::{Parse, ParserContext};
+use crate::properties::parse_property_declaration_list;
+use crate::selector_parser::{SelectorImpl, SelectorParser};
+use crate::shared_lock::{Locked, SharedRwLock};
+use crate::str::starts_with_ignore_ascii_case;
+use crate::stylesheets::document_rule::DocumentCondition;
+use crate::stylesheets::font_feature_values_rule::parse_family_name_list;
+use crate::stylesheets::keyframes_rule::parse_keyframe_list;
+use crate::stylesheets::stylesheet::Namespaces;
+use crate::stylesheets::supports_rule::SupportsCondition;
+use crate::stylesheets::viewport_rule;
+use crate::stylesheets::{CssRule, CssRuleType, CssRules, RulesMutateError, StylesheetLoader};
+use crate::stylesheets::{DocumentRule, FontFeatureValuesRule, KeyframesRule, MediaRule};
+use crate::stylesheets::{NamespaceRule, PageRule, StyleRule, SupportsRule, ViewportRule};
+use crate::values::computed::font::FamilyName;
+use crate::values::{CssUrl, CustomIdent, KeyframesName};
+use crate::{Namespace, Prefix};
 use cssparser::{AtRuleParser, AtRuleType, Parser, QualifiedRuleParser, RuleListParser};
 use cssparser::{BasicParseError, BasicParseErrorKind, CowRcStr, SourceLocation};
-use error_reporting::ContextualParseError;
-use font_face::parse_font_face_block;
-use media_queries::MediaList;
-use parser::{Parse, ParserContext};
-use properties::parse_property_declaration_list;
-use selector_parser::{SelectorImpl, SelectorParser};
 use selectors::SelectorList;
 use servo_arc::Arc;
-use shared_lock::{Locked, SharedRwLock};
-use str::starts_with_ignore_ascii_case;
 use style_traits::{ParseError, StyleParseErrorKind};
-use stylesheets::document_rule::DocumentCondition;
-use stylesheets::font_feature_values_rule::parse_family_name_list;
-use stylesheets::keyframes_rule::parse_keyframe_list;
-use stylesheets::stylesheet::Namespaces;
-use stylesheets::supports_rule::SupportsCondition;
-use stylesheets::viewport_rule;
-use stylesheets::{CssRule, CssRuleType, CssRules, RulesMutateError, StylesheetLoader};
-use stylesheets::{DocumentRule, FontFeatureValuesRule, KeyframesRule, MediaRule};
-use stylesheets::{NamespaceRule, PageRule, StyleRule, SupportsRule, ViewportRule};
-use values::computed::font::FamilyName;
-use values::{CssUrl, CustomIdent, KeyframesName};
-use {Namespace, Prefix};
 
 /// The information we need particularly to do CSSOM insertRule stuff.
 pub struct InsertRuleContext<'a> {
     /// The rule list we're about to insert into.
     pub rule_list: &'a [CssRule],
     /// The index we're about to get inserted at.
     pub index: usize,
 }
@@ -197,17 +197,17 @@ impl<'a, 'i> AtRuleParser<'i> for TopLev
                 let prelude = AtRuleNonBlockPrelude::Import(url, media);
                 return Ok(AtRuleType::WithoutBlock(prelude));
             },
             "namespace" => {
                 if !self.check_state(State::Namespaces) {
                     return Err(input.new_custom_error(StyleParseErrorKind::UnexpectedNamespaceRule))
                 }
 
-                let prefix = input.try(|i| i.expect_ident_cloned())
+                let prefix = input.r#try(|i| i.expect_ident_cloned())
                                   .map(|s| Prefix::from(s.as_ref())).ok();
                 let maybe_namespace = match input.expect_url_or_string() {
                     Ok(url_or_string) => url_or_string,
                     Err(BasicParseError { kind: BasicParseErrorKind::UnexpectedToken(t), location }) => {
                         return Err(location.new_custom_error(StyleParseErrorKind::UnexpectedTokenWithinNamespace(t)))
                     }
                     Err(e) => return Err(e.into()),
                 };
--- a/servo/components/style/stylesheets/rules_iterator.rs
+++ b/servo/components/style/stylesheets/rules_iterator.rs
@@ -1,21 +1,21 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * 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/. */
 
 //! An iterator over a list of rules.
 
-use context::QuirksMode;
-use media_queries::Device;
-use shared_lock::SharedRwLockReadGuard;
+use crate::context::QuirksMode;
+use crate::media_queries::Device;
+use crate::shared_lock::SharedRwLockReadGuard;
+use crate::stylesheets::StylesheetInDocument;
+use crate::stylesheets::{CssRule, DocumentRule, ImportRule, MediaRule, SupportsRule};
 use smallvec::SmallVec;
 use std::slice;
-use stylesheets::StylesheetInDocument;
-use stylesheets::{CssRule, DocumentRule, ImportRule, MediaRule, SupportsRule};
 
 /// An iterator over a list of rules.
 pub struct RulesIterator<'a, 'b, C>
 where
     'b: 'a,
     C: NestedRuleIterationCondition + 'static,
 {
     device: &'a Device,
--- a/servo/components/style/stylesheets/style_rule.rs
+++ b/servo/components/style/stylesheets/style_rule.rs
@@ -1,27 +1,27 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * 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/. */
 
 //! A style rule.
 
+use crate::properties::PropertyDeclarationBlock;
+use crate::selector_parser::SelectorImpl;
+use crate::shared_lock::{DeepCloneParams, DeepCloneWithLock, Locked};
+use crate::shared_lock::{SharedRwLock, SharedRwLockReadGuard, ToCssWithGuard};
+use crate::str::CssStringWriter;
 use cssparser::SourceLocation;
 #[cfg(feature = "gecko")]
 use malloc_size_of::MallocUnconditionalShallowSizeOf;
 #[cfg(feature = "gecko")]
 use malloc_size_of::{MallocSizeOf, MallocSizeOfOps};
-use properties::PropertyDeclarationBlock;
-use selector_parser::SelectorImpl;
 use selectors::SelectorList;
 use servo_arc::Arc;
-use shared_lock::{DeepCloneParams, DeepCloneWithLock, Locked};
-use shared_lock::{SharedRwLock, SharedRwLockReadGuard, ToCssWithGuard};
 use std::fmt::{self, Write};
-use str::CssStringWriter;
 
 /// A style rule, with selectors and declarations.
 #[derive(Debug)]
 pub struct StyleRule {
     /// The list of selectors in this rule.
     pub selectors: SelectorList<SelectorImpl>,
     /// The declaration block with the properties it contains.
     pub block: Arc<Locked<PropertyDeclarationBlock>>,
--- a/servo/components/style/stylesheets/stylesheet.rs
+++ b/servo/components/style/stylesheets/stylesheet.rs
@@ -1,37 +1,37 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * 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 context::QuirksMode;
+use crate::context::QuirksMode;
+use crate::error_reporting::{ContextualParseError, ParseErrorReporter};
+use crate::invalidation::media_queries::{MediaListKey, ToMediaListKey};
+use crate::media_queries::{Device, MediaList};
+use crate::parser::ParserContext;
+use crate::shared_lock::{
+    DeepCloneParams, DeepCloneWithLock, Locked, SharedRwLock, SharedRwLockReadGuard,
+};
+use crate::stylesheets::loader::StylesheetLoader;
+use crate::stylesheets::rule_parser::{State, TopLevelRuleParser};
+use crate::stylesheets::rules_iterator::{EffectiveRules, EffectiveRulesIterator};
+use crate::stylesheets::rules_iterator::{NestedRuleIterationCondition, RulesIterator};
+use crate::stylesheets::{CssRule, CssRules, Origin, UrlExtraData};
+use crate::use_counters::UseCounters;
+use crate::{Namespace, Prefix};
 use cssparser::{Parser, ParserInput, RuleListParser};
-use error_reporting::{ContextualParseError, ParseErrorReporter};
 use fallible::FallibleVec;
 use fxhash::FxHashMap;
-use invalidation::media_queries::{MediaListKey, ToMediaListKey};
 #[cfg(feature = "gecko")]
 use malloc_size_of::{MallocSizeOfOps, MallocUnconditionalShallowSizeOf};
-use media_queries::{Device, MediaList};
 use parking_lot::RwLock;
-use parser::ParserContext;
 use servo_arc::Arc;
-use shared_lock::{
-    DeepCloneParams, DeepCloneWithLock, Locked, SharedRwLock, SharedRwLockReadGuard,
-};
 use std::mem;
 use std::sync::atomic::{AtomicBool, Ordering};
 use style_traits::ParsingMode;
-use stylesheets::loader::StylesheetLoader;
-use stylesheets::rule_parser::{State, TopLevelRuleParser};
-use stylesheets::rules_iterator::{EffectiveRules, EffectiveRulesIterator};
-use stylesheets::rules_iterator::{NestedRuleIterationCondition, RulesIterator};
-use stylesheets::{CssRule, CssRules, Origin, UrlExtraData};
-use use_counters::UseCounters;
-use {Namespace, Prefix};
 
 /// This structure holds the user-agent and user stylesheets.
 pub struct UserAgentStylesheets {
     /// The lock used for user-agent stylesheets.
     pub shared_lock: SharedRwLock,
     /// The user or user agent stylesheets.
     pub user_or_user_agent_stylesheets: Vec<DocumentStyleSheet>,
     /// The quirks mode stylesheet.
@@ -161,19 +161,19 @@ pub struct Stylesheet {
     pub disabled: AtomicBool,
 }
 
 macro_rules! rule_filter {
     ($( $method: ident($variant:ident => $rule_type: ident), )+) => {
         $(
             #[allow(missing_docs)]
             fn $method<F>(&self, device: &Device, guard: &SharedRwLockReadGuard, mut f: F)
-                where F: FnMut(&::stylesheets::$rule_type),
+                where F: FnMut(&crate::stylesheets::$rule_type),
             {
-                use stylesheets::CssRule;
+                use crate::stylesheets::CssRule;
 
                 for rule in self.effective_rules(device, guard) {
                     if let CssRule::$variant(ref lock) = *rule {
                         let rule = lock.read_with(guard);
                         f(&rule)
                     }
                 }
             }
--- a/servo/components/style/stylesheets/supports_rule.rs
+++ b/servo/components/style/stylesheets/supports_rule.rs
@@ -1,32 +1,32 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * 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/. */
 
 //! [@supports rules](https://drafts.csswg.org/css-conditional-3/#at-supports)
 
+use crate::parser::ParserContext;
+use crate::properties::{PropertyDeclaration, PropertyId, SourcePropertyDeclaration};
+use crate::selector_parser::{SelectorImpl, SelectorParser};
+use crate::shared_lock::{DeepCloneParams, DeepCloneWithLock, Locked};
+use crate::shared_lock::{SharedRwLock, SharedRwLockReadGuard, ToCssWithGuard};
+use crate::str::CssStringWriter;
+use crate::stylesheets::{CssRuleType, CssRules, Namespaces};
 use cssparser::parse_important;
 use cssparser::{Delimiter, Parser, SourceLocation, Token};
 use cssparser::{ParseError as CssParseError, ParserInput};
 #[cfg(feature = "gecko")]
 use malloc_size_of::{MallocSizeOfOps, MallocUnconditionalShallowSizeOf};
-use parser::ParserContext;
-use properties::{PropertyDeclaration, PropertyId, SourcePropertyDeclaration};
-use selector_parser::{SelectorImpl, SelectorParser};
 use selectors::parser::{Selector, SelectorParseErrorKind};
 use servo_arc::Arc;
-use shared_lock::{DeepCloneParams, DeepCloneWithLock, Locked};
-use shared_lock::{SharedRwLock, SharedRwLockReadGuard, ToCssWithGuard};
 use std::ffi::{CStr, CString};
 use std::fmt::{self, Write};
 use std::str;
-use str::CssStringWriter;
 use style_traits::{CssWriter, ParseError, StyleParseErrorKind, ToCss};
-use stylesheets::{CssRuleType, CssRules, Namespaces};
 
 /// An [`@supports`][supports] rule.
 ///
 /// [supports]: https://drafts.csswg.org/css-conditional-3/#at-supports
 #[derive(Debug)]
 pub struct SupportsRule {
     /// The parsed condition
     pub condition: SupportsCondition,
@@ -98,17 +98,17 @@ pub enum SupportsCondition {
     FutureSyntax(String),
 }
 
 impl SupportsCondition {
     /// Parse a condition
     ///
     /// <https://drafts.csswg.org/css-conditional/#supports_condition>
     pub fn parse<'i, 't>(input: &mut Parser<'i, 't>) -> Result<Self, ParseError<'i>> {
-        if input.try(|i| i.expect_ident_matching("not")).is_ok() {
+        if input.r#try(|i| i.expect_ident_matching("not")).is_ok() {
             let inner = SupportsCondition::parse_in_parens(input)?;
             return Ok(SupportsCondition::Not(Box::new(inner)));
         }
 
         let in_parens = SupportsCondition::parse_in_parens(input)?;
 
         let location = input.current_source_location();
         let (keyword, wrapper) = match input.next() {
@@ -124,17 +124,17 @@ impl SupportsCondition {
             Ok(t) => return Err(location.new_unexpected_token_error(t.clone())),
         };
 
         let mut conditions = Vec::with_capacity(2);
         conditions.push(in_parens);
         loop {
             conditions.push(SupportsCondition::parse_in_parens(input)?);
             if input
-                .try(|input| input.expect_ident_matching(keyword))
+                .r#try(|input| input.expect_ident_matching(keyword))
                 .is_err()
             {
                 // Did not find the expected keyword.
                 // If we found some other token, it will be rejected by
                 // `Parser::parse_entirely` somewhere up the stack.
                 return Ok(wrapper(conditions));
             }
         }
@@ -170,30 +170,30 @@ impl SupportsCondition {
             }
         }
     }
 
     /// <https://drafts.csswg.org/css-conditional-3/#supports_condition_in_parens>
     fn parse_in_parens<'i, 't>(input: &mut Parser<'i, 't>) -> Result<Self, ParseError<'i>> {
         // Whitespace is normally taken care of in `Parser::next`,
         // but we want to not include it in `pos` for the SupportsCondition::FutureSyntax cases.
-        while input.try(Parser::expect_whitespace).is_ok() {}
+        while input.r#try(Parser::expect_whitespace).is_ok() {}
         let pos = input.position();
         let location = input.current_source_location();
         // FIXME: remove clone() when lifetimes are non-lexical
         match input.next()?.clone() {
             Token::ParenthesisBlock => {
                 let nested =
-                    input.try(|input| input.parse_nested_block(parse_condition_or_declaration));
+                    input.r#try(|input| input.parse_nested_block(parse_condition_or_declaration));
                 if nested.is_ok() {
                     return nested;
                 }
             },
             Token::Function(ident) => {
-                let nested = input.try(|input| {
+                let nested = input.r#try(|input| {
                     input.parse_nested_block(|input| {
                         SupportsCondition::parse_functional(&ident, input)
                     })
                 });
                 if nested.is_ok() {
                     return nested;
                 }
             },
@@ -235,17 +235,17 @@ fn eval_moz_bool_pref(_: &CStr, _: &Pars
     false
 }
 
 /// supports_condition | declaration
 /// <https://drafts.csswg.org/css-conditional/#dom-css-supports-conditiontext-conditiontext>
 pub fn parse_condition_or_declaration<'i, 't>(
     input: &mut Parser<'i, 't>,
 ) -> Result<SupportsCondition, ParseError<'i>> {
-    if let Ok(condition) = input.try(SupportsCondition::parse) {
+    if let Ok(condition) = input.r#try(SupportsCondition::parse) {
         Ok(SupportsCondition::Parenthesized(Box::new(condition)))
     } else {
         Declaration::parse(input).map(SupportsCondition::Declaration)
     }
 }
 
 impl ToCss for SupportsCondition {
     fn to_css<W>(&self, dest: &mut CssWriter<W>) -> fmt::Result
@@ -413,14 +413,14 @@ impl Declaration {
                 let id =
                     PropertyId::parse(&prop, context).map_err(|_| input.new_custom_error(()))?;
 
                 let mut declarations = SourcePropertyDeclaration::new();
                 input.parse_until_before(Delimiter::Bang, |input| {
                     PropertyDeclaration::parse_into(&mut declarations, id, &context, input)
                         .map_err(|_| input.new_custom_error(()))
                 })?;
-                let _ = input.try(parse_important);
+                let _ = input.r#try(parse_important);
                 Ok(())
             })
             .is_ok()
     }
 }
--- a/servo/components/style/stylesheets/viewport_rule.rs
+++ b/servo/components/style/stylesheets/viewport_rule.rs
@@ -3,39 +3,39 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 //! The [`@viewport`][at] at-rule and [`meta`][meta] element.
 //!
 //! [at]: https://drafts.csswg.org/css-device-adapt/#atviewport-rule
 //! [meta]: https://drafts.csswg.org/css-device-adapt/#viewport-meta
 
 use app_units::Au;
-use context::QuirksMode;
+use crate::context::QuirksMode;
+use crate::error_reporting::ContextualParseError;
+use crate::font_metrics::get_metrics_provider_for_product;
+use crate::media_queries::Device;
+use crate::parser::ParserContext;
+use crate::properties::StyleBuilder;
+use crate::rule_cache::RuleCacheConditions;
+use crate::shared_lock::{SharedRwLockReadGuard, StylesheetGuards, ToCssWithGuard};
+use crate::str::CssStringWriter;
+use crate::stylesheets::{Origin, StylesheetInDocument};
+use crate::values::computed::{Context, ToComputedValue};
+use crate::values::specified::{LengthOrPercentageOrAuto, NoCalcLength, ViewportPercentageLength};
 use cssparser::CowRcStr;
 use cssparser::{parse_important, AtRuleParser, DeclarationListParser, DeclarationParser, Parser};
-use error_reporting::ContextualParseError;
 use euclid::TypedSize2D;
-use font_metrics::get_metrics_provider_for_product;
-use media_queries::Device;
-use parser::ParserContext;
-use properties::StyleBuilder;
-use rule_cache::RuleCacheConditions;
 use selectors::parser::SelectorParseErrorKind;
-use shared_lock::{SharedRwLockReadGuard, StylesheetGuards, ToCssWithGuard};
 use std::borrow::Cow;
 use std::cell::RefCell;
 use std::fmt::{self, Write};
 use std::iter::Enumerate;
 use std::str::Chars;
-use str::CssStringWriter;
 use style_traits::viewport::{Orientation, UserZoom, ViewportConstraints, Zoom};
 use style_traits::{CssWriter, ParseError, PinchZoomFactor, StyleParseErrorKind, ToCss};
-use stylesheets::{Origin, StylesheetInDocument};
-use values::computed::{Context, ToComputedValue};
-use values::specified::{LengthOrPercentageOrAuto, NoCalcLength, ViewportPercentageLength};
 
 /// Whether parsing and processing of `@viewport` rules is enabled.
 #[cfg(feature = "servo")]
 pub fn enabled() -> bool {
     use servo_config::prefs::PREFS;
     PREFS
         .get("layout.viewport.enabled")
         .as_boolean()
@@ -260,17 +260,17 @@ impl ToCss for ViewportDescriptorDeclara
     }
 }
 
 fn parse_shorthand<'i, 't>(
     context: &ParserContext,
     input: &mut Parser<'i, 't>,
 ) -> Result<(ViewportLength, ViewportLength), ParseError<'i>> {
     let min = ViewportLength::parse(context, input)?;
-    match input.try(|i| ViewportLength::parse(context, i)) {
+    match input.r#try(|i| ViewportLength::parse(context, i)) {
         Err(_) => Ok((min.clone(), min)),
         Ok(max) => Ok((min, max)),
     }
 }
 
 impl<'a, 'b, 'i> AtRuleParser<'i> for ViewportRuleParser<'a, 'b> {
     type PreludeNoBlock = ();
     type PreludeBlock = ();
@@ -284,34 +284,34 @@ impl<'a, 'b, 'i> DeclarationParser<'i> f
 
     fn parse_value<'t>(
         &mut self,
         name: CowRcStr<'i>,
         input: &mut Parser<'i, 't>,
     ) -> Result<Vec<ViewportDescriptorDeclaration>, ParseError<'i>> {
         macro_rules! declaration {
             ($declaration:ident($parse:expr)) => {
-                declaration!($declaration(value: try!($parse(input)),
-                                          important: input.try(parse_important).is_ok()))
+                declaration!($declaration(value: r#try!($parse(input)),
+                                          important: input.r#try(parse_important).is_ok()))
             };
             ($declaration:ident(value: $value:expr, important: $important:expr)) => {
                 ViewportDescriptorDeclaration::new(
                     self.context.stylesheet_origin,
                     ViewportDescriptor::$declaration($value),
                     $important)
             }
         }
 
         macro_rules! ok {
             ($declaration:ident($parse:expr)) => {
                 Ok(vec![declaration!($declaration($parse))])
             };
             (shorthand -> [$min:ident, $max:ident]) => {{
                 let shorthand = parse_shorthand(self.context, input)?;
-                let important = input.try(parse_important).is_ok();
+                let important = input.r#try(parse_important).is_ok();
 
                 Ok(vec![
                     declaration!($min(value: shorthand.0, important: important)),
                     declaration!($max(value: shorthand.1, important: important)),
                 ])
             }};
         }
 
--- a/servo/components/style/stylist.rs
+++ b/servo/components/style/stylist.rs
@@ -1,65 +1,65 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * 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/. */
 
 //! Selector matching.
 
-use applicable_declarations::{ApplicableDeclarationBlock, ApplicableDeclarationList};
-use context::{CascadeInputs, QuirksMode};
-use dom::{TElement, TShadowRoot};
-use element_state::{DocumentState, ElementState};
-use font_metrics::FontMetricsProvider;
+use crate::applicable_declarations::{ApplicableDeclarationBlock, ApplicableDeclarationList};
+use crate::context::{CascadeInputs, QuirksMode};
+use crate::dom::{TElement, TShadowRoot};
+use crate::element_state::{DocumentState, ElementState};
+use crate::font_metrics::FontMetricsProvider;
+use crate::invalidation::element::invalidation_map::InvalidationMap;
+use crate::invalidation::media_queries::{EffectiveMediaQueryResults, ToMediaListKey};
+use crate::media_queries::Device;
+use crate::properties::{self, CascadeMode, ComputedValues};
+use crate::properties::{AnimationRules, PropertyDeclarationBlock};
+use crate::rule_cache::{RuleCache, RuleCacheConditions};
+use crate::rule_collector::RuleCollector;
+use crate::rule_tree::{CascadeLevel, RuleTree, ShadowCascadeOrder, StrongRuleNode, StyleSource};
+use crate::selector_map::{PrecomputedHashMap, PrecomputedHashSet, SelectorMap, SelectorMapEntry};
+use crate::selector_parser::{PerPseudoElementMap, PseudoElement, SelectorImpl, SnapshotMap};
+use crate::shared_lock::{Locked, SharedRwLockReadGuard, StylesheetGuards};
+use crate::stylesheet_set::{DataValidity, DocumentStylesheetSet, SheetRebuildKind};
+use crate::stylesheet_set::{DocumentStylesheetFlusher, SheetCollectionFlusher};
+use crate::stylesheets::keyframes_rule::KeyframesAnimation;
+use crate::stylesheets::viewport_rule::{self, MaybeNew, ViewportRule};
+use crate::stylesheets::StyleRule;
+use crate::stylesheets::StylesheetInDocument;
+use crate::stylesheets::{CssRule, Origin, OriginSet, PerOrigin, PerOriginIter};
+use crate::thread_state::{self, ThreadState};
+use crate::{Atom, LocalName, Namespace, WeakAtom};
 #[cfg(feature = "gecko")]
 use gecko_bindings::structs::{ServoStyleSetSizes, StyleRuleInclusion};
 use hashglobe::FailedAllocationError;
-use invalidation::element::invalidation_map::InvalidationMap;
-use invalidation::media_queries::{EffectiveMediaQueryResults, ToMediaListKey};
 #[cfg(feature = "gecko")]
 use malloc_size_of::MallocUnconditionalShallowSizeOf;
 #[cfg(feature = "gecko")]
 use malloc_size_of::{MallocShallowSizeOf, MallocSizeOf, MallocSizeOfOps};
-use media_queries::Device;
-use properties::{self, CascadeMode, ComputedValues};
-use properties::{AnimationRules, PropertyDeclarationBlock};
-use rule_cache::{RuleCache, RuleCacheConditions};
-use rule_tree::{CascadeLevel, RuleTree, ShadowCascadeOrder, StrongRuleNode, StyleSource};
-use rule_collector::RuleCollector;
-use selector_map::{PrecomputedHashMap, PrecomputedHashSet, SelectorMap, SelectorMapEntry};
-use selector_parser::{PerPseudoElementMap, PseudoElement, SelectorImpl, SnapshotMap};
 use selectors::attr::{CaseSensitivity, NamespaceConstraint};
 use selectors::bloom::BloomFilter;
 use selectors::matching::VisitedHandlingMode;
 use selectors::matching::{matches_selector, ElementSelectorFlags, MatchingContext, MatchingMode};
 use selectors::parser::{AncestorHashes, Combinator, Component, Selector};
 use selectors::parser::{SelectorIter, Visit};
 use selectors::visitor::SelectorVisitor;
 use selectors::NthIndexCache;
 use servo_arc::{Arc, ArcBorrow};
-use shared_lock::{Locked, SharedRwLockReadGuard, StylesheetGuards};
 use smallbitvec::SmallBitVec;
 use std::ops;
 use std::sync::Mutex;
 use style_traits::viewport::ViewportConstraints;
-use stylesheet_set::{DataValidity, DocumentStylesheetSet, SheetRebuildKind};
-use stylesheet_set::{DocumentStylesheetFlusher, SheetCollectionFlusher};
-use stylesheets::keyframes_rule::KeyframesAnimation;
-use stylesheets::viewport_rule::{self, MaybeNew, ViewportRule};
-use stylesheets::StyleRule;
-use stylesheets::StylesheetInDocument;
 #[cfg(feature = "gecko")]
 use stylesheets::{CounterStyleRule, FontFaceRule, FontFeatureValuesRule, PageRule};
-use stylesheets::{CssRule, Origin, OriginSet, PerOrigin, PerOriginIter};
-use thread_state::{self, ThreadState};
-use {Atom, LocalName, Namespace, WeakAtom};
 
 /// The type of the stylesheets that the stylist contains.
 #[cfg(feature = "servo")]
-pub type StylistSheet = ::stylesheets::DocumentStyleSheet;
+pub type StylistSheet = crate::stylesheets::DocumentStyleSheet;
 
 /// The type of the stylesheets that the stylist contains.
 #[cfg(feature = "gecko")]
 pub type StylistSheet = ::gecko::data::GeckoStyleSheet;
 
 /// A cache of computed user-agent data, to be shared across documents.
 lazy_static! {
     static ref UA_CASCADE_DATA_CACHE: Mutex<UserAgentCascadeDataCache> =
@@ -723,17 +723,17 @@ impl Stylist {
         &self,
         guards: &StylesheetGuards,
         pseudo: &PseudoElement,
         parent_style: &ComputedValues,
     ) -> Arc<ComputedValues>
     where
         E: TElement,
     {
-        use font_metrics::ServoMetricsProvider;
+        use crate::font_metrics::ServoMetricsProvider;
         self.precomputed_values_for_pseudo::<E>(
             guards,
             &pseudo,
             Some(parent_style),
             &ServoMetricsProvider,
         )
     }
 
@@ -1289,17 +1289,17 @@ impl Stylist {
         &self,
         guards: &StylesheetGuards,
         parent_style: &ComputedValues,
         declarations: Arc<Locked<PropertyDeclarationBlock>>,
     ) -> Arc<ComputedValues>
     where
         E: TElement,
     {
-        use font_metrics::get_metrics_provider_for_product;
+        use crate::font_metrics::get_metrics_provider_for_product;
 
         let block = declarations.read_with(guards.author);
         let iter_declarations = || {
             block
                 .declaration_importance_iter()
                 .map(|(declaration, importance)| {
                     debug_assert!(!importance.important());
                     (declaration, CascadeLevel::StyleAttributeNormal)
@@ -2069,17 +2069,17 @@ impl CascadeData {
         stylesheet: &S,
         guard: &SharedRwLockReadGuard,
         device: &Device,
         quirks_mode: QuirksMode,
     ) -> bool
     where
         S: StylesheetInDocument + ToMediaListKey + 'static,
     {
-        use invalidation::media_queries::PotentiallyEffectiveMediaRules;
+        use crate::invalidation::media_queries::PotentiallyEffectiveMediaRules;
 
         let effective_now = stylesheet.is_effective_for_device(device, guard);
 
         let effective_then = self.effective_media_query_results.was_effective(stylesheet);
 
         if effective_now != effective_then {
             debug!(
                 " > Stylesheet {:?} changed -> {}, {}",
--- a/servo/components/style/traversal.rs
+++ b/servo/components/style/traversal.rs
@@ -1,26 +1,26 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * 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/. */
 
 //! Traversing the DOM tree; the bloom filter.
 
-use context::{ElementCascadeInputs, SharedStyleContext, StyleContext};
-use data::{ElementData, ElementStyles};
-use dom::{NodeInfo, OpaqueNode, TElement, TNode};
-use invalidation::element::restyle_hints::RestyleHint;
-use matching::{ChildCascadeRequirement, MatchMethods};
-use selector_parser::PseudoElement;
+use crate::context::{ElementCascadeInputs, SharedStyleContext, StyleContext};
+use crate::data::{ElementData, ElementStyles};
+use crate::dom::{NodeInfo, OpaqueNode, TElement, TNode};
+use crate::invalidation::element::restyle_hints::RestyleHint;
+use crate::matching::{ChildCascadeRequirement, MatchMethods};
+use crate::selector_parser::PseudoElement;
+use crate::sharing::StyleSharingTarget;
+use crate::style_resolver::{PseudoElementResolution, StyleResolverForElement};
+use crate::stylist::RuleInclusion;
+use crate::traversal_flags::TraversalFlags;
 use selectors::NthIndexCache;
-use sharing::StyleSharingTarget;
 use smallvec::SmallVec;
-use style_resolver::{PseudoElementResolution, StyleResolverForElement};
-use stylist::RuleInclusion;
-use traversal_flags::TraversalFlags;
 
 /// A per-traversal-level chunk of data. This is sent down by the traversal, and
 /// currently only holds the dom depth for the bloom filter.
 ///
 /// NB: Keep this as small as possible, please!
 #[derive(Clone, Debug)]
 pub struct PerLevelTraversalData {
     /// The current dom depth.
@@ -302,17 +302,17 @@ pub fn resolve_style<E>(
     context: &mut StyleContext<E>,
     element: E,
     rule_inclusion: RuleInclusion,
     pseudo: Option<&PseudoElement>,
 ) -> ElementStyles
 where
     E: TElement,
 {
-    use style_resolver::StyleResolverForElement;
+    use crate::style_resolver::StyleResolverForElement;
 
     debug_assert!(
         rule_inclusion == RuleInclusion::DefaultOnly ||
             pseudo.map_or(false, |p| p.is_before_or_after()) ||
             element.borrow_data().map_or(true, |d| !d.has_styles()),
         "Why are we here?"
     );
     let mut ancestors_requiring_style_resolution = SmallVec::<[E; 16]>::new();
@@ -401,18 +401,18 @@ pub fn recalc_style_at<E, D, F>(
     element: E,
     data: &mut ElementData,
     note_child: F,
 ) where
     E: TElement,
     D: DomTraversal<E>,
     F: FnMut(E::ConcreteNode),
 {
+    use crate::traversal_flags::TraversalFlags;
     use std::cmp;
-    use traversal_flags::TraversalFlags;
 
     let flags = context.shared.traversal_flags;
     let is_initial_style = !data.has_styles();
 
     context.thread_local.statistics.elements_traversed += 1;
     debug_assert!(
         flags.intersects(TraversalFlags::AnimationOnly) ||
             !element.has_snapshot() ||
@@ -581,17 +581,17 @@ fn compute_style<E>(
     traversal_data: &PerLevelTraversalData,
     context: &mut StyleContext<E>,
     element: E,
     data: &mut ElementData,
 ) -> ChildCascadeRequirement
 where
     E: TElement,
 {
-    use data::RestyleKind::*;
+    use crate::data::RestyleKind::*;
 
     context.thread_local.statistics.elements_styled += 1;
     let kind = data.restyle_kind(context.shared);
 
     debug!("compute_style: {:?} (kind={:?})", element, kind);
 
     if data.has_styles() {
         data.set_restyled();
@@ -714,19 +714,19 @@ where
     element.finish_restyle(context, data, new_styles, important_rules_changed)
 }
 
 #[cfg(feature = "servo")]
 fn notify_paint_worklet<E>(context: &StyleContext<E>, data: &ElementData)
 where
     E: TElement,
 {
+    use crate::values::generics::image::Image;
+    use crate::values::Either;
     use style_traits::ToCss;
-    use values::generics::image::Image;
-    use values::Either;
 
     // We speculatively evaluate any paint worklets during styling.
     // This allows us to run paint worklets in parallel with style and layout.
     // Note that this is wasted effort if the size of the node has
     // changed, but in may cases it won't have.
     if let Some(ref values) = data.styles.primary {
         for image in &values.get_background().background_image.0 {
             let (name, arguments) = match *image {
@@ -806,17 +806,17 @@ fn note_children<E, D, F>(
         if let Some(ref mut child_data) = child_data {
             let mut child_hint = propagated_hint;
             match cascade_requirement {
                 ChildCascadeRequirement::CanSkipCascade => {},
                 ChildCascadeRequirement::MustCascadeDescendants => {
                     child_hint |= RestyleHint::RECASCADE_SELF | RestyleHint::RECASCADE_DESCENDANTS;
                 },
                 ChildCascadeRequirement::MustCascadeChildrenIfInheritResetStyle => {
-                    use properties::computed_value_flags::ComputedValueFlags;
+                    use crate::properties::computed_value_flags::ComputedValueFlags;
                     if child_data
                         .styles
                         .primary()
                         .flags
                         .contains(ComputedValueFlags::INHERITS_RESET_STYLE)
                     {
                         child_hint |= RestyleHint::RECASCADE_SELF;
                     }
--- a/servo/components/style/use_counters/mod.rs
+++ b/servo/components/style/use_counters/mod.rs
@@ -1,17 +1,17 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * 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/. */
 
 //! Various stuff for CSS property use counters.
 
+use crate::properties::{NonCustomPropertyId, NON_CUSTOM_PROPERTY_ID_COUNT};
 #[cfg(feature = "gecko")]
 use gecko_bindings::sugar::ownership::{HasBoxFFI, HasFFI, HasSimpleFFI};
-use properties::{NonCustomPropertyId, NON_CUSTOM_PROPERTY_ID_COUNT};
 use std::cell::Cell;
 
 #[cfg(target_pointer_width = "64")]
 const BITS_PER_ENTRY: usize = 64;
 
 #[cfg(target_pointer_width = "32")]
 const BITS_PER_ENTRY: usize = 32;
 
--- a/servo/components/style/values/animated/color.rs
+++ b/servo/components/style/values/animated/color.rs
@@ -1,17 +1,17 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * 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/. */
 
 //! Animated types for CSS colors.
 
-use values::animated::{Animate, Procedure, ToAnimatedZero};
-use values::distance::{ComputeSquaredDistance, SquaredDistance};
-use values::generics::color::{Color as GenericColor, ComplexColorRatios};
+use crate::values::animated::{Animate, Procedure, ToAnimatedZero};
+use crate::values::distance::{ComputeSquaredDistance, SquaredDistance};
+use crate::values::generics::color::{Color as GenericColor, ComplexColorRatios};
 
 /// An animated RGBA color.
 ///
 /// Unlike in computed values, each component value may exceed the
 /// range `[0.0, 1.0]`.
 #[cfg_attr(feature = "servo", derive(MallocSizeOf))]
 #[derive(Clone, Copy, Debug, PartialEq, ToAnimatedZero)]
 pub struct RGBA {
--- a/servo/components/style/values/animated/effects.rs
+++ b/servo/components/style/values/animated/effects.rs
@@ -1,24 +1,24 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * 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/. */
 
 //! Animated types for CSS values related to effects.
 
-use values::animated::color::Color;
-use values::computed::length::Length;
+use crate::values::animated::color::Color;
+use crate::values::computed::length::Length;
+use crate::values::computed::{Angle, Number};
+use crate::values::generics::effects::BoxShadow as GenericBoxShadow;
+use crate::values::generics::effects::Filter as GenericFilter;
+use crate::values::generics::effects::SimpleShadow as GenericSimpleShadow;
+#[cfg(not(feature = "gecko"))]
+use crate::values::Impossible;
 #[cfg(feature = "gecko")]
 use values::computed::url::ComputedUrl;
-use values::computed::{Angle, Number};
-use values::generics::effects::BoxShadow as GenericBoxShadow;
-use values::generics::effects::Filter as GenericFilter;
-use values::generics::effects::SimpleShadow as GenericSimpleShadow;
-#[cfg(not(feature = "gecko"))]
-use values::Impossible;
 
 /// An animated value for a single `box-shadow`.
 pub type BoxShadow = GenericBoxShadow<Color, Length, Length, Length>;
 
 /// An animated value for a single `filter`.
 #[cfg(feature = "gecko")]
 pub type Filter = GenericFilter<Angle, Number, Length, SimpleShadow, ComputedUrl>;
 
--- a/servo/components/style/values/animated/font.rs
+++ b/servo/components/style/values/animated/font.rs
@@ -1,19 +1,19 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * 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/. */
 
 //! Animation implementation for various font-related types.
 
 use super::{Animate, Procedure, ToAnimatedZero};
-use values::computed::font::{FontVariationSettings, FontWeight};
-use values::computed::Number;
-use values::distance::{ComputeSquaredDistance, SquaredDistance};
-use values::generics::font::{FontSettings as GenericFontSettings, FontTag, VariationValue};
+use crate::values::computed::font::{FontVariationSettings, FontWeight};
+use crate::values::computed::Number;
+use crate::values::distance::{ComputeSquaredDistance, SquaredDistance};
+use crate::values::generics::font::{FontSettings as GenericFontSettings, FontTag, VariationValue};
 
 impl ToAnimatedZero for FontWeight {
     #[inline]
     fn to_animated_zero(&self) -> Result<Self, ()> {
         Ok(FontWeight::normal())
     }
 }
 
--- a/servo/components/style/values/animated/length.rs
+++ b/servo/components/style/values/animated/length.rs
@@ -1,20 +1,20 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * 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/. */
 
 //! Animation implementation for various length-related types.
 
 use super::{Animate, Procedure, ToAnimatedValue, ToAnimatedZero};
-use values::computed::length::{CalcLengthOrPercentage, Length};
-use values::computed::length::{LengthOrPercentageOrAuto, LengthOrPercentageOrNone};
-use values::computed::MaxLength as ComputedMaxLength;
-use values::computed::MozLength as ComputedMozLength;
-use values::computed::Percentage;
+use crate::values::computed::length::{CalcLengthOrPercentage, Length};
+use crate::values::computed::length::{LengthOrPercentageOrAuto, LengthOrPercentageOrNone};
+use crate::values::computed::MaxLength as ComputedMaxLength;
+use crate::values::computed::MozLength as ComputedMozLength;
+use crate::values::computed::Percentage;
 
 /// <https://drafts.csswg.org/css-transitions/#animtype-lpcalc>
 impl Animate for CalcLengthOrPercentage {
     #[inline]
     fn animate(&self, other: &Self, procedure: Procedure) -> Result<Self, ()> {
         let animate_percentage_half = |this: Option<Percentage>, other: Option<Percentage>| {
             if this.is_none() && other.is_none() {
                 return Ok(None);
@@ -69,18 +69,18 @@ impl ToAnimatedValue for ComputedMaxLeng
 
     #[inline]
     fn to_animated_value(self) -> Self {
         self
     }
 
     #[inline]
     fn from_animated_value(animated: Self::AnimatedValue) -> Self {
-        use values::computed::{Length, LengthOrPercentageOrNone, Percentage};
-        use values::generics::length::MaxLength as GenericMaxLength;
+        use crate::values::computed::{Length, LengthOrPercentageOrNone, Percentage};
+        use crate::values::generics::length::MaxLength as GenericMaxLength;
         match animated {
             GenericMaxLength::LengthOrPercentageOrNone(lopn) => {
                 let result = match lopn {
                     LengthOrPercentageOrNone::Length(px) => {
                         LengthOrPercentageOrNone::Length(Length::new(px.px().max(0.)))
                     },
                     LengthOrPercentageOrNone::Percentage(percentage) => {
                         LengthOrPercentageOrNone::Percentage(Percentage(percentage.0.max(0.)))
@@ -99,18 +99,18 @@ impl ToAnimatedValue for ComputedMozLeng
 
     #[inline]
     fn to_animated_value(self) -> Self {
         self
     }
 
     #[inline]
     fn from_animated_value(animated: Self::AnimatedValue) -> Self {
-        use values::computed::{Length, LengthOrPercentageOrAuto, Percentage};
-        use values::generics::length::MozLength as GenericMozLength;
+        use crate::values::computed::{Length, LengthOrPercentageOrAuto, Percentage};
+        use crate::values::generics::length::MozLength as GenericMozLength;
         match animated {
             GenericMozLength::LengthOrPercentageOrAuto(lopa) => {
                 let result = match lopa {
                     LengthOrPercentageOrAuto::Length(px) => {
                         LengthOrPercentageOrAuto::Length(Length::new(px.px().max(0.)))
                     },
                     LengthOrPercentageOrAuto::Percentage(percentage) => {
                         LengthOrPercentageOrAuto::Percentage(Percentage(percentage.0.max(0.)))
--- a/servo/components/style/values/animated/mod.rs
+++ b/servo/components/style/values/animated/mod.rs
@@ -4,24 +4,24 @@
 
 //! Animated values.
 //!
 //! Some values, notably colors, cannot be interpolated directly with their
 //! computed values and need yet another intermediate representation. This
 //! module's raison d'être is to ultimately contain all these types.
 
 use app_units::Au;
+use crate::properties::PropertyId;
+use crate::values::computed::length::CalcLengthOrPercentage;
+use crate::values::computed::url::ComputedUrl;
+use crate::values::computed::Angle as ComputedAngle;
+use crate::values::computed::BorderCornerRadius as ComputedBorderCornerRadius;
 use euclid::{Point2D, Size2D};
-use properties::PropertyId;
 use smallvec::SmallVec;
 use std::cmp;
-use values::computed::length::CalcLengthOrPercentage;
-use values::computed::url::ComputedUrl;
-use values::computed::Angle as ComputedAngle;
-use values::computed::BorderCornerRadius as ComputedBorderCornerRadius;
 
 pub mod color;
 pub mod effects;
 mod font;
 mod length;
 mod svg;
 
 /// The category a property falls into for ordering purposes.
--- a/servo/components/style/values/animated/svg.rs
+++ b/servo/components/style/values/animated/svg.rs
@@ -1,22 +1,22 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * 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/. */
 
 //! Animation implementations for various SVG-related types.
 
 use super::{Animate, Procedure, ToAnimatedZero};
-use properties::animated_properties::ListAnimation;
-use values::animated::color::Color as AnimatedColor;
-use values::computed::url::ComputedUrl;
-use values::computed::{LengthOrPercentage, Number, NumberOrPercentage};
-use values::distance::{ComputeSquaredDistance, SquaredDistance};
-use values::generics::svg::{SVGLength, SVGPaint, SvgLengthOrPercentageOrNumber};
-use values::generics::svg::{SVGOpacity, SVGStrokeDashArray};
+use crate::properties::animated_properties::ListAnimation;
+use crate::values::animated::color::Color as AnimatedColor;
+use crate::values::computed::url::ComputedUrl;
+use crate::values::computed::{LengthOrPercentage, Number, NumberOrPercentage};
+use crate::values::distance::{ComputeSquaredDistance, SquaredDistance};
+use crate::values::generics::svg::{SVGLength, SVGPaint, SvgLengthOrPercentageOrNumber};
+use crate::values::generics::svg::{SVGOpacity, SVGStrokeDashArray};
 
 /// Animated SVGPaint.
 pub type IntermediateSVGPaint = SVGPaint<AnimatedColor, ComputedUrl>;
 
 impl ToAnimatedZero for IntermediateSVGPaint {
     #[inline]
     fn to_animated_zero(&self) -> Result<Self, ()> {
         Ok(IntermediateSVGPaint {
--- a/servo/components/style/values/computed/angle.rs
+++ b/servo/components/style/values/computed/angle.rs
@@ -1,22 +1,22 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * 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/. */
 
 //! Computed angles.
 
+use crate::values::distance::{ComputeSquaredDistance, SquaredDistance};
+use crate::values::CSSFloat;
 use num_traits::Zero;
 use std::f64::consts::PI;
 use std::fmt::{self, Write};
 use std::ops::Add;
 use std::{f32, f64};
 use style_traits::{CssWriter, ToCss};
-use values::distance::{ComputeSquaredDistance, SquaredDistance};
-use values::CSSFloat;
 
 /// A computed angle in degrees.
 #[cfg_attr(feature = "servo", derive(Deserialize, Serialize))]
 #[derive(Animate, Clone, Copy, Debug, MallocSizeOf, PartialEq, PartialOrd, ToAnimatedZero)]
 pub struct Angle(CSSFloat);
 
 impl ToCss for Angle {
     fn to_css<W>(&self, dest: &mut CssWriter<W>) -> fmt::Result
--- a/servo/components/style/values/computed/background.rs
+++ b/servo/components/style/values/computed/background.rs
@@ -1,21 +1,21 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * 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/. */
 
 //! Computed types for CSS values related to backgrounds.
 
+use crate::values::computed::length::NonNegativeLengthOrPercentageOrAuto;
+use crate::values::computed::{Context, ToComputedValue};
+use crate::values::generics::background::BackgroundSize as GenericBackgroundSize;
+use crate::values::specified::background::BackgroundRepeat as SpecifiedBackgroundRepeat;
+use crate::values::specified::background::BackgroundRepeatKeyword;
 use std::fmt::{self, Write};
 use style_traits::{CssWriter, ToCss};
-use values::computed::length::NonNegativeLengthOrPercentageOrAuto;
-use values::computed::{Context, ToComputedValue};
-use values::generics::background::BackgroundSize as GenericBackgroundSize;
-use values::specified::background::BackgroundRepeat as SpecifiedBackgroundRepeat;
-use values::specified::background::BackgroundRepeatKeyword;
 
 /// A computed value for the `background-size` property.
 pub type BackgroundSize = GenericBackgroundSize<NonNegativeLengthOrPercentageOrAuto>;
 
 impl BackgroundSize {
     /// Returns `auto auto`.
     pub fn auto() -> Self {
         GenericBackgroundSize::Explicit {
--- a/servo/components/style/values/computed/basic_shape.rs
+++ b/servo/components/style/values/computed/basic_shape.rs
@@ -2,24 +2,24 @@
  * 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/. */
 
 //! CSS handling for the computed value of
 //! [`basic-shape`][basic-shape]s
 //!
 //! [basic-shape]: https://drafts.csswg.org/css-shapes/#typedef-basic-shape
 
+use crate::values::computed::url::ComputedUrl;
+use crate::values::computed::{Image, LengthOrPercentage};
+use crate::values::generics::basic_shape as generic;
 use std::fmt::{self, Write};
 use style_traits::{CssWriter, ToCss};
-use values::computed::url::ComputedUrl;
-use values::computed::{Image, LengthOrPercentage};
-use values::generics::basic_shape as generic;
 
 /// A computed alias for FillRule.
-pub use values::generics::basic_shape::FillRule;
+pub use crate::values::generics::basic_shape::FillRule;
 
 /// A computed clipping shape.
 pub type ClippingShape = generic::ClippingShape<BasicShape, ComputedUrl>;
 
 /// A computed float area shape.
 pub type FloatAreaShape = generic::FloatAreaShape<BasicShape, Image>;
 
 /// A computed basic shape.
--- a/servo/components/style/values/computed/border.rs
+++ b/servo/components/style/values/computed/border.rs
@@ -1,27 +1,27 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * 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/. */
 
 //! Computed types for CSS values related to borders.
 
 use app_units::Au;
-use values::animated::ToAnimatedZero;
-use values::computed::length::{LengthOrPercentage, NonNegativeLength};
-use values::computed::{Number, NumberOrPercentage};
-use values::generics::border::BorderCornerRadius as GenericBorderCornerRadius;
-use values::generics::border::BorderImageSideWidth as GenericBorderImageSideWidth;
-use values::generics::border::BorderImageSlice as GenericBorderImageSlice;
-use values::generics::border::BorderRadius as GenericBorderRadius;
-use values::generics::border::BorderSpacing as GenericBorderSpacing;
-use values::generics::rect::Rect;
-use values::generics::size::Size;
+use crate::values::animated::ToAnimatedZero;
+use crate::values::computed::length::{LengthOrPercentage, NonNegativeLength};
+use crate::values::computed::{Number, NumberOrPercentage};
+use crate::values::generics::border::BorderCornerRadius as GenericBorderCornerRadius;
+use crate::values::generics::border::BorderImageSideWidth as GenericBorderImageSideWidth;
+use crate::values::generics::border::BorderImageSlice as GenericBorderImageSlice;
+use crate::values::generics::border::BorderRadius as GenericBorderRadius;
+use crate::values::generics::border::BorderSpacing as GenericBorderSpacing;
+use crate::values::generics::rect::Rect;
+use crate::values::generics::size::Size;
 
-pub use values::specified::border::BorderImageRepeat;
+pub use crate::values::specified::border::BorderImageRepeat;
 
 /// A computed value for the `border-image-width` property.
 pub type BorderImageWidth = Rect<BorderImageSideWidth>;
 
 /// A computed value for a single side of a `border-image-width` property.
 pub type BorderImageSideWidth = GenericBorderImageSideWidth<LengthOrPercentage, Number>;
 
 /// A computed value for the `border-image-slice` property.
--- a/servo/components/style/values/computed/box.rs
+++ b/servo/components/style/values/computed/box.rs
@@ -1,24 +1,26 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * 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/. */
 
 //! Computed types for box properties.
 
-use values::computed::length::{LengthOrPercentage, NonNegativeLength};
-use values::computed::{Context, Number, ToComputedValue};
-use values::generics::box_::AnimationIterationCount as GenericAnimationIterationCount;
-use values::generics::box_::Perspective as GenericPerspective;
-use values::generics::box_::VerticalAlign as GenericVerticalAlign;
-use values::specified::box_ as specified;
+use crate::values::computed::length::{LengthOrPercentage, NonNegativeLength};
+use crate::values::computed::{Context, Number, ToComputedValue};
+use crate::values::generics::box_::AnimationIterationCount as GenericAnimationIterationCount;
+use crate::values::generics::box_::Perspective as GenericPerspective;
+use crate::values::generics::box_::VerticalAlign as GenericVerticalAlign;
+use crate::values::specified::box_ as specified;
 
-pub use values::specified::box_::{AnimationName, Appearance, Contain, Display, OverflowClipBox};
-pub use values::specified::box_::{Clear as SpecifiedClear, Float as SpecifiedFloat};
-pub use values::specified::box_::{
+pub use crate::values::specified::box_::{
+    AnimationName, Appearance, Contain, Display, OverflowClipBox,
+};
+pub use crate::values::specified::box_::{Clear as SpecifiedClear, Float as SpecifiedFloat};
+pub use crate::values::specified::box_::{
     OverscrollBehavior, ScrollSnapType, TouchAction, TransitionProperty, WillChange,
 };
 
 /// A computed value for the `vertical-align` property.
 pub type VerticalAlign = GenericVerticalAlign<LengthOrPercentage>;
 
 /// A computed value for the `animation-iteration-count` property.
 pub type AnimationIterationCount = GenericAnimationIterationCount<Number>;
--- a/servo/components/style/values/computed/color.rs
+++ b/servo/components/style/values/computed/color.rs
@@ -1,20 +1,20 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * 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/. */
 
 //! Computed color values.
 
+use crate::values::animated::color::RGBA as AnimatedRGBA;
+use crate::values::animated::ToAnimatedValue;
+use crate::values::generics::color::Color as GenericColor;
 use cssparser::{Color as CSSParserColor, RGBA};
 use std::fmt;
 use style_traits::{CssWriter, ToCss};
-use values::animated::color::RGBA as AnimatedRGBA;
-use values::animated::ToAnimatedValue;
-use values::generics::color::Color as GenericColor;
 
 /// Computed value type for the specified RGBAColor.
 pub type RGBAColor = RGBA;
 
 /// The computed value of the `color` property.
 pub type ColorPropertyValue = RGBA;
 
 /// A computed value for `<color>`.
--- a/servo/components/style/values/computed/column.rs
+++ b/servo/components/style/values/computed/column.rs
@@ -1,11 +1,11 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * 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/. */
 
 //! Computed types for the column properties.
 
-use values::computed::PositiveInteger;
-use values::generics::column::ColumnCount as GenericColumnCount;
+use crate::values::computed::PositiveInteger;
+use crate::values::generics::column::ColumnCount as GenericColumnCount;
 
 /// A computed type for `column-count` values.
 pub type ColumnCount = GenericColumnCount<PositiveInteger>;
--- a/servo/components/style/values/computed/counters.rs
+++ b/servo/components/style/values/computed/counters.rs
@@ -1,18 +1,18 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * 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/. */
 
 //! Computed values for counter properties
 
-use values::computed::url::ComputedImageUrl;
-use values::generics::counters as generics;
-use values::generics::counters::CounterIncrement as GenericCounterIncrement;
-use values::generics::counters::CounterReset as GenericCounterReset;
+use crate::values::computed::url::ComputedImageUrl;
+use crate::values::generics::counters as generics;
+use crate::values::generics::counters::CounterIncrement as GenericCounterIncrement;
+use crate::values::generics::counters::CounterReset as GenericCounterReset;
 
 /// A computed value for the `counter-increment` property.
 pub type CounterIncrement = GenericCounterIncrement<i32>;
 
 /// A computed value for the `counter-increment` property.
 pub type CounterReset = GenericCounterReset<i32>;
 
 /// A computed value for the `content` property.
--- a/servo/components/style/values/computed/easing.rs
+++ b/servo/components/style/values/computed/easing.rs
@@ -1,14 +1,14 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * 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/. */
 
 //! Computed types for CSS Easing functions.
 
-use values::computed::{Integer, Number};
-use values::generics::easing;
+use crate::values::computed::{Integer, Number};
+use crate::values::generics::easing;
 
 /// A computed timing function.
 pub type ComputedTimingFunction = easing::TimingFunction<Integer, Number>;
 
 /// An alias of the computed timing function.
 pub type TimingFunction = ComputedTimingFunction;
--- a/servo/components/style/values/computed/effects.rs
+++ b/servo/components/style/values/computed/effects.rs
@@ -1,24 +1,24 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * 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/. */
 
 //! Computed types for CSS values related to effects.
 
-use values::computed::color::Color;
-use values::computed::length::{Length, NonNegativeLength};
+use crate::values::computed::color::Color;
+use crate::values::computed::length::{Length, NonNegativeLength};
+use crate::values::computed::{Angle, NonNegativeNumber};
+use crate::values::generics::effects::BoxShadow as GenericBoxShadow;
+use crate::values::generics::effects::Filter as GenericFilter;
+use crate::values::generics::effects::SimpleShadow as GenericSimpleShadow;
+#[cfg(not(feature = "gecko"))]
+use crate::values::Impossible;
 #[cfg(feature = "gecko")]
 use values::computed::url::ComputedUrl;
-use values::computed::{Angle, NonNegativeNumber};
-use values::generics::effects::BoxShadow as GenericBoxShadow;
-use values::generics::effects::Filter as GenericFilter;
-use values::generics::effects::SimpleShadow as GenericSimpleShadow;
-#[cfg(not(feature = "gecko"))]
-use values::Impossible;
 
 /// A computed value for a single shadow of the `box-shadow` property.
 pub type BoxShadow = GenericBoxShadow<Color, Length, NonNegativeLength, Length>;
 
 /// A computed value for a single `filter`.
 #[cfg(feature = "gecko")]
 pub type Filter =
     GenericFilter<Angle, NonNegativeNumber, NonNegativeLength, SimpleShadow, ComputedUrl>;
--- a/servo/components/style/values/computed/flex.rs
+++ b/servo/components/style/values/computed/flex.rs
@@ -1,19 +1,19 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * 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/. */
 
 //! Computed types for CSS values related to flexbox.
 
-use values::generics::flex::FlexBasis as GenericFlexBasis;
+use crate::values::generics::flex::FlexBasis as GenericFlexBasis;
 
 /// The `width` value type.
 #[cfg(feature = "servo")]
-pub type Width = ::values::computed::NonNegativeLengthOrPercentageOrAuto;
+pub type Width = crate::values::computed::NonNegativeLengthOrPercentageOrAuto;
 
 /// The `width` value type.
 #[cfg(feature = "gecko")]
 pub type Width = ::values::computed::MozLength;
 
 /// A computed value for the `flex-basis` property.
 pub type FlexBasis = GenericFlexBasis<Width>;
 
--- a/servo/components/style/values/computed/font.rs
+++ b/servo/components/style/values/computed/font.rs
@@ -1,39 +1,43 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * 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/. */
 
 //! Computed values for font properties
 
 use app_units::Au;
 use byteorder::{BigEndian, ByteOrder};
+use crate::values::animated::{ToAnimatedValue, ToAnimatedZero};
+use crate::values::computed::{Angle, Context, Integer, NonNegativeLength, NonNegativePercentage};
+use crate::values::computed::{Number, Percentage, ToComputedValue};
+use crate::values::generics::font::{
+    self as generics, FeatureTagValue, FontSettings, VariationValue,
+};
+use crate::values::specified::font::{self as specified, MAX_FONT_WEIGHT, MIN_FONT_WEIGHT};
+use crate::values::specified::length::{FontBaseSize, NoCalcLength};
+use crate::values::CSSFloat;
+use crate::Atom;
 use cssparser::{serialize_identifier, CssStringWriter, Parser};
 #[cfg(feature = "gecko")]
 use gecko_bindings::sugar::refptr::RefPtr;
 #[cfg(feature = "gecko")]
 use gecko_bindings::{bindings, structs};
 #[cfg(feature = "gecko")]
 use malloc_size_of::{MallocSizeOf, MallocSizeOfOps};
 use std::fmt::{self, Write};
 use std::hash::{Hash, Hasher};
 #[cfg(feature = "servo")]
 use std::slice;
 use style_traits::{CssWriter, ParseError, ToCss};
-use values::animated::{ToAnimatedValue, ToAnimatedZero};
-use values::computed::{Angle, Context, Integer, NonNegativeLength, NonNegativePercentage};
-use values::computed::{Number, Percentage, ToComputedValue};
-use values::generics::font::{self as generics, FeatureTagValue, FontSettings, VariationValue};
-use values::specified::font::{self as specified, MAX_FONT_WEIGHT, MIN_FONT_WEIGHT};
-use values::specified::length::{FontBaseSize, NoCalcLength};
-use values::CSSFloat;
-use Atom;
 
-pub use values::computed::Length as MozScriptMinSize;
-pub use values::specified::font::{FontSynthesis, MozScriptSizeMultiplier, XLang, XTextZoom};
+pub use crate::values::computed::Length as MozScriptMinSize;
+pub use crate::values::specified::font::{
+    FontSynthesis, MozScriptSizeMultiplier, XLang, XTextZoom,
+};
 
 /// A value for the font-weight property per:
 ///
 /// https://drafts.csswg.org/css-fonts-4/#propdef-font-weight
 ///
 /// This is effectively just a `Number`.
 #[derive(Clone, ComputeSquaredDistance, Copy, Debug, MallocSizeOf, PartialEq, ToCss)]
 #[cfg_attr(feature = "servo", derive(Deserialize, Serialize))]
@@ -365,17 +369,17 @@ impl SingleFontFamily {
         SingleFontFamily::FamilyName(FamilyName {
             name: input,
             syntax: FamilyNameSyntax::Quoted,
         })
     }
 
     /// Parse a font-family value
     pub fn parse<'i, 't>(input: &mut Parser<'i, 't>) -> Result<Self, ParseError<'i>> {
-        if let Ok(value) = input.try(|i| i.expect_string_cloned()) {
+        if let Ok(value) = input.r#try(|i| i.expect_string_cloned()) {
             return Ok(SingleFontFamily::FamilyName(FamilyName {
                 name: Atom::from(&*value),
                 syntax: FamilyNameSyntax::Quoted,
             }));
         }
         let first_ident = input.expect_ident()?.clone();
 
         // FIXME(bholley): The fast thing to do here would be to look up the
@@ -410,17 +414,17 @@ impl SingleFontFamily {
 
         // These keywords are not allowed by themselves.
         // The only way this value can be valid with with another keyword.
         if css_wide_keyword {
             let ident = input.expect_ident()?;
             value.push(' ');
             value.push_str(&ident);
         }
-        while let Ok(ident) = input.try(|i| i.expect_ident_cloned()) {
+        while let Ok(ident) = input.r#try(|i| i.expect_ident_cloned()) {
             value.push(' ');
             value.push_str(&ident);
         }
         let syntax = if value.starts_with(' ') || value.ends_with(' ') || value.contains("  ") {
             // For font family names which contains special white spaces, e.g.
             // `font-family: \ a\ \ b\ \ c\ ;`, it is tricky to serialize them
             // as identifiers correctly. Just mark them quoted so we don't need
             // to worry about them in serialization code.
--- a/servo/components/style/values/computed/image.rs
+++ b/servo/components/style/values/computed/image.rs
@@ -2,29 +2,29 @@
  * 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/. */
 
 //! CSS handling for the computed value of
 //! [`image`][image]s
 //!
 //! [image]: https://drafts.csswg.org/css-images/#image-values
 
+use crate::values::computed::position::Position;
+use crate::values::computed::url::ComputedImageUrl;
+use crate::values::computed::{Angle, Color, Context};
+use crate::values::computed::{Length, LengthOrPercentage, NumberOrPercentage, ToComputedValue};
+use crate::values::generics::image::{self as generic, CompatMode};
+use crate::values::specified::image::LineDirection as SpecifiedLineDirection;
+use crate::values::specified::position::{X, Y};
+use crate::values::{Either, None_};
 use std::f32::consts::PI;
 use std::fmt::{self, Write};
 use style_traits::{CssWriter, ToCss};
-use values::computed::position::Position;
-use values::computed::url::ComputedImageUrl;
 #[cfg(feature = "gecko")]
 use values::computed::Percentage;
-use values::computed::{Angle, Color, Context};
-use values::computed::{Length, LengthOrPercentage, NumberOrPercentage, ToComputedValue};
-use values::generics::image::{self as generic, CompatMode};
-use values::specified::image::LineDirection as SpecifiedLineDirection;
-use values::specified::position::{X, Y};
-use values::{Either, None_};
 
 /// A computed image layer.
 pub type ImageLayer = Either<None_, Image>;
 
 /// Computed values for an image according to CSS-IMAGES.
 /// <https://drafts.csswg.org/css-images/#image-values>
 pub type Image = generic::Image<Gradient, MozImageRect, ComputedImageUrl>;
 
--- a/servo/components/style/values/computed/length.rs
+++ b/servo/components/style/values/computed/length.rs
@@ -1,33 +1,35 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * 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/. */
 
 //! `<length>` computed values, and related ones.
 
 use super::{Context, Number, Percentage, ToComputedValue};
 use app_units::Au;
+use crate::values::animated::{Animate, Procedure, ToAnimatedValue, ToAnimatedZero};
+use crate::values::distance::{ComputeSquaredDistance, SquaredDistance};
+use crate::values::generics::length::{
+    MaxLength as GenericMaxLength, MozLength as GenericMozLength,
+};
+use crate::values::generics::transform::IsZeroLength;
+use crate::values::generics::NonNegative;
+use crate::values::specified::length::ViewportPercentageLength;
+use crate::values::specified::length::{AbsoluteLength, FontBaseSize, FontRelativeLength};
+use crate::values::{specified, Auto, CSSFloat, Either, IsAuto, Normal};
 use ordered_float::NotNan;
 use std::fmt::{self, Write};
 use std::ops::{Add, Neg};
 use style_traits::values::specified::AllowedNumericType;
 use style_traits::{CssWriter, ToCss};
-use values::animated::{Animate, Procedure, ToAnimatedValue, ToAnimatedZero};
-use values::distance::{ComputeSquaredDistance, SquaredDistance};
-use values::generics::length::{MaxLength as GenericMaxLength, MozLength as GenericMozLength};
-use values::generics::transform::IsZeroLength;
-use values::generics::NonNegative;
-use values::specified::length::ViewportPercentageLength;
-use values::specified::length::{AbsoluteLength, FontBaseSize, FontRelativeLength};
-use values::{specified, Auto, CSSFloat, Either, IsAuto, Normal};
 
 pub use super::image::Image;
-pub use values::specified::url::UrlOrNone;
-pub use values::specified::{Angle, BorderStyle, Time};
+pub use crate::values::specified::url::UrlOrNone;
+pub use crate::values::specified::{Angle, BorderStyle, Time};
 
 impl ToComputedValue for specified::NoCalcLength {
     type ComputedValue = CSSPixelLength;
 
     #[inline]
     fn to_computed_value(&self, context: &Context) -> Self::ComputedValue {
         match *self {
             specified::NoCalcLength::Absolute(length) => length.to_computed_value(context),
--- a/servo/components/style/values/computed/list.rs
+++ b/servo/components/style/values/computed/list.rs
@@ -1,17 +1,17 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * 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/. */
 
 //! `list` computed values.
 
+pub use crate::values::specified::list::{QuotePair, Quotes};
 #[cfg(feature = "gecko")]
 pub use values::specified::list::ListStyleType;
-pub use values::specified::list::{QuotePair, Quotes};
 
 use servo_arc::Arc;
 
 lazy_static! {
     static ref INITIAL_QUOTES: Arc<Box<[QuotePair]>> = Arc::new(
         vec![
             QuotePair {
                 opening: "\u{201c}".to_owned().into_boxed_str(),
--- a/servo/components/style/values/computed/mod.rs
+++ b/servo/components/style/values/computed/mod.rs
@@ -6,33 +6,33 @@
 
 use super::animated::ToAnimatedValue;
 use super::generics::grid::GridTemplateComponent as GenericGridTemplateComponent;
 use super::generics::grid::{GridLine as GenericGridLine, TrackBreadth as GenericTrackBreadth};
 use super::generics::grid::{TrackList as GenericTrackList, TrackSize as GenericTrackSize};
 use super::generics::{GreaterThanOrEqualToOne, NonNegative};
 use super::specified;
 use super::{CSSFloat, CSSInteger};
-use context::QuirksMode;
+use crate::context::QuirksMode;
+use crate::font_metrics::{get_metrics_provider_for_product, FontMetricsProvider};
+use crate::media_queries::Device;
+use crate::properties::{ComputedValues, LonghandId, StyleBuilder};
+use crate::rule_cache::RuleCacheConditions;
+use crate::Atom;
+#[cfg(feature = "servo")]
+use crate::Prefix;
 use euclid::Size2D;
-use font_metrics::{get_metrics_provider_for_product, FontMetricsProvider};
-use media_queries::Device;
 #[cfg(feature = "gecko")]
 use properties;
-use properties::{ComputedValues, LonghandId, StyleBuilder};
-use rule_cache::RuleCacheConditions;
 use std::cell::RefCell;
 use std::cmp;
 use std::f32;
 use std::fmt::{self, Write};
 use style_traits::cursor::CursorKind;
 use style_traits::{CssWriter, ToCss};
-use Atom;
-#[cfg(feature = "servo")]
-use Prefix;
 
 #[cfg(feature = "gecko")]
 pub use self::align::{AlignContent, AlignItems, JustifyContent, JustifyItems, SelfAlignment};
 #[cfg(feature = "gecko")]
 pub use self::align::{AlignSelf, JustifySelf};
 pub use self::angle::Angle;
 pub use self::background::{BackgroundRepeat, BackgroundSize};
 pub use self::basic_shape::FillRule;
--- a/servo/components/style/values/computed/motion.rs
+++ b/servo/components/style/values/computed/motion.rs
@@ -2,9 +2,9 @@
  * 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/. */
 
 //! Computed types for CSS values that are related to motion path.
 
 /// A computed offset-path. The computed value is as specified value.
 ///
 /// https://drafts.fxtf.org/motion-1/#offset-path-property
-pub use values::specified::motion::OffsetPath;
+pub use crate::values::specified::motion::OffsetPath;
--- a/servo/components/style/values/computed/outline.rs
+++ b/servo/components/style/values/computed/outline.rs
@@ -1,7 +1,7 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * 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/. */
 
 //! Computed values for outline properties
 
-pub use values::specified::OutlineStyle;
+pub use crate::values::specified::OutlineStyle;
--- a/servo/components/style/values/computed/percentage.rs
+++ b/servo/components/style/values/computed/percentage.rs
@@ -1,19 +1,19 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * 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/. */
 
 //! Computed percentages.
 
+use crate::values::animated::ToAnimatedValue;
+use crate::values::generics::NonNegative;
+use crate::values::{serialize_percentage, CSSFloat};
 use std::fmt;
 use style_traits::{CssWriter, ToCss};
-use values::animated::ToAnimatedValue;
-use values::generics::NonNegative;
-use values::{serialize_percentage, CSSFloat};
 
 /// A computed percentage.
 #[cfg_attr(feature = "servo", derive(Deserialize, Serialize))]
 #[derive(
     Animate,
     Clone,
     ComputeSquaredDistance,
     Copy,
--- a/servo/components/style/values/computed/position.rs
+++ b/servo/components/style/values/computed/position.rs
@@ -2,22 +2,22 @@
  * 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/. */
 
 //! CSS handling for the computed value of
 //! [`position`][position] values.
 //!
 //! [position]: https://drafts.csswg.org/css-backgrounds-3/#position
 
+use crate::values::computed::{Integer, LengthOrPercentage, Percentage};
+use crate::values::generics::position::Position as GenericPosition;
+use crate::values::generics::position::ZIndex as GenericZIndex;
+pub use crate::values::specified::position::{GridAutoFlow, GridTemplateAreas};
 use std::fmt::{self, Write};
 use style_traits::{CssWriter, ToCss};
-use values::computed::{Integer, LengthOrPercentage, Percentage};
-use values::generics::position::Position as GenericPosition;
-use values::generics::position::ZIndex as GenericZIndex;
-pub use values::specified::position::{GridAutoFlow, GridTemplateAreas};
 
 /// The computed value of a CSS `<position>`
 pub type Position = GenericPosition<HorizontalPosition, VerticalPosition>;
 
 /// The computed value of a CSS horizontal position.
 pub type HorizontalPosition = LengthOrPercentage;
 
 /// The computed value of a CSS vertical position.
--- a/servo/components/style/values/computed/rect.rs
+++ b/servo/components/style/values/computed/rect.rs
@@ -1,11 +1,11 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * 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/. */
 
 //! Computed types for CSS borders.
 
-use values::computed::length::LengthOrNumber;
-use values::generics::rect::Rect;
+use crate::values::computed::length::LengthOrNumber;
+use crate::values::generics::rect::Rect;
 
 /// A specified rectangle made of four `<length-or-number>` values.
 pub type LengthOrNumberRect = Rect<LengthOrNumber>;
--- a/servo/components/style/values/computed/resolution.rs
+++ b/servo/components/style/values/computed/resolution.rs
@@ -1,21 +1,21 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * 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/. */
 
 //! Resolution values:
 //!
 //! https://drafts.csswg.org/css-values/#resolution
 
+use crate::values::computed::{Context, ToComputedValue};
+use crate::values::specified;
+use crate::values::CSSFloat;
 use std::fmt::{self, Write};
 use style_traits::{CssWriter, ToCss};
-use values::computed::{Context, ToComputedValue};
-use values::specified;
-use values::CSSFloat;
 
 /// A computed `<resolution>`.
 pub struct Resolution(CSSFloat);
 
 impl Resolution {
     /// Returns this resolution value as dppx.
     #[inline]
     pub fn dppx(&self) -> CSSFloat {
--- a/servo/components/style/values/computed/svg.rs
+++ b/servo/components/style/values/computed/svg.rs
@@ -1,24 +1,24 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * 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/. */
 
 //! Computed types for SVG properties.
 
-use values::computed::color::Color;
-use values::computed::url::ComputedUrl;
-use values::computed::{LengthOrPercentage, NonNegativeLengthOrPercentage};
-use values::computed::{NonNegativeNumber, Number, Opacity};
-use values::generics::svg as generic;
-use values::RGBA;
+use crate::values::computed::color::Color;
+use crate::values::computed::url::ComputedUrl;
+use crate::values::computed::{LengthOrPercentage, NonNegativeLengthOrPercentage};
+use crate::values::computed::{NonNegativeNumber, Number, Opacity};
+use crate::values::generics::svg as generic;
+use crate::values::RGBA;
 
-pub use values::specified::SVGPaintOrder;
+pub use crate::values::specified::SVGPaintOrder;
 
-pub use values::specified::MozContextProperties;
+pub use crate::values::specified::MozContextProperties;
 
 /// Computed SVG Paint value
 pub type SVGPaint = generic::SVGPaint<Color, ComputedUrl>;
 /// Computed SVG Paint Kind value
 pub type SVGPaintKind = generic::SVGPaintKind<Color, ComputedUrl>;
 
 impl Default for SVGPaint {
     fn default() -> Self {
@@ -78,17 +78,17 @@ impl Into<NonNegativeSvgLengthOrPercenta
 }
 
 /// An non-negative wrapper of SVGLength.
 pub type SVGWidth = generic::SVGLength<NonNegativeSvgLengthOrPercentageOrNumber>;
 
 impl SVGWidth {
     /// `1px`.
     pub fn one() -> Self {
-        use values::generics::NonNegative;
+        use crate::values::generics::NonNegative;
         generic::SVGLength::Length(generic::SvgLengthOrPercentageOrNumber::LengthOrPercentage(
             NonNegative(LengthOrPercentage::one()),
         ))
     }
 }
 
 /// [ <length> | <percentage> | <number> ]# | context-value
 pub type SVGStrokeDashArray = generic::SVGStrokeDashArray<NonNegativeSvgLengthOrPercentageOrNumber>;
--- a/servo/components/style/values/computed/table.rs
+++ b/servo/components/style/values/computed/table.rs
@@ -1,7 +1,7 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * 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/. */
 
 //! Computed types for table properties.
 
-pub use values::specified::table::XSpan;
+pub use crate::values::specified::table::XSpan;
--- a/servo/components/style/values/computed/text.rs
+++ b/servo/components/style/values/computed/text.rs
@@ -1,30 +1,32 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * 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/. */
 
 //! Computed types for text properties.
 
 #[cfg(feature = "servo")]
-use properties::StyleBuilder;
+use crate::properties::StyleBuilder;
+use crate::values::computed::length::{Length, LengthOrPercentage};
+use crate::values::computed::{NonNegativeLength, NonNegativeNumber};
+use crate::values::generics::text::InitialLetter as GenericInitialLetter;
+use crate::values::generics::text::LineHeight as GenericLineHeight;
+use crate::values::generics::text::MozTabSize as GenericMozTabSize;
+use crate::values::generics::text::Spacing;
+use crate::values::specified::text::{
+    TextEmphasisFillMode, TextEmphasisShapeKeyword, TextOverflowSide,
+};
+use crate::values::{CSSFloat, CSSInteger};
 use std::fmt::{self, Write};
 use style_traits::{CssWriter, ToCss};
-use values::computed::length::{Length, LengthOrPercentage};
-use values::computed::{NonNegativeLength, NonNegativeNumber};
-use values::generics::text::InitialLetter as GenericInitialLetter;
-use values::generics::text::LineHeight as GenericLineHeight;
-use values::generics::text::MozTabSize as GenericMozTabSize;
-use values::generics::text::Spacing;
-use values::specified::text::{TextEmphasisFillMode, TextEmphasisShapeKeyword, TextOverflowSide};
-use values::{CSSFloat, CSSInteger};
 
-pub use values::specified::TextAlignKeyword as TextAlign;
-pub use values::specified::TextEmphasisPosition;
-pub use values::specified::OverflowWrap;
+pub use crate::values::specified::TextAlignKeyword as TextAlign;
+pub use crate::values::specified::TextEmphasisPosition;
+pub use crate::values::specified::OverflowWrap;
 
 /// A computed value for the `initial-letter` property.
 pub type InitialLetter = GenericInitialLetter<CSSFloat, CSSInteger>;
 
 /// A computed value for the `letter-spacing` property.
 pub type LetterSpacing = Spacing<Length>;
 
 /// A computed value for the `word-spacing` property.
@@ -95,17 +97,17 @@ pub struct TextDecorationsInEffect {
     /// Whether a line-through style is in effect.
     pub line_through: bool,
 }
 
 impl TextDecorationsInEffect {
     /// Computes the text-decorations in effect for a given style.
     #[cfg(feature = "servo")]
     pub fn from_style(style: &StyleBuilder) -> Self {
-        use values::computed::Display;
+        use crate::values::computed::Display;
 
         // Start with no declarations if this is an atomic inline-level box;
         // otherwise, start with the declarations in effect and add in the text
         // decorations that this block specifies.
         let mut result = match style.get_box().clone_display() {
             Display::InlineBlock | Display::InlineTable => Self::default(),
             _ => style
                 .get_parent_inherited_text()
--- a/servo/components/style/values/computed/time.rs
+++ b/servo/components/style/values/computed/time.rs
@@ -1,17 +1,17 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * 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/. */
 
 //! Computed time values.
 
+use crate::values::CSSFloat;
 use std::fmt::{self, Write};
 use style_traits::{CssWriter, ToCss};
-use values::CSSFloat;
 
 /// A computed `<time>` value.
 #[derive(Clone, Copy, Debug, MallocSizeOf, PartialEq, PartialOrd)]
 #[cfg_attr(feature = "servo", derive(Deserialize, Serialize))]
 pub struct Time {
     seconds: CSSFloat,
 }
 
--- a/servo/components/style/values/computed/transform.rs
+++ b/servo/components/style/values/computed/transform.rs
@@ -1,22 +1,22 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * 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/. */
 
 //! Computed types for CSS values that are related to transformations.
 
 use super::CSSFloat;
+use crate::values::animated::ToAnimatedZero;
+use crate::values::computed::{Angle, Integer, Length, LengthOrPercentage, Number, Percentage};
+use crate::values::generics::transform as generic;
 use euclid::{Transform3D, Vector3D};
 use num_traits::Zero;
-use values::animated::ToAnimatedZero;
-use values::computed::{Angle, Integer, Length, LengthOrPercentage, Number, Percentage};
-use values::generics::transform as generic;
 
-pub use values::generics::transform::TransformStyle;
+pub use crate::values::generics::transform::TransformStyle;
 
 /// A single operation in a computed CSS `transform`
 pub type TransformOperation =
     generic::TransformOperation<Angle, Number, Length, Integer, LengthOrPercentage>;
 /// A computed CSS `transform`
 pub type Transform = generic::Transform<TransformOperation>;
 
 /// The computed value of a CSS `<transform-origin>`
--- a/servo/components/style/values/computed/ui.rs
+++ b/servo/components/style/values/computed/ui.rs
@@ -1,21 +1,21 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * 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/. */
 
 //! Computed values for UI properties
 
-use values::computed::color::Color;
-use values::computed::url::ComputedImageUrl;
-use values::computed::Number;
-use values::generics::ui as generics;
-use values::{Auto, Either};
+use crate::values::computed::color::Color;
+use crate::values::computed::url::ComputedImageUrl;
+use crate::values::computed::Number;
+use crate::values::generics::ui as generics;
+use crate::values::{Auto, Either};
 
-pub use values::specified::ui::MozForceBrokenImageIcon;
+pub use crate::values::specified::ui::MozForceBrokenImageIcon;
 
 /// auto | <color>
 pub type ColorOrAuto = Either<Color, Auto>;
 
 /// A computed value for the `cursor` property.
 pub type Cursor = generics::Cursor<CursorImage>;
 
 /// A computed value for item of `image cursors`.
--- a/servo/components/style/values/computed/url.rs
+++ b/servo/components/style/values/computed/url.rs
@@ -1,18 +1,18 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * 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/. */
 
 //! Common handling for the computed value CSS url() values.
 
-use values::generics::url::UrlOrNone as GenericUrlOrNone;
+use crate::values::generics::url::UrlOrNone as GenericUrlOrNone;
 
+#[cfg(feature = "servo")]
+pub use crate::servo::url::{ComputedImageUrl, ComputedUrl};
 #[cfg(feature = "gecko")]
 pub use gecko::url::{ComputedImageUrl, ComputedUrl};
-#[cfg(feature = "servo")]
-pub use servo::url::{ComputedImageUrl, ComputedUrl};
 
 /// Computed <url> | <none>
 pub type UrlOrNone = GenericUrlOrNone<ComputedUrl>;
 
 /// Computed image <url> | <none>
 pub type ImageUrlOrNone = GenericUrlOrNone<ComputedImageUrl>;
--- a/servo/components/style/values/generics/basic_shape.rs
+++ b/servo/components/style/values/generics/basic_shape.rs
@@ -1,23 +1,23 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * 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/. */
 
 //! CSS handling for the [`basic-shape`](https://drafts.csswg.org/css-shapes/#typedef-basic-shape)
 //! types that are generic over their `ToCss` implementations.
 
+use crate::values::animated::{Animate, Procedure, ToAnimatedZero};
+use crate::values::distance::{ComputeSquaredDistance, SquaredDistance};
+use crate::values::generics::border::BorderRadius;
+use crate::values::generics::position::Position;
+use crate::values::generics::rect::Rect;
+use crate::values::specified::SVGPathData;
 use std::fmt::{self, Write};
 use style_traits::{CssWriter, ToCss};
-use values::animated::{Animate, Procedure, ToAnimatedZero};
-use values::distance::{ComputeSquaredDistance, SquaredDistance};
-use values::generics::border::BorderRadius;
-use values::generics::position::Position;
-use values::generics::rect::Rect;
-use values::specified::SVGPathData;
 
 /// A clipping shape, for `clip-path`.
 pub type ClippingShape<BasicShape, Url> = ShapeSource<BasicShape, GeometryBox, Url>;
 
 /// <https://drafts.fxtf.org/css-masking-1/#typedef-geometry-box>
 #[allow(missing_docs)]
 #[derive(
     Animate, Clone, Copy, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToComputedValue, ToCss,
--- a/servo/components/style/values/generics/border.rs
+++ b/servo/components/style/values/generics/border.rs
@@ -1,18 +1,18 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * 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/. */
 
 //! Generic types for CSS values related to borders.
 
+use crate::values::generics::rect::Rect;
+use crate::values::generics::size::Size;
 use std::fmt::{self, Write};
 use style_traits::{CssWriter, ToCss};
-use values::generics::rect::Rect;
-use values::generics::size::Size;
 
 /// A generic value for a single side of a `border-image-width` property.
 #[derive(
     Clone, Copy, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToComputedValue, ToCss,
 )]
 pub enum BorderImageSideWidth<LengthOrPercentage, Number> {
     /// `<length-or-percentage>`
     Length(LengthOrPercentage),
--- a/servo/components/style/values/generics/box.rs
+++ b/servo/components/style/values/generics/box.rs
@@ -1,15 +1,15 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * 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/. */
 
 //! Generic types for box properties.
 
-use values::animated::ToAnimatedZero;
+use crate::values::animated::ToAnimatedZero;
 
 /// A generic value for the `vertical-align` property.
 #[derive(
     Animate,
     Clone,
     ComputeSquaredDistance,
     Copy,
     Debug,
--- a/servo/components/style/values/generics/counters.rs
+++ b/servo/components/style/values/generics/counters.rs
@@ -1,22 +1,22 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * 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/. */
 
 //! Generic types for counters-related CSS values.
 
 #[cfg(feature = "servo")]
-use computed_values::list_style_type::T as ListStyleType;
+use crate::computed_values::list_style_type::T as ListStyleType;
+use crate::values::CustomIdent;
 use std::ops::Deref;
 #[cfg(feature = "gecko")]
 use values::generics::CounterStyleOrNone;
 #[cfg(feature = "gecko")]
 use values::specified::Attr;
-use values::CustomIdent;
 
 /// A name / value pair for counters.
 #[derive(Clone, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToComputedValue, ToCss)]
 pub struct CounterPair<Integer> {
     /// The name of the counter.
     pub name: CustomIdent,
     /// The value of the counter / increment / etc.
     pub value: Integer,
--- a/servo/components/style/values/generics/easing.rs
+++ b/servo/components/style/values/generics/easing.rs
@@ -1,17 +1,17 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * 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/. */
 
 //! Generic types for CSS Easing Functions.
 //! https://drafts.csswg.org/css-easing/#timing-functions
 
-use parser::ParserContext;
-use values::CSSFloat;
+use crate::parser::ParserContext;
+use crate::values::CSSFloat;
 
 /// A generic easing function.
 #[derive(
     Clone, Copy, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToComputedValue, ToCss,
 )]
 #[value_info(ty = "TIMING_FUNCTION")]
 #[repr(u8, C)]
 pub enum TimingFunction<Integer, Number> {
--- a/servo/components/style/values/generics/font.rs
+++ b/servo/components/style/values/generics/font.rs
@@ -1,19 +1,19 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * 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/. */
 
 //! Generic types for font stuff.
 
 use app_units::Au;
 use byteorder::{BigEndian, ReadBytesExt};
+use crate::parser::{Parse, ParserContext};
 use cssparser::Parser;
 use num_traits::One;
-use parser::{Parse, ParserContext};
 use std::fmt::{self, Write};
 use std::io::Cursor;
 use style_traits::{CssWriter, KeywordsCollectFn, ParseError};
 use style_traits::{SpecifiedValueInfo, StyleParseErrorKind, ToCss};
 
 /// https://drafts.csswg.org/css-fonts-4/#feature-tag-value
 #[derive(Clone, Debug, Eq, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToComputedValue)]
 pub struct FeatureTagValue<Integer> {
@@ -80,17 +80,17 @@ impl<T> FontSettings<T> {
 
 impl<T: Parse> Parse for FontSettings<T> {
     /// https://drafts.csswg.org/css-fonts-4/#descdef-font-face-font-feature-settings
     /// https://drafts.csswg.org/css-fonts-4/#font-variation-settings-def
     fn parse<'i, 't>(
         context: &ParserContext,
         input: &mut Parser<'i, 't>,
     ) -> Result<Self, ParseError<'i>> {
-        if input.try(|i| i.expect_ident_matching("normal")).is_ok() {
+        if input.r#try(|i| i.expect_ident_matching("normal")).is_ok() {
             return Ok(Self::normal());
         }
 
         Ok(FontSettings(
             input
                 .parse_comma_separated(|i| T::parse(context, i))?
                 .into_boxed_slice(),
         ))
--- a/servo/components/style/values/generics/grid.rs
+++ b/servo/components/style/values/generics/grid.rs
@@ -1,24 +1,24 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * 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/. */
 
 //! Generic types for the handling of
 //! [grids](https://drafts.csswg.org/css-grid/).
 
+use crate::parser::{Parse, ParserContext};
+use crate::values::computed::{Context, ToComputedValue};
+use crate::values::specified;
+use crate::values::specified::grid::parse_line_names;
+use crate::values::{CSSFloat, CustomIdent};
 use cssparser::Parser;
-use parser::{Parse, ParserContext};
 use std::fmt::{self, Write};
 use std::{mem, usize};
 use style_traits::{CssWriter, ParseError, StyleParseErrorKind, ToCss};
-use values::computed::{Context, ToComputedValue};
-use values::specified;
-use values::specified::grid::parse_line_names;
-use values::{CSSFloat, CustomIdent};
 
 /// A `<grid-line>` type.
 ///
 /// <https://drafts.csswg.org/css-grid/#typedef-grid-row-start-grid-line>
 #[derive(Clone, Debug, Default, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToComputedValue)]
 pub struct GridLine<Integer> {
     /// Flag to check whether it's a `span` keyword.
     pub is_span: bool,
@@ -81,47 +81,47 @@ where
 }
 
 impl Parse for GridLine<specified::Integer> {
     fn parse<'i, 't>(
         context: &ParserContext,
         input: &mut Parser<'i, 't>,
     ) -> Result<Self, ParseError<'i>> {
         let mut grid_line = Self::auto();
-        if input.try(|i| i.expect_ident_matching("auto")).is_ok() {
+        if input.r#try(|i| i.expect_ident_matching("auto")).is_ok() {
             return Ok(grid_line);
         }
 
         // <custom-ident> | [ <integer> && <custom-ident>? ] | [ span && [ <integer> || <custom-ident> ] ]
         // This <grid-line> horror is simply,
         // [ span? && [ <custom-ident> || <integer> ] ]
         // And, for some magical reason, "span" should be the first or last value and not in-between.
         let mut val_before_span = false;
 
         for _ in 0..3 {
             // Maximum possible entities for <grid-line>
             let location = input.current_source_location();
-            if input.try(|i| i.expect_ident_matching("span")).is_ok() {
+            if input.r#try(|i| i.expect_ident_matching("span")).is_ok() {
                 if grid_line.is_span {
                     return Err(location.new_custom_error(StyleParseErrorKind::UnspecifiedError));
                 }
 
                 if grid_line.line_num.is_some() || grid_line.ident.is_some() {
                     val_before_span = true;
                 }
 
                 grid_line.is_span = true;
-            } else if let Ok(i) = input.try(|i| specified::Integer::parse(context, i)) {
+            } else if let Ok(i) = input.r#try(|i| specified::Integer::parse(context, i)) {
                 // FIXME(emilio): Probably shouldn't reject if it's calc()...
                 if i.value() == 0 || val_before_span || grid_line.line_num.is_some() {
                     return Err(location.new_custom_error(StyleParseErrorKind::UnspecifiedError));
                 }
 
                 grid_line.line_num = Some(i);
-            } else if let Ok(name) = input.try(|i| i.expect_ident_cloned()) {
+            } else if let Ok(name) = input.r#try(|i| i.expect_ident_cloned()) {
                 if val_before_span || grid_line.ident.is_some() {
                     return Err(location.new_custom_error(StyleParseErrorKind::UnspecifiedError));
                 }
                 // NOTE(emilio): `span` is consumed above, so we only need to
                 // reject `auto`.
                 grid_line.ident = Some(CustomIdent::from_ident(location, &name, &["auto"])?);
             } else {
                 break;
@@ -370,17 +370,17 @@ pub enum RepeatCount<Integer> {
 
 impl Parse for RepeatCount<specified::Integer> {
     fn parse<'i, 't>(
         context: &ParserContext,
         input: &mut Parser<'i, 't>,
     ) -> Result<Self, ParseError<'i>> {
         // Maximum number of repeat is 10000. The greater numbers should be clamped.
         const MAX_LINE: i32 = 10000;
-        if let Ok(mut i) = input.try(|i| specified::Integer::parse_positive(context, i)) {
+        if let Ok(mut i) = input.r#try(|i| specified::Integer::parse_positive(context, i)) {
             if i.value() > MAX_LINE {
                 i = specified::Integer::new(MAX_LINE);
             }
             Ok(RepeatCount::Number(i))
         } else {
             try_match_ident_ignore_ascii_case! { input,
                 "auto-fill" => Ok(RepeatCount::AutoFill),
                 "auto-fit" => Ok(RepeatCount::AutoFit),
@@ -600,24 +600,24 @@ impl Parse for LineNameList {
         context: &ParserContext,
         input: &mut Parser<'i, 't>,
     ) -> Result<Self, ParseError<'i>> {
         input.expect_ident_matching("subgrid")?;
         let mut line_names = vec![];
         let mut fill_idx = None;
 
         loop {
-            let repeat_parse_result = input.try(|input| {
+            let repeat_parse_result = input.r#try(|input| {
                 input.expect_function_matching("repeat")?;
                 input.parse_nested_block(|input| {
                     let count = RepeatCount::parse(context, input)?;
                     input.expect_comma()?;
                     let mut names_list = vec![];
                     names_list.push(parse_line_names(input)?); // there should be at least one
-                    while let Ok(names) = input.try(parse_line_names) {
+                    while let Ok(names) = input.r#try(parse_line_names) {
                         names_list.push(names);
                     }
 
                     Ok((names_list, count))
                 })
             });
 
             if let Ok((mut names_list, count)) = repeat_parse_result {
@@ -638,17 +638,17 @@ impl Parse for LineNameList {
                         }
                         let names = names_list.pop().unwrap();
 
                         line_names.push(names);
                         fill_idx = Some(line_names.len() as u32 - 1);
                     },
                     _ => return Err(input.new_custom_error(StyleParseErrorKind::UnspecifiedError)),
                 }
-            } else if let Ok(names) = input.try(parse_line_names) {
+            } else if let Ok(names) = input.r#try(parse_line_names) {
                 line_names.push(names);
             } else {
                 break;
             }
         }
 
         Ok(LineNameList {
             names: line_names.into_boxed_slice(),
--- a/servo/components/style/values/generics/image.rs
+++ b/servo/components/style/values/generics/image.rs
@@ -1,22 +1,22 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * 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/. */
 
 //! Generic types for the handling of [images].
 //!
 //! [images]: https://drafts.csswg.org/css-images/#image-values
 
-use custom_properties;
+use crate::custom_properties;
+use crate::values::serialize_atom_identifier;
+use crate::Atom;
 use servo_arc::Arc;
 use std::fmt::{self, Write};
 use style_traits::{CssWriter, ToCss};
-use values::serialize_atom_identifier;
-use Atom;
 
 /// An [image].
 ///
 /// [image]: https://drafts.csswg.org/css-images/#image-values
 #[derive(Clone, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToComputedValue)]
 pub enum Image<Gradient, MozImageRect, ImageUrl> {
     /// A `<url()>` image.
     Url(ImageUrl),
--- a/servo/components/style/values/generics/length.rs
+++ b/servo/components/style/values/generics/length.rs
@@ -1,15 +1,15 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * 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/. */
 
 //! Generic types for CSS values related to length.
 
-use values::computed::ExtremumLength;
+use crate::values::computed::ExtremumLength;
 
 /// A generic value for the `width`, `height`, `min-width`, or `min-height` property.
 ///
 /// Unlike `max-width` or `max-height` properties, a MozLength can be `auto`,
 /// and cannot be `none`.
 ///
 /// Note that it only accepts non-negative values.
 #[allow(missing_docs)]
--- a/servo/components/style/values/generics/mod.rs
+++ b/servo/components/style/values/generics/mod.rs
@@ -1,19 +1,19 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * 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/. */
 
 //! Generic types that share their serialization implementations
 //! for both specified and computed values.
 
 use super::CustomIdent;
-use counter_style::{parse_counter_style_name, Symbols};
+use crate::counter_style::{parse_counter_style_name, Symbols};
+use crate::parser::{Parse, ParserContext};
 use cssparser::Parser;
-use parser::{Parse, ParserContext};
 use style_traits::{KeywordsCollectFn, ParseError};
 use style_traits::{SpecifiedValueInfo, StyleParseErrorKind};
 
 pub mod background;
 pub mod basic_shape;
 pub mod border;
 #[path = "box.rs"]
 pub mod box_;
@@ -106,26 +106,29 @@ impl CounterStyleOrNone {
     }
 }
 
 impl Parse for CounterStyleOrNone {
     fn parse<'i, 't>(
         context: &ParserContext,
         input: &mut Parser<'i, 't>,
     ) -> Result<Self, ParseError<'i>> {
-        if let Ok(name) = input.try(|i| parse_counter_style_name(i)) {
+        if let Ok(name) = input.r#try(|i| parse_counter_style_name(i)) {
             return Ok(CounterStyleOrNone::Name(name));
         }
-        if input.try(|i| i.expect_ident_matching("none")).is_ok() {
+        if input.r#try(|i| i.expect_ident_matching("none")).is_ok() {
             return Ok(CounterStyleOrNone::None);
         }
-        if input.try(|i| i.expect_function_matching("symbols")).is_ok() {
+        if input
+            .r#try(|i| i.expect_function_matching("symbols"))
+            .is_ok()
+        {
             return input.parse_nested_block(|input| {
                 let symbols_type = input
-                    .try(|i| SymbolsType::parse(i))
+                    .r#try(|i| SymbolsType::parse(i))
                     .unwrap_or(SymbolsType::Symbolic);
                 let symbols = Symbols::parse(context, input)?;
                 // There must be at least two symbols for alphabetic or
                 // numeric system.
                 if (symbols_type == SymbolsType::Alphabetic ||
                     symbols_type == SymbolsType::Numeric) && symbols.0.len() < 2
                 {
                     return Err(input.new_custom_error(StyleParseErrorKind::UnspecifiedError));
--- a/servo/components/style/values/generics/rect.rs
+++ b/servo/components/style/values/generics/rect.rs
@@ -1,16 +1,16 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * 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/. */
 
 //! Generic types for CSS values that are composed of four sides.
 
+use crate::parser::{Parse, ParserContext};
 use cssparser::Parser;
-use parser::{Parse, ParserContext};
 use std::fmt::{self, Write};
 use style_traits::{CssWriter, ParseError, ToCss};
 
 /// A CSS value made of four components, where its `ToCss` impl will try to
 /// serialize as few components as possible, like for example in `border-width`.
 #[derive(
     Animate,
     Clone,
@@ -45,34 +45,34 @@ where
         context: &ParserContext,
         input: &mut Parser<'i, 't>,
         parse: Parse,
     ) -> Result<Self, ParseError<'i>>
     where
         Parse: Fn(&ParserContext, &mut Parser<'i, 't>) -> Result<T, ParseError<'i>>,
     {
         let first = parse(context, input)?;
-        let second = if let Ok(second) = input.try(|i| parse(context, i)) {
+        let second = if let Ok(second) = input.r#try(|i| parse(context, i)) {
             second
         } else {
             // <first>
             return Ok(Self::new(
                 first.clone(),
                 first.clone(),
                 first.clone(),
                 first,
             ));
         };
-        let third = if let Ok(third) = input.try(|i| parse(context, i)) {
+        let third = if let Ok(third) = input.r#try(|i| parse(context, i)) {
             third
         } else {
             // <first> <second>
             return Ok(Self::new(first.clone(), second.clone(), first, second));
         };
-        let fourth = if let Ok(fourth) = input.try(|i| parse(context, i)) {
+        let fourth = if let Ok(fourth) = input.r#try(|i| parse(context, i)) {
             fourth
         } else {
             // <first> <second> <third>
             return Ok(Self::new(first, second.clone(), third, second));
         };
         // <first> <second> <third> <fourth>
         Ok(Self::new(first, second, third, fourth))
     }
--- a/servo/components/style/values/generics/size.rs
+++ b/servo/components/style/values/generics/size.rs
@@ -1,20 +1,20 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * 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/. */
 
 //! Generic type for CSS properties that are composed by two dimensions.
 
+use crate::parser::ParserContext;
+use crate::values::animated::ToAnimatedValue;
 use cssparser::Parser;
 use euclid::Size2D;
-use parser::ParserContext;
 use std::fmt::{self, Write};
 use style_traits::{CssWriter, ParseError, SpecifiedValueInfo, ToCss};
-use values::animated::ToAnimatedValue;
 
 /// A generic size, for `border-*-radius` longhand properties, or
 /// `border-spacing`.
 #[derive(
     Animate,
     Clone,
     ComputeSquaredDistance,
     Copy,
@@ -50,17 +50,17 @@ impl<L> Size<L> {
         parse_one: F,
     ) -> Result<Self, ParseError<'i>>
     where
         L: Clone,
         F: Fn(&ParserContext, &mut Parser<'i, 't>) -> Result<L, ParseError<'i>>,
     {
         let first = parse_one(context, input)?;
         let second = input
-            .try(|i| parse_one(context, i))
+            .r#try(|i| parse_one(context, i))
             .unwrap_or_else(|_| first.clone());
         Ok(Self::new(first, second))
     }
 }
 
 impl<L> ToCss for Size<L>
 where
     L: ToCss + PartialEq,
--- a/servo/components/style/values/generics/svg.rs
+++ b/servo/components/style/values/generics/svg.rs
@@ -1,18 +1,18 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * 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/. */
 
 //! Generic types for CSS values in SVG
 
+use crate::parser::{Parse, ParserContext};
+use crate::values::{Either, None_};
 use cssparser::Parser;
-use parser::{Parse, ParserContext};
 use style_traits::{ParseError, StyleParseErrorKind};
-use values::{Either, None_};
 
 /// An SVG paint value
 ///
 /// <https://www.w3.org/TR/SVG2/painting.html#SpecifyingPaint>
 #[animation(no_bound(UrlPaintServer))]
 #[derive(
     Animate,
     Clone,
@@ -79,50 +79,50 @@ impl<ColorType, UrlPaintServer> SVGPaint
 
 /// Parse SVGPaint's fallback.
 /// fallback is keyword(none), Color or empty.
 /// <https://svgwg.org/svg2-draft/painting.html#SpecifyingPaint>
 fn parse_fallback<'i, 't, ColorType: Parse>(
     context: &ParserContext,
     input: &mut Parser<'i, 't>,
 ) -> Option<Either<ColorType, None_>> {
-    if input.try(|i| i.expect_ident_matching("none")).is_ok() {
+    if input.r#try(|i| i.expect_ident_matching("none")).is_ok() {
         Some(Either::Second(None_))
     } else {
-        if let Ok(color) = input.try(|i| ColorType::parse(context, i)) {
+        if let Ok(color) = input.r#try(|i| ColorType::parse(context, i)) {
             Some(Either::First(color))
         } else {
             None
         }
     }
 }
 
 impl<ColorType: Parse, UrlPaintServer: Parse> Parse for SVGPaint<ColorType, UrlPaintServer> {
     fn parse<'i, 't>(
         context: &ParserContext,
         input: &mut Parser<'i, 't>,
     ) -> Result<Self, ParseError<'i>> {
-        if let Ok(url) = input.try(|i| UrlPaintServer::parse(context, i)) {
+        if let Ok(url) = input.r#try(|i| UrlPaintServer::parse(context, i)) {
             Ok(SVGPaint {
                 kind: SVGPaintKind::PaintServer(url),
                 fallback: parse_fallback(context, input),
             })
-        } else if let Ok(kind) = input.try(SVGPaintKind::parse_ident) {
+        } else if let Ok(kind) = input.r#try(SVGPaintKind::parse_ident) {
             if let SVGPaintKind::None = kind {
                 Ok(SVGPaint {
                     kind: kind,
                     fallback: None,
                 })
             } else {
                 Ok(SVGPaint {
                     kind: kind,
                     fallback: parse_fallback(context, input),
                 })
             }
-        } else if let Ok(color) = input.try(|i| ColorType::parse(context, i)) {
+        } else if let Ok(color) = input.r#try(|i| ColorType::parse(context, i)) {
             Ok(SVGPaint {
                 kind: SVGPaintKind::Color(color),
                 fallback: None,
             })
         } else {
             Err(input.new_custom_error(StyleParseErrorKind::UnspecifiedError))
         }
     }
@@ -153,17 +153,17 @@ pub enum SvgLengthOrPercentageOrNumber<L
 /// since prevent converting to the length.
 impl<LengthOrPercentageType: Parse, NumberType: Parse> Parse
     for SvgLengthOrPercentageOrNumber<LengthOrPercentageType, NumberType>
 {
     fn parse<'i, 't>(
         context: &ParserContext,
         input: &mut Parser<'i, 't>,
     ) -> Result<Self, ParseError<'i>> {
-        if let Ok(num) = input.try(|i| NumberType::parse(context, i)) {
+        if let Ok(num) = input.r#try(|i| NumberType::parse(context, i)) {
             return Ok(SvgLengthOrPercentageOrNumber::Number(num));
         }
 
         let lop = LengthOrPercentageType::parse(context, input)?;
         Ok(SvgLengthOrPercentageOrNumber::LengthOrPercentage(lop))
     }
 }
 
--- a/servo/components/style/values/generics/text.rs
+++ b/servo/components/style/values/generics/text.rs
@@ -1,20 +1,20 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * 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/. */
 
 //! Generic types for text properties.
 
 use app_units::Au;
+use crate::parser::ParserContext;
+use crate::values::animated::{Animate, Procedure, ToAnimatedZero};
+use crate::values::distance::{ComputeSquaredDistance, SquaredDistance};
 use cssparser::Parser;
-use parser::ParserContext;
 use style_traits::ParseError;
-use values::animated::{Animate, Procedure, ToAnimatedZero};
-use values::distance::{ComputeSquaredDistance, SquaredDistance};
 
 /// A generic value for the `initial-letter` property.
 #[derive(
     Clone, Copy, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToComputedValue, ToCss,
 )]
 pub enum InitialLetter<Number, Integer> {
     /// `normal`
     Normal,
@@ -53,17 +53,17 @@ impl<Value> Spacing<Value> {
     pub fn parse_with<'i, 't, F>(
         context: &ParserContext,
         input: &mut Parser<'i, 't>,
         parse: F,
     ) -> Result<Self, ParseError<'i>>
     where
         F: FnOnce(&ParserContext, &mut Parser<'i, 't>) -> Result<Value, ParseError<'i>>,
     {
-        if input.try(|i| i.expect_ident_matching("normal")).is_ok() {
+        if input.r#try(|i| i.expect_ident_matching("normal")).is_ok() {
             return Ok(Spacing::Normal);
         }
         parse(context, input).map(Spacing::Value)
     }
 
     /// Returns the spacing value, if not `normal`.
     #[inline]
     pub fn value(&self) -> Option<&Value> {
--- a/servo/components/style/values/generics/transform.rs
+++ b/servo/components/style/values/generics/transform.rs
@@ -1,25 +1,25 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * 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/. */
 
 //! Generic types for CSS values that are related to transformations.
 
 use app_units::Au;
+use crate::values::computed::length::Length as ComputedLength;
+use crate::values::computed::length::LengthOrPercentage as ComputedLengthOrPercentage;
+use crate::values::specified::angle::Angle as SpecifiedAngle;
+use crate::values::specified::length::Length as SpecifiedLength;
+use crate::values::specified::length::LengthOrPercentage as SpecifiedLengthOrPercentage;
+use crate::values::{computed, CSSFloat};
 use euclid::{self, Rect, Transform3D};
 use num_traits::Zero;
 use std::fmt::{self, Write};
 use style_traits::{CssWriter, ToCss};
-use values::computed::length::Length as ComputedLength;
-use values::computed::length::LengthOrPercentage as ComputedLengthOrPercentage;
-use values::specified::angle::Angle as SpecifiedAngle;
-use values::specified::length::Length as SpecifiedLength;
-use values::specified::length::LengthOrPercentage as SpecifiedLengthOrPercentage;
-use values::{computed, CSSFloat};
 
 /// A generic 2D transformation matrix.
 #[allow(missing_docs)]
 #[derive(
     Clone, Copy, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToComputedValue, ToCss,
 )]
 #[css(comma, function)]
 pub struct Matrix<T> {
@@ -509,18 +509,18 @@ pub fn create_perspective_matrix(d: CSSF
 
 /// Return the normalized direction vector and its angle for Rotate3D.
 pub fn get_normalized_vector_and_angle<T: Zero>(
     x: CSSFloat,
     y: CSSFloat,
     z: CSSFloat,
     angle: T,
 ) -> (CSSFloat, CSSFloat, CSSFloat, T) {
+    use crate::values::computed::transform::DirectionVector;
     use euclid::approxeq::ApproxEq;
-    use values::computed::transform::DirectionVector;
     let vector = DirectionVector::new(x, y, z);
     if vector.square_length().approx_eq(&f32::zero()) {
         // https://www.w3.org/TR/css-transforms-1/#funcdef-rotate3d
         // A direction vector that cannot be normalized, such as [0, 0, 0], will cause the
         // rotation to not be applied, so we use identity matrix (i.e. rotate3d(0, 0, 1, 0)).
         (0., 0., 1., T::zero())
     } else {
         let vector = vector.robust_normalize();
--- a/servo/components/style/values/generics/url.rs
+++ b/servo/components/style/values/generics/url.rs
@@ -1,16 +1,16 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * 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/. */
 
 //! Generic types for url properties.
 
+use crate::parser::{Parse, ParserContext};
 use cssparser::Parser;
-use parser::{Parse, ParserContext};
 use style_traits::ParseError;
 
 /// An image url or none, used for example in list-style-image
 #[derive(
     Animate,
     Clone,
     ComputeSquaredDistance,
     Debug,
@@ -39,15 +39,15 @@ impl<Url> UrlOrNone<Url> {
 impl<Url> Parse for UrlOrNone<Url>
 where
     Url: Parse,
 {
     fn parse<'i, 't>(
         context: &ParserContext,
         input: &mut Parser<'i, 't>,
     ) -> Result<UrlOrNone<Url>, ParseError<'i>> {
-        if let Ok(url) = input.try(|input| Url::parse(context, input)) {
+        if let Ok(url) = input.r#try(|input| Url::parse(context, input)) {
             return Ok(UrlOrNone::Url(url));
         }
         input.expect_ident_matching("none")?;
         Ok(UrlOrNone::None)
     }
 }
--- a/servo/components/style/values/mod.rs
+++ b/servo/components/style/values/mod.rs
@@ -5,28 +5,28 @@
 //! Common [values][values] used in CSS.
 //!
 //! [values]: https://drafts.csswg.org/css-values/
 
 #![deny(missing_docs)]
 
 pub use cssparser::{serialize_identifier, serialize_name, CowRcStr, Parser};
 pub use cssparser::{SourceLocation, Token, RGBA};
-use parser::{Parse, ParserContext};
+use crate::Atom;
+use crate::parser::{Parse, ParserContext};
+use crate::values::distance::{ComputeSquaredDistance, SquaredDistance};
 use selectors::parser::SelectorParseErrorKind;
 use std::fmt::{self, Debug, Write};
 use std::hash;
 use style_traits::{CssWriter, ParseError, StyleParseErrorKind, ToCss};
-use values::distance::{ComputeSquaredDistance, SquaredDistance};
-use Atom;
 
+#[cfg(feature = "servo")]
+pub use crate::servo::url::CssUrl;
 #[cfg(feature = "gecko")]
 pub use gecko::url::CssUrl;
-#[cfg(feature = "servo")]
-pub use servo::url::CssUrl;
 
 pub mod animated;
 pub mod computed;
 pub mod distance;
 pub mod generics;
 pub mod specified;
 
 /// A CSS float value.
@@ -150,17 +150,17 @@ impl<A: Debug, B: Debug> Debug for Eithe
     }
 }
 
 impl<A: Parse, B: Parse> Parse for Either<A, B> {
     fn parse<'i, 't>(
         context: &ParserContext,
         input: &mut Parser<'i, 't>,
     ) -> Result<Either<A, B>, ParseError<'i>> {
-        if let Ok(v) = input.try(|i| A::parse(context, i)) {
+        if let Ok(v) = input.r#try(|i| A::parse(context, i)) {
             Ok(Either::First(v))
         } else {
             B::parse(context, input).map(Either::Second)
         }
     }
 }
 
 /// <https://drafts.csswg.org/css-values-4/#custom-idents>
--- a/servo/components/style/values/specified/angle.rs
+++ b/servo/components/style/values/specified/angle.rs
@@ -1,23 +1,23 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * 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/. */
 
 //! Specified angles.
 
+use crate::parser::{Parse, ParserContext};
+use crate::values::computed::angle::Angle as ComputedAngle;
+use crate::values::computed::{Context, ToComputedValue};
+use crate::values::specified::calc::CalcNode;
+use crate::values::CSSFloat;
 use cssparser::{Parser, Token};
-use parser::{Parse, ParserContext};
 use std::f32::consts::PI;
 use std::fmt::{self, Write};
 use style_traits::{CssWriter, ParseError, SpecifiedValueInfo, ToCss};
-use values::computed::angle::Angle as ComputedAngle;
-use values::computed::{Context, ToComputedValue};
-use values::specified::calc::CalcNode;
-use values::CSSFloat;
 
 /// A specified angle dimension.
 #[cfg_attr(feature = "servo", derive(Deserialize, Serialize))]
 #[derive(Clone, Copy, Debug, MallocSizeOf, PartialEq, PartialOrd, ToCss)]
 pub enum AngleDimension {
     /// An angle with degree unit.
     #[css(dimension)]
     Deg(CSSFloat),
--- a/servo/components/style/values/specified/background.rs
+++ b/servo/components/style/values/specified/background.rs
@@ -1,32 +1,32 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * 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/. */
 
 //! Specified types for CSS values related to backgrounds.
 
+use crate::parser::{Parse, ParserContext};
+use crate::values::generics::background::BackgroundSize as GenericBackgroundSize;
+use crate::values::specified::length::NonNegativeLengthOrPercentageOrAuto;
 use cssparser::Parser;
-use parser::{Parse, ParserContext};
 use selectors::parser::SelectorParseErrorKind;
 use style_traits::ParseError;
-use values::generics::background::BackgroundSize as GenericBackgroundSize;
-use values::specified::length::NonNegativeLengthOrPercentageOrAuto;
 
 /// A specified value for the `background-size` property.
 pub type BackgroundSize = GenericBackgroundSize<NonNegativeLengthOrPercentageOrAuto>;
 
 impl Parse for BackgroundSize {
     fn parse<'i, 't>(
         context: &ParserContext,
         input: &mut Parser<'i, 't>,
     ) -> Result<Self, ParseError<'i>> {
-        if let Ok(width) = input.try(|i| NonNegativeLengthOrPercentageOrAuto::parse(context, i)) {
+        if let Ok(width) = input.r#try(|i| NonNegativeLengthOrPercentageOrAuto::parse(context, i)) {
             let height = input
-                .try(|i| NonNegativeLengthOrPercentageOrAuto::parse(context, i))
+                .r#try(|i| NonNegativeLengthOrPercentageOrAuto::parse(context, i))
                 .unwrap_or(NonNegativeLengthOrPercentageOrAuto::auto());
             return Ok(GenericBackgroundSize::Explicit { width, height });
         }
         Ok(try_match_ident_ignore_ascii_case! { input,
             "cover" => GenericBackgroundSize::Cover,
             "contain" => GenericBackgroundSize::Contain,
         })
     }
@@ -101,12 +101,12 @@ impl Parse for BackgroundRepeat {
             Ok(h) => h,
             Err(()) => {
                 return Err(
                     input.new_custom_error(SelectorParseErrorKind::UnexpectedIdent(ident.clone()))
                 );
             },
         };
 
-        let vertical = input.try(BackgroundRepeatKeyword::parse).ok();
+        let vertical = input.r#try(BackgroundRepeatKeyword::parse).ok();
         Ok(BackgroundRepeat::Keywords(horizontal, vertical))
     }
 }
--- a/servo/components/style/values/specified/basic_shape.rs
+++ b/servo/components/style/values/specified/basic_shape.rs
@@ -2,36 +2,36 @@
  * 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/. */
 
 //! CSS handling for the specified value of
 //! [`basic-shape`][basic-shape]s
 //!
 //! [basic-shape]: https://drafts.csswg.org/css-shapes/#typedef-basic-shape
 
+use crate::parser::{Parse, ParserContext};
+use crate::values::computed::Percentage;
+use crate::values::generics::basic_shape as generic;
+use crate::values::generics::basic_shape::{GeometryBox, Path, PolygonCoord};
+use crate::values::generics::basic_shape::{ShapeBox, ShapeSource};
+use crate::values::generics::rect::Rect;
+use crate::values::specified::border::BorderRadius;
+use crate::values::specified::image::Image;
+use crate::values::specified::position::{HorizontalPosition, Position, PositionComponent};
+use crate::values::specified::position::{Side, VerticalPosition};
+use crate::values::specified::url::SpecifiedUrl;
+use crate::values::specified::LengthOrPercentage;
+use crate::values::specified::SVGPathData;
 use cssparser::Parser;
-use parser::{Parse, ParserContext};
 use std::borrow::Cow;
 use std::fmt::{self, Write};
 use style_traits::{CssWriter, ParseError, StyleParseErrorKind, ToCss};
-use values::computed::Percentage;
-use values::generics::basic_shape as generic;
-use values::generics::basic_shape::{GeometryBox, Path, PolygonCoord};
-use values::generics::basic_shape::{ShapeBox, ShapeSource};
-use values::generics::rect::Rect;
-use values::specified::border::BorderRadius;
-use values::specified::image::Image;
-use values::specified::position::{HorizontalPosition, Position, PositionComponent};
-use values::specified::position::{Side, VerticalPosition};
-use values::specified::url::SpecifiedUrl;
-use values::specified::LengthOrPercentage;
-use values::specified::SVGPathData;
 
 /// A specified alias for FillRule.
-pub use values::generics::basic_shape::FillRule;
+pub use crate::values::generics::basic_shape::FillRule;
 
 /// A specified clipping shape.
 pub type ClippingShape = generic::ClippingShape<BasicShape, SpecifiedUrl>;
 
 /// A specified float area shape.
 pub type FloatAreaShape = generic::FloatAreaShape<BasicShape, Image>;
 
 /// A specified basic shape.
@@ -65,66 +65,66 @@ fn is_clip_path_path_enabled(_: &ParserC
 
 impl Parse for ClippingShape {
     #[inline]
     fn parse<'i, 't>(
         context: &ParserContext,
         input: &mut Parser<'i, 't>,
     ) -> Result<Self, ParseError<'i>> {
         if is_clip_path_path_enabled(context) {
-            if let Ok(p) = input.try(|i| Path::parse(context, i)) {
+            if let Ok(p) = input.r#try(|i| Path::parse(context, i)) {
                 return Ok(ShapeSource::Path(p));
             }
         }
 
-        if let Ok(url) = input.try(|i| SpecifiedUrl::parse(context, i)) {
+        if let Ok(url) = input.r#try(|i| SpecifiedUrl::parse(context, i)) {
             return Ok(ShapeSource::ImageOrUrl(url));
         }
 
         Self::parse_common(context, input)
     }
 }
 
 impl Parse for FloatAreaShape {
     #[inline]
     fn parse<'i, 't>(
         context: &ParserContext,
         input: &mut Parser<'i, 't>,
     ) -> Result<Self, ParseError<'i>> {
-        if let Ok(image) = input.try(|i| Image::parse_with_cors_anonymous(context, i)) {
+        if let Ok(image) = input.r#try(|i| Image::parse_with_cors_anonymous(context, i)) {
             return Ok(ShapeSource::ImageOrUrl(image));
         }
 
         Self::parse_common(context, input)
     }
 }
 
 impl<ReferenceBox, ImageOrUrl> ShapeSource<BasicShape, ReferenceBox, ImageOrUrl>
 where
     ReferenceBox: Parse,
 {
     /// The internal parser for ShapeSource.
     fn parse_common<'i, 't>(
         context: &ParserContext,
         input: &mut Parser<'i, 't>,
     ) -> Result<Self, ParseError<'i>> {
-        if input.try(|i| i.expect_ident_matching("none")).is_ok() {
+        if input.r#try(|i| i.expect_ident_matching("none")).is_ok() {
             return Ok(ShapeSource::None);
         }
 
         fn parse_component<U: Parse>(
             context: &ParserContext,
             input: &mut Parser,
             component: &mut Option<U>,
         ) -> bool {
             if component.is_some() {
                 return false; // already parsed this component
             }
 
-            *component = input.try(|i| U::parse(context, i)).ok();
+            *component = input.r#try(|i| U::parse(context, i)).ok();
             component.is_some()
         }
 
         let mut shape = None;
         let mut ref_box = None;
 
         while parse_component(context, input, &mut shape) ||
             parse_component(context, input, &mut ref_box)
@@ -142,17 +142,17 @@ where
     }
 }
 
 impl Parse for GeometryBox {
     fn parse<'i, 't>(
         _context: &ParserContext,
         input: &mut Parser<'i, 't>,
     ) -> Result<Self, ParseError<'i>> {
-        if let Ok(shape_box) = input.try(|i| ShapeBox::parse(i)) {
+        if let Ok(shape_box) = input.r#try(|i| ShapeBox::parse(i)) {
             return Ok(GeometryBox::ShapeBox(shape_box));
         }
 
         try_match_ident_ignore_ascii_case! { input,
             "fill-box" => Ok(GeometryBox::FillBox),
             "stroke-box" => Ok(GeometryBox::StrokeBox),
             "view-box" => Ok(GeometryBox::ViewBox),
         }
@@ -192,17 +192,17 @@ impl Parse for InsetRect {
 
 impl InsetRect {
     /// Parse the inner function arguments of `inset()`
     fn parse_function_arguments<'i, 't>(
         context: &ParserContext,
         input: &mut Parser<'i, 't>,
     ) -> Result<Self, ParseError<'i>> {
         let rect = Rect::parse_with(context, input, LengthOrPercentage::parse)?;
-        let round = if input.try(|i| i.expect_ident_matching("round")).is_ok() {
+        let round = if input.r#try(|i| i.expect_ident_matching("round")).is_ok() {
             Some(BorderRadius::parse(context, input)?)
         } else {
             None
         };
         Ok(generic::InsetRect {
             rect: rect,
             round: round,
         })
@@ -220,19 +220,19 @@ impl Parse for Circle {
 }
 
 impl Circle {
     fn parse_function_arguments<'i, 't>(
         context: &ParserContext,
         input: &mut Parser<'i, 't>,
     ) -> Result<Self, ParseError<'i>> {
         let radius = input
-            .try(|i| ShapeRadius::parse(context, i))
+            .r#try(|i| ShapeRadius::parse(context, i))
             .unwrap_or_default();
-        let position = if input.try(|i| i.expect_ident_matching("at")).is_ok() {
+        let position = if input.r#try(|i| i.expect_ident_matching("at")).is_ok() {
             Position::parse(context, input)?
         } else {
             Position::center()
         };
 
         Ok(generic::Circle { radius, position })
     }
 }
@@ -265,24 +265,24 @@ impl Parse for Ellipse {
 }
 
 impl Ellipse {
     fn parse_function_arguments<'i, 't>(
         context: &ParserContext,
         input: &mut Parser<'i, 't>,
     ) -> Result<Self, ParseError<'i>> {
         let (a, b) = input
-            .try(|i| -> Result<_, ParseError> {
+            .r#try(|i| -> Result<_, ParseError> {
                 Ok((
                     ShapeRadius::parse(context, i)?,
                     ShapeRadius::parse(context, i)?,
                 ))
             })
             .unwrap_or_default();
-        let position = if input.try(|i| i.expect_ident_matching("at")).is_ok() {
+        let position = if input.r#try(|i| i.expect_ident_matching("at")).is_ok() {
             Position::parse(context, input)?
         } else {
             Position::center()
         };
 
         Ok(generic::Ellipse {
             semiaxis_x: a,
             semiaxis_y: b,
@@ -310,17 +310,17 @@ impl ToCss for Ellipse {
     }
 }
 
 impl Parse for ShapeRadius {
     fn parse<'i, 't>(
         context: &ParserContext,
         input: &mut Parser<'i, 't>,
     ) -> Result<Self, ParseError<'i>> {
-        if let Ok(lop) = input.try(|i| LengthOrPercentage::parse_non_negative(context, i)) {
+        if let Ok(lop) = input.r#try(|i| LengthOrPercentage::parse_non_negative(context, i)) {
             return Ok(generic::ShapeRadius::Length(lop));
         }
 
         try_match_ident_ignore_ascii_case! { input,
             "closest-side" => Ok(generic::ShapeRadius::ClosestSide),
             "farthest-side" => Ok(generic::ShapeRadius::FarthestSide),
         }
     }
@@ -414,17 +414,17 @@ impl Parse for Polygon {
 
 impl Polygon {
     /// Parse the inner arguments of a `polygon` function.
     fn parse_function_arguments<'i, 't>(
         context: &ParserContext,
         input: &mut Parser<'i, 't>,
     ) -> Result<Self, ParseError<'i>> {
         let fill = input
-            .try(|i| -> Result<_, ParseError> {
+            .r#try(|i| -> Result<_, ParseError> {
                 let fill = FillRule::parse(i)?;
                 i.expect_comma()?; // only eat the comma if there is something before it
                 Ok(fill)
             })
             .unwrap_or_default();
 
         let buf = input.parse_comma_separated(|i| {
             Ok(PolygonCoord(
@@ -452,17 +452,17 @@ impl Parse for Path {
 
 impl Path {
     /// Parse the inner arguments of a `path` function.
     fn parse_function_arguments<'i, 't>(
         context: &ParserContext,
         input: &mut Parser<'i, 't>,
     ) -> Result<Self, ParseError<'i>> {
         let fill = input
-            .try(|i| -> Result<_, ParseError> {
+            .r#try(|i| -> Result<_, ParseError> {
                 let fill = FillRule::parse(i)?;
                 i.expect_comma()?;
                 Ok(fill)
             })
             .unwrap_or_default();
         let path = SVGPathData::parse(context, input)?;
         Ok(Path { fill, path })
     }
--- a/servo/components/style/values/specified/border.rs
+++ b/servo/components/style/values/specified/border.rs
@@ -1,28 +1,28 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * 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/. */
 
 //! Specified types for CSS values related to borders.
 
+use crate::parser::{Parse, ParserContext};
+use crate::values::computed::{self, Context, ToComputedValue};
+use crate::values::generics::border::BorderCornerRadius as GenericBorderCornerRadius;
+use crate::values::generics::border::BorderImageSideWidth as GenericBorderImageSideWidth;
+use crate::values::generics::border::BorderImageSlice as GenericBorderImageSlice;
+use crate::values::generics::border::BorderRadius as GenericBorderRadius;
+use crate::values::generics::border::BorderSpacing as GenericBorderSpacing;
+use crate::values::generics::rect::Rect;
+use crate::values::generics::size::Size;
+use crate::values::specified::length::{Length, LengthOrPercentage, NonNegativeLength};
+use crate::values::specified::{AllowQuirks, Number, NumberOrPercentage};
 use cssparser::Parser;
-use parser::{Parse, ParserContext};
 use std::fmt::{self, Write};
 use style_traits::{CssWriter, ParseError, ToCss};
-use values::computed::{self, Context, ToComputedValue};
-use values::generics::border::BorderCornerRadius as GenericBorderCornerRadius;
-use values::generics::border::BorderImageSideWidth as GenericBorderImageSideWidth;
-use values::generics::border::BorderImageSlice as GenericBorderImageSlice;
-use values::generics::border::BorderRadius as GenericBorderRadius;
-use values::generics::border::BorderSpacing as GenericBorderSpacing;
-use values::generics::rect::Rect;
-use values::generics::size::Size;
-use values::specified::length::{Length, LengthOrPercentage, NonNegativeLength};
-use values::specified::{AllowQuirks, Number, NumberOrPercentage};
 
 /// A specified value for a single side of the `border-width` property.
 #[derive(Clone, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToCss)]
 pub enum BorderSideWidth {
     /// `thin`
     Thin,
     /// `medium`
     Medium,
@@ -53,17 +53,17 @@ pub type BorderSpacing = GenericBorderSp
 impl BorderSideWidth {
     /// Parses, with quirks.
     pub fn parse_quirky<'i, 't>(
         context: &ParserContext,
         input: &mut Parser<'i, 't>,
         allow_quirks: AllowQuirks,
     ) -> Result<Self, ParseError<'i>> {
         if let Ok(length) =
-            input.try(|i| Length::parse_non_negative_quirky(context, i, allow_quirks))
+            input.r#try(|i| Length::parse_non_negative_quirky(context, i, allow_quirks))
         {
             return Ok(BorderSideWidth::Length(length));
         }
         try_match_ident_ignore_ascii_case! { input,
             "thin" => Ok(BorderSideWidth::Thin),
             "medium" => Ok(BorderSideWidth::Medium),
             "thick" => Ok(BorderSideWidth::Thick),
         }
@@ -110,53 +110,53 @@ impl BorderImageSideWidth {
     }
 }
 
 impl Parse for BorderImageSideWidth {
     fn parse<'i, 't>(
         context: &ParserContext,
         input: &mut Parser<'i, 't>,
     ) -> Result<Self, ParseError<'i>> {
-        if input.try(|i| i.expect_ident_matching("auto")).is_ok() {
+        if input.r#try(|i| i.expect_ident_matching("auto")).is_ok() {
             return Ok(GenericBorderImageSideWidth::Auto);
         }
 
-        if let Ok(len) = input.try(|i| LengthOrPercentage::parse_non_negative(context, i)) {
+        if let Ok(len) = input.r#try(|i| LengthOrPercentage::parse_non_negative(context, i)) {
             return Ok(GenericBorderImageSideWidth::Length(len));
         }
 
         let num = Number::parse_non_negative(context, input)?;
         Ok(GenericBorderImageSideWidth::Number(num))
     }
 }
 
 impl Parse for BorderImageSlice {
     fn parse<'i, 't>(
         context: &ParserContext,
         input: &mut Parser<'i, 't>,
     ) -> Result<Self, ParseError<'i>> {
-        let mut fill = input.try(|i| i.expect_ident_matching("fill")).is_ok();
+        let mut fill = input.r#try(|i| i.expect_ident_matching("fill")).is_ok();
         let offsets = Rect::parse_with(context, input, NumberOrPercentage::parse_non_negative)?;
         if !fill {
-            fill = input.try(|i| i.expect_ident_matching("fill")).is_ok();
+            fill = input.r#try(|i| i.expect_ident_matching("fill")).is_ok();
         }
         Ok(GenericBorderImageSlice {
             offsets: offsets,
             fill: fill,
         })
     }
 }
 
 impl Parse for BorderRadius {
     fn parse<'i, 't>(
         context: &ParserContext,
         input: &mut Parser<'i, 't>,
     ) -> Result<Self, ParseError<'i>> {
         let widths = Rect::parse_with(context, input, LengthOrPercentage::parse_non_negative)?;
-        let heights = if input.try(|i| i.expect_delim('/')).is_ok() {
+        let heights = if input.r#try(|i| i.expect_delim('/')).is_ok() {
             Rect::parse_with(context, input, LengthOrPercentage::parse_non_negative)?
         } else {
             widths.clone()
         };
 
         Ok(GenericBorderRadius {
             top_left: BorderCornerRadius::new(widths.0, heights.0),
             top_right: BorderCornerRadius::new(widths.1, heights.1),
@@ -231,15 +231,15 @@ impl BorderImageRepeat {
 }
 
 impl Parse for BorderImageRepeat {
     fn parse<'i, 't>(
         _context: &ParserContext,
         input: &mut Parser<'i, 't>,
     ) -> Result<Self, ParseError<'i>> {
         let horizontal = BorderImageRepeatKeyword::parse(input)?;
-        let vertical = input.try(BorderImageRepeatKeyword::parse).ok();
+        let vertical = input.r#try(BorderImageRepeatKeyword::parse).ok();
         Ok(BorderImageRepeat(
             horizontal,
             vertical.unwrap_or(horizontal),
         ))
     }
 }
--- a/servo/components/style/values/specified/box.rs
+++ b/servo/components/style/values/specified/box.rs
@@ -1,32 +1,34 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * 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/. */
 
 //! Specified types for box properties.
 
+use crate::custom_properties::Name as CustomPropertyName;
+use crate::parser::{Parse, ParserContext};
+use crate::properties::{
+    LonghandId, PropertyDeclarationId, PropertyFlags, PropertyId, ShorthandId,
+};
+use crate::values::generics::box_::AnimationIterationCount as GenericAnimationIterationCount;
+use crate::values::generics::box_::Perspective as GenericPerspective;
+use crate::values::generics::box_::VerticalAlign as GenericVerticalAlign;
+use crate::values::specified::length::{LengthOrPercentage, NonNegativeLength};
+use crate::values::specified::{AllowQuirks, Number};
+use crate::values::{CustomIdent, KeyframesName};
+use crate::Atom;
 use cssparser::Parser;
-use custom_properties::Name as CustomPropertyName;
-use parser::{Parse, ParserContext};
-use properties::{LonghandId, PropertyDeclarationId, PropertyFlags, PropertyId, ShorthandId};
 use selectors::parser::SelectorParseErrorKind;
 use std::fmt::{self, Write};
 use style_traits::{CssWriter, KeywordsCollectFn, ParseError};
 use style_traits::{SpecifiedValueInfo, StyleParseErrorKind, ToCss};
-use values::generics::box_::AnimationIterationCount as GenericAnimationIterationCount;
-use values::generics::box_::Perspective as GenericPerspective;
-use values::generics::box_::VerticalAlign as GenericVerticalAlign;
-use values::specified::length::{LengthOrPercentage, NonNegativeLength};
-use values::specified::{AllowQuirks, Number};
-use values::{CustomIdent, KeyframesName};
-use Atom;
 
 fn in_ua_or_chrome_sheet(context: &ParserContext) -> bool {
-    use stylesheets::Origin;
+    use crate::stylesheets::Origin;
     context.stylesheet_origin == Origin::UserAgent || context.chrome_rules_enabled()
 }
 
 #[cfg(feature = "gecko")]
 fn moz_display_values_enabled(context: &ParserContext) -> bool {
     use gecko_bindings::structs;
     in_ua_or_chrome_sheet(context) ||
         unsafe { structs::StaticPrefs_sVarCache_layout_css_xul_display_values_content_enabled }
@@ -303,17 +305,17 @@ impl Display {
 pub type VerticalAlign = GenericVerticalAlign<LengthOrPercentage>;
 
 impl Parse for VerticalAlign {
     fn parse<'i, 't>(
         context: &ParserContext,
         input: &mut Parser<'i, 't>,
     ) -> Result<Self, ParseError<'i>> {
         if let Ok(lop) =
-            input.try(|i| LengthOrPercentage::parse_quirky(context, i, AllowQuirks::Yes))
+            input.r#try(|i| LengthOrPercentage::parse_quirky(context, i, AllowQuirks::Yes))
         {
             return Ok(GenericVerticalAlign::Length(lop));
         }
 
         try_match_ident_ignore_ascii_case! { input,
             "baseline" => Ok(GenericVerticalAlign::Baseline),
             "sub" => Ok(GenericVerticalAlign::Sub),
             "super" => Ok(GenericVerticalAlign::Super),
@@ -334,17 +336,17 @@ impl Parse for VerticalAlign {
 pub type AnimationIterationCount = GenericAnimationIterationCount<Number>;
 
 impl Parse for AnimationIterationCount {
     fn parse<'i, 't>(
         context: &ParserContext,
         input: &mut ::cssparser::Parser<'i, 't>,
     ) -> Result<Self, ParseError<'i>> {
         if input
-            .try(|input| input.expect_ident_matching("infinite"))
+            .r#try(|input| input.expect_ident_matching("infinite"))
             .is_ok()
         {
             return Ok(GenericAnimationIterationCount::Infinite);
         }
 
         let number = Number::parse_non_negative(context, input)?;
         Ok(GenericAnimationIterationCount::Number(number))
     }
@@ -387,17 +389,17 @@ impl ToCss for AnimationName {
     }
 }
 
 impl Parse for AnimationName {
     fn parse<'i, 't>(
         context: &ParserContext,
         input: &mut Parser<'i, 't>,
     ) -> Result<Self, ParseError<'i>> {
-        if let Ok(name) = input.try(|input| KeyframesName::parse(context, input)) {
+        if let Ok(name) = input.r#try(|input| KeyframesName::parse(context, input)) {
             return Ok(AnimationName(Some(name)));
         }
 
         input.expect_ident_matching("none")?;
         Ok(AnimationName(None))
     }
 }
 
@@ -550,17 +552,17 @@ fn change_bits_for_maybe_property(ident:
 
 impl Parse for WillChange {
     /// auto | <animateable-feature>#
     fn parse<'i, 't>(
         context: &ParserContext,
         input: &mut Parser<'i, 't>,
     ) -> Result<WillChange, ParseError<'i>> {
         if input
-            .try(|input| input.expect_ident_matching("auto"))
+            .r#try(|input| input.expect_ident_matching("auto"))
             .is_ok()
         {
             return Ok(WillChange::Auto);
         }
 
         let mut bits = WillChangeBits::empty();
         let custom_idents = input.parse_comma_separated(|i| {
             let location = i.current_source_location();
@@ -639,24 +641,24 @@ impl Parse for TouchAction {
         _context: &ParserContext,
         input: &mut Parser<'i, 't>,
     ) -> Result<TouchAction, ParseError<'i>> {
         try_match_ident_ignore_ascii_case! { input,
             "auto" => Ok(TouchAction::TOUCH_ACTION_AUTO),
             "none" => Ok(TouchAction::TOUCH_ACTION_NONE),
             "manipulation" => Ok(TouchAction::TOUCH_ACTION_MANIPULATION),
             "pan-x" => {
-                if input.try(|i| i.expect_ident_matching("pan-y")).is_ok() {
+                if input.r#try(|i| i.expect_ident_matching("pan-y")).is_ok() {
                     Ok(TouchAction::TOUCH_ACTION_PAN_X | TouchAction::TOUCH_ACTION_PAN_Y)
                 } else {
                     Ok(TouchAction::TOUCH_ACTION_PAN_X)
                 }
             },
             "pan-y" => {
-                if input.try(|i| i.expect_ident_matching("pan-x")).is_ok() {
+                if input.r#try(|i| i.expect_ident_matching("pan-x")).is_ok() {
                     Ok(TouchAction::TOUCH_ACTION_PAN_X | TouchAction::TOUCH_ACTION_PAN_Y)
                 } else {
                     Ok(TouchAction::TOUCH_ACTION_PAN_Y)
                 }
             },
         }
     }
 }
@@ -750,17 +752,17 @@ impl ToCss for Contain {
 
 impl Parse for Contain {
     /// none | strict | content | [ size || layout || style || paint ]
     fn parse<'i, 't>(
         _context: &ParserContext,
         input: &mut Parser<'i, 't>,
     ) -> Result<Contain, ParseError<'i>> {
         let mut result = Contain::empty();
-        while let Ok(name) = input.try(|i| i.expect_ident_cloned()) {
+        while let Ok(name) = input.r#try(|i| i.expect_ident_cloned()) {
             let flag = match_ignore_ascii_case! { &name,
                 "size" => Some(Contain::SIZE),
                 "layout" => Some(Contain::LAYOUT),
                 "style" => Some(Contain::STYLE),
                 "paint" => Some(Contain::PAINT),
                 "strict" if result.is_empty() => return Ok(Contain::STRICT | Contain::STRICT_BITS),
                 "content" if result.is_empty() => return Ok(Contain::CONTENT | Contain::CONTENT_BITS),
                 "none" if result.is_empty() => return Ok(result),
@@ -787,17 +789,17 @@ impl Parse for Contain {
 /// A specified value for the `perspective` property.
 pub type Perspective = GenericPerspective<NonNegativeLength>;
 
 impl Parse for Perspective {
     fn parse<'i, 't>(
         context: &ParserContext,
         input: &mut Parser<'i, 't>,
     ) -> Result<Self, ParseError<'i>> {
-        if input.try(|i| i.expect_ident_matching("none")).is_ok() {
+        if input.r#try(|i| i.expect_ident_matching("none")).is_ok() {
             return Ok(GenericPerspective::None);
         }
         Ok(GenericPerspective::Length(NonNegativeLength::parse(
             context, input,
         )?))
     }
 }
 
@@ -816,17 +818,17 @@ pub enum TransitionProperty {
     Unsupported(CustomIdent),
 }
 
 impl ToCss for TransitionProperty {
     fn to_css<W>(&self, dest: &mut CssWriter<W>) -> fmt::Result
     where
         W: Write,
     {
-        use values::serialize_atom_name;
+        use crate::values::serialize_atom_name;
         match *self {
             TransitionProperty::Shorthand(ref s) => s.to_css(dest),
             TransitionProperty::Longhand(ref l) => l.to_css(dest),
             TransitionProperty::Custom(ref name) => {
                 dest.write_str("--")?;
                 serialize_atom_name(name, dest)
             },
             TransitionProperty::Unsupported(ref i) => i.to_css(dest),
--- a/servo/components/style/values/specified/calc.rs
+++ b/servo/components/style/values/specified/calc.rs
@@ -1,26 +1,26 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * 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/. */
 
 //! [Calc expressions][calc].
 //!
 //! [calc]: https://drafts.csswg.org/css-values/#calc-notation
 
+use crate::parser::ParserContext;
+use crate::values::computed;
+use crate::values::specified::length::ViewportPercentageLength;
+use crate::values::specified::length::{AbsoluteLength, FontRelativeLength, NoCalcLength};
+use crate::values::specified::{Angle, Time};
+use crate::values::{CSSFloat, CSSInteger};
 use cssparser::{AngleOrNumber, NumberOrPercentage, Parser, Token};
-use parser::ParserContext;
 use std::fmt::{self, Write};
 use style_traits::values::specified::AllowedNumericType;
 use style_traits::{CssWriter, ParseError, SpecifiedValueInfo, StyleParseErrorKind, ToCss};
-use values::computed;
-use values::specified::length::ViewportPercentageLength;
-use values::specified::length::{AbsoluteLength, FontRelativeLength, NoCalcLength};
-use values::specified::{Angle, Time};
-use values::{CSSFloat, CSSInteger};
 
 /// A node inside a `Calc` expression's AST.
 #[derive(Clone, Debug)]
 pub enum CalcNode {
     /// `<length>`
     Length(NoCalcLength),
     /// `<angle>`
     Angle(Angle),
--- a/servo/components/style/values/specified/color.rs
+++ b/servo/components/style/values/specified/color.rs
@@ -1,30 +1,30 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * 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/. */
 
 //! Specified color values.
 
 use super::AllowQuirks;
+use crate::parser::{Parse, ParserContext};
+use crate::values::computed::{Color as ComputedColor, Context, ToComputedValue};
+use crate::values::generics::color::Color as GenericColor;
+use crate::values::specified::calc::CalcNode;
 use cssparser::{AngleOrNumber, Color as CSSParserColor, Parser, Token, RGBA};
 use cssparser::{BasicParseErrorKind, NumberOrPercentage, ParseErrorKind};
 #[cfg(feature = "gecko")]
 use gecko_bindings::structs::nscolor;
 use itoa;
-use parser::{Parse, ParserContext};
 #[cfg(feature = "gecko")]
 use properties::longhands::system_colors::SystemColor;
 use std::fmt::{self, Write};
 use std::io::Write as IoWrite;
 use style_traits::{CssType, CssWriter, KeywordsCollectFn, ParseError, StyleParseErrorKind};
 use style_traits::{SpecifiedValueInfo, ToCss, ValueParseErrorKind};
-use values::computed::{Color as ComputedColor, Context, ToComputedValue};
-use values::generics::color::Color as GenericColor;
-use values::specified::calc::CalcNode;
 
 /// Specified color value
 #[derive(Clone, Debug, MallocSizeOf, PartialEq)]
 pub enum Color {
     /// The 'currentColor' keyword
     CurrentColor,
     /// A specific RGBA color
     Numeric {
@@ -68,17 +68,17 @@ impl From<RGBA> for Color {
 struct ColorComponentParser<'a, 'b: 'a>(&'a ParserContext<'b>);
 impl<'a, 'b: 'a, 'i: 'a> ::cssparser::ColorComponentParser<'i> for ColorComponentParser<'a, 'b> {
     type Error = StyleParseErrorKind<'i>;
 
     fn parse_angle_or_number<'t>(
         &self,
         input: &mut Parser<'i, 't>,
     ) -> Result<AngleOrNumber, ParseError<'i>> {
-        use values::specified::Angle;
+        use crate::values::specified::Angle;
 
         let location = input.current_source_location();
         let token = input.next()?.clone();
         match token {
             Token::Dimension {
                 value, ref unit, ..
             } => {
                 let angle = Angle::parse_dimension(value, unit, /* from_calc = */ false);
@@ -94,23 +94,23 @@ impl<'a, 'b: 'a, 'i: 'a> ::cssparser::Co
             Token::Function(ref name) if name.eq_ignore_ascii_case("calc") => {
                 input.parse_nested_block(|i| CalcNode::parse_angle_or_number(self.0, i))
             },
             t => return Err(location.new_unexpected_token_error(t)),
         }
     }
 
     fn parse_percentage<'t>(&self, input: &mut Parser<'i, 't>) -> Result<f32, ParseError<'i>> {
-        use values::specified::Percentage;
+        use crate::values::specified::Percentage;
 
         Ok(Percentage::parse(self.0, input)?.get())
     }
 
     fn parse_number<'t>(&self, input: &mut Parser<'i, 't>) -> Result<f32, ParseError<'i>> {
-        use values::specified::Number;
+        use crate::values::specified::Number;
 
         Ok(Number::parse(self.0, input)?.get())
     }
 
     fn parse_number_or_percentage<'t>(
         &self,
         input: &mut Parser<'i, 't>,
     ) -> Result<NumberOrPercentage, ParseError<'i>> {
@@ -137,17 +137,17 @@ impl Parse for Color {
         // Currently we only store authored value for color keywords,
         // because all browsers serialize those values as keywords for
         // specified value.
         let start = input.state();
         let authored = input.expect_ident_cloned().ok();
         input.reset(&start);
 
         let compontent_parser = ColorComponentParser(&*context);
-        match input.try(|i| CSSParserColor::parse_with(&compontent_parser, i)) {
+        match input.r#try(|i| CSSParserColor::parse_with(&compontent_parser, i)) {
             Ok(value) => Ok(match value {
                 CSSParserColor::CurrentColor => Color::CurrentColor,
                 CSSParserColor::RGBA(rgba) => Color::Numeric {
                     parsed: rgba,
                     authored: authored.map(|s| s.to_ascii_lowercase().into_boxed_str()),
                 },
             }),
             Err(e) => {
@@ -240,17 +240,17 @@ impl Color {
     /// Parse a color, with quirks.
     ///
     /// <https://quirks.spec.whatwg.org/#the-hashless-hex-color-quirk>
     pub fn parse_quirky<'i, 't>(
         context: &ParserContext,
         input: &mut Parser<'i, 't>,
         allow_quirks: AllowQuirks,
     ) -> Result<Self, ParseError<'i>> {
-        input.try(|i| Self::parse(context, i)).or_else(|e| {
+        input.r#try(|i| Self::parse(context, i)).or_else(|e| {
             if !allow_quirks.allowed(context.quirks_mode) {
                 return Err(e);
             }
             Color::parse_quirky_color(input)
                 .map(Color::rgba)
                 .map_err(|_| e)
         })
     }
--- a/servo/components/style/values/specified/column.rs
+++ b/servo/components/style/values/specified/column.rs
@@ -1,28 +1,28 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * 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/. */
 
 //! Specified types for the column properties.
 
+use crate::parser::{Parse, ParserContext};
+use crate::values::generics::column::ColumnCount as GenericColumnCount;
+use crate::values::specified::PositiveInteger;
 use cssparser::Parser;
-use parser::{Parse, ParserContext};
 use style_traits::ParseError;
-use values::generics::column::ColumnCount as GenericColumnCount;
-use values::specified::PositiveInteger;
 
 /// A specified type for `column-count` values.
 pub type ColumnCount = GenericColumnCount<PositiveInteger>;
 
 impl Parse for ColumnCount {
     fn parse<'i, 't>(
         context: &ParserContext,
         input: &mut Parser<'i, 't>,
     ) -> Result<Self, ParseError<'i>> {
-        if input.try(|i| i.expect_ident_matching("auto")).is_ok() {
+        if input.r#try(|i| i.expect_ident_matching("auto")).is_ok() {
             return Ok(GenericColumnCount::Auto);
         }
         Ok(GenericColumnCount::Integer(PositiveInteger::parse(
             context, input,
         )?))
     }
 }
--- a/servo/components/style/values/specified/counters.rs
+++ b/servo/components/style/values/specified/counters.rs
@@ -1,31 +1,31 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * 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/. */
 
 //! Specified types for counter properties.
 
 #[cfg(feature = "servo")]
-use computed_values::list_style_type::T as ListStyleType;
+use crate::computed_values::list_style_type::T as ListStyleType;
+use crate::parser::{Parse, ParserContext};
+use crate::values::generics::counters as generics;
+use crate::values::generics::counters::CounterIncrement as GenericCounterIncrement;
+use crate::values::generics::counters::CounterPair;
+use crate::values::generics::counters::CounterReset as GenericCounterReset;
+use crate::values::specified::url::SpecifiedImageUrl;
+use crate::values::specified::Integer;
+use crate::values::CustomIdent;
 use cssparser::{Parser, Token};
-use parser::{Parse, ParserContext};
 use selectors::parser::SelectorParseErrorKind;
 use style_traits::{ParseError, StyleParseErrorKind};
-use values::generics::counters as generics;
-use values::generics::counters::CounterIncrement as GenericCounterIncrement;
-use values::generics::counters::CounterPair;
-use values::generics::counters::CounterReset as GenericCounterReset;
 #[cfg(feature = "gecko")]
 use values::generics::CounterStyleOrNone;
-use values::specified::url::SpecifiedImageUrl;
 #[cfg(feature = "gecko")]
 use values::specified::Attr;
-use values::specified::Integer;
-use values::CustomIdent;
 
 /// A specified value for the `counter-increment` property.
 pub type CounterIncrement = GenericCounterIncrement<Integer>;
 
 impl Parse for CounterIncrement {
     fn parse<'i, 't>(
         context: &ParserContext,
         input: &mut Parser<'i, 't>,
@@ -47,33 +47,33 @@ impl Parse for CounterReset {
 }
 
 fn parse_counters<'i, 't>(
     context: &ParserContext,
     input: &mut Parser<'i, 't>,
     default_value: i32,
 ) -> Result<Vec<CounterPair<Integer>>, ParseError<'i>> {
     if input
-        .try(|input| input.expect_ident_matching("none"))
+        .r#try(|input| input.expect_ident_matching("none"))
         .is_ok()
     {
         return Ok(vec![]);
     }
 
     let mut counters = Vec::new();
     loop {
         let location = input.current_source_location();
         let name = match input.next() {
             Ok(&Token::Ident(ref ident)) => CustomIdent::from_ident(location, ident, &["none"])?,
             Ok(t) => return Err(location.new_unexpected_token_error(t.clone())),
             Err(_) => break,
         };
 
         let value = input
-            .try(|input| Integer::parse(context, input))
+            .r#try(|input| Integer::parse(context, input))
             .unwrap_or(Integer::new(default_value));
         counters.push(CounterPair { name, value });
     }
 
     if !counters.is_empty() {
         Ok(counters)
     } else {
         Err(input.new_custom_error(StyleParseErrorKind::UnspecifiedError))
@@ -85,69 +85,69 @@ pub type Content = generics::Content<Spe
 
 /// The specified value for a content item in the `content` property.
 pub type ContentItem = generics::ContentItem<SpecifiedImageUrl>;
 
 impl Content {
     #[cfg(feature = "servo")]
     fn parse_counter_style(_: &ParserContext, input: &mut Parser) -> ListStyleType {
         input
-            .try(|input| {
+            .r#try(|input| {
                 input.expect_comma()?;
                 ListStyleType::parse(input)
             })
             .unwrap_or(ListStyleType::Decimal)
     }
 
     #[cfg(feature = "gecko")]
     fn parse_counter_style(context: &ParserContext, input: &mut Parser) -> CounterStyleOrNone {
         input
-            .try(|input| {
+            .r#try(|input| {
                 input.expect_comma()?;
                 CounterStyleOrNone::parse(context, input)
             })
             .unwrap_or(CounterStyleOrNone::decimal())
     }
 }
 
 impl Parse for Content {
     // normal | none | [ <string> | <counter> | open-quote | close-quote | no-open-quote |
     // no-close-quote ]+
     // TODO: <uri>, attr(<identifier>)
     fn parse<'i, 't>(
         context: &ParserContext,
         input: &mut Parser<'i, 't>,
     ) -> Result<Self, ParseError<'i>> {
         if input
-            .try(|input| input.expect_ident_matching("normal"))
+            .r#try(|input| input.expect_ident_matching("normal"))
             .is_ok()
         {
             return Ok(generics::Content::Normal);
         }
         if input
-            .try(|input| input.expect_ident_matching("none"))
+            .r#try(|input| input.expect_ident_matching("none"))
             .is_ok()
         {
             return Ok(generics::Content::None);
         }
         #[cfg(feature = "gecko")]
         {
             if input
-                .try(|input| input.expect_ident_matching("-moz-alt-content"))
+                .r#try(|input| input.expect_ident_matching("-moz-alt-content"))
                 .is_ok()
             {
                 return Ok(generics::Content::MozAltContent);
             }
         }
 
         let mut content = vec![];
         loop {
             #[cfg(feature = "gecko")]
             {
-                if let Ok(url) = input.try(|i| SpecifiedImageUrl::parse(context, i)) {
+                if let Ok(url) = input.r#try(|i| SpecifiedImageUrl::parse(context, i)) {
                     content.push(generics::ContentItem::Url(url));
                     continue;
                 }
             }
             // FIXME: remove clone() when lifetimes are non-lexical
             match input.next().map(|t| t.clone()) {
                 Ok(Token::QuotedString(ref value)) => {
                     content.push(generics::ContentItem::String(
--- a/servo/components/style/values/specified/easing.rs
+++ b/servo/components/style/values/specified/easing.rs
@@ -1,35 +1,35 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * 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/. */
 
 //! Specified types for CSS Easing functions.
 
+use crate::parser::{Parse, ParserContext};
+use crate::values::computed::easing::TimingFunction as ComputedTimingFunction;
+use crate::values::generics::easing::TimingFunction as GenericTimingFunction;
+use crate::values::generics::easing::{StepPosition, TimingKeyword};
+use crate::values::specified::{Integer, Number};
 use cssparser::Parser;
-use parser::{Parse, ParserContext};
 use selectors::parser::SelectorParseErrorKind;
 use style_traits::{ParseError, StyleParseErrorKind};
-use values::computed::easing::TimingFunction as ComputedTimingFunction;
-use values::generics::easing::TimingFunction as GenericTimingFunction;
-use values::generics::easing::{StepPosition, TimingKeyword};
-use values::specified::{Integer, Number};
 
 /// A specified timing function.
 pub type TimingFunction = GenericTimingFunction<Integer, Number>;
 
 impl Parse for TimingFunction {
     fn parse<'i, 't>(
         context: &ParserContext,
         input: &mut Parser<'i, 't>,
     ) -> Result<Self, ParseError<'i>> {
-        if let Ok(keyword) = input.try(TimingKeyword::parse) {
+        if let Ok(keyword) = input.r#try(TimingKeyword::parse) {
             return Ok(GenericTimingFunction::Keyword(keyword));
         }
-        if let Ok(ident) = input.try(|i| i.expect_ident_cloned()) {
+        if let Ok(ident) = input.r#try(|i| i.expect_ident_cloned()) {
             let position = match_ignore_ascii_case! { &ident,
                 "step-start" => StepPosition::Start,
                 "step-end" => StepPosition::End,
                 _ => {
                     return Err(input.new_custom_error(
                         SelectorParseErrorKind::UnexpectedIdent(ident.clone())
                     ));
                 },
@@ -52,17 +52,17 @@ impl Parse for TimingFunction {
                     if x1.get() < 0.0 || x1.get() > 1.0 || x2.get() < 0.0 || x2.get() > 1.0 {
                         return Err(i.new_custom_error(StyleParseErrorKind::UnspecifiedError));
                     }
 
                     Ok(GenericTimingFunction::CubicBezier { x1, y1, x2, y2 })
                 },
                 "steps" => {
                     let steps = Integer::parse_positive(context, i)?;
-                    let position = i.try(|i| {
+                    let position = i.r#try(|i| {
                         i.expect_comma()?;
                         StepPosition::parse(context, i)
                     }).unwrap_or(StepPosition::End);
 
                     // jump-none accepts a positive integer greater than 1.
                     // FIXME(emilio): The spec asks us to avoid rejecting it at parse
                     // time except until computed value time.
                     //
--- a/servo/components/style/values/specified/effects.rs
+++ b/servo/components/style/values/specified/effects.rs
@@ -1,31 +1,33 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * 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/. */
 
 //! Specified types for CSS values related to effects.
 
+use crate::parser::{Parse, ParserContext};
+use crate::values::computed::effects::BoxShadow as ComputedBoxShadow;
+use crate::values::computed::effects::SimpleShadow as ComputedSimpleShadow;
+use crate::values::computed::{
+    Context, NonNegativeNumber as ComputedNonNegativeNumber, ToComputedValue,
+};
+use crate::values::generics::effects::BoxShadow as GenericBoxShadow;
+use crate::values::generics::effects::Filter as GenericFilter;
+use crate::values::generics::effects::SimpleShadow as GenericSimpleShadow;
+use crate::values::generics::NonNegative;
+use crate::values::specified::color::Color;
+use crate::values::specified::length::{Length, NonNegativeLength};
+use crate::values::specified::{Angle, NumberOrPercentage};
+#[cfg(not(feature = "gecko"))]
+use crate::values::Impossible;
 use cssparser::{self, BasicParseErrorKind, Parser, Token};
-use parser::{Parse, ParserContext};
 use style_traits::{ParseError, StyleParseErrorKind, ValueParseErrorKind};
-use values::computed::effects::BoxShadow as ComputedBoxShadow;
-use values::computed::effects::SimpleShadow as ComputedSimpleShadow;
-use values::computed::{Context, NonNegativeNumber as ComputedNonNegativeNumber, ToComputedValue};
-use values::generics::effects::BoxShadow as GenericBoxShadow;
-use values::generics::effects::Filter as GenericFilter;
-use values::generics::effects::SimpleShadow as GenericSimpleShadow;
-use values::generics::NonNegative;
-use values::specified::color::Color;
-use values::specified::length::{Length, NonNegativeLength};
 #[cfg(feature = "gecko")]
 use values::specified::url::SpecifiedUrl;
-use values::specified::{Angle, NumberOrPercentage};
-#[cfg(not(feature = "gecko"))]
-use values::Impossible;
 
 /// A specified value for a single shadow of the `box-shadow` property.
 pub type BoxShadow =
     GenericBoxShadow<Option<Color>, Length, Option<NonNegativeLength>, Option<Length>>;
 
 /// A specified value for a single `filter`.
 #[cfg(feature = "gecko")]
 pub type Filter = GenericFilter<Angle, Factor, NonNegativeLength, SimpleShadow, SpecifiedUrl>;
@@ -72,17 +74,17 @@ impl Parse for Factor {
     }
 }
 
 impl ToComputedValue for Factor {
     type ComputedValue = ComputedNonNegativeNumber;
 
     #[inline]
     fn to_computed_value(&self, context: &Context) -> Self::ComputedValue {
-        use values::computed::NumberOrPercentage;
+        use crate::values::computed::NumberOrPercentage;
         match self.0.to_computed_value(context) {
             NumberOrPercentage::Number(n) => n.into(),
             NumberOrPercentage::Percentage(p) => p.0.into(),
         }
     }
 
     #[inline]
     fn from_computed_value(computed: &Self::ComputedValue) -> Self {
@@ -102,45 +104,45 @@ impl Parse for BoxShadow {
     ) -> Result<Self, ParseError<'i>> {
         let mut lengths = None;
         let mut color = None;
         let mut inset = false;
 
         loop {
             if !inset {
                 if input
-                    .try(|input| input.expect_ident_matching("inset"))
+                    .r#try(|input| input.expect_ident_matching("inset"))
                     .is_ok()
                 {
                     inset = true;
                     continue;
                 }
             }
             if lengths.is_none() {
-                let value = input.try::<_, _, ParseError>(|i| {
+                let value = input.r#try::<_, _, ParseError>(|i| {
                     let horizontal = Length::parse(context, i)?;
                     let vertical = Length::parse(context, i)?;
                     let (blur, spread) = match i
-                        .try::<_, _, ParseError>(|i| Length::parse_non_negative(context, i))
+                        .r#try::<_, _, ParseError>(|i| Length::parse_non_negative(context, i))
                     {
                         Ok(blur) => {
-                            let spread = i.try(|i| Length::parse(context, i)).ok();
+                            let spread = i.r#try(|i| Length::parse(context, i)).ok();
                             (Some(blur.into()), spread)
                         },
                         Err(_) => (None, None),
                     };
                     Ok((horizontal, vertical, blur, spread))
                 });
                 if let Ok(value) = value {
                     lengths = Some(value);
                     continue;
                 }
             }
             if color.is_none() {
-                if let Ok(value) = input.try(|i| Color::parse(context, i)) {
+                if let Ok(value) = input.r#try(|i| Color::parse(context, i)) {
                     color = Some(value);
                     continue;
                 }
             }
             break;
         }
 
         let lengths =
@@ -187,17 +189,17 @@ impl ToComputedValue for BoxShadow {
 impl Parse for Filter {
     #[inline]
     fn parse<'i, 't>(
         context: &ParserContext,
         input: &mut Parser<'i, 't>,
     ) -> Result<Self, ParseError<'i>> {
         #[cfg(feature = "gecko")]
         {
-            if let Ok(url) = input.try(|i| SpecifiedUrl::parse(context, i)) {
+            if let Ok(url) = input.r#try(|i| SpecifiedUrl::parse(context, i)) {
                 return Ok(GenericFilter::Url(url));
             }
         }
         let location = input.current_source_location();
         let function = match input.expect_function() {
             Ok(f) => f.clone(),
             Err(cssparser::BasicParseError {
                 kind: BasicParseErrorKind::UnexpectedToken(t),
@@ -246,22 +248,22 @@ impl Parse for Filter {
 }
 
 impl Parse for SimpleShadow {
     #[inline]
     fn parse<'i, 't>(
         context: &ParserContext,
         input: &mut Parser<'i, 't>,
     ) -> Result<Self, ParseError<'i>> {
-        let color = input.try(|i| Color::parse(context, i)).ok();
+        let color = input.r#try(|i| Color::parse(context, i)).ok();
         let horizontal = Length::parse(context, input)?;
         let vertical = Length::parse(context, input)?;
-        let blur = input.try(|i| Length::parse_non_negative(context, i)).ok();
+        let blur = input.r#try(|i| Length::parse_non_negative(context, i)).ok();
         let blur = blur.map(NonNegative::<Length>);
-        let color = color.or_else(|| input.try(|i| Color::parse(context, i)).ok());
+        let color = color.or_else(|| input.r#try(|i| Color::parse(context, i)).ok());
 
         Ok(SimpleShadow {
             color,
             horizontal,
             vertical,
             blur,
         })
     }
--- a/servo/components/style/values/specified/flex.rs
+++ b/servo/components/style/values/specified/flex.rs
@@ -1,36 +1,36 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * 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/. */
 
 //! Specified types for CSS values related to flexbox.
 
+use crate::parser::{Parse, ParserContext};
+use crate::values::generics::flex::FlexBasis as GenericFlexBasis;
 use cssparser::Parser;
-use parser::{Parse, ParserContext};
 use style_traits::ParseError;
-use values::generics::flex::FlexBasis as GenericFlexBasis;
 
 /// The `width` value type.
 #[cfg(feature = "servo")]
-pub type Width = ::values::specified::NonNegativeLengthOrPercentageOrAuto;
+pub type Width = crate::values::specified::NonNegativeLengthOrPercentageOrAuto;
 
 /// The `width` value type.
 #[cfg(feature = "gecko")]
 pub type Width = ::values::specified::MozLength;
 
 /// A specified value for the `flex-basis` property.
 pub type FlexBasis = GenericFlexBasis<Width>;
 
 impl Parse for FlexBasis {
     fn parse<'i, 't>(
         context: &ParserContext,
         input: &mut Parser<'i, 't>,
     ) -> Result<Self, ParseError<'i>> {
-        if let Ok(width) = input.try(|i| Width::parse(context, i)) {
+        if let Ok(width) = input.r#try(|i| Width::parse(context, i)) {
             return Ok(GenericFlexBasis::Width(width));
         }
         try_match_ident_ignore_ascii_case! { input,
             "content" => Ok(GenericFlexBasis::Content),
         }
     }
 }
 
--- a/servo/components/style/values/specified/font.rs
+++ b/servo/components/style/values/specified/font.rs
@@ -1,38 +1,41 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * 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/. */
 
 //! Specified values for font properties
 
 use app_units::Au;
 use byteorder::{BigEndian, ByteOrder};
+use crate::parser::{Parse, ParserContext};
+use crate::properties::longhands::system_font::SystemFont;
+use crate::values::computed::font::{FamilyName, FontFamilyList, FontStyleAngle, SingleFontFamily};
+use crate::values::computed::{
+    font as computed, Context, Length, NonNegativeLength, ToComputedValue,
+};
+use crate::values::computed::{Angle as ComputedAngle, Percentage as ComputedPercentage};
+use crate::values::generics::font::{self as generics, FeatureTagValue, FontSettings, FontTag};
+use crate::values::generics::font::{KeywordSize, VariationValue};
+use crate::values::generics::NonNegative;
+use crate::values::specified::length::{FontBaseSize, AU_PER_PT, AU_PER_PX};
+use crate::values::specified::{AllowQuirks, Angle, Integer, LengthOrPercentage};
+use crate::values::specified::{NoCalcLength, Number, Percentage};
+use crate::values::CustomIdent;
+use crate::Atom;
 use cssparser::{Parser, Token};
 #[cfg(feature = "gecko")]
 use gecko_bindings::bindings;
 #[cfg(feature = "gecko")]
 use malloc_size_of::{MallocSizeOf, MallocSizeOfOps};
-use parser::{Parse, ParserContext};
-use properties::longhands::system_font::SystemFont;
 use std::fmt::{self, Write};
 use style_traits::values::SequenceWriter;
 use style_traits::{CssWriter, KeywordsCollectFn, ParseError};
 use style_traits::{SpecifiedValueInfo, StyleParseErrorKind, ToCss};
-use values::computed::font::{FamilyName, FontFamilyList, FontStyleAngle, SingleFontFamily};
-use values::computed::{font as computed, Context, Length, NonNegativeLength, ToComputedValue};
-use values::computed::{Angle as ComputedAngle, Percentage as ComputedPercentage};
-use values::generics::font::{self as generics, FeatureTagValue, FontSettings, FontTag};
-use values::generics::font::{KeywordSize, VariationValue};
-use values::generics::NonNegative;
-use values::specified::length::{FontBaseSize, AU_PER_PT, AU_PER_PX};
-use values::specified::{AllowQuirks, Angle, Integer, LengthOrPercentage};
-use values::specified::{NoCalcLength, Number, Percentage};
-use values::CustomIdent;
-use Atom;
+
 
 // FIXME(emilio): The system font code is copy-pasta, and should be cleaned up.
 macro_rules! system_font_methods {
     ($ty:ident, $field:ident) => {
         system_font_methods!($ty);
 
         fn compute_system(&self, _context: &Context) -> <$ty as ToComputedValue>::ComputedValue {
             debug_assert!(matches!(*self, $ty::System(..)));
@@ -110,17 +113,17 @@ impl FontWeight {
     }
 }
 
 impl Parse for FontWeight {
     fn parse<'i, 't>(
         context: &ParserContext,
         input: &mut Parser<'i, 't>,
     ) -> Result<FontWeight, ParseError<'i>> {
-        if let Ok(absolute) = input.try(|input| AbsoluteFontWeight::parse(context, input)) {
+        if let Ok(absolute) = input.r#try(|input| AbsoluteFontWeight::parse(context, input)) {
             return Ok(FontWeight::Absolute(absolute));
         }
 
         Ok(try_match_ident_ignore_ascii_case! { input,
             "bolder" => FontWeight::Bolder,
             "lighter" => FontWeight::Lighter,
         })
     }
@@ -183,17 +186,17 @@ impl AbsoluteFontWeight {
     }
 }
 
 impl Parse for AbsoluteFontWeight {
     fn parse<'i, 't>(
         context: &ParserContext,
         input: &mut Parser<'i, 't>,
     ) -> Result<Self, ParseError<'i>> {
-        if let Ok(number) = input.try(|input| Number::parse(context, input)) {
+        if let Ok(number) = input.r#try(|input| Number::parse(context, input)) {
             // We could add another AllowedNumericType value, but it doesn't
             // seem worth it just for a single property with such a weird range,
             // so we do the clamping here manually.
             if !number.was_calc() &&
                 (number.get() < MIN_FONT_WEIGHT || number.get() > MAX_FONT_WEIGHT)
             {
                 return Err(input.new_custom_error(StyleParseErrorKind::UnspecifiedError));
             }
@@ -235,17 +238,17 @@ impl Parse for SpecifiedFontStyle {
     fn parse<'i, 't>(
         context: &ParserContext,
         input: &mut Parser<'i, 't>,
     ) -> Result<Self, ParseError<'i>> {
         Ok(try_match_ident_ignore_ascii_case! { input,
             "normal" => generics::FontStyle::Normal,
             "italic" => generics::FontStyle::Italic,
             "oblique" => {
-                let angle = input.try(|input| Self::parse_angle(context, input))
+                let angle = input.r#try(|input| Self::parse_angle(context, input))
                     .unwrap_or_else(|_| Self::default_angle());
 
                 generics::FontStyle::Oblique(angle)
             }
         })
     }
 }
 
@@ -474,17 +477,18 @@ impl Parse for FontStretch {
     fn parse<'i, 't>(
         context: &ParserContext,
         input: &mut Parser<'i, 't>,
     ) -> Result<Self, ParseError<'i>> {
         // From https://drafts.csswg.org/css-fonts-4/#font-stretch-prop:
         //
         //    Values less than 0% are not allowed and are treated as parse
         //    errors.
-        if let Ok(percentage) = input.try(|input| Percentage::parse_non_negative(context, input)) {
+        if let Ok(percentage) = input.r#try(|input| Percentage::parse_non_negative(context, input))
+        {
             return Ok(FontStretch::Stretch(percentage));
         }
 
         Ok(FontStretch::Keyword(FontStretchKeyword::parse(input)?))
     }
 }
 
 impl ToComputedValue for FontStretch {
@@ -674,17 +678,17 @@ impl ToComputedValue for FontSizeAdjust 
 
 impl Parse for FontSizeAdjust {
     /// none | <number>
     fn parse<'i, 't>(
         context: &ParserContext,
         input: &mut Parser<'i, 't>,
     ) -> Result<FontSizeAdjust, ParseError<'i>> {
         if input
-            .try(|input| input.expect_ident_matching("none"))
+            .r#try(|input| input.expect_ident_matching("none"))
             .is_ok()
         {
             return Ok(FontSizeAdjust::None);
         }
 
         Ok(FontSizeAdjust::Number(Number::parse_non_negative(
             context, input,
         )?))
@@ -845,17 +849,17 @@ impl FontSize {
     }
 
     /// Compute it against a given base font size
     pub fn to_computed_value_against(
         &self,
         context: &Context,
         base_size: FontBaseSize,
     ) -> computed::FontSize {
-        use values::specified::length::FontRelativeLength;
+        use crate::values::specified::length::FontRelativeLength;
 
         let compose_keyword = |factor| {
             context
                 .style()
                 .get_parent_font()
                 .clone_font_size()
                 .keyword_info
                 .map(|i| i.compose(factor, Au(0).into()))
@@ -982,22 +986,22 @@ impl FontSize {
 
     /// Parses a font-size, with quirks.
     pub fn parse_quirky<'i, 't>(
         context: &ParserContext,
         input: &mut Parser<'i, 't>,
         allow_quirks: AllowQuirks,
     ) -> Result<FontSize, ParseError<'i>> {
         if let Ok(lop) =
-            input.try(|i| LengthOrPercentage::parse_non_negative_quirky(context, i, allow_quirks))
+            input.r#try(|i| LengthOrPercentage::parse_non_negative_quirky(context, i, allow_quirks))
         {
             return Ok(FontSize::Length(lop));
         }
 
-        if let Ok(kw) = input.try(KeywordSize::parse) {
+        if let Ok(kw) = input.r#try(KeywordSize::parse) {
             return Ok(FontSize::Keyword(kw.into()));
         }
 
         try_match_ident_ignore_ascii_case! { input,
             "smaller" => Ok(FontSize::Smaller),
             "larger" => Ok(FontSize::Larger),
         }
     }
@@ -1169,34 +1173,34 @@ impl Parse for FontVariantAlternates {
     ///    ornaments(<feature-value-name>)           ||
     ///    annotation(<feature-value-name>) ]
     fn parse<'i, 't>(
         _: &ParserContext,
         input: &mut Parser<'i, 't>,
     ) -> Result<FontVariantAlternates, ParseError<'i>> {
         let mut alternates = Vec::new();
         if input
-            .try(|input| input.expect_ident_matching("normal"))
+            .r#try(|input| input.expect_ident_matching("normal"))
             .is_ok()
         {
             return Ok(FontVariantAlternates::Value(VariantAlternatesList(
                 alternates.into_boxed_slice(),
             )));
         }
 
         let mut parsed_alternates = VariantAlternatesParsingFlags::empty();
         macro_rules! check_if_parsed(
             ($input:expr, $flag:path) => (
                 if parsed_alternates.contains($flag) {
                     return Err($input.new_custom_error(StyleParseErrorKind::UnspecifiedError))
                 }
                 parsed_alternates |= $flag;
             )
         );
-        while let Ok(_) = input.try(|input| {
+        while let Ok(_) = input.r#try(|input| {
             // FIXME: remove clone() when lifetimes are non-lexical
             match input.next()?.clone() {
                 Token::Ident(ref value) if value.eq_ignore_ascii_case("historical-forms") => {
                     check_if_parsed!(input, VariantAlternatesParsingFlags::HISTORICAL_FORMS);
                     alternates.push(VariantAlternates::HistoricalForms);
                     Ok(())
                 },
                 Token::Function(ref name) => input.parse_nested_block(|i| {
@@ -1401,23 +1405,23 @@ impl Parse for FontVariantEastAsian {
     /// <east-asian-width-values>   = [ full-width | proportional-width ]
     fn parse<'i, 't>(
         _context: &ParserContext,
         input: &mut Parser<'i, 't>,
     ) -> Result<FontVariantEastAsian, ParseError<'i>> {
         let mut result = VariantEastAsian::empty();
 
         if input
-            .try(|input| input.expect_ident_matching("normal"))
+            .r#try(|input| input.expect_ident_matching("normal"))
             .is_ok()
         {
             return Ok(FontVariantEastAsian::Value(result));
         }
 
-        while let Ok(flag) = input.try(|input| {
+        while let Ok(flag) = input.r#try(|input| {
             Ok(
                 match_ignore_ascii_case! { &input.expect_ident().map_err(|_| ())?,
                     "jis78" =>
                         exclusive_value!((result, VariantEastAsian::JIS78 | VariantEastAsian::JIS83 |
                                                   VariantEastAsian::JIS90 | VariantEastAsian::JIS04 |
                                                   VariantEastAsian::SIMPLIFIED | VariantEastAsian::TRADITIONAL
                                         ) => VariantEastAsian::JIS78),
                     "jis83" =>
@@ -1625,29 +1629,29 @@ impl Parse for FontVariantLigatures {
     /// <contextual-alt-values>    = [ contextual | no-contextual ]
     fn parse<'i, 't>(
         _context: &ParserContext,
         input: &mut Parser<'i, 't>,
     ) -> Result<FontVariantLigatures, ParseError<'i>> {
         let mut result = VariantLigatures::empty();
 
         if input
-            .try(|input| input.expect_ident_matching("normal"))
+            .r#try(|input| input.expect_ident_matching("normal"))
             .is_ok()
         {
             return Ok(FontVariantLigatures::Value(result));
         }
         if input
-            .try(|input| input.expect_ident_matching("none"))
+            .r#try(|input| input.expect_ident_matching("none"))
             .is_ok()
         {
             return Ok(FontVariantLigatures::Value(VariantLigatures::NONE));
         }
 
-        while let Ok(flag) = input.try(|input| {
+        while let Ok(flag) = input.r#try(|input| {
             Ok(
                 match_ignore_ascii_case! { &input.expect_ident().map_err(|_| ())?,
                     "common-ligatures" =>
                         exclusive_value!((result, VariantLigatures::COMMON_LIGATURES |
                                                   VariantLigatures::NO_COMMON_LIGATURES
                                         ) => VariantLigatures::COMMON_LIGATURES),
                     "no-common-ligatures" =>
                         exclusive_value!((result, VariantLigatures::COMMON_LIGATURES |
@@ -1834,23 +1838,23 @@ impl Parse for FontVariantNumeric {
     /// <numeric-fraction-values> = [ diagonal-fractions | stacked-fractions ]
     fn parse<'i, 't>(
         _context: &ParserContext,
         input: &mut Parser<'i, 't>,
     ) -> Result<FontVariantNumeric, ParseError<'i>> {
         let mut result = VariantNumeric::empty();
 
         if input
-            .try(|input| input.expect_ident_matching("normal"))
+            .r#try(|input| input.expect_ident_matching("normal"))
             .is_ok()
         {
             return Ok(FontVariantNumeric::Value(result));
         }
 
-        while let Ok(flag) = input.try(|input| {
+        while let Ok(flag) = input.r#try(|input| {
             Ok(
                 match_ignore_ascii_case! { &input.expect_ident().map_err(|_| ())?,
                     "ordinal" =>
                         exclusive_value!((result, VariantNumeric::ORDINAL) => VariantNumeric::ORDINAL),
                     "slashed-zero" =>
                         exclusive_value!((result, VariantNumeric::SLASHED_ZERO) => VariantNumeric::SLASHED_ZERO),
                     "lining-nums" =>
                         exclusive_value!((result, VariantNumeric::LINING_NUMS |
@@ -1974,24 +1978,24 @@ impl Parse for FontSynthesis {
         let mut result = FontSynthesis {
             weight: false,
             style: false,
         };
         try_match_ident_ignore_ascii_case! { input,
             "none" => Ok(result),
             "weight" => {
                 result.weight = true;
-                if input.try(|input| input.expect_ident_matching("style")).is_ok() {
+                if input.r#try(|input| input.expect_ident_matching("style")).is_ok() {
                     result.style = true;
                 }
                 Ok(result)
             },
             "style" => {
                 result.style = true;
-                if input.try(|input| input.expect_ident_matching("weight")).is_ok() {
+                if input.r#try(|input| input.expect_ident_matching("weight")).is_ok() {
                     result.weight = true;
                 }
                 Ok(result)
             },
         }
     }
 }
 
@@ -2120,17 +2124,17 @@ impl ToComputedValue for FontLanguageOve
 
 impl Parse for FontLanguageOverride {
     /// normal | <string>
     fn parse<'i, 't>(
         _: &ParserContext,
         input: &mut Parser<'i, 't>,
     ) -> Result<FontLanguageOverride, ParseError<'i>> {
         if input
-            .try(|input| input.expect_ident_matching("normal"))
+            .r#try(|input| input.expect_ident_matching("normal"))
             .is_ok()
         {
             return Ok(FontLanguageOverride::Normal);
         }
 
         let string = input.expect_string()?;
         Ok(FontLanguageOverride::Override(
             string.as_ref().to_owned().into_boxed_str(),
@@ -2187,17 +2191,17 @@ impl Parse for FontVariationSettings {
         SpecifiedFontVariationSettings::parse(context, input).map(FontVariationSettings::Value)
     }
 }
 
 fn parse_one_feature_value<'i, 't>(
     context: &ParserContext,
     input: &mut Parser<'i, 't>,
 ) -> Result<Integer, ParseError<'i>> {
-    if let Ok(integer) = input.try(|i| Integer::parse_non_negative(context, i)) {
+    if let Ok(integer) = input.r#try(|i| Integer::parse_non_negative(context, i)) {
         return Ok(integer);
     }
 
     try_match_ident_ignore_ascii_case! { input,
         "on" => Ok(Integer::new(1)),
         "off" => Ok(Integer::new(0)),
     }
 }
@@ -2205,17 +2209,17 @@ fn parse_one_feature_value<'i, 't>(
 impl Parse for FeatureTagValue<Integer> {
     /// https://drafts.csswg.org/css-fonts-4/#feature-tag-value
     fn parse<'i, 't>(
         context: &ParserContext,
         input: &mut Parser<'i, 't>,
     ) -> Result<Self, ParseError<'i>> {
         let tag = FontTag::parse(context, input)?;
         let value = input
-            .try(|i| parse_one_feature_value(context, i))
+            .r#try(|i| parse_one_feature_value(context, i))
             .unwrap_or_else(|_| Integer::new(1));
 
         Ok(Self { tag, value })
     }
 }
 
 impl Parse for VariationValue<Number> {
     /// This is the `<string> <number>` part of the font-variation-settings
@@ -2323,17 +2327,17 @@ pub enum MozScriptLevel {
 }
 
 impl Parse for MozScriptLevel {
     fn parse<'i, 't>(
         _: &ParserContext,
         input: &mut Parser<'i, 't>,
     ) -> Result<MozScriptLevel, ParseError<'i>> {
         // We don't bother to handle calc here.
-        if let Ok(i) = input.try(|i| i.expect_integer()) {
+        if let Ok(i) = input.r#try(|i| i.expect_integer()) {
             return Ok(MozScriptLevel::Relative(i));
         }
         input.expect_ident_matching("auto")?;
         Ok(MozScriptLevel::Auto)
     }
 }
 
 #[cfg_attr(feature = "gecko", derive(MallocSizeOf))]
--- a/servo/components/style/values/specified/grid.rs
+++ b/servo/components/style/values/specified/grid.rs
@@ -1,25 +1,25 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * 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/. */
 
 //! CSS handling for the computed value of
 //! [grids](https://drafts.csswg.org/css-grid/)
 
+use crate::parser::{Parse, ParserContext};
+use crate::values::computed::{self, Context, ToComputedValue};
+use crate::values::generics::grid::{GridTemplateComponent, RepeatCount, TrackBreadth};
+use crate::values::generics::grid::{LineNameList, TrackKeyword, TrackRepeat, TrackSize};
+use crate::values::generics::grid::{TrackList, TrackListType, TrackListValue};
+use crate::values::specified::{Integer, LengthOrPercentage};
+use crate::values::{CSSFloat, CustomIdent};
 use cssparser::{ParseError as CssParseError, Parser, Token};
-use parser::{Parse, ParserContext};
 use std::mem;
 use style_traits::{ParseError, StyleParseErrorKind};
-use values::computed::{self, Context, ToComputedValue};
-use values::generics::grid::{GridTemplateComponent, RepeatCount, TrackBreadth};
-use values::generics::grid::{LineNameList, TrackKeyword, TrackRepeat, TrackSize};
-use values::generics::grid::{TrackList, TrackListType, TrackListValue};
-use values::specified::{Integer, LengthOrPercentage};
-use values::{CSSFloat, CustomIdent};
 
 /// Parse a single flexible length.
 pub fn parse_flex<'i, 't>(input: &mut Parser<'i, 't>) -> Result<CSSFloat, ParseError<'i>> {
     let location = input.current_source_location();
     match *input.next()? {
         Token::Dimension {
             value, ref unit, ..
         }
@@ -31,41 +31,44 @@ pub fn parse_flex<'i, 't>(input: &mut Pa
     }
 }
 
 impl Parse for TrackBreadth<LengthOrPercentage> {
     fn parse<'i, 't>(
         context: &ParserContext,
         input: &mut Parser<'i, 't>,
     ) -> Result<Self, ParseError<'i>> {
-        if let Ok(lop) = input.try(|i| LengthOrPercentage::parse_non_negative(context, i)) {
+        if let Ok(lop) = input.r#try(|i| LengthOrPercentage::parse_non_negative(context, i)) {
             return Ok(TrackBreadth::Breadth(lop));
         }
 
-        if let Ok(f) = input.try(parse_flex) {
+        if let Ok(f) = input.r#try(parse_flex) {
             return Ok(TrackBreadth::Fr(f));
         }
 
         TrackKeyword::parse(input).map(TrackBreadth::Keyword)
     }
 }
 
 impl Parse for TrackSize<LengthOrPercentage> {
     fn parse<'i, 't>(
         context: &ParserContext,
         input: &mut Parser<'i, 't>,
     ) -> Result<Self, ParseError<'i>> {
-        if let Ok(b) = input.try(|i| TrackBreadth::parse(context, i)) {
+        if let Ok(b) = input.r#try(|i| TrackBreadth::parse(context, i)) {
             return Ok(TrackSize::Breadth(b));
         }
 
-        if input.try(|i| i.expect_function_matching("minmax")).is_ok() {
+        if input
+            .r#try(|i| i.expect_function_matching("minmax"))
+            .is_ok()
+        {
             return input.parse_nested_block(|input| {
                 let inflexible_breadth =
-                    match input.try(|i| LengthOrPercentage::parse_non_negative(context, i)) {
+                    match input.r#try(|i| LengthOrPercentage::parse_non_negative(context, i)) {
                         Ok(lop) => TrackBreadth::Breadth(lop),
                         Err(..) => {
                             let keyword = TrackKeyword::parse(input)?;
                             TrackBreadth::Keyword(keyword)
                         },
                     };
 
                 input.expect_comma()?;
@@ -87,17 +90,17 @@ impl Parse for TrackSize<LengthOrPercent
 ///
 /// <https://drafts.csswg.org/css-grid/#typedef-line-names>
 pub fn parse_line_names<'i, 't>(
     input: &mut Parser<'i, 't>,
 ) -> Result<Box<[CustomIdent]>, ParseError<'i>> {
     input.expect_square_bracket_block()?;
     input.parse_nested_block(|input| {
         let mut values = vec![];
-        while let Ok((loc, ident)) = input.try(|i| -> Result<_, CssParseError<()>> {
+        while let Ok((loc, ident)) = input.r#try(|i| -> Result<_, CssParseError<()>> {
             Ok((i.current_source_location(), i.expect_ident_cloned()?))
         }) {
             let ident = CustomIdent::from_ident(loc, &ident, &["span", "auto"])?;
             values.push(ident);
         }
 
         Ok(values.into_boxed_slice())
     })
@@ -118,17 +121,17 @@ enum RepeatType {
 }
 
 impl TrackRepeat<LengthOrPercentage, Integer> {
     fn parse_with_repeat_type<'i, 't>(
         context: &ParserContext,
         input: &mut Parser<'i, 't>,
     ) -> Result<(Self, RepeatType), ParseError<'i>> {
         input
-            .try(|i| i.expect_function_matching("repeat").map_err(|e| e.into()))
+            .r#try(|i| i.expect_function_matching("repeat").map_err(|e| e.into()))
             .and_then(|_| {
                 input.parse_nested_block(|input| {
                     let count = RepeatCount::parse(context, input)?;
                     input.expect_comma()?;
 
                     let is_auto = count == RepeatCount::AutoFit || count == RepeatCount::AutoFill;
                     let mut repeat_type = if is_auto {
                         RepeatType::Auto
@@ -138,19 +141,19 @@ impl TrackRepeat<LengthOrPercentage, Int
                     };
 
                     let mut names = vec![];
                     let mut values = vec![];
                     let mut current_names;
 
                     loop {
                         current_names = input
-                            .try(parse_line_names)
+                            .r#try(parse_line_names)
                             .unwrap_or(vec![].into_boxed_slice());
-                        if let Ok(track_size) = input.try(|i| TrackSize::parse(context, i)) {
+                        if let Ok(track_size) = input.r#try(|i| TrackSize::parse(context, i)) {
                             if !track_size.is_fixed() {
                                 if is_auto {
                                     // should be <fixed-size> for <auto-repeat>
                                     return Err(input
                                         .new_custom_error(StyleParseErrorKind::UnspecifiedError));
                                 }
 
                                 if repeat_type == RepeatType::Fixed {
@@ -164,17 +167,17 @@ impl TrackRepeat<LengthOrPercentage, Int
                                 // FIXME: In the older version of the spec
                                 // (https://www.w3.org/TR/2015/WD-css-grid-1-20150917/#typedef-auto-repeat),
                                 // if the repeat type is `<auto-repeat>` we shouldn't try to parse more than
                                 // one `TrackSize`. But in current version of the spec, this is deprecated
                                 // but we are adding this for gecko parity. We should remove this when
                                 // gecko implements new spec.
                                 names.push(
                                     input
-                                        .try(parse_line_names)
+                                        .r#try(parse_line_names)
                                         .unwrap_or(vec![].into_boxed_slice()),
                                 );
                                 break;
                             }
                         } else {
                             if values.is_empty() {
                                 // expecting at least one <track-size>
                                 return Err(
@@ -218,33 +221,33 @@ impl Parse for TrackList<LengthOrPercent
         // account to set the position of <auto-repeat> so it remains the same while computing
         // values.
         let mut auto_offset = 0;
         // assume that everything is <fixed-size>. This flag is useful when we encounter <auto-repeat>
         let mut atleast_one_not_fixed = false;
         loop {
             current_names.extend_from_slice(
                 &mut input
-                    .try(parse_line_names)
+                    .r#try(parse_line_names)
                     .unwrap_or(vec![].into_boxed_slice()),
             );
-            if let Ok(track_size) = input.try(|i| TrackSize::parse(context, i)) {
+            if let Ok(track_size) = input.r#try(|i| TrackSize::parse(context, i)) {
                 if !track_size.is_fixed() {
                     atleast_one_not_fixed = true;
                     if auto_repeat.is_some() {
                         // <auto-track-list> only accepts <fixed-size> and <fixed-repeat>
                         return Err(input.new_custom_error(StyleParseErrorKind::UnspecifiedError));
                     }
                 }
 
                 let vec = mem::replace(&mut current_names, vec![]);
                 names.push(vec.into_boxed_slice());
                 values.push(TrackListValue::TrackSize(track_size));
             } else if let Ok((repeat, type_)) =
-                input.try(|i| TrackRepeat::parse_with_repeat_type(context, i))
+                input.r#try(|i| TrackRepeat::parse_with_repeat_type(context, i))
             {
                 if list_type == TrackListType::Explicit {
                     list_type = TrackListType::Normal; // <explicit-track-list> doesn't contain repeat()
                 }
 
                 match type_ {
                     RepeatType::Normal => {
                         atleast_one_not_fixed = true;
@@ -396,31 +399,31 @@ fn allow_grid_template_subgrids() -> boo
 }
 
 impl Parse for GridTemplateComponent<LengthOrPercentage, Integer> {
     // FIXME: Derive Parse (probably with None_)
     fn parse<'i, 't>(
         context: &ParserContext,
         input: &mut Parser<'i, 't>,
     ) -> Result<Self, ParseError<'i>> {
-        if input.try(|i| i.expect_ident_matching("none")).is_ok() {
+        if input.r#try(|i| i.expect_ident_matching("none")).is_ok() {
             return Ok(GridTemplateComponent::None);
         }
 
         Self::parse_without_none(context, input)
     }
 }
 
 impl GridTemplateComponent<LengthOrPercentage, Integer> {
     /// Parses a `GridTemplateComponent<LengthOrPercentage>` except `none` keyword.
     pub fn parse_without_none<'i, 't>(
         context: &ParserContext,
         input: &mut Parser<'i, 't>,
     ) -> Result<Self, ParseError<'i>> {
         if allow_grid_template_subgrids() {
-            if let Ok(t) = input.try(|i| LineNameList::parse(context, i)) {
+            if let Ok(t) = input.r#try(|i| LineNameList::parse(context, i)) {
                 return Ok(GridTemplateComponent::Subgrid(t));
             }
         }
 
         TrackList::parse(context, input).map(GridTemplateComponent::TrackList)
     }
 }
--- a/servo/components/style/values/specified/image.rs
+++ b/servo/components/style/values/specified/image.rs
@@ -2,49 +2,49 @@
  * 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/. */
 
 //! CSS handling for the specified value of
 //! [`image`][image]s
 //!
 //! [image]: https://drafts.csswg.org/css-images/#image-values
 
+use crate::custom_properties::SpecifiedValue;
+use crate::parser::{Parse, ParserContext};
+use crate::values::generics::image::PaintWorklet;
+use crate::values::generics::image::{self as generic, Circle, CompatMode, Ellipse, ShapeExtent};
+use crate::values::generics::position::Position as GenericPosition;
+use crate::values::specified::position::{LegacyPosition, Position, PositionComponent, Side, X, Y};
+use crate::values::specified::url::SpecifiedImageUrl;
+use crate::values::specified::{Angle, Color, Length, LengthOrPercentage};
+use crate::values::specified::{Number, NumberOrPercentage, Percentage};
+use crate::values::{Either, None_};
+use crate::Atom;
 use cssparser::{Delimiter, Parser, Token};
-use custom_properties::SpecifiedValue;
-use parser::{Parse, ParserContext};
 use selectors::parser::SelectorParseErrorKind;
 #[cfg(feature = "servo")]
 use servo_url::ServoUrl;
 use std::cmp::Ordering;
 use std::fmt::{self, Write};
 use style_traits::{CssType, CssWriter, KeywordsCollectFn, ParseError};
 use style_traits::{SpecifiedValueInfo, StyleParseErrorKind, ToCss};
 #[cfg(feature = "gecko")]
 use values::computed::{Context, Position as ComputedPosition, ToComputedValue};
-use values::generics::image::PaintWorklet;
-use values::generics::image::{self as generic, Circle, CompatMode, Ellipse, ShapeExtent};
-use values::generics::position::Position as GenericPosition;
-use values::specified::position::{LegacyPosition, Position, PositionComponent, Side, X, Y};
-use values::specified::url::SpecifiedImageUrl;
-use values::specified::{Angle, Color, Length, LengthOrPercentage};
-use values::specified::{Number, NumberOrPercentage, Percentage};
-use values::{Either, None_};
-use Atom;
 
 /// A specified image layer.
 pub type ImageLayer = Either<None_, Image>;
 
 impl ImageLayer {
     /// This is a specialization of Either with an alternative parse
     /// method to provide anonymous CORS headers for the Image url fetch.
     pub fn parse_with_cors_anonymous<'i, 't>(
         context: &ParserContext,
         input: &mut Parser<'i, 't>,
     ) -> Result<Self, ParseError<'i>> {
-        if let Ok(v) = input.try(|i| None_::parse(context, i)) {
+        if let Ok(v) = input.r#try(|i| None_::parse(context, i)) {
             return Ok(Either::First(v));
         }
         Image::parse_with_cors_anonymous(context, input).map(Either::Second)
     }
 }
 
 /// Specified values for an image according to CSS-IMAGES.
 /// <https://drafts.csswg.org/css-images/#image-values>
@@ -137,47 +137,47 @@ pub type ColorStop = generic::ColorStop<
 /// -moz-image-rect(<uri>, top, right, bottom, left);
 pub type MozImageRect = generic::MozImageRect<NumberOrPercentage, SpecifiedImageUrl>;
 
 impl Parse for Image {
     fn parse<'i, 't>(
         context: &ParserContext,
         input: &mut Parser<'i, 't>,
     ) -> Result<Image, ParseError<'i>> {
-        if let Ok(url) = input.try(|input| SpecifiedImageUrl::parse(context, input)) {
+        if let Ok(url) = input.r#try(|input| SpecifiedImageUrl::parse(context, input)) {
             return Ok(generic::Image::Url(url));
         }
-        if let Ok(gradient) = input.try(|i| Gradient::parse(context, i)) {
+        if let Ok(gradient) = input.r#try(|i| Gradient::parse(context, i)) {
             return Ok(generic::Image::Gradient(Box::new(gradient)));
         }
         #[cfg(feature = "servo")]
         {
-            if let Ok(paint_worklet) = input.try(|i| PaintWorklet::parse(context, i)) {
+            if let Ok(paint_worklet) = input.r#try(|i| PaintWorklet::parse(context, i)) {
                 return Ok(generic::Image::PaintWorklet(paint_worklet));
             }
         }
-        if let Ok(image_rect) = input.try(|input| MozImageRect::parse(context, input)) {
+        if let Ok(image_rect) = input.r#try(|input| MozImageRect::parse(context, input)) {
             return Ok(generic::Image::Rect(Box::new(image_rect)));
         }
         Ok(generic::Image::Element(Image::parse_element(input)?))
     }
 }
 
 impl Image {
     /// Creates an already specified image value from an already resolved URL
     /// for insertion in the cascade.
     #[cfg(feature = "servo")]
     pub fn for_cascade(url: ServoUrl) -> Self {
-        use values::CssUrl;
+        use crate::values::CssUrl;
         generic::Image::Url(CssUrl::for_cascade(url))
     }
 
     /// Parses a `-moz-element(# <element-id>)`.
     fn parse_element<'i, 't>(input: &mut Parser<'i, 't>) -> Result<Atom, ParseError<'i>> {
-        input.try(|i| i.expect_function_matching("-moz-element"))?;
+        input.r#try(|i| i.expect_function_matching("-moz-element"))?;
         let location = input.current_source_location();
         input.parse_nested_block(|i| match *i.next()? {
             Token::IDHash(ref id) => Ok(Atom::from(id.as_ref())),
             ref t => Err(location.new_unexpected_token_error(t.clone())),
         })
     }
 
     /// Provides an alternate method for parsing that associates the URL with
@@ -185,17 +185,17 @@ impl Image {
     ///
     /// FIXME(emilio): It'd be nicer for this to pass a `CorsMode` parameter to
     /// a shared function instead.
     pub fn parse_with_cors_anonymous<'i, 't>(
         context: &ParserContext,
         input: &mut Parser<'i, 't>,
     ) -> Result<Image, ParseError<'i>> {
         if let Ok(url) =
-            input.try(|input| SpecifiedImageUrl::parse_with_cors_anonymous(context, input))
+            input.r#try(|input| SpecifiedImageUrl::parse_with_cors_anonymous(context, input))
         {
             return Ok(generic::Image::Url(url));
         }
         Self::parse(context, input)
     }
 }
 
 impl Parse for Gradient {
@@ -345,17 +345,17 @@ impl Gradient {
             }
         }
 
         impl Parse for Point {
             fn parse<'i, 't>(
                 context: &ParserContext,
                 input: &mut Parser<'i, 't>,
             ) -> Result<Self, ParseError<'i>> {
-                input.try(|i| {
+                input.r#try(|i| {
                     let x = Component::parse(context, i)?;
                     let y = Component::parse(context, i)?;
 
                     Ok(Self::new(x, y))
                 })
             }
         }
 
@@ -408,23 +408,23 @@ impl Gradient {
             }
         }
 
         impl<S: Parse> Parse for Component<S> {
             fn parse<'i, 't>(
                 context: &ParserContext,
                 input: &mut Parser<'i, 't>,
             ) -> Result<Self, ParseError<'i>> {
-                if let Ok(side) = input.try(|i| S::parse(context, i)) {
+                if let Ok(side) = input.r#try(|i| S::parse(context, i)) {
                     return Ok(Component::Side(side));
                 }
-                if let Ok(number) = input.try(|i| NumberOrPercentage::parse(context, i)) {
+                if let Ok(number) = input.r#try(|i| NumberOrPercentage::parse(context, i)) {
                     return Ok(Component::Number(number));
                 }
-                input.try(|i| i.expect_ident_matching("center"))?;
+                input.r#try(|i| i.expect_ident_matching("center"))?;
                 Ok(Component::Center)
             }
         }
 
         let ident = input.expect_ident_cloned()?;
         input.expect_comma()?;
 
         let (kind, reverse_stops) = match_ignore_ascii_case! { &ident,
@@ -472,17 +472,17 @@ impl Gradient {
             },
             _ => {
                 let e = SelectorParseErrorKind::UnexpectedIdent(ident.clone());
                 return Err(input.new_custom_error(e));
             },
         };
 
         let mut items = input
-            .try(|i| {
+            .r#try(|i| {
                 i.expect_comma()?;
                 i.parse_comma_separated(|i| {
                     let function = i.expect_function()?.clone();
                     let (color, mut p) = i.parse_nested_block(|i| {
                         let p = match_ignore_ascii_case! { &function,
                             "color-stop" => {
                                 let p = match NumberOrPercentage::parse(context, i)? {
                                     NumberOrPercentage::Number(number) => Percentage::new(number.value),
@@ -567,46 +567,46 @@ impl Gradient {
 impl GradientKind {
     /// Parses a linear gradient.
     /// CompatMode can change during `-moz-` prefixed gradient parsing if it come across a `to` keyword.
     fn parse_linear<'i, 't>(
         context: &ParserContext,
         input: &mut Parser<'i, 't>,
         compat_mode: &mut CompatMode,
     ) -> Result<Self, ParseError<'i>> {
-        let direction = if let Ok(d) = input.try(|i| LineDirection::parse(context, i, compat_mode))
-        {
-            input.expect_comma()?;
-            d
-        } else {
-            match *compat_mode {
-                CompatMode::Modern => LineDirection::Vertical(Y::Bottom),
-                _ => LineDirection::Vertical(Y::Top),
-            }
-        };
+        let direction =
+            if let Ok(d) = input.r#try(|i| LineDirection::parse(context, i, compat_mode)) {
+                input.expect_comma()?;
+                d
+            } else {
+                match *compat_mode {
+                    CompatMode::Modern => LineDirection::Vertical(Y::Bottom),
+                    _ => LineDirection::Vertical(Y::Top),
+                }
+            };
         Ok(generic::GradientKind::Linear(direction))
     }
 
     fn parse_radial<'i, 't>(
         context: &ParserContext,
         input: &mut Parser<'i, 't>,
         compat_mode: &mut CompatMode,
     ) -> Result<Self, ParseError<'i>> {
         let (shape, position, angle, moz_position) = match *compat_mode {
             CompatMode::Modern => {
-                let shape = input.try(|i| EndingShape::parse(context, i, *compat_mode));
-                let position = input.try(|i| {
+                let shape = input.r#try(|i| EndingShape::parse(context, i, *compat_mode));
+                let position = input.r#try(|i| {
                     i.expect_ident_matching("at")?;
                     Position::parse(context, i)
                 });
                 (shape, position.ok(), None, None)
             },
             CompatMode::WebKit => {
-                let position = input.try(|i| Position::parse(context, i));
-                let shape = input.try(|i| {
+                let position = input.r#try(|i| Position::parse(context, i));
+                let shape = input.r#try(|i| {
                     if position.is_ok() {
                         i.expect_comma()?;
                     }
                     EndingShape::parse(context, i, *compat_mode)
                 });
                 (shape, position.ok(), None, None)
             },
             // The syntax of `-moz-` prefixed radial gradient is:
@@ -615,23 +615,23 @@ impl GradientKind {
             //     [ <position> || <angle> ]?  [ [ circle | ellipse ] | <extent-keyword> ] , |
             //   ]?
             //   <color-stop> [ , <color-stop> ]+
             // )
             // where <extent-keyword> = closest-corner | closest-side | farthest-corner | farthest-side |
             //                          cover | contain
             // and <color-stop>     = <color> [ <percentage> | <length> ]?
             CompatMode::Moz => {
-                let mut position = input.try(|i| LegacyPosition::parse(context, i));
-                let angle = input.try(|i| Angle::parse(context, i)).ok();
+                let mut position = input.r#try(|i| LegacyPosition::parse(context, i));
+                let angle = input.r#try(|i| Angle::parse(context, i)).ok();
                 if position.is_err() {
-                    position = input.try(|i| LegacyPosition::parse(context, i));
+                    position = input.r#try(|i| LegacyPosition::parse(context, i));
                 }
 
-                let shape = input.try(|i| {
+                let shape = input.r#try(|i| {
                     if position.is_ok() || angle.is_some() {
                         i.expect_comma()?;
                     }
                     EndingShape::parse(context, i, *compat_mode)
                 });
 
                 (shape, None, angle, position.ok())
             },
@@ -763,28 +763,28 @@ impl generic::LineDirection for LineDire
 
 impl LineDirection {
     fn parse<'i, 't>(
         context: &ParserContext,
         input: &mut Parser<'i, 't>,
         compat_mode: &mut CompatMode,
     ) -> Result<Self, ParseError<'i>> {
         let mut _angle = if *compat_mode == CompatMode::Moz {
-            input.try(|i| Angle::parse(context, i)).ok()
+            input.r#try(|i| Angle::parse(context, i)).ok()
         } else {
             // Gradients allow unitless zero angles as an exception, see:
             // https://github.com/w3c/csswg-drafts/issues/1162
-            if let Ok(angle) = input.try(|i| Angle::parse_with_unitless(context, i)) {
+            if let Ok(angle) = input.r#try(|i| Angle::parse_with_unitless(context, i)) {
                 return Ok(LineDirection::Angle(angle));
             }
             None
         };
 
-        input.try(|i| {
-            let to_ident = i.try(|i| i.expect_ident_matching("to"));
+        input.r#try(|i| {
+            let to_ident = i.r#try(|i| i.expect_ident_matching("to"));
             match *compat_mode {
                 // `to` keyword is mandatory in modern syntax.
                 CompatMode::Modern => to_ident?,
                 // Fall back to Modern compatibility mode in case there is a `to` keyword.
                 // According to Gecko, `-moz-linear-gradient(to ...)` should serialize like
                 // `linear-gradient(to ...)`.
                 CompatMode::Moz if to_ident.is_ok() => *compat_mode = CompatMode::Modern,
                 // There is no `to` keyword in webkit prefixed syntax. If it's consumed,
@@ -796,36 +796,36 @@ impl LineDirection {
                 },
                 _ => {},
             }
 
             #[cfg(feature = "gecko")]
             {
                 // `-moz-` prefixed linear gradient can be both Angle and Position.
                 if *compat_mode == CompatMode::Moz {
-                    let position = i.try(|i| LegacyPosition::parse(context, i)).ok();
+                    let position = i.r#try(|i| LegacyPosition::parse(context, i)).ok();
                     if _angle.is_none() {
-                        _angle = i.try(|i| Angle::parse(context, i)).ok();
+                        _angle = i.r#try(|i| Angle::parse(context, i)).ok();
                     };
 
                     if _angle.is_none() && position.is_none() {
                         return Err(i.new_custom_error(StyleParseErrorKind::UnspecifiedError));
                     }
                     return Ok(LineDirection::MozPosition(position, _angle));
                 }
             }
 
-            if let Ok(x) = i.try(X::parse) {
-                if let Ok(y) = i.try(Y::parse) {
+            if let Ok(x) = i.r#try(X::parse) {
+                if let Ok(y) = i.r#try(Y::parse) {
                     return Ok(LineDirection::Corner(x, y));
                 }
                 return Ok(LineDirection::Horizontal(x));
             }
             let y = Y::parse(i)?;
-            if let Ok(x) = i.try(X::parse) {
+            if let Ok(x) = i.r#try(X::parse) {
                 return Ok(LineDirection::Corner(x, y));
             }
             Ok(LineDirection::Vertical(y))
         })
     }
 }
 
 #[cfg(feature = "gecko")]
@@ -845,89 +845,91 @@ impl ToComputedValue for GradientPositio
 }
 
 impl EndingShape {
     fn parse<'i, 't>(
         context: &ParserContext,
         input: &mut Parser<'i, 't>,
         compat_mode: CompatMode,
     ) -> Result<Self, ParseError<'i>> {
-        if let Ok(extent) = input.try(|i| ShapeExtent::parse_with_compat_mode(i, compat_mode)) {
-            if input.try(|i| i.expect_ident_matching("circle")).is_ok() {
+        if let Ok(extent) = input.r#try(|i| ShapeExtent::parse_with_compat_mode(i, compat_mode)) {
+            if input.r#try(|i| i.expect_ident_matching("circle"))