Bug 1766265 - Content hidden by `content-visibility` should not trigger intersection observers r=emilio

Differential Revision: https://phabricator.services.mozilla.com/D144584
This commit is contained in:
Martin Robinson 2022-04-26 08:40:26 +00:00
Родитель 3df3e47b53
Коммит fdf7fc5326
2 изменённых файлов: 9 добавлений и 4 удалений

Просмотреть файл

@ -598,6 +598,15 @@ void DOMIntersectionObserver::Update(Document* aDocument,
return false;
}
// "From the perspective of an IntersectionObserver, the skipped contents
// of an element are never intersecting the intersection root. This is
// true even if both the root and the target elements are in the skipped
// contents."
// https://drafts.csswg.org/css-contain/#cv-notes
if (targetFrame->AncestorHidesContent()) {
return false;
}
// 2.1. If the intersection root is not the implicit root and target is
// not a descendant of the intersection root in the containing block
// chain, skip further processing for target.

Просмотреть файл

@ -1,4 +0,0 @@
[content-visibility-030.html]
[IntersectionObserver interactions]
expected: FAIL