aboutsummaryrefslogtreecommitdiffstats
path: root/components/script
diff options
context:
space:
mode:
authorbors-servo <lbergstrom+bors@mozilla.com>2017-06-05 20:10:28 -0700
committerGitHub <noreply@github.com>2017-06-05 20:10:28 -0700
commit74ea8ce3ed6aa3d7edfe05924f196ccbe57daed6 (patch)
tree3e06d60e09ac729094a4193a754dea182c772312 /components/script
parent6fe0e30c169b54eb711ca1ee2dc1cdbf0ef83e82 (diff)
parentf105d3438dc3a97bf7f34f28adcd216c67adb262 (diff)
downloadservo-74ea8ce3ed6aa3d7edfe05924f196ccbe57daed6.tar.gz
servo-74ea8ce3ed6aa3d7edfe05924f196ccbe57daed6.zip
Auto merge of #17179 - bholley:one_selector_allocation, r=emilio
shrink Rule and store all heap-allocated selector data inline https://bugzilla.mozilla.org/show_bug.cgi?id=1370107 <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/17179) <!-- Reviewable:end -->
Diffstat (limited to 'components/script')
-rw-r--r--components/script/dom/element.rs4
-rw-r--r--components/script/dom/node.rs4
2 files changed, 4 insertions, 4 deletions
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>(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<Node>;
fn next(&mut self) -> Option<Root<Node>> {
- 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)
}))
}
}