From dcb8c2fdc7a3ad162cc7312faaebccd2d2a5e6fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= Date: Sat, 14 Oct 2017 13:18:06 +0200 Subject: [PATCH] style: Properly use nesting_level in the invalidation code. --- components/style/invalidation/element/element_wrapper.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/components/style/invalidation/element/element_wrapper.rs b/components/style/invalidation/element/element_wrapper.rs index 90749625493..294f878cd20 100644 --- a/components/style/invalidation/element/element_wrapper.rs +++ b/components/style/invalidation/element/element_wrapper.rs @@ -165,10 +165,12 @@ impl<'a, E> Element for ElementWrapper<'a, E> #[cfg(feature = "gecko")] NonTSPseudoClass::MozAny(ref selectors) => { use selectors::matching::matches_complex_selector; - // FIXME(emilio): nesting_level! - return selectors.iter().any(|s| { + context.nesting_level += 1; + let result = selectors.iter().any(|s| { matches_complex_selector(s.iter(), self, context, _setter) - }) + }); + context.nesting_level -= 1; + return result } // :dir is implemented in terms of state flags, but which state flag