From d8455a772f19adc3800cc3a9b9e55b7c4240e111 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= Date: Sat, 20 Jan 2018 02:32:11 +0100 Subject: [PATCH] style: Remove redundant QuirksMode argument to SelectorMap --- components/style/selector_map.rs | 8 +++++--- components/style/stylist.rs | 7 +------ 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/components/style/selector_map.rs b/components/style/selector_map.rs index 1ebf5cea6b6..fbef963302e 100644 --- a/components/style/selector_map.rs +++ b/components/style/selector_map.rs @@ -159,7 +159,6 @@ impl SelectorMap { rule_hash_target: E, matching_rules_list: &mut ApplicableDeclarationList, context: &mut MatchingContext, - quirks_mode: QuirksMode, flags_setter: &mut F, cascade_level: CascadeLevel, ) @@ -171,7 +170,10 @@ impl SelectorMap { return } - // At the end, we're going to sort the rules that we added, so remember where we began. + let quirks_mode = context.quirks_mode(); + + // At the end, we're going to sort the rules that we added, so remember + // where we began. let init_len = matching_rules_list.len(); if let Some(id) = rule_hash_target.get_id() { if let Some(rules) = self.id_hash.get(&id, quirks_mode) { @@ -247,7 +249,7 @@ impl SelectorMap { pub fn insert( &mut self, entry: T, - quirks_mode: QuirksMode + quirks_mode: QuirksMode, ) -> Result<(), FailedAllocationError> { self.count += 1; diff --git a/components/style/stylist.rs b/components/style/stylist.rs index ec8b738bccd..88689d92890 100644 --- a/components/style/stylist.rs +++ b/components/style/stylist.rs @@ -1236,7 +1236,6 @@ impl Stylist { rule_hash_target, applicable_declarations, context, - self.quirks_mode, flags_setter, CascadeLevel::UANormal ); @@ -1274,7 +1273,6 @@ impl Stylist { rule_hash_target, applicable_declarations, context, - self.quirks_mode, flags_setter, CascadeLevel::UserNormal, ); @@ -1305,7 +1303,6 @@ impl Stylist { rule_hash_target, applicable_declarations, context, - self.quirks_mode, flags_setter, CascadeLevel::AuthorNormal ); @@ -1327,7 +1324,7 @@ impl Stylist { // as `context`, write a test-case of :visited not working on // Shadow DOM and fix it! let mut matching_context = MatchingContext::new( - context.matching_mode, + context.matching_mode(), context.bloom_filter, context.nth_index_cache.as_mut().map(|s| &mut **s), stylist.quirks_mode, @@ -1339,7 +1336,6 @@ impl Stylist { rule_hash_target, applicable_declarations, &mut matching_context, - stylist.quirks_mode, flags_setter, CascadeLevel::AuthorNormal, ); @@ -1356,7 +1352,6 @@ impl Stylist { rule_hash_target, applicable_declarations, context, - self.quirks_mode, flags_setter, CascadeLevel::AuthorNormal );