Bug 1897322 - More consistently deal with pres shell style observers. r=smaug

Much like we deal with resize events.

Differential Revision: https://phabricator.services.mozilla.com/D210776
This commit is contained in:
Emilio Cobos Álvarez
2024-05-17 10:25:31 +00:00
parent 756abd90ff
commit 9bae74fae2
2 changed files with 19 additions and 17 deletions

View File

@@ -10217,6 +10217,7 @@ bool PresShell::RemovePostRefreshObserver(nsAPostRefreshObserver* aObserver) {
}
void PresShell::DoObserveStyleFlushes() {
MOZ_DIAGNOSTIC_ASSERT(!IsDestroying());
MOZ_ASSERT(!ObservingStyleFlushes());
mObservingStyleFlushes = true;