aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbors-servo <lbergstrom+bors@mozilla.com>2018-03-30 20:31:36 -0400
committerGitHub <noreply@github.com>2018-03-30 20:31:36 -0400
commit107fd47b93e5e8586ca27293052b9fedc75b88e4 (patch)
treeb8d5d4a539bb613af4b260fa49eb6e470598d19a
parentd232705106478e0a2e5de78f8b40144408879c36 (diff)
parentf815d2f9c68fc564ed3c2193c752becb853b55b8 (diff)
downloadservo-107fd47b93e5e8586ca27293052b9fedc75b88e4.tar.gz
servo-107fd47b93e5e8586ca27293052b9fedc75b88e4.zip
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 -->
-rw-r--r--components/style/gecko/wrapper.rs4
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) };