diff --git a/Cargo.lock b/Cargo.lock index fe176efbe7c..7d37a57b7b1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4654,8 +4654,6 @@ dependencies = [ "servo_arc", "smallvec 1.0.0", "thin-slice", - "to_shmem", - "to_shmem_derive", ] [[package]] diff --git a/components/selectors/Cargo.toml b/components/selectors/Cargo.toml index 21077f426c6..1aaebdc167d 100644 --- a/components/selectors/Cargo.toml +++ b/components/selectors/Cargo.toml @@ -31,8 +31,6 @@ precomputed-hash = "0.1" servo_arc = { version = "0.1", path = "../servo_arc" } smallvec = "1.0" thin-slice = "0.1.0" -to_shmem = { path = "../to_shmem" } -to_shmem_derive = { path = "../to_shmem_derive" } [build-dependencies] phf_codegen = "0.8" diff --git a/components/selectors/attr.rs b/components/selectors/attr.rs index 96abbe1c132..36d31e11345 100644 --- a/components/selectors/attr.rs +++ b/components/selectors/attr.rs @@ -6,15 +6,11 @@ use crate::parser::SelectorImpl; use cssparser::ToCss; use std::fmt; -#[derive(Clone, Eq, PartialEq, ToShmem)] -#[shmem(no_bounds)] +#[derive(Clone, Eq, PartialEq)] pub struct AttrSelectorWithOptionalNamespace { - #[shmem(field_bound)] pub namespace: Option>, - #[shmem(field_bound)] pub local_name: Impl::LocalName, pub local_name_lower: Impl::LocalName, - #[shmem(field_bound)] pub operation: ParsedAttrSelectorOperation, pub never_matches: bool, } @@ -28,7 +24,7 @@ impl AttrSelectorWithOptionalNamespace { } } -#[derive(Clone, Eq, PartialEq, ToShmem)] +#[derive(Clone, Eq, PartialEq)] pub enum NamespaceConstraint { Any, @@ -36,7 +32,7 @@ pub enum NamespaceConstraint { Specific(NamespaceUrl), } -#[derive(Clone, Eq, PartialEq, ToShmem)] +#[derive(Clone, Eq, PartialEq)] pub enum ParsedAttrSelectorOperation { Exists, WithValue { @@ -76,7 +72,7 @@ impl AttrSelectorOperation { } } -#[derive(Clone, Copy, Eq, PartialEq, ToShmem)] +#[derive(Clone, Copy, Eq, PartialEq)] pub enum AttrSelectorOperator { Equal, Includes, @@ -136,7 +132,7 @@ impl AttrSelectorOperator { /// The definition of whitespace per CSS Selectors Level 3 ยง 4. pub static SELECTOR_WHITESPACE: &'static [char] = &[' ', '\t', '\n', '\r', '\x0C']; -#[derive(Clone, Copy, Debug, Eq, PartialEq, ToShmem)] +#[derive(Clone, Copy, Debug, Eq, PartialEq)] pub enum ParsedCaseSensitivity { // 's' was specified. ExplicitCaseSensitive, diff --git a/components/selectors/builder.rs b/components/selectors/builder.rs index 7a58e35d17f..607bb987932 100644 --- a/components/selectors/builder.rs +++ b/components/selectors/builder.rs @@ -193,7 +193,7 @@ fn split_from_end(s: &[T], at: usize) -> (&[T], &[T]) { bitflags! { /// Flags that indicate at which point of parsing a selector are we. - #[derive(Default, ToShmem)] + #[derive(Default)] pub (crate) struct SelectorFlags : u8 { const HAS_PSEUDO = 1 << 0; const HAS_SLOTTED = 1 << 1; @@ -201,7 +201,7 @@ bitflags! { } } -#[derive(Clone, Copy, Debug, Eq, PartialEq, ToShmem)] +#[derive(Clone, Copy, Debug, Eq, PartialEq)] pub struct SpecificityAndFlags { /// There are two free bits here, since we use ten bits for each specificity /// kind (id, class, element). diff --git a/components/selectors/lib.rs b/components/selectors/lib.rs index e8d8062dff7..1d9bf58edb3 100644 --- a/components/selectors/lib.rs +++ b/components/selectors/lib.rs @@ -21,9 +21,6 @@ extern crate precomputed_hash; extern crate servo_arc; extern crate smallvec; extern crate thin_slice; -extern crate to_shmem; -#[macro_use] -extern crate to_shmem_derive; pub mod attr; pub mod bloom; diff --git a/components/selectors/parser.rs b/components/selectors/parser.rs index 92a5b039b90..0b550dd26ef 100644 --- a/components/selectors/parser.rs +++ b/components/selectors/parser.rs @@ -293,10 +293,9 @@ pub trait Parser<'i> { } } -#[derive(Clone, Debug, Eq, PartialEq, ToShmem)] -#[shmem(no_bounds)] +#[derive(Clone, Debug, Eq, PartialEq)] pub struct SelectorList( - #[shmem(field_bound)] pub SmallVec<[Selector; 1]>, + pub SmallVec<[Selector; 1]>, ); impl SelectorList { @@ -582,10 +581,9 @@ pub fn namespace_empty_string() -> Impl::NamespaceUrl { /// /// This reordering doesn't change the semantics of selector matching, and we /// handle it in to_css to make it invisible to serialization. -#[derive(Clone, Eq, PartialEq, ToShmem)] -#[shmem(no_bounds)] +#[derive(Clone, Eq, PartialEq)] pub struct Selector( - #[shmem(field_bound)] ThinArc>, + ThinArc>, ); impl Selector { @@ -890,7 +888,7 @@ impl<'a, Impl: SelectorImpl> Iterator for AncestorIter<'a, Impl> { } } -#[derive(Clone, Copy, Debug, Eq, PartialEq, ToShmem)] +#[derive(Clone, Copy, Debug, Eq, PartialEq)] pub enum Combinator { Child, // > Descendant, // space @@ -941,27 +939,25 @@ impl Combinator { /// optimal packing and cache performance, see [1]. /// /// [1] https://bugzilla.mozilla.org/show_bug.cgi?id=1357973 -#[derive(Clone, Eq, PartialEq, ToShmem)] -#[shmem(no_bounds)] +#[derive(Clone, Eq, PartialEq)] pub enum Component { Combinator(Combinator), ExplicitAnyNamespace, ExplicitNoNamespace, - DefaultNamespace(#[shmem(field_bound)] Impl::NamespaceUrl), + DefaultNamespace(Impl::NamespaceUrl), Namespace( - #[shmem(field_bound)] Impl::NamespacePrefix, - #[shmem(field_bound)] Impl::NamespaceUrl, + Impl::NamespacePrefix, + Impl::NamespaceUrl, ), ExplicitUniversalType, LocalName(LocalName), - ID(#[shmem(field_bound)] Impl::Identifier), - Class(#[shmem(field_bound)] Impl::ClassName), + ID(Impl::Identifier), + Class(Impl::ClassName), AttributeInNoNamespaceExists { - #[shmem(field_bound)] local_name: Impl::LocalName, local_name_lower: Impl::LocalName, }, @@ -969,7 +965,6 @@ pub enum Component { AttributeInNoNamespace { local_name: Impl::LocalName, operator: AttrSelectorOperator, - #[shmem(field_bound)] value: Impl::AttrValue, case_sensitivity: ParsedCaseSensitivity, never_matches: bool, @@ -1001,7 +996,7 @@ pub enum Component { FirstOfType, LastOfType, OnlyOfType, - NonTSPseudoClass(#[shmem(field_bound)] Impl::NonTSPseudoClass), + NonTSPseudoClass(Impl::NonTSPseudoClass), /// The ::slotted() pseudo-element: /// /// https://drafts.csswg.org/css-scoping/#slotted-pseudo @@ -1016,7 +1011,7 @@ pub enum Component { Slotted(Selector), /// The `::part` pseudo-element. /// https://drafts.csswg.org/css-shadow-parts/#part - Part(#[shmem(field_bound)] Box<[Impl::PartName]>), + Part(Box<[Impl::PartName]>), /// The `:host` pseudo-class: /// /// https://drafts.csswg.org/css-scoping/#host-selector @@ -1027,7 +1022,7 @@ pub enum Component { /// /// See https://github.com/w3c/csswg-drafts/issues/2158 Host(Option>), - PseudoElement(#[shmem(field_bound)] Impl::PseudoElement), + PseudoElement(Impl::PseudoElement), } impl Component { @@ -1082,10 +1077,8 @@ impl Component { } } -#[derive(Clone, Eq, PartialEq, ToShmem)] -#[shmem(no_bounds)] +#[derive(Clone, Eq, PartialEq)] pub struct LocalName { - #[shmem(field_bound)] pub name: Impl::LocalName, pub lower_name: Impl::LocalName, }