mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
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:
commit
107fd47b93
1 changed files with 4 additions and 0 deletions
|
@ -1121,6 +1121,10 @@ impl<'le> TElement for GeckoElement<'le> {
|
||||||
where
|
where
|
||||||
F: FnMut(Self),
|
F: FnMut(Self),
|
||||||
{
|
{
|
||||||
|
if !self.may_have_anonymous_children() {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
let array: *mut structs::nsTArray<*mut nsIContent> =
|
let array: *mut structs::nsTArray<*mut nsIContent> =
|
||||||
unsafe { bindings::Gecko_GetAnonymousContentForElement(self.0) };
|
unsafe { bindings::Gecko_GetAnonymousContentForElement(self.0) };
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue