Bug 1791759 - Add support for content-visibility: auto r=emilio

This change adds support for `content-visibilty: auto` as well as
showing and hiding content based on the relevancy of the content as
defined in the specification. Changes to relevancy are handled by
triggering updates in a set of `content-visibility: auto` frames stored
in PresShell at the appropriate time in the document lifecycle.

Some tests are now failing due to this feature exposing the failures,
but they will be fixed in later changes.

This change is a reland of an earlier version that properly updates
intrinsic sizes and triggers an update of remembered size for the
purposes of contain-intrinsic-size when content relevancy changes.

Co-authored-by: Jihye Hong <jihye@igalia.com>

Differential Revision: https://phabricator.services.mozilla.com/D159693
This commit is contained in:
Martin Robinson
2022-11-30 18:00:27 +00:00
parent 3c601ebb5b
commit b5d910a0ca
37 changed files with 616 additions and 91 deletions

View File

@@ -9,6 +9,8 @@
*/
#include "mozilla/dom/Selection.h"
#include "LayoutConstants.h"
#include "mozilla/intl/BidiEmbeddingLevel.h"
#include "mozilla/AccessibleCaretEventHub.h"
@@ -3200,6 +3202,7 @@ void Selection::NotifySelectionListeners() {
PresShell* presShell = GetPresShell();
if (presShell) {
doc = presShell->GetDocument();
presShell->ScheduleContentRelevancyUpdate(ContentRelevancyReason::Selected);
}
// We've notified all selection listeners even when some of them are removed