Auto merge of #20479 - emilio:anon-child-bit, r=upsuper

style: Add a fast path to each_anonymous_content_child.

If we know that we don't have anon children it is pointless to go through FFI.

<!-- 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/20479)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2018-03-30 20:31:36 -04:00 committed by GitHub
commit 107fd47b93
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1121,6 +1121,10 @@ impl<'le> TElement for GeckoElement<'le> {
where
F: FnMut(Self),
{
if !self.may_have_anonymous_children() {
return;
}
let array: *mut structs::nsTArray<*mut nsIContent> =
unsafe { bindings::Gecko_GetAnonymousContentForElement(self.0) };