From 713c9a63f63c03f9aefd54664a6c5106cee514d7 Mon Sep 17 00:00:00 2001 From: Bobby Holley Date: Thu, 1 Jun 2017 13:56:21 -0700 Subject: Move the ancestor hashes out of Selector. MozReview-Commit-ID: 5mipXnjgSED --- components/script/dom/element.rs | 4 ++-- components/script/dom/node.rs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'components/script/dom') diff --git a/components/script/dom/element.rs b/components/script/dom/element.rs index be708113def..f875986edd2 100644 --- a/components/script/dom/element.rs +++ b/components/script/dom/element.rs @@ -2061,7 +2061,7 @@ impl ElementMethods for Element { Err(()) => Err(Error::Syntax), Ok(selectors) => { let mut ctx = MatchingContext::new(MatchingMode::Normal, None); - Ok(matches_selector_list(&selectors.0, &Root::from_ref(self), &mut ctx)) + Ok(matches_selector_list(&selectors, &Root::from_ref(self), &mut ctx)) } } } @@ -2080,7 +2080,7 @@ impl ElementMethods for Element { for element in root.inclusive_ancestors() { if let Some(element) = Root::downcast::(element) { let mut ctx = MatchingContext::new(MatchingMode::Normal, None); - if matches_selector_list(&selectors.0, &element, &mut ctx) { + if matches_selector_list(&selectors, &element, &mut ctx) { return Ok(Some(element)); } } diff --git a/components/script/dom/node.rs b/components/script/dom/node.rs index cc817587eda..8dde9cc7b01 100644 --- a/components/script/dom/node.rs +++ b/components/script/dom/node.rs @@ -345,7 +345,7 @@ impl<'a> Iterator for QuerySelectorIterator { type Item = Root; fn next(&mut self) -> Option> { - let selectors = &self.selectors.0; + let selectors = &self.selectors; // TODO(cgaebel): Is it worth it to build a bloom filter here // (instead of passing `None`)? Probably. @@ -722,7 +722,7 @@ impl Node { Ok(selectors) => { let mut ctx = MatchingContext::new(MatchingMode::Normal, None); Ok(self.traverse_preorder().filter_map(Root::downcast).find(|element| { - matches_selector_list(&selectors.0, element, &mut ctx) + matches_selector_list(&selectors, element, &mut ctx) })) } } -- cgit v1.2.3