Bug 1789166 - Use content-visibility rather than display: none to hide <details> content. r=smaug

This matches the current shipping version of Chromium, and the last
version of the spec, except for the <slot> display when open, which per
spec ought to be `block`, but it's still `contents`.

animation-canceled-by-parent-details-element-being-closed.html is
invalid because content-visibility doesn't cancel animations, just
pauses them. It also times out in Chrome.

Differential Revision: https://phabricator.services.mozilla.com/D217192
This commit is contained in:
Emilio Cobos Álvarez
2024-07-20 14:17:31 +00:00
parent c903a0bc08
commit 79779b8643
16 changed files with 34 additions and 105 deletions

View File

@@ -12152,8 +12152,7 @@ bool PresShell::ReflowForHiddenContentIfNeeded() {
}
void PresShell::UpdateHiddenContentInForcedLayout(nsIFrame* aFrame) {
if (!aFrame || !aFrame->IsSubtreeDirty() ||
!StaticPrefs::layout_css_content_visibility_enabled()) {
if (!aFrame || !aFrame->IsSubtreeDirty()) {
return;
}