diff --git a/components/style/gecko/data.rs b/components/style/gecko/data.rs index b95e938d3a2..88c94a2870f 100644 --- a/components/style/gecko/data.rs +++ b/components/style/gecko/data.rs @@ -5,20 +5,16 @@ //! Data needed to style a Gecko document. use Atom; -use animation::Animation; use atomic_refcell::{AtomicRef, AtomicRefCell, AtomicRefMut}; -use dom::OpaqueNode; +use fnv::FnvHashMap; use gecko::rules::{CounterStyleRule, FontFaceRule}; use gecko_bindings::bindings::RawServoStyleSet; use gecko_bindings::structs::RawGeckoPresContextOwned; use gecko_bindings::structs::nsIDocument; use gecko_bindings::sugar::ownership::{HasBoxFFI, HasFFI, HasSimpleFFI}; use media_queries::Device; -use parking_lot::RwLock; use properties::ComputedValues; use shared_lock::{Locked, StylesheetGuards, SharedRwLockReadGuard}; -use std::collections::HashMap; -use std::sync::mpsc::{Receiver, Sender, channel}; use stylearc::Arc; use stylesheet_set::StylesheetSet; use stylesheets::Origin; @@ -33,24 +29,11 @@ pub struct PerDocumentStyleDataImpl { /// List of stylesheets, mirrored from Gecko. pub stylesheets: StylesheetSet, - // FIXME(bholley): Hook these up to something. - /// Unused. Will go away when we actually implement transitions and - /// animations properly. - pub new_animations_sender: Sender, - /// Unused. Will go away when we actually implement transitions and - /// animations properly. - pub new_animations_receiver: Receiver, - /// Unused. Will go away when we actually implement transitions and - /// animations properly. - pub running_animations: Arc>>>, - /// Unused. Will go away when we actually implement transitions and - /// animations properly. - pub expired_animations: Arc>>>, - /// List of effective font face rules. pub font_faces: Vec<(Arc>, Origin)>, + /// Map for effective counter style rules. - pub counter_styles: HashMap>>, + pub counter_styles: FnvHashMap>>, } /// The data itself is an `AtomicRefCell`, which guarantees the proper semantics @@ -65,17 +48,11 @@ impl PerDocumentStyleData { (*(*device.pres_context).mDocument.raw::()).mCompatMode }; - let (new_anims_sender, new_anims_receiver) = channel(); - PerDocumentStyleData(AtomicRefCell::new(PerDocumentStyleDataImpl { stylist: Stylist::new(device, quirks_mode.into()), stylesheets: StylesheetSet::new(), - new_animations_sender: new_anims_sender, - new_animations_receiver: new_anims_receiver, - running_animations: Arc::new(RwLock::new(HashMap::new())), - expired_animations: Arc::new(RwLock::new(HashMap::new())), font_faces: vec![], - counter_styles: HashMap::new(), + counter_styles: FnvHashMap::default(), })) } diff --git a/components/style/stylist.rs b/components/style/stylist.rs index 3189defd7b1..816f31bfccf 100644 --- a/components/style/stylist.rs +++ b/components/style/stylist.rs @@ -174,7 +174,7 @@ pub struct ExtraStyleData<'a> { /// A list of effective font-face rules and their origin. pub font_faces: &'a mut Vec<(Arc>, Origin)>, /// A map of effective counter-style rules. - pub counter_styles: &'a mut HashMap>>, + pub counter_styles: &'a mut FnvHashMap>>, } #[cfg(feature = "gecko")]