style: Prevent a crash when push_applicable_declarations is called with a non eagerly-cascaded pseudo-element

This actually didn't happen, but this should be done sooner than later.
This commit is contained in:
Emilio Cobos Álvarez 2016-02-12 01:51:36 +01:00
parent dad1738ba7
commit a604d605ed

View file

@ -261,7 +261,12 @@ impl<Impl: SelectorImplExt> Stylist<Impl> {
"Style attributes do not apply to pseudo-elements");
let map = match pseudo_element {
Some(ref pseudo) => self.pseudos_map.get(pseudo).unwrap(),
Some(ref pseudo) => match self.pseudos_map.get(pseudo) {
Some(map) => map,
// TODO(ecoal95): get non eagerly-cascaded pseudo-element rules here.
// Actually assume there are no rules applicable.
None => return true,
},
None => &self.element_map,
};