Bug 1966682 - Don't reframe the root when inserting / removing the view transition snapshot containing block. r=dshin

Much like the custom content container, we don't need to reframe it. This
prevents some unnecessary work and triggering assertions which try to prevent
it.

Differential Revision: https://phabricator.services.mozilla.com/D249854
This commit is contained in:
Emilio Cobos Álvarez
2025-05-21 14:40:59 +00:00
committed by ealvarez@mozilla.com
parent 0f23d6414c
commit 023857f56b
2 changed files with 20 additions and 0 deletions

View File

@@ -8437,6 +8437,12 @@ static bool ShouldRecreateContainerForNativeAnonymousContentRoot(
return false; return false;
} }
if (auto* el = Element::FromNode(aContent)) { if (auto* el = Element::FromNode(aContent)) {
if (el->GetPseudoElementType() ==
PseudoStyleType::mozSnapshotContainingBlock) {
// Much like above, all abspos and on its own top layer so insertion order
// wouldn't really matter anyways.
return false;
}
if (auto* classes = el->GetClasses()) { if (auto* classes = el->GetClasses()) {
if (classes->Contains(nsGkAtoms::mozCustomContentContainer, if (classes->Contains(nsGkAtoms::mozCustomContentContainer,
eCaseMatters)) { eCaseMatters)) {

View File

@@ -0,0 +1,14 @@
<!DOCTYPE html>
<html class="reftest-wait">
<link rel="help" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1966682">
<script>
window.addEventListener("load", async () => {
const viewTransition = document.startViewTransition(async () => {})
await viewTransition.ready
const header = document.createElement("th")
document.documentElement.appendChild(header)
document.documentElement.getBoundingClientRect();
document.documentElement.className = "";
})
</script>
</html>