Bug 1756118, stop observing RefreshDriver if there are no resize observers, r=dholbert

Differential Revision: https://phabricator.services.mozilla.com/D139109
This commit is contained in:
Olli Pettay 2022-02-22 11:46:16 +00:00
parent c6409d2d11
commit bb0eb3cf5d

View File

@ -95,6 +95,7 @@ static void FlushLayoutForWholeBrowsingContextTree(Document& aDoc) {
}
void ResizeObserverController::Notify() {
mResizeObserverNotificationHelper->Unregister();
if (mResizeObservers.IsEmpty()) {
return;
}
@ -136,8 +137,6 @@ void ResizeObserverController::Notify() {
GatherAllActiveObservations(shallowestTargetDepth);
}
mResizeObserverNotificationHelper->Unregister();
if (HasAnySkippedObservations()) {
// Per spec, we deliver an error if the document has any skipped
// observations. Also, we re-register via ScheduleNotification().