From a604d605edf1813cc129409babb819d26db90824 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= Date: Fri, 12 Feb 2016 01:51:36 +0100 Subject: [PATCH] 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. --- components/style/selector_matching.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/components/style/selector_matching.rs b/components/style/selector_matching.rs index be3ae5453fa..a6c93cebcbc 100644 --- a/components/style/selector_matching.rs +++ b/components/style/selector_matching.rs @@ -261,7 +261,12 @@ impl Stylist { "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, };