diff options
author | Emilio Cobos Álvarez <emilio@crisal.io> | 2018-03-30 21:06:34 +0200 |
---|---|---|
committer | Emilio Cobos Álvarez <emilio@crisal.io> | 2018-03-30 21:06:34 +0200 |
commit | f815d2f9c68fc564ed3c2193c752becb853b55b8 (patch) | |
tree | b8d5d4a539bb613af4b260fa49eb6e470598d19a | |
parent | d232705106478e0a2e5de78f8b40144408879c36 (diff) | |
download | servo-f815d2f9c68fc564ed3c2193c752becb853b55b8.tar.gz servo-f815d2f9c68fc564ed3c2193c752becb853b55b8.zip |
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.
-rw-r--r-- | components/style/gecko/wrapper.rs | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/components/style/gecko/wrapper.rs b/components/style/gecko/wrapper.rs index ae8612fa490..6902093be7d 100644 --- a/components/style/gecko/wrapper.rs +++ b/components/style/gecko/wrapper.rs @@ -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) }; |