From 2f967893f3a700bd17b2ab09a824186fb4f222fc Mon Sep 17 00:00:00 2001 From: Simon Sapin Date: Tue, 19 Jul 2016 15:34:08 +0200 Subject: [PATCH] Move geckolib/selector_impl.rs -> style/gecko_selector_impl.rs --- .../style/gecko_selector_impl.rs | 19 +++++++++---------- components/style/lib.rs | 3 ++- ports/geckolib/Cargo.lock | 1 - ports/geckolib/Cargo.toml | 1 - ports/geckolib/lib.rs | 4 +--- 5 files changed, 12 insertions(+), 16 deletions(-) rename ports/geckolib/selector_impl.rs => components/style/gecko_selector_impl.rs (95%) diff --git a/ports/geckolib/selector_impl.rs b/components/style/gecko_selector_impl.rs similarity index 95% rename from ports/geckolib/selector_impl.rs rename to components/style/gecko_selector_impl.rs index 45b46ea49bb..966d455e3ec 100644 --- a/ports/geckolib/selector_impl.rs +++ b/components/style/gecko_selector_impl.rs @@ -2,18 +2,17 @@ * 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 properties::GeckoComputedValues; +use element_state::ElementState; +use gecko_properties::GeckoComputedValues; +use selector_impl::{PseudoElementCascadeType, SelectorImplExt}; use selectors::parser::{ParserContext, SelectorImpl}; use string_cache::Atom; -use style; -use style::element_state::ElementState; -use style::selector_impl::{PseudoElementCascadeType, SelectorImplExt}; -pub type Stylist = style::selector_matching::Stylist; -pub type Stylesheet = style::stylesheets::Stylesheet; -pub type SharedStyleContext = style::context::SharedStyleContext; -pub type PrivateStyleData = style::data::PrivateStyleData; -pub type Animation = style::animation::Animation; +pub type Stylist = ::selector_matching::Stylist; +pub type Stylesheet = ::stylesheets::Stylesheet; +pub type SharedStyleContext = ::context::SharedStyleContext; +pub type PrivateStyleData = ::data::PrivateStyleData; +pub type Animation = ::animation::Animation; #[derive(Debug, Clone)] pub struct GeckoSelectorImpl; @@ -135,8 +134,8 @@ pub enum NonTSPseudoClass { impl NonTSPseudoClass { pub fn state_flag(&self) -> ElementState { + use element_state::*; use self::NonTSPseudoClass::*; - use style::element_state::*; match *self { Active => IN_ACTIVE_STATE, Focus => IN_FOCUS_STATE, diff --git a/components/style/lib.rs b/components/style/lib.rs index 4fa0fe1eeb6..6e8cedab4cf 100644 --- a/components/style/lib.rs +++ b/components/style/lib.rs @@ -82,8 +82,9 @@ pub mod element_state; pub mod error_reporting; pub mod font_face; #[cfg(feature = "gecko")] pub mod gecko_conversions; -#[cfg(feature = "gecko")] pub mod gecko_values; #[cfg(feature = "gecko")] pub mod gecko_glue; +#[cfg(feature = "gecko")] pub mod gecko_selector_impl; +#[cfg(feature = "gecko")] pub mod gecko_values; pub mod keyframes; pub mod logical_geometry; pub mod matching; diff --git a/ports/geckolib/Cargo.lock b/ports/geckolib/Cargo.lock index 58c8f5d50d5..bfdf613270d 100644 --- a/ports/geckolib/Cargo.lock +++ b/ports/geckolib/Cargo.lock @@ -3,7 +3,6 @@ name = "geckoservo" version = "0.0.1" dependencies = [ "app_units 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", - "cssparser 0.5.6 (registry+https://github.com/rust-lang/crates.io-index)", "env_logger 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", "euclid 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", "gecko_bindings 0.0.1", diff --git a/ports/geckolib/Cargo.toml b/ports/geckolib/Cargo.toml index b0a71c7874b..8cbe09340a6 100644 --- a/ports/geckolib/Cargo.toml +++ b/ports/geckolib/Cargo.toml @@ -11,7 +11,6 @@ crate-type = ["staticlib"] [dependencies] app_units = "0.2.5" -cssparser = "0.5.4" env_logger = "0.3" euclid = "0.7.1" gecko_bindings = {version = "0.0.1", path = "gecko_bindings"} diff --git a/ports/geckolib/lib.rs b/ports/geckolib/lib.rs index dba84f0b069..0f12ac71525 100644 --- a/ports/geckolib/lib.rs +++ b/ports/geckolib/lib.rs @@ -3,8 +3,6 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ extern crate app_units; -#[macro_use] -extern crate cssparser; extern crate env_logger; extern crate euclid; extern crate gecko_bindings; @@ -26,11 +24,11 @@ mod context; mod data; #[allow(non_snake_case)] pub mod glue; -mod selector_impl; mod traversal; mod wrapper; pub use style::gecko_properties as properties; +pub use style::gecko_selector_impl as selector_impl; pub use style::gecko_values as values; // FIXME(bholley): This should probably go away once we harmonize the allocators.