Auto merge of #19454 - emilio:has-class-is-stupid, r=upsuper

style: Add a missing fast-path in GeckoElement::each_class.

This shows up when inserting elements in the bloom filter.

<!-- 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/19454)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2017-12-02 01:40:00 -06:00 committed by GitHub
commit 45bbbac9d9
2 changed files with 23 additions and 13 deletions

View file

@ -1113,6 +1113,10 @@ impl<'le> TElement for GeckoElement<'le> {
where
F: FnMut(&Atom),
{
if !self.may_have_class() {
return;
}
snapshot_helpers::each_class(self.0, callback, Gecko_ClassOrClassList)
}
@ -2129,10 +2133,12 @@ impl<'le> ::selectors::Element for GeckoElement<'le> {
return false;
}
snapshot_helpers::has_class(self.0,
name,
case_sensitivity,
Gecko_ClassOrClassList)
snapshot_helpers::has_class(
self.0,
name,
case_sensitivity,
Gecko_ClassOrClassList,
)
}
#[inline]