Bug 1760222 - Add an API for JS to tell whether the document has scroll-linked effects or not. r=botond

Differential Revision: https://phabricator.services.mozilla.com/D141456
This commit is contained in:
Hiroyuki Ikezoe 2022-03-27 23:40:23 +00:00
Родитель 8143bad0eb
Коммит 1bbdcb99db
2 изменённых файлов: 18 добавлений и 0 удалений

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

@ -4736,3 +4736,13 @@ nsDOMWindowUtils::GetSuspendedByBrowsingContextGroup(bool* aResult) {
*aResult = inner->GetWasSuspendedByGroup();
return NS_OK;
}
NS_IMETHODIMP
nsDOMWindowUtils::GetHasScrollLinkedEffect(bool* aResult) {
Document* doc = GetDocument();
if (!doc) {
return NS_ERROR_FAILURE;
}
*aResult = doc->HasScrollLinkedEffect();
return NS_OK;
}

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

@ -2250,6 +2250,14 @@ interface nsIDOMWindowUtils : nsISupports {
// Used for testing to check the suspend status.
readonly attribute bool suspendedByBrowsingContextGroup;
// Whether there's any scroll-linked effect in this document. This is only
// meaningful after the script in question tried to mutate something in a
// scroll event callback until the next refresh driver tick happens.
//
// See https://firefox-source-docs.mozilla.org/performance/scroll-linked_effects.html
// about scroll-linked effects.
readonly attribute bool hasScrollLinkedEffect;
};
[scriptable, uuid(c694e359-7227-4392-a138-33c0cc1f15a6)]