style: Don't pre-fill eager pseudo-maps.

This was needed long time ago for Servo's layout. But I don't think there's any
reason for doing this now.
This commit is contained in:
Emilio Cobos Álvarez 2017-08-07 16:23:01 +02:00
parent b11b658379
commit c3501084f0
No known key found for this signature in database
GPG key ID: 056B727BB9C1027C

View file

@ -1646,14 +1646,10 @@ struct PerOriginCascadeData {
impl PerOriginCascadeData {
fn new() -> Self {
let mut data = PerOriginCascadeData {
Self {
element_map: SelectorMap::new(),
pseudos_map: Default::default(),
};
SelectorImpl::each_eagerly_cascaded_pseudo_element(|pseudo| {
data.pseudos_map.insert(pseudo, SelectorMap::new());
});
data
}
}
#[inline]
@ -1677,11 +1673,7 @@ impl PerOriginCascadeData {
}
fn clear(&mut self) {
self.element_map = SelectorMap::new();
self.pseudos_map = Default::default();
SelectorImpl::each_eagerly_cascaded_pseudo_element(|pseudo| {
self.pseudos_map.insert(pseudo, SelectorMap::new());
});
*self = Self::new();
}
fn has_rules_for_pseudo(&self, pseudo: &PseudoElement) -> bool {