Bug 1827856 - Remove nativeAnonymousChildList observers. r=smaug,credential-management-reviewers,devtools-reviewers,sgalich,nchevobbe

You let me know if this seems appealing to you :)

Differential Revision: https://phabricator.services.mozilla.com/D175382
This commit is contained in:
Emilio Cobos Álvarez
2023-04-18 14:58:34 +00:00
parent bba043695c
commit c5c8aee75c
31 changed files with 137 additions and 438 deletions

View File

@@ -1896,6 +1896,10 @@ void nsCSSFrameConstructor::CreateGeneratedContentItem(
return;
}
if (mDocument->DevToolsAnonymousAndShadowEventsEnabled()) {
container->QueueDevtoolsAnonymousEvent(/* aIsRemove = */ false);
}
// Servo has already eagerly computed the style for the container, so we can
// just stick the style on the element and avoid an additional traversal.
//
@@ -3999,6 +4003,13 @@ nsresult nsCSSFrameConstructor::GetAnonymousContent(
return rv;
}
if (aContent.IsEmpty()) {
return NS_OK;
}
const bool devtoolsEventsEnabled =
mDocument->DevToolsAnonymousAndShadowEventsEnabled();
MOZ_ASSERT(aParent->IsElement());
for (const auto& info : aContent) {
// get our child's content and set its parent to our content
@@ -4012,6 +4023,10 @@ nsresult nsCSSFrameConstructor::GetAnonymousContent(
content->UnbindFromTree();
return rv;
}
if (devtoolsEventsEnabled) {
content->QueueDevtoolsAnonymousEvent(/* aIsRemove = */ false);
}
}
// Some situations where we don't cache anonymous content styles: