From b329d547bea5476aaba3af2211e45c1ce51c4a01 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= Date: Wed, 24 May 2023 12:55:12 +0000 Subject: [PATCH] style: Properly increase the nesting level when matching :nth-child(of) selectors Differential Revision: https://phabricator.services.mozilla.com/D178920 --- components/selectors/matching.rs | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/components/selectors/matching.rs b/components/selectors/matching.rs index ab864e176cb..908fc55a548 100644 --- a/components/selectors/matching.rs +++ b/components/selectors/matching.rs @@ -876,12 +876,14 @@ where Component::Nth(ref nth_data) => { matches_generic_nth_child(element, context.shared, nth_data, &[]) }, - Component::NthOf(ref nth_of_data) => matches_generic_nth_child( - element, - context.shared, - nth_of_data.nth_data(), - nth_of_data.selectors(), - ), + Component::NthOf(ref nth_of_data) => context.shared.nest(|context| { + matches_generic_nth_child( + element, + context, + nth_of_data.nth_data(), + nth_of_data.selectors(), + ) + }), Component::Is(ref list) | Component::Where(ref list) => context .shared .nest(|context| list_matches_complex_selector(list, element, context)),